From f6677d1e307e94a282b3a0194e30785ea88c09bb Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Mon, 19 May 2014 11:55:34 +0000 Subject: glusterd/geo-rep: Use getent passwd instead of $HOME $HOME might not be set in the env variables, as is the case when these scripts are executed using the runner framework. Hence using getent passwd instead of $HOME Change-Id: I99f6bcd788d727be534b3040600d66c8dbb7ee92 BUG: 1099041 Signed-off-by: Avra Sengupta Reviewed-on: http://review.gluster.org/7803 Reviewed-by: Atin Mukherjee Reviewed-by: Kotresh HR Tested-by: Gluster Build System Reviewed-by: Venky Shankar Tested-by: Venky Shankar --- extras/hook-scripts/S56glusterd-geo-rep-create-post.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'extras/hook-scripts') diff --git a/extras/hook-scripts/S56glusterd-geo-rep-create-post.sh b/extras/hook-scripts/S56glusterd-geo-rep-create-post.sh index c1400148bfa..835daf819c9 100755 --- a/extras/hook-scripts/S56glusterd-geo-rep-create-post.sh +++ b/extras/hook-scripts/S56glusterd-geo-rep-create-post.sh @@ -49,8 +49,7 @@ if [ -f $pub_file ]; then # For a non-root user copy the pub file to the user's home directory # For a root user copy the pub files to priv_dir->geo-rep. if [ "$slave_user" != "root" ]; then - slave_user_home_dir=`ssh $slave_user@$slave_ip 'source /etc/profile; echo $HOME'` - echo $slave_user_home_dir + slave_user_home_dir=`ssh $slave_user@$slave_ip "getent passwd $slave_user | cut -d ':' -f 6"` scp $pub_file $slave_user@$slave_ip:$slave_user_home_dir/common_secret.pem.pub_tmp ssh $slave_user@$slave_ip "mv $slave_user_home_dir/common_secret.pem.pub_tmp $slave_user_home_dir/common_secret.pem.pub" else -- cgit