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>
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; }