You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2015/09/16 19:19:45 UTC
[1/2] ambari git commit: AMBARI-13116. Extraneous ‘list’ command being invoked through sudo (aonishuk)
Repository: ambari
Updated Branches:
refs/heads/branch-2.1 b726df76f -> e1efd557e
refs/heads/trunk bf6db1ff9 -> 0a204e04f
AMBARI-13116. Extraneous ‘list’ command being invoked through sudo (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0a204e04
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0a204e04
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0a204e04
Branch: refs/heads/trunk
Commit: 0a204e04f0a2163cc0ade0318ebb7df98770214e
Parents: bf6db1f
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Wed Sep 16 20:19:02 2015 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Wed Sep 16 20:19:02 2015 +0300
----------------------------------------------------------------------
ambari-agent/conf/unix/ambari-agent | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/0a204e04/ambari-agent/conf/unix/ambari-agent
----------------------------------------------------------------------
diff --git a/ambari-agent/conf/unix/ambari-agent b/ambari-agent/conf/unix/ambari-agent
index f894c8e..ea59216 100755
--- a/ambari-agent/conf/unix/ambari-agent
+++ b/ambari-agent/conf/unix/ambari-agent
@@ -49,10 +49,13 @@ OK=1
NOTOK=0
current_user=`id -u -n`
-echo "" | sudo -S -l > /dev/null 2>&1
-if [ "$?" != "0" ] && [ "$EUID" -ne 0 ] ; then
- echo "You can't perform this operation as non-sudoer user. Please, re-login or configure sudo access for this user."
- exit 0
+
+if [ "$EUID" -ne 0 ] ; then
+ echo "" | sudo -S -l > /dev/null 2>&1
+ if [ "$?" != "0" ] ; then
+ echo "You can't perform this operation as non-sudoer user. Please, re-login or configure sudo access for this user."
+ exit 0
+ fi
fi
keysdir=$(awk -F "=" '/keysdir/ {print $2}' /etc/ambari-agent/conf/ambari-agent.ini)
[2/2] ambari git commit: AMBARI-13116. Extraneous ‘list’ command being invoked through sudo (aonishuk)
Posted by ao...@apache.org.
AMBARI-13116. Extraneous ‘list’ command being invoked through sudo (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e1efd557
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e1efd557
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e1efd557
Branch: refs/heads/branch-2.1
Commit: e1efd557e6ba3847298b6211ee4f150ec5565a54
Parents: b726df7
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Wed Sep 16 20:19:08 2015 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Wed Sep 16 20:19:08 2015 +0300
----------------------------------------------------------------------
ambari-agent/conf/unix/ambari-agent | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/e1efd557/ambari-agent/conf/unix/ambari-agent
----------------------------------------------------------------------
diff --git a/ambari-agent/conf/unix/ambari-agent b/ambari-agent/conf/unix/ambari-agent
index 9659014..a08ead2 100755
--- a/ambari-agent/conf/unix/ambari-agent
+++ b/ambari-agent/conf/unix/ambari-agent
@@ -49,10 +49,13 @@ OK=1
NOTOK=0
current_user=`id -u -n`
-echo "" | sudo -S -l > /dev/null 2>&1
-if [ "$?" != "0" ] && [ "$EUID" -ne 0 ] ; then
- echo "You can't perform this operation as non-sudoer user. Please, re-login or configure sudo access for this user."
- exit 0
+
+if [ "$EUID" -ne 0 ] ; then
+ echo "" | sudo -S -l > /dev/null 2>&1
+ if [ "$?" != "0" ] ; then
+ echo "You can't perform this operation as non-sudoer user. Please, re-login or configure sudo access for this user."
+ exit 0
+ fi
fi
keysdir=$(awk -F "=" '/keysdir/ {print $2}' /etc/ambari-agent/conf/ambari-agent.ini)