diff options
author | Ray Strode <rstrode@redhat.com> | 2012-07-09 21:33:10 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2012-07-17 04:14:56 -0400 |
commit | 2853ce5812aa8f03f677516e64d5dcff1e6e01ab (patch) | |
tree | 9287b11efc20a033ca2d57a99d7046c607163e18 /daemon/gdm-display.c | |
parent | 4f86de30a115a77cf61b4652fef53f9f0517fc0b (diff) | |
download | gdm-2853ce5812aa8f03f677516e64d5dcff1e6e01ab.tar.gz |
worker: add reauthentication support
This commit adds reauthentication support for
screensavers and user switching to use.
1) It adds a "verification mode" argument to the GdmSession constructor
that tweaks the behavior of how the session worker acts to fit login or
unlock scenarios better.
2) It adds a way for programs to open a communication channel for user
verification to already runnings sessions (so reauthentication happens
in the context of the session).
Diffstat (limited to 'daemon/gdm-display.c')
-rw-r--r-- | daemon/gdm-display.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c index 0c6e7564..25fff698 100644 --- a/daemon/gdm-display.c +++ b/daemon/gdm-display.c @@ -1254,6 +1254,8 @@ register_display (GdmDisplay *display) char * gdm_display_open_session_sync (GdmDisplay *display, + GPid pid_of_caller, + uid_t uid_of_caller, GCancellable *cancellable, GError **error) { @@ -1270,6 +1272,8 @@ gdm_display_open_session_sync (GdmDisplay *display, address = NULL; ret = gdm_dbus_slave_call_open_session_sync (display->priv->slave_bus_proxy, + (int) pid_of_caller, + (int) uid_of_caller, &address, cancellable, error); @@ -1281,6 +1285,41 @@ gdm_display_open_session_sync (GdmDisplay *display, return address; } +char * +gdm_display_open_reauthentication_channel_sync (GdmDisplay *display, + const char *username, + GPid pid_of_caller, + uid_t uid_of_caller, + GCancellable *cancellable, + GError **error) +{ + char *address; + int ret; + + if (display->priv->slave_bus_proxy == NULL) { + g_set_error (error, + G_DBUS_ERROR, + G_DBUS_ERROR_ACCESS_DENIED, + _("No session available yet")); + return NULL; + } + + address = NULL; + ret = gdm_dbus_slave_call_open_reauthentication_channel_sync (display->priv->slave_bus_proxy, + username, + pid_of_caller, + uid_of_caller, + &address, + cancellable, + error); + + if (!ret) { + return NULL; + } + + return address; +} + /* dbus-send --system --print-reply --dest=org.gnome.DisplayManager /org/gnome/DisplayManager/Displays/1 org.freedesktop.DBus.Introspectable.Introspect */ |