Repository: ambari
Updated Branches:
  refs/heads/trunk cfd0f090b -> 5ad8869a5


Revert "AMBARI-22016 - changeToSecureUid.sh might collide with existing user if 
it is not a local user (Aman Poonia via jonathanhurley)"

This reverts commit 512c941b7bd2122d5078aa54b1fa9acb0fec5239.


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

Branch: refs/heads/trunk
Commit: 5ad8869a5f2a9d9d693494dc03381ffd5968fc40
Parents: cfd0f09
Author: Jonathan Hurley <[email protected]>
Authored: Mon Oct 23 11:22:46 2017 -0400
Committer: Jonathan Hurley <[email protected]>
Committed: Mon Oct 23 11:22:46 2017 -0400

----------------------------------------------------------------------
 .../resources/stack-hooks/before-ANY/files/changeToSecureUid.sh    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5ad8869a/ambari-server/src/main/resources/stack-hooks/before-ANY/files/changeToSecureUid.sh
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stack-hooks/before-ANY/files/changeToSecureUid.sh
 
b/ambari-server/src/main/resources/stack-hooks/before-ANY/files/changeToSecureUid.sh
index e735ea7..a6b8b77 100644
--- 
a/ambari-server/src/main/resources/stack-hooks/before-ANY/files/changeToSecureUid.sh
+++ 
b/ambari-server/src/main/resources/stack-hooks/before-ANY/files/changeToSecureUid.sh
@@ -26,7 +26,7 @@ newUid=$3
 function find_available_uid() {
  for ((i=1001; i<=2000; i++))
  do
-   getent passwd $i | cut -d: -f4
+   grep -q $i /etc/passwd
    if [ "$?" -ne 0 ]
    then
     newUid=$i

Reply via email to