From 6eab51411982fc61c193caed388608c4f2bd25d1 Mon Sep 17 00:00:00 2001 From: "John (J5) Palmieri" Date: Tue, 22 Mar 2005 17:57:27 +0000 Subject: * tools/Makefile.am: Patch by Colin Walters that fixes distcheck * dbus/dbus-userdb.c, dbus/dbus-userdb-util.c: Add patch we have had in Red Hat packages for a while but for some reason never got merged upstream (_dbus_is_a_number): New checks if a string can be converted to a number and does the conversion if it can (_dbus_user_database_lookup): Add check to see if the given username is a udi. This allows udi's to be used instead of usernames in the config file. (_dbus_user_database_lookup_group): Add check to see if the given groupname is a gdi. This allows gdi's to be used instead of groupnames in the config file. --- dbus/dbus-userdb-util.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'dbus/dbus-userdb-util.c') diff --git a/dbus/dbus-userdb-util.c b/dbus/dbus-userdb-util.c index bd9c2e35..344bd747 100644 --- a/dbus/dbus-userdb-util.c +++ b/dbus/dbus-userdb-util.c @@ -195,6 +195,16 @@ _dbus_user_database_lookup_group (DBusUserDatabase *db, _DBUS_ASSERT_ERROR_IS_CLEAR (error); + /* See if the group is really a number */ + if (gid == DBUS_UID_UNSET) + { + unsigned long n; + + if (_dbus_is_a_number (groupname, &n)) + gid = n; + } + + if (gid != DBUS_GID_UNSET) info = _dbus_hash_table_lookup_ulong (db->groups, gid); else -- cgit