ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject ambari git commit: AMBARI-10400. Handle no "sudo -E" environments (aonishuk)
Date Fri, 10 Apr 2015 09:27:39 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 9d9dc00bb -> 24a93410f


AMBARI-10400. Handle no "sudo -E" environments (aonishuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/24a93410
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/24a93410
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/24a93410

Branch: refs/heads/trunk
Commit: 24a93410fa6bb611211e510d9526f312190554dd
Parents: 9d9dc00
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Fri Apr 10 12:27:31 2015 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Fri Apr 10 12:27:31 2015 +0300

----------------------------------------------------------------------
 ambari-agent/conf/unix/ambari-sudo.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/24a93410/ambari-agent/conf/unix/ambari-sudo.sh
----------------------------------------------------------------------
diff --git a/ambari-agent/conf/unix/ambari-sudo.sh b/ambari-agent/conf/unix/ambari-sudo.sh
index 80761c5..ba76f25 100755
--- a/ambari-agent/conf/unix/ambari-sudo.sh
+++ b/ambari-agent/conf/unix/ambari-sudo.sh
@@ -20,9 +20,8 @@ if [[ $# -eq 0 ]] ; then
   exit 1
 fi
 
-$SUDO_BINARY -S -l 2>/dev/null 1>/dev/null
-
-if [ $? == 0 ] ; then
+# if user is non-root
+if [ "$EUID" -ne 0 ] ; then
   $SUDO_BINARY "$@"
 else
   ENV=()


Mime
View raw message