summaryrefslogtreecommitdiff
path: root/daemon/gdm-session-worker.c
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2018-06-04 15:12:01 -0400
committerRay Strode <halfline@gmail.com>2018-07-17 20:04:46 +0000
commitf44dbef8c6dc7e8f3b631e315ea261c643b606d6 (patch)
tree08163eec34225a35226e8dfc3eed692d8e81e191 /daemon/gdm-session-worker.c
parent20ef7016b4e44e9e7dc19faec72398aab7a66188 (diff)
downloadgdm-f44dbef8c6dc7e8f3b631e315ea261c643b606d6.tar.gz
session-worker: set PWD for user session
It's possible for the current working directory to be a symlink. Some programs, and notably, the get_current_dir_name() libc api use the PWD environment variable to know the symlink being used (so they don't use the canonical name that the symlink points to) This commit makes sure we set PWD in that case, to allow those programs to show the right path.
Diffstat (limited to 'daemon/gdm-session-worker.c')
-rw-r--r--daemon/gdm-session-worker.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
index 34b3bf7f..a0a755c6 100644
--- a/daemon/gdm-session-worker.c
+++ b/daemon/gdm-session-worker.c
@@ -1392,6 +1392,7 @@ gdm_session_worker_update_environment_from_passwd_info (GdmSessionWorker *worker
gdm_session_worker_set_environment_variable (worker, "USER", worker->priv->username);
gdm_session_worker_set_environment_variable (worker, "USERNAME", worker->priv->username);
gdm_session_worker_set_environment_variable (worker, "HOME", home);
+ gdm_session_worker_set_environment_variable (worker, "PWD", home);
gdm_session_worker_set_environment_variable (worker, "SHELL", shell);
}