Browse Source

HPCC-11258 Improve grep pattern to get user home directory

Xiaoming Wang 11 năm trước cách đây
mục cha
commit
8ee9f18f4a
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      initfiles/bash/etc/init.d/install-init.in

+ 1 - 1
initfiles/bash/etc/init.d/install-init.in

@@ -178,7 +178,7 @@ binPath="$path/bin"
 add_user $user $group $homePath || exit 1
 
 # If user already exists get the home directory
-homePath=$(cat /etc/passwd | grep -e "^$user" | cut -d':' -f6)
+homePath=$(cat /etc/passwd | grep -e "^${user}:" | cut -d':' -f6)
 homeBase=$(dirname $homePath)
 echo ""