aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2009-01-07 04:38:57 +0000
committerFelix Fietkau <nbd@openwrt.org>2009-01-07 04:38:57 +0000
commit6d27b16e2b3ebc16de0bb544c4e353dbb43a8b7b (patch)
tree38f9d5f53b4d3c444c6ed90e63ad4bb1db58c3a0
parent59a00d52a96ad6c30c607bbcecca7d4ed6e9d9c6 (diff)
downloadupstream-6d27b16e2b3ebc16de0bb544c4e353dbb43a8b7b.tar.gz
upstream-6d27b16e2b3ebc16de0bb544c4e353dbb43a8b7b.tar.bz2
upstream-6d27b16e2b3ebc16de0bb544c4e353dbb43a8b7b.zip
fix $HOME in /etc/profile (#4424)
SVN-Revision: 13914
-rw-r--r--package/base-files/files/etc/profile3
1 files changed, 2 insertions, 1 deletions
diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile
index e82408ff83..1f680655f7 100644
--- a/package/base-files/files/etc/profile
+++ b/package/base-files/files/etc/profile
@@ -2,7 +2,8 @@
[ -f /etc/banner ] && cat /etc/banner
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-export HOME=/root
+export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
+export HOME=${HOME:-/root}
export PS1='\u@\h:\w\$ '
[ -x /bin/more ] || alias more=less