Commit cc37dc85 authored by Jan Alexander Steffens's avatar Jan Alexander Steffens Committed by Simon McVittie

bus-driver: Support returning org.freedesktop.DBus UID and PID

Attempting to call SetEnvironment on systemd causes it to inquire
about the caller's connection UID and PID. If this check fails,
the call is rejected.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92857Reviewed-by: default avatarSimon McVittie <simon.mcvittie@collabora.co.uk>
[smcv: go back to DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN as the error code
for failure to determine the pid]
parent 6e63e239
This diff is collapsed.
......@@ -138,7 +138,6 @@ dbus_bool_t _dbus_group_info_fill_gid (DBusGroupInfo *info,
DBusError *error);
void _dbus_group_info_free (DBusGroupInfo *info);
dbus_uid_t _dbus_getuid (void);
DBUS_PRIVATE_EXPORT
dbus_uid_t _dbus_geteuid (void);
......
......@@ -2138,6 +2138,15 @@ _dbus_getpid (void)
return GetCurrentProcessId ();
}
/** Gets our Unix UID
* @returns on Windows, just DBUS_UID_UNSET
*/
dbus_uid_t
_dbus_getuid (void)
{
return DBUS_UID_UNSET;
}
/** nanoseconds in a second */
#define NANOSECONDS_PER_SECOND 1000000000
/** microseconds in a second */
......
......@@ -641,6 +641,9 @@ unsigned long _dbus_pid_for_log (void);
DBUS_PRIVATE_EXPORT
dbus_pid_t _dbus_getpid (void);
DBUS_PRIVATE_EXPORT
dbus_uid_t _dbus_getuid (void);
dbus_bool_t _dbus_change_to_daemon_user (const char *user,
DBusError *error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment