diff options
author | Ray Strode <rstrode@redhat.com> | 2013-10-31 15:00:26 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2013-10-31 16:23:04 -0400 |
commit | ae7beb63cb254c2b7e5aedb9d034133c4de90b85 (patch) | |
tree | e22b00322d93e2d4dd470a175dbca94869962a88 /daemon/gdm-manager.c | |
parent | 82296a3350b64d0ed5ae3b9f6983466c60dd8a53 (diff) | |
download | gdm-ae7beb63cb254c2b7e5aedb9d034133c4de90b85.tar.gz |
manager: return ACCESS DENIED for most open-reauth-channel failures
gnome-shell only falls back to opening a new session if the reauth
channel fails to open because of denied access. For XDMCP we currently
fail for other reasons.
This commit returns ACCESS DENIED for those cases as well, so the
intended fallback happens.
Based on a patch by Jeremy White <jwhite@codeweavers.com>
https://bugzilla.gnome.org/show_bug.cgi?id=690926
Diffstat (limited to 'daemon/gdm-manager.c')
-rw-r--r-- | daemon/gdm-manager.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c index 17e8ca52..f2c00eda 100644 --- a/daemon/gdm-manager.c +++ b/daemon/gdm-manager.c @@ -725,9 +725,14 @@ gdm_manager_handle_open_reauthentication_channel (GdmDBusManager *manager ret = gdm_dbus_get_pid_for_name (sender, &pid, &error); if (!ret) { - g_prefix_error (&error, "Error while retrieving caller session id: "); - g_dbus_method_invocation_return_gerror (invocation, error); + g_debug ("GdmManager: could not get pid of caller: %s", + error->message); g_error_free (error); + + g_dbus_method_invocation_return_error_literal (invocation, + G_DBUS_ERROR, + G_DBUS_ERROR_ACCESS_DENIED, + "Error getting process id of caller"); return TRUE; } @@ -735,9 +740,14 @@ gdm_manager_handle_open_reauthentication_channel (GdmDBusManager *manager ret = gdm_dbus_get_uid_for_name (sender, &caller_uid, &error); if (!ret) { - g_prefix_error (&error, "Error while retrieving caller session id: "); - g_dbus_method_invocation_return_gerror (invocation, error); + g_debug ("GdmManager: could not get uid of caller: %s", + error->message); g_error_free (error); + + g_dbus_method_invocation_return_error_literal (invocation, + G_DBUS_ERROR, + G_DBUS_ERROR_ACCESS_DENIED, + "Error getting user id of caller"); return TRUE; } @@ -746,15 +756,27 @@ gdm_manager_handle_open_reauthentication_channel (GdmDBusManager *manager seat_id = get_seat_id_for_pid (connection, pid, &error); if (seat_id == NULL) { - g_dbus_method_invocation_return_gerror (invocation, error); + g_debug ("GdmManager: could not get seat id of caller: %s", + error->message); g_error_free (error); + + g_dbus_method_invocation_return_error_literal (invocation, + G_DBUS_ERROR, + G_DBUS_ERROR_ACCESS_DENIED, + "Error getting seat id of caller"); return TRUE; } session_id = get_session_id_for_user_on_seat (connection, username, seat_id, &error); if (session_id == NULL) { - g_dbus_method_invocation_return_gerror (invocation, error); + g_debug ("GdmManager: could not get session id for caller: %s", + error->message); g_error_free (error); + + g_dbus_method_invocation_return_error_literal (invocation, + G_DBUS_ERROR, + G_DBUS_ERROR_ACCESS_DENIED, + "Error getting session id for caller"); return TRUE; } |