[systemd-devel] [PATCH][RFC] bus-proxy: add support for "GetConnectionCredentials" method

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Feb 20 04:54:01 PST 2015


On 20/02/15 12:43, David Herrmann wrote:
> -1 is not a valid value. It should be silently dropped, so we're fine here.

Perhaps I'm misunderstanding what you're saying here and we're actually 
agreeing, but for clarity:

The specification for GetConnectionCredentials deliberately does not 
document any invalid values; members of the returned a{sv} should only 
appear if their values are valid. If ((uint32_t) -1) is in fact never a 
valid value for a UnixUserID or ProcessID, then the pairs
{ "UnixUserID": (uint32_t) -1 } and { "ProcessID": (uint32_t) -1 } 
should never appear in the a{sv} at all.

Similarly, for LinuxSecurityLabel, if getsockopt SO_PEERSEC (or the 
closest kdbus equivalent) fails, or if the kdbus message does not 
contain the necessary information, the keys of the a{sv} should not 
include LinuxSecurityLabel: the absence of a security label looks like 
{}, not { "LinuxSecurityLabel": [] } or
{ "LinuxSecurityLabel": [ '\0' ] }.

-- 
Simon McVittie
Collabora Ltd. <http://www.collabora.com/>



More information about the systemd-devel mailing list