guix-commits
[Top][All Lists]
Advanced

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

01/02: system: /etc/profile reads /etc/environment for the sake of lshd.


From: Ludovic Courtès
Subject: 01/02: system: /etc/profile reads /etc/environment for the sake of lshd.
Date: Wed, 03 Feb 2016 10:23:31 +0000

civodul pushed a commit to branch master
in repository guix.

commit 2a5f0db4c45679cac6a747a48993fe73982cadca
Author: Ludovic Courtès <address@hidden>
Date:   Wed Feb 3 09:07:35 2016 +0100

    system: /etc/profile reads /etc/environment for the sake of lshd.
    
    Fixes <http://bugs.gnu.org/22175>.
    
    * gnu/system.scm (operating-system-etc-service)[profile]: Add hack to
    define variables from /etc/environment.
---
 gnu/system.scm |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index dea7d88..d4759a0 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -465,6 +465,17 @@ else
   export PATH=\"$HOME/.guix-profile/bin:$PATH\"
 fi
 
+# Since 'lshd' does not use pam_env, /etc/environment must be explicitly
+# loaded when someone logs in via SSH.  See <http://bugs.gnu.org/22175>.
+# We need 'PATH' to be defined here, for 'cat' and 'cut'.
+if [ -f /etc/environment -a -n \"$SSH_CLIENT\" \\
+     -a -z \"$LINUX_MODULE_DIRECTORY\" ]
+then
+  . /etc/environment
+  export `cat /etc/environment | cut -d= -f1`
+fi
+
+
 # Allow GStreamer-based applications to find plugins.
 export GST_PLUGIN_PATH=\"$HOME/.guix-profile/lib/gstreamer-1.0\"
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]