summaryrefslogtreecommitdiffstats
path: root/pam-ck-connector
diff options
context:
space:
mode:
authorWilliam Jon McCann <mccann@jhu.edu>2007-04-04 12:04:16 -0400
committerWilliam Jon McCann <mccann@jhu.edu>2007-04-04 12:04:16 -0400
commitc012fdf98a19e9e3d67a64ed308943a04c355dc8 (patch)
tree7201e202c29d7041362545fb1840d5706bd12fe0 /pam-ck-connector
parent42f6afb560859bf0dab898ae4c8f6d23070ef268 (diff)
add support for CKCON_X11_DISPLAY_DEVICE environment variable
In order to set the x11-display-device parameter on the new session.
Diffstat (limited to 'pam-ck-connector')
-rw-r--r--pam-ck-connector/pam-ck-connector.c13
-rw-r--r--pam-ck-connector/pam_ck_connector.819
2 files changed, 23 insertions, 9 deletions
diff --git a/pam-ck-connector/pam-ck-connector.c b/pam-ck-connector/pam-ck-connector.c
index 22c076f..253edd0 100644
--- a/pam-ck-connector/pam-ck-connector.c
+++ b/pam-ck-connector/pam-ck-connector.c
@@ -227,6 +227,7 @@ pam_sm_open_session (pam_handle_t *pamh,
const char *user;
const char *display_device;
const char *x11_display;
+ const char *x11_display_device;
const char *remote_host_name;
const char *s;
uid_t uid;
@@ -302,6 +303,14 @@ pam_sm_open_session (pam_handle_t *pamh,
}
}
+ x11_display_device = NULL;
+ if ((s = pam_getenv (pamh, "CKCON_X11_DISPLAY_DEVICE")) != NULL) {
+ x11_display_device = s;
+ if (opt_debug) {
+ ck_pam_syslog (pamh, LOG_INFO, "using '%s' as X11 display device (from CKCON_X11_DISPLAY_DEVICE)", x11_display_device);
+ }
+ }
+
uid = _util_name_to_uid (user, NULL);
if (uid == (uid_t) -1) {
ck_pam_syslog (pamh, LOG_ERR, "cannot determine uid for user '%s'", user);
@@ -316,6 +325,9 @@ pam_sm_open_session (pam_handle_t *pamh,
if (x11_display == NULL) {
x11_display = "";
}
+ if (x11_display_device == NULL) {
+ x11_display_device = "";
+ }
if (remote_host_name == NULL) {
remote_host_name = "";
}
@@ -326,6 +338,7 @@ pam_sm_open_session (pam_handle_t *pamh,
"user", &uid,
"display-device", &display_device,
"x11-display", &x11_display,
+ "x11-display-device", &x11_display_device,
"remote-host-name", &remote_host_name,
"is-local", &is_local,
NULL);
diff --git a/pam-ck-connector/pam_ck_connector.8 b/pam-ck-connector/pam_ck_connector.8
index 43241a0..0824557 100644
--- a/pam-ck-connector/pam_ck_connector.8
+++ b/pam-ck-connector/pam_ck_connector.8
@@ -15,25 +15,26 @@ pam_ck_connector \- Register sessin with ConsoleKit
.SH "DESCRIPTION"
.PP
The pam_ck_connector PAM module registers a login session with
-the system-wide
-.I ConsoleKit
+the system-wide
+.I ConsoleKit
daemon. This PAM module should be used with
-caution; only local login managers such as
+caution; only local login managers such as
.B login(1)
-should use this. Since the
+should use this. Since the
.I ConsoleKit
daemon can accept both an
.B tty
and an X11 display the normal parameters set by PAM are not always
-useful.
+useful.
An application can therefore override these with the PAM environment
variables
-.B CKCON_TTY
-and
+.B CKCON_TTY,
.B CHCON_X11_DISPLAY
+and
+.B CHCON_X11_DISPLAY_DEVICE
(the application should remember to unset these before starting the
-login session).
+login session).
Also note that the
.I ConsoleKit
@@ -54,7 +55,7 @@ which is used to defined membership of a login session.
This PAM module has the side effect that it creates a connection to
the system message bus that is kept open until the session ends. This
-is used by the
+is used by the
.I ConsoleKit
daemon to track the life-cycle of the
session and, as such, should the login manager crash, the session will