]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
dbus-userdb: Remove unused _dbus_homedir_from_username()
authorSimon McVittie <smcv@collabora.com>
Wed, 23 Jan 2019 11:57:42 +0000 (11:57 +0000)
committerSimon McVittie <smcv@collabora.com>
Wed, 23 Jan 2019 11:57:42 +0000 (11:57 +0000)
Everything that wants a home directory uses either
_dbus_homedir_from_uid() or _dbus_homedir_from_current_process().

Signed-off-by: Simon McVittie <smcv@collabora.com>
dbus/dbus-userdb.c
dbus/dbus-userdb.h

index 7f58a376b6e8ee4507dcb12f4569853729ad90b3..666827488392b6d5d94a0c0bd4417528edb07602 100644 (file)
@@ -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.
  *
index 9b7934a4728aa4ac736abb0626f9a6c0dea573e7..fa4567651813a88b17dae5f304046c4b69e31aa0 100644 (file)
@@ -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);