From 71dc75bdafe62a098c0493ad62f2d0d2a6ca7946 Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Tue, 6 Sep 2011 14:55:28 -0700 Subject: [PATCH] mkcephfs: Config $user is irrelevant when we want to run as root. It used to just not sudo if $user was empty, on non-ssh do_root_cmd's. This bug was exposed by commit 47b09e2f0463f6a5ea8cc8e127b012a0cf1ec4af. Signed-off-by: Tommi Virtanen --- src/ceph_common.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/ceph_common.sh b/src/ceph_common.sh index 0c5ea52d8490a..adb8783f4e9a7 100644 --- a/src/ceph_common.sh +++ b/src/ceph_common.sh @@ -97,12 +97,7 @@ do_root_cmd() { if [ -z "$ssh" ]; then [ $verbose -eq 1 ] && echo "--- $host# $1" ulimit -c unlimited - whoami=`whoami` - if [ "$whoami" = "root" ] || [ -z "$user" ]; then - bash -c "$1" || { echo "failed: '$1'" ; exit 1; } - else - sudo bash -c "$1" || { echo "failed: '$1'" ; exit 1; } - fi + sudo bash -c "$1" || { echo "failed: '$1'" ; exit 1; } else [ $verbose -eq 1 ] && echo "--- $rootssh $2 \"cd $sshdir ; ulimit -c unlimited ; $1\"" $rootssh $2 "cd $sshdir ; ulimit -c unlimited ; $1" || { echo "failed: '$rootssh $1'" ; exit 1; } -- 2.39.5