broker: use parent seclabel for the driver
broker: use parent seclabel for the driver

If LSMs are enabled, the DBus spec allows querying seclabels of peers,
as well as the bus driver itself. Furthermore, the security label of
the bus-driver is also used as default label for all unlabeled names.

Until now we used the label of the broker process for this. However, we
always intended to query SO_PEERSEC on the controller socket. While
this is possible now, we are unable to distinguish the label from the
old kernel behavior, where it simply returned the unlabeled entry (at
least for SELinux).

Hence, this patch tries to move behavior as close to this as possible.
We now use the seclabel of the parent process. In all supported
scenarios, this will end up as the same as what SO_PEERSEC would
return. Once we open up the controller-API to external users, we really
need to rely on SO_PEERSEC and bump the kernel requirements.

Signed-off-by: David Herrmann <fb53b2ddb8d141e0cb39d7c67c2f81b6bc2eb0f7@gmail.com>

bus1/dbus-broker