summaryrefslogtreecommitdiff
path: root/daemon/gdm-session-worker.c
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2014-03-06 15:08:29 -0500
committerRay Strode <rstrode@redhat.com>2014-03-14 22:52:13 -0400
commit83b48a305e71637181975fc7ec479a71079b6fbc (patch)
tree7b09a017a5ff72531bf5147c3fcc78342ed011a6 /daemon/gdm-session-worker.c
parent1b3c5e732effd540154116432af94bd445772427 (diff)
downloadgdm-83b48a305e71637181975fc7ec479a71079b6fbc.tar.gz
session-worker: Move PostLogin / PreSession / PostSession here
Pushing these up to the session worker dramatically simplifies the interface for the slave, which will allow us to kill the slaves as separate binaries. Ideally, in the long-term, these scripts should go away.
Diffstat (limited to 'daemon/gdm-session-worker.c')
-rw-r--r--daemon/gdm-session-worker.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
index 5adc0151..8c1ea778 100644
--- a/daemon/gdm-session-worker.c
+++ b/daemon/gdm-session-worker.c
@@ -1554,6 +1554,17 @@ register_ck_session (GdmSessionWorker *worker)
#endif
}
+static gboolean
+run_script (GdmSessionWorker *worker,
+ const char *dir)
+{
+ return gdm_run_script (dir,
+ worker->priv->username,
+ worker->priv->x11_display_name,
+ worker->priv->display_is_local? NULL : worker->priv->hostname,
+ worker->priv->x11_authority_file);
+}
+
static void
session_worker_child_watch (GPid pid,
int status,
@@ -1579,6 +1590,8 @@ session_worker_child_watch (GPid pid,
status);
worker->priv->child_pid = -1;
+
+ run_script (worker, GDMCONFDIR "/PostSession");
}
static void
@@ -1999,6 +2012,14 @@ gdm_session_worker_open_session (GdmSessionWorker *worker,
flags |= PAM_SILENT;
}
+ if (!run_script (worker, GDMCONFDIR "/PostLogin")) {
+ g_set_error (error,
+ GDM_SESSION_WORKER_ERROR,
+ GDM_SESSION_WORKER_ERROR_OPENING_SESSION,
+ "Failed to execute PostLogin script");
+ goto out;
+ }
+
error_code = pam_open_session (worker->priv->pam_handle, flags);
if (error_code != PAM_SUCCESS) {
@@ -2016,6 +2037,14 @@ gdm_session_worker_open_session (GdmSessionWorker *worker,
session_id = gdm_session_worker_get_environment_variable (worker, "XDG_SESSION_ID");
#endif
+ /* FIXME: should we do something here?
+ * Note that error return status from PreSession script should
+ * be ignored in the case of a X-GDM-BypassXsession session, which can
+ * be checked by calling:
+ * gdm_session_bypasses_xsession (session)
+ */
+ run_script (worker, GDMCONFDIR "/PreSession");
+
#ifdef WITH_CONSOLE_KIT
register_ck_session (worker);