Repository: ambari Updated Branches: refs/heads/trunk daac7df8a -> 512c941b7
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/trunk Commit: 512c941b7bd2122d5078aa54b1fa9acb0fec5239 Parents: daac7df Author: Jonathan Hurley <[email protected]> Authored: Mon Oct 23 09:34:19 2017 -0400 Committer: Jonathan Hurley <[email protected]> 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
