summaryrefslogtreecommitdiffstats
path: root/bus/bus.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2007-06-09 21:53:20 +0000
committerHavoc Pennington <hp@redhat.com>2007-06-09 21:53:20 +0000
commit23832672266bb4ff23b66247c0cfa1a2ed0cc97b (patch)
tree119e37411f14923780de3ca7a759707508f1ec63 /bus/bus.c
parentb80a8fe6b364543aa4b32a02a5ad913faf97173b (diff)
2007-06-09 Havoc Pennington <hp@redhat.com>
* bus/dispatch.c (check_get_connection_unix_process_id): adapt since sysdeps-unix.h stuff isn't included anymore * bus/bus.c (bus_context_new): use more abstract functions to change user, so they can be no-ops on Windows * dbus/dbus-credentials.c, dbus/dbus-credentials.h, dbus/dbus-credentials-util.c: new files containing a fully opaque DBusCredentials data type to replace the old not opaque one. * configure.in (DBUS_UNIX): define DBUS_UNIX to match DBUS_WIN on windows * dbus/dbus-userdb.h: prohibit on Windows, next step is to clean up the uses of it in bus/*.c and factor out the parts of cookie auth that depend on it
Diffstat (limited to 'bus/bus.c')
-rw-r--r--bus/bus.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/bus/bus.c b/bus/bus.c
index fb9322a9..e1396f23 100644
--- a/bus/bus.c
+++ b/bus/bus.c
@@ -533,7 +533,6 @@ bus_context_new (const DBusString *config_file,
{
BusContext *context;
BusConfigParser *parser;
- DBusCredentials creds;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
@@ -660,13 +659,7 @@ bus_context_new (const DBusString *config_file,
/* check user before we fork */
if (context->user != NULL)
{
- DBusString u;
-
- _dbus_string_init_const (&u, context->user);
-
- if (!_dbus_credentials_from_username (&u, &creds) ||
- creds.uid < 0 ||
- creds.gid < 0)
+ if (!_dbus_verify_daemon_user (context->user))
{
dbus_set_error (error, DBUS_ERROR_FAILED,
"Could not get UID and GID for username \"%s\"",
@@ -769,7 +762,7 @@ bus_context_new (const DBusString *config_file,
*/
if (context->user != NULL)
{
- if (!_dbus_change_identity (creds.uid, creds.gid, error))
+ if (!_dbus_change_to_daemon_user (context->user, error))
{
_DBUS_ASSERT_ERROR_IS_SET (error);
goto failed;