From: Simon McVittie Date: Mon, 15 Jan 2018 20:05:05 +0000 (+0000) Subject: sysdeps: Document what _dbus_credentials_new_from_current_process has X-Git-Tag: dbus-1.13.4~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbc2a447c4ef189567617aa1372e83141de40a68;p=thirdparty%2Fdbus.git sysdeps: Document what _dbus_credentials_new_from_current_process has It only has the most important credentials, not the full set. Signed-off-by: Simon McVittie Reviewed-by: Philip Withnall Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103737 --- diff --git a/dbus/dbus-credentials.c b/dbus/dbus-credentials.c index 927f79d5f..4a7bafd10 100644 --- a/dbus/dbus-credentials.c +++ b/dbus/dbus-credentials.c @@ -93,7 +93,7 @@ _dbus_credentials_new (void) } /** - * Creates a new object with credentials (user ID and process ID) from the current process. + * Creates a new object with the most important credentials (user ID and process ID) from the current process. * @returns the new object or #NULL if no memory */ DBusCredentials* diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index f1764416e..d2a331eba 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -2756,8 +2756,14 @@ _dbus_user_info_fill_uid (DBusUserInfo *info, } /** - * Adds the credentials of the current process to the - * passed-in credentials object. + * Adds the most important credentials of the current process + * (the uid and pid) to the passed-in credentials object. + * + * The group vector is not included because it is rarely needed. + * The Linux security label is not included because it is rarely + * needed, it requires reading /proc, and the LSM API doesn't actually + * guarantee that the string seen in /proc is comparable to the strings + * found in SO_PEERSEC results. * * @param credentials credentials to add to * @returns #FALSE if no memory; does not properly roll back on failure, so only some credentials may have been added