summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2012-03-19 14:05:18 -0400
committerRay Strode <rstrode@redhat.com>2012-03-19 15:50:49 -0400
commit932c65c66d26915b40830a91762ae10ca95458a2 (patch)
tree410e33323078bd1b5c65d9ba564377865d9ed510
parent29ebbbb37bb65fadd5fb80ae4f6b13b1f6462aa8 (diff)
downloadgdm-932c65c66d26915b40830a91762ae10ca95458a2.tar.gz
user-switching: don't set PAM_TTY when using systemd
It does it for us, and we don't know it anyway, so don't bother trying. https://bugzilla.gnome.org/show_bug.cgi?id=655380
-rw-r--r--daemon/gdm-server.c8
-rw-r--r--daemon/gdm-session-worker.c4
2 files changed, 11 insertions, 1 deletions
diff --git a/daemon/gdm-server.c b/daemon/gdm-server.c
index 53d78410..6d2d6cd5 100644
--- a/daemon/gdm-server.c
+++ b/daemon/gdm-server.c
@@ -165,6 +165,14 @@ _gdm_server_query_ck_for_display_device (GdmServer *server)
char *
gdm_server_get_display_device (GdmServer *server)
{
+#ifdef WITH_SYSTEMD
+ /* systemd finds the display device out on its own based on the display */
+ return NULL;
+#endif
+
+#ifndef WITH_CONSOLE_KIT
+ return NULL;
+#endif
if (server->priv->display_device == NULL) {
server->priv->display_device =
_gdm_server_query_ck_for_display_device (server);
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
index 1136bb4b..57f10718 100644
--- a/daemon/gdm-session-worker.c
+++ b/daemon/gdm-session-worker.c
@@ -1142,7 +1142,9 @@ gdm_session_worker_initialize_pam (GdmSessionWorker *worker,
/* set TTY */
pam_tty = _get_tty_for_pam (x11_display_name, display_device);
- error_code = pam_set_item (worker->priv->pam_handle, PAM_TTY, pam_tty);
+ if (pam_tty != NULL && pam_tty[0] != '\0') {
+ error_code = pam_set_item (worker->priv->pam_handle, PAM_TTY, pam_tty);
+ }
g_free (pam_tty);
if (error_code != PAM_SUCCESS) {