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:36 +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 048d0127ee459d786c14b8b350f0da3e79e3c570..39860ebf011870e7a9601f72d8f3b996c3e4cdc1 100644 (file)
@@ -1841,6 +1841,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
@@ -1868,11 +1869,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.025971 seconds and 4 git commands to generate.