mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-02-12 05:20:37 +01:00
dbus: remove pam_console/pam_foreground support
DBUS_CONSOLE_AUTH_DIR is deprecated since 1.11.18, and was intended to have been removed in 1.13. Let's drop the related code now. Fixes: https://gitlab.freedesktop.org/dbus/dbus/-/issues/181 Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=101629 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
366b075dec
commit
84fdcc5f27
3 changed files with 1 additions and 84 deletions
|
|
@ -568,53 +568,6 @@ _dbus_file_exists (const char *file)
|
|||
return (access (file, F_OK) == 0);
|
||||
}
|
||||
|
||||
/** Checks if user is at the console
|
||||
*
|
||||
* @param username user to check
|
||||
* @param error return location for errors
|
||||
* @returns #TRUE is the user is at the consolei and there are no errors
|
||||
*/
|
||||
dbus_bool_t
|
||||
_dbus_user_at_console (const char *username,
|
||||
DBusError *error)
|
||||
{
|
||||
#ifdef DBUS_CONSOLE_AUTH_DIR
|
||||
DBusString u, f;
|
||||
dbus_bool_t result;
|
||||
|
||||
result = FALSE;
|
||||
if (!_dbus_string_init (&f))
|
||||
{
|
||||
_DBUS_SET_OOM (error);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!_dbus_string_append (&f, DBUS_CONSOLE_AUTH_DIR))
|
||||
{
|
||||
_DBUS_SET_OOM (error);
|
||||
goto out;
|
||||
}
|
||||
|
||||
_dbus_string_init_const (&u, username);
|
||||
|
||||
if (!_dbus_concat_dir_and_file (&f, &u))
|
||||
{
|
||||
_DBUS_SET_OOM (error);
|
||||
goto out;
|
||||
}
|
||||
|
||||
result = _dbus_file_exists (_dbus_string_get_const_data (&f));
|
||||
|
||||
out:
|
||||
_dbus_string_free (&f);
|
||||
|
||||
return result;
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks whether the filename is an absolute path
|
||||
*
|
||||
|
|
|
|||
|
|
@ -589,9 +589,6 @@ dbus_bool_t _dbus_command_for_pid (unsigned long pid,
|
|||
int max_len,
|
||||
DBusError *error);
|
||||
|
||||
dbus_bool_t _dbus_user_at_console (const char *username,
|
||||
DBusError *error);
|
||||
|
||||
typedef enum {
|
||||
DBUS_LOG_FLAGS_STDERR = (1 << 0),
|
||||
DBUS_LOG_FLAGS_SYSTEM_LOG = (1 << 1)
|
||||
|
|
|
|||
|
|
@ -65,11 +65,6 @@ dbus_bool_t
|
|||
_dbus_is_console_user (dbus_uid_t uid,
|
||||
DBusError *error)
|
||||
{
|
||||
|
||||
DBusUserDatabase *db;
|
||||
const DBusUserInfo *info;
|
||||
dbus_bool_t result = FALSE;
|
||||
|
||||
#ifdef HAVE_SYSTEMD
|
||||
/* check if we have logind */
|
||||
if (access ("/run/systemd/seats/", F_OK) >= 0)
|
||||
|
|
@ -120,35 +115,7 @@ _dbus_is_console_user (dbus_uid_t uid,
|
|||
|
||||
#endif /* HAVE_CONSOLE_OWNER_FILE */
|
||||
|
||||
if (!_dbus_user_database_lock_system ())
|
||||
{
|
||||
_DBUS_SET_OOM (error);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
db = _dbus_user_database_get_system ();
|
||||
if (db == NULL)
|
||||
{
|
||||
dbus_set_error (error, DBUS_ERROR_FAILED, "Could not get system database.");
|
||||
_dbus_user_database_unlock_system ();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* TPTD: this should be cache-safe, we've locked the DB and
|
||||
_dbus_user_at_console doesn't pass it on. */
|
||||
info = _dbus_user_database_lookup (db, uid, NULL, error);
|
||||
|
||||
if (info == NULL)
|
||||
{
|
||||
_dbus_user_database_unlock_system ();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
result = _dbus_user_at_console (info->username, error);
|
||||
|
||||
_dbus_user_database_unlock_system ();
|
||||
|
||||
return result;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue