]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mkcephfs: Config $user is irrelevant when we want to run as root.
authorTommi Virtanen <tommi.virtanen@dreamhost.com>
Tue, 6 Sep 2011 21:55:28 +0000 (14:55 -0700)
committerTommi Virtanen <tommi.virtanen@dreamhost.com>
Tue, 6 Sep 2011 22:57:17 +0000 (15:57 -0700)
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 <tommi.virtanen@dreamhost.com>
src/ceph_common.sh

index 0c5ea52d8490a09f636432ce70f7c03a17b563c1..adb8783f4e9a7a88f494a75f460b7946974d7666 100644 (file)
@@ -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; }