Fix: explicitly send client credentials during handshake
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 17:35:40 +0000 (13:35 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 17:42:24 +0000 (13:42 -0400)
commit01ea340e0a3914f12a50875e6477bfd9a9eee099
tree93794cb01d70a72ee3327505cebac5af8bad9fcc
parent4b01971f9df6293ace728642f15f5262691cec66
Fix: explicitly send client credentials during handshake

The notification client does not send its credentials during
the handshake. However, the session daemon will still receive
them except in very rare, and hard to reproduce, cases.

It appears that the kernel will provide the credential cmsg
regardless of whether or not the client has actually sent them.

Inspecting the kernel source (af_unix.c) seems to indicate that
the credentials will be passed on sendmsg whenever one of the
sockets involved has set the SO_PASSCRED flag. It also seems to
maintain compatibility with applications that expect write() to
pass credentials by default. This explains why the explicit
passing didn't seem needed.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/notification-thread-events.c
src/lib/lttng-ctl/channel.c
This page took 0.025399 seconds and 4 git commands to generate.