summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2016-04-18 16:09:08 -0400
committerRay Strode <rstrode@redhat.com>2017-03-03 15:32:37 -0500
commit7be68258b6d9b51d574311aef7ab3ab35629a939 (patch)
treee15e19e5f54227487fa02f9448cdcace93a78f37
parentba80ce1ea4e0efe63f661dc2c13eb4cde3b39ddf (diff)
downloadgdm-7be68258b6d9b51d574311aef7ab3ab35629a939.tar.gz
worker: run PostLogin/PreSession scripts later
Right now we run them while the login screen is still up, so they have no way of showing UI to the user. This commit moves them until after the login screen is torn down. https://bugzilla.gnome.org/show_bug.cgi?id=779497
-rw-r--r--daemon/gdm-session-worker.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
index daf8b91d..d97b02b5 100644
--- a/daemon/gdm-session-worker.c
+++ b/daemon/gdm-session-worker.c
@@ -1856,6 +1856,24 @@ gdm_session_worker_start_session (GdmSessionWorker *worker,
jump_to_vt (worker, worker->priv->session_vt);
}
+ if (!worker->priv->is_program_session && !run_script (worker, GDMCONFDIR "/PostLogin")) {
+ g_set_error (error,
+ GDM_SESSION_WORKER_ERROR,
+ GDM_SESSION_WORKER_ERROR_OPENING_SESSION,
+ "Failed to execute PostLogin script");
+ error_code = PAM_ABORT;
+ goto out;
+ }
+
+ if (!worker->priv->is_program_session && !run_script (worker, GDMCONFDIR "/PreSession")) {
+ g_set_error (error,
+ GDM_SESSION_WORKER_ERROR,
+ GDM_SESSION_WORKER_ERROR_OPENING_SESSION,
+ "Failed to execute PreSession script");
+ error_code = PAM_ABORT;
+ goto out;
+ }
+
session_pid = fork ();
if (session_pid < 0) {
@@ -2251,14 +2269,6 @@ 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");
- return FALSE;
- }
-
error_code = pam_open_session (worker->priv->pam_handle, flags);
if (error_code != PAM_SUCCESS) {
@@ -2274,14 +2284,6 @@ gdm_session_worker_open_session (GdmSessionWorker *worker,
session_id = gdm_session_worker_get_environment_variable (worker, "XDG_SESSION_ID");
- /* 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");
-
if (session_id != NULL) {
g_free (worker->priv->session_id);
worker->priv->session_id = session_id;