You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rl...@apache.org on 2017/10/23 15:20:56 UTC

[48/50] [abbrv] ambari git commit: AMBARI-22016 - changeToSecureUid.sh might collide with existing user if it is not a local user (Aman Poonia via jonathanhurley)

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


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 512c941b7bd2122d5078aa54b1fa9acb0fec5239
Parents: daac7df
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Mon Oct 23 09:34:19 2017 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Mon Oct 23 09:36:04 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/512c941b/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 a6b8b77..e735ea7 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
-   grep -q $i /etc/passwd
+   getent passwd $i | cut -d: -f4
    if [ "$?" -ne 0 ]
    then
     newUid=$i