+2008-01-14 John (J5) Palmieri <johnp@redhat.com>
+
+ * Patch by Andrea Luzzardi <scox at sig11 dot org>: creates a
+ _dbus_geteuid function to fix EXTERNAL authentication in setuid
+ applications
+
+ * dbus/dbus-sysdeps-unix.c (_dbus_geteuid): used to get the effective
+ uid of the running program
+ (_dbus_credentials_add_from_current_process): use geteuid instead of
+ getuid
+ (_dbus_append_user_from_current_process): use geteuid instead of
+ getuid
+
+ * dbus/dbus-sysdeps-util-unix.c (_dbus_change_to_daemon_user): use
+ geteuid instead of getuid
+ (_dbus_unix_user_is_at_console): use geteuid instead of getuid
+
+ * dbus/dbus-sysdeps-win.c (_dbus_geteuid): add a windows equivilant
+ that returns DBUS_UID_UNSET
+
2007-12-18 Havoc Pennington <hp@redhat.com>
* dbus/dbus-connection.c (_dbus_connection_block_pending_call):
if (!_dbus_credentials_add_unix_pid(credentials, _dbus_getpid()))
return FALSE;
- if (!_dbus_credentials_add_unix_uid(credentials, _dbus_getuid()))
+ if (!_dbus_credentials_add_unix_uid(credentials, _dbus_geteuid()))
return FALSE;
return TRUE;
_dbus_append_user_from_current_process (DBusString *str)
{
return _dbus_string_append_uint (str,
- _dbus_getuid ());
+ _dbus_geteuid ());
}
/**
return getuid ();
}
+/** Gets our effective UID
+ * @returns process effective UID
+ */
+dbus_uid_t
+_dbus_geteuid (void)
+{
+ return geteuid ();
+}
+
/**
* The only reason this is separate from _dbus_getpid() is to allow it
* on Windows for logging but not for other purposes.
void _dbus_group_info_free (DBusGroupInfo *info);
dbus_uid_t _dbus_getuid (void);
+dbus_uid_t _dbus_geteuid (void);
dbus_gid_t _dbus_getgid (void);
dbus_bool_t _dbus_parse_uid (const DBusString *uid_str,
}
#ifdef HAVE_LIBAUDIT
- we_were_root = _dbus_getuid () == 0;
+ we_were_root = _dbus_geteuid () == 0;
new_caps = NULL;
/* have a tmp set of caps that we use to transition to the usr/grp dbus should
* run as ... doesn't really help. But keeps people happy.
dbus_bool_t
_dbus_unix_user_is_process_owner (dbus_uid_t uid)
{
- return uid == _dbus_getuid ();
+ return uid == _dbus_geteuid ();
}
/**
* @returns process UID
*/
dbus_uid_t
-_dbus_getuid(void)
+_dbus_getuid (void)
+{
+ return DBUS_UID_UNSET;
+}
+
+/** Gets our effective UID
+ * @returns process effective UID
+ */
+dbus_uid_t
+_dbus_geteuid (void)
{
return DBUS_UID_UNSET;
}