fix: unix socket peercred on FreeBSD
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 24 Feb 2021 20:12:12 +0000 (15:12 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 25 Feb 2021 20:45:16 +0000 (15:45 -0500)
Include 'sys/un.h' for LOCAL_PEERCRED.

The uid member of 'struct xucred' is 'cr_uid'.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I6d94e5ad53292401afebeae0cbbba82e7568a847

liblttng-ust-ctl/ustctl.c

index 0272d9b9331c6750c276993b14552bbeb6e565f2..f66e0bc5d85d3b9b118b56f11ba5b12cb52b6647 100644 (file)
@@ -2067,6 +2067,7 @@ int get_cred(int sock,
 }
 #elif defined(__FreeBSD__)
 #include <sys/ucred.h>
+#include <sys/un.h>
 
 /*
  * Override application uid/gid with unix socket credentials. Use the
@@ -2094,11 +2095,11 @@ int get_cred(int sock,
        }
        DBG("Unix socket peercred [ uid: %u, gid: %u ], "
                "application registered claiming [ pid: %d, ppid: %d, uid: %u, gid: %u ]",
-               xucred.uid, xucred.cr_groups[0],
+               xucred.cr_uid, xucred.cr_groups[0],
                reg_msg->pid, reg_msg->ppid, reg_msg->uid, reg_msg->gid);
        *pid = reg_msg->pid;
        *ppid = reg_msg->ppid;
-       *uid = xucred.uid;
+       *uid = xucred.cr_uid;
        *gid = xucred.cr_groups[0];
        return 0;
 }
This page took 0.026285 seconds and 4 git commands to generate.