summaryrefslogtreecommitdiff
path: root/src/session.c
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2014-03-24 11:41:16 +1300
committerRobert Ancell <robert.ancell@canonical.com>2014-03-24 11:41:16 +1300
commitf9a70850ac1e3881773280f2891ad183e2f50906 (patch)
tree921b52fcc9ad3da60992dfea7dafd4631f07519b /src/session.c
parent9de5566b6d87d395b53078a1c297e53a93727277 (diff)
downloadlightdm-f9a70850ac1e3881773280f2891ad183e2f50906.tar.gz
When unlocking an existing session cleanly exit the child and refresh the PAM credentials
Diffstat (limited to 'src/session.c')
-rw-r--r--src/session.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/session.c b/src/session.c
index 1ec2c3e5..c0cbc140 100644
--- a/src/session.c
+++ b/src/session.c
@@ -846,6 +846,22 @@ session_stop (Session *session)
{
g_return_if_fail (session != NULL);
+ /* If can cleanly stop then do that */
+ if (session_get_is_authenticated (session) && !session->priv->command_run)
+ {
+ gsize n = 0;
+
+ session->priv->command_run = TRUE;
+ write_string (session, NULL); // log filename
+ write_string (session, NULL); // tty
+ write_string (session, NULL); // xauth filename
+ write_string (session, NULL); // xdisplay
+ write_xauth (session, NULL); // xauth
+ write_data (session, &n, sizeof (n)); // environment
+ write_data (session, &n, sizeof (n)); // command
+ return;
+ }
+
if (session->priv->stopping)
return;
session->priv->stopping = TRUE;