浏览代码

Merge pull request #5725 from xwang2713/HPCC_111258_user_home

HPCC-11258 Improve grep pattern to get user home directory

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 11 年之前
父节点
当前提交
a3303f2f63
共有 1 个文件被更改,包括 1 次插入1 次删除
  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 ""