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>
Tue, 30 May 2017 16:39:26 +0000 (12:39 -0400)
commitf950d02c272a8a21d6e1d0da876d9d41225905f2
treebde2ccb2b274967011c6809c10feb9f9836ca63b
parent39c98949653fa29976e4b86d5260c63e428207f7
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.025729 seconds and 4 git commands to generate.