Skip to content

Commit 1ab4008

Browse files
committed
Fix: FS#866 - bad handling of environment variables with jailkit ssh users in server/conf/bash.bashrc.master
1 parent a3205ec commit 1ab4008

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

server/conf/bash.bashrc.master

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11

22
<tmpl_if name='jailkit_chroot'>
33
## Hack for Jailkit User to change back to the logged in user ##
4-
if [ "$LOGNAME" != $USER ]; then
5-
export HOME=<tmpl_var name='home_dir'>$LOGNAME
6-
export USER=$LOGNAME
7-
export USERNAME=$LOGNAME
8-
cd $HOME
4+
if [ -n "$LOGNAME" ]; then
5+
if [ "$LOGNAME" != $USER ]; then
6+
export HOME=<tmpl_var name='home_dir'>$LOGNAME
7+
export USER=$LOGNAME
8+
export USERNAME=$LOGNAME
9+
cd $HOME
10+
fi
911
fi
1012

1113
## Change machine hostname to site domain ##

0 commit comments

Comments
 (0)