From: Simon McVittie Date: Wed, 23 Jan 2019 11:57:42 +0000 (+0000) Subject: dbus-userdb: Remove unused _dbus_homedir_from_username() X-Git-Tag: dbus-1.13.10~18^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2a3bc30e6fbb3f3412758364a4057593e43b8c0;p=thirdparty%2Fdbus.git dbus-userdb: Remove unused _dbus_homedir_from_username() Everything that wants a home directory uses either _dbus_homedir_from_uid() or _dbus_homedir_from_current_process(). Signed-off-by: Simon McVittie --- diff --git a/dbus/dbus-userdb.c b/dbus/dbus-userdb.c index 7f58a376b..666827488 100644 --- a/dbus/dbus-userdb.c +++ b/dbus/dbus-userdb.c @@ -415,48 +415,6 @@ _dbus_homedir_from_current_process (const DBusString **homedir) return TRUE; } -/** - * Gets the home directory for the given user. - * - * @param username the username - * @param homedir string to append home directory to - * @returns #TRUE if user existed and we appended their homedir - */ -dbus_bool_t -_dbus_homedir_from_username (const DBusString *username, - DBusString *homedir) -{ - DBusUserDatabase *db; - const DBusUserInfo *info; - - /* FIXME: this can't distinguish ENOMEM from other errors */ - if (!_dbus_user_database_lock_system ()) - return FALSE; - - db = _dbus_user_database_get_system (); - if (db == NULL) - { - _dbus_user_database_unlock_system (); - return FALSE; - } - - if (!_dbus_user_database_get_username (db, username, - &info, NULL)) - { - _dbus_user_database_unlock_system (); - return FALSE; - } - - if (!_dbus_string_append (homedir, info->homedir)) - { - _dbus_user_database_unlock_system (); - return FALSE; - } - - _dbus_user_database_unlock_system (); - return TRUE; -} - /** * Gets the home directory for the given user. * diff --git a/dbus/dbus-userdb.h b/dbus/dbus-userdb.h index 9b7934a47..fa4567651 100644 --- a/dbus/dbus-userdb.h +++ b/dbus/dbus-userdb.h @@ -122,9 +122,6 @@ DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_username_from_current_process (const DBusString **username); DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_homedir_from_current_process (const DBusString **homedir); -dbus_bool_t _dbus_homedir_from_username (const DBusString *username, - DBusString *homedir); - dbus_bool_t _dbus_homedir_from_uid (dbus_uid_t uid, DBusString *homedir);