[gdm/wip/pwd-fix: 32/32] session-worker: set PWD for user session



commit f44dbef8c6dc7e8f3b631e315ea261c643b606d6
Author: Ray Strode <rstrode redhat com>
Date:   Mon Jun 4 15:12:01 2018 -0400

    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.

 daemon/gdm-session-worker.c | 1 +
 1 file changed, 1 insertion(+)
---
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);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]