summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-sysdeps-util-unix.c
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2008-01-14 15:07:48 -0500
committerJohn (J5) Palmieri <johnp@redhat.com>2008-01-14 15:07:48 -0500
commitede4e4514698612e226763ea8b6ae8ce13f2173d (patch)
treed0764decc001fd10699b1c50feac8735491aa094 /dbus/dbus-sysdeps-util-unix.c
parent047ec880e9e228183237c661ec2e45a949785cb9 (diff)
add _dbus_geteuid to fix EXTERNAL authentication in setuid applications
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
Diffstat (limited to 'dbus/dbus-sysdeps-util-unix.c')
-rw-r--r--dbus/dbus-sysdeps-util-unix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dbus/dbus-sysdeps-util-unix.c b/dbus/dbus-sysdeps-util-unix.c
index 49965d9a..9ff3fbc1 100644
--- a/dbus/dbus-sysdeps-util-unix.c
+++ b/dbus/dbus-sysdeps-util-unix.c
@@ -332,7 +332,7 @@ _dbus_change_to_daemon_user (const char *user,
}
#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.
@@ -990,7 +990,7 @@ _dbus_unix_user_is_at_console (dbus_uid_t uid,
dbus_bool_t
_dbus_unix_user_is_process_owner (dbus_uid_t uid)
{
- return uid == _dbus_getuid ();
+ return uid == _dbus_geteuid ();
}
/**