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:28:50 -0500
commit1bd10fd185222a106bd4a8098d5ed6e8bc3c655e (patch)
treeb7dce1b57ad08498ba91ee6d5214df5b29406d93
parent5cb5819c44c146d2832573561e34b883fcc5eee9 (diff)
downloadgdm-1bd10fd185222a106bd4a8098d5ed6e8bc3c655e.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;