summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'session.c')
-rw-r--r--session.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/session.c b/session.c
index 6f389ac66..6250c2031 100644
--- a/session.c
+++ b/session.c
@@ -93,6 +93,7 @@
93#include "kex.h" 93#include "kex.h"
94#include "monitor_wrap.h" 94#include "monitor_wrap.h"
95#include "sftp.h" 95#include "sftp.h"
96#include "consolekit.h"
96 97
97#if defined(KRB5) && defined(USE_AFS) 98#if defined(KRB5) && defined(USE_AFS)
98#include <kafs.h> 99#include <kafs.h>
@@ -1143,6 +1144,9 @@ do_setup_env(Session *s, const char *shell)
1143#if !defined (HAVE_LOGIN_CAP) && !defined (HAVE_CYGWIN) 1144#if !defined (HAVE_LOGIN_CAP) && !defined (HAVE_CYGWIN)
1144 char *path = NULL; 1145 char *path = NULL;
1145#endif 1146#endif
1147#ifdef USE_CONSOLEKIT
1148 const char *ckcookie = NULL;
1149#endif /* USE_CONSOLEKIT */
1146 1150
1147 /* Initialize the environment. */ 1151 /* Initialize the environment. */
1148 envsize = 100; 1152 envsize = 100;
@@ -1287,6 +1291,11 @@ do_setup_env(Session *s, const char *shell)
1287 child_set_env(&env, &envsize, "KRB5CCNAME", 1291 child_set_env(&env, &envsize, "KRB5CCNAME",
1288 s->authctxt->krb5_ccname); 1292 s->authctxt->krb5_ccname);
1289#endif 1293#endif
1294#ifdef USE_CONSOLEKIT
1295 ckcookie = PRIVSEP(consolekit_register(s, s->display));
1296 if (ckcookie)
1297 child_set_env(&env, &envsize, "XDG_SESSION_COOKIE", ckcookie);
1298#endif /* USE_CONSOLEKIT */
1290#ifdef USE_PAM 1299#ifdef USE_PAM
1291 /* 1300 /*
1292 * Pull in any environment variables that may have 1301 * Pull in any environment variables that may have
@@ -2350,6 +2359,10 @@ session_pty_cleanup2(Session *s)
2350 2359
2351 debug("session_pty_cleanup: session %d release %s", s->self, s->tty); 2360 debug("session_pty_cleanup: session %d release %s", s->self, s->tty);
2352 2361
2362#ifdef USE_CONSOLEKIT
2363 consolekit_unregister(s);
2364#endif /* USE_CONSOLEKIT */
2365
2353 /* Record that the user has logged out. */ 2366 /* Record that the user has logged out. */
2354 if (s->pid != 0) 2367 if (s->pid != 0)
2355 record_logout(s->pid, s->tty, s->pw->pw_name); 2368 record_logout(s->pid, s->tty, s->pw->pw_name);