You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "Jonathan Hurley (JIRA)" <ji...@apache.org> on 2017/10/23 15:21:00 UTC
[jira] [Reopened] (AMBARI-22016) changeToSecureUid.sh might collide
with existing user if it is not a local user but a network managed user
[ https://issues.apache.org/jira/browse/AMBARI-22016?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jonathan Hurley reopened AMBARI-22016:
--------------------------------------
Had to revert this change as it was causing deploy problems:
{code}
Traceback (most recent call last):
File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/hook.py", line 35, in <module>
BeforeAnyHook().execute()
File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 367, in execute
method(env)
File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/hook.py", line 29, in hook
setup_users()
File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py", line 55, in setup_users
set_uid(params.smoke_user, params.smoke_user_dirs)
File "/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py", line 144, in set_uid
not_if = format("(test $(id -u {user}) -gt 1000) || ({ignore_groupsusers_create_str})"))
File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 166, in __init__
self.env.run()
File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 160, in run
self.run_action(resource, action)
File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 124, in run_action
provider_action()
File "/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py", line 262, in action_run
tries=self.resource.tries, try_sleep=self.resource.try_sleep)
File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 72, in inner
result = function(command, **kwargs)
File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 102, in checked_call
tries=tries, try_sleep=try_sleep, timeout_kill_strategy=timeout_kill_strategy)
File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 150, in _call_wrapper
result = _call(command, **kwargs_copy)
File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 303, in _call
raise ExecutionFailed(err_msg, code, out, err)
{code}
> changeToSecureUid.sh might collide with existing user if it is not a local user but a network managed user
> ----------------------------------------------------------------------------------------------------------
>
> Key: AMBARI-22016
> URL: https://issues.apache.org/jira/browse/AMBARI-22016
> Project: Ambari
> Issue Type: Bug
> Components: stacks
> Affects Versions: 2.5.2
> Environment: Using Centos as the test bed
> Reporter: Aman Poonia
> Assignee: Aman Poonia
> Fix For: 2.6.1
>
> Attachments: AMBARI-22016.patch, AMBARI-22016_branch-2.6.patch
>
>
> changeToSecureUid.sh might collide with existing user if it is not a local user but a network managed user
> Currently we are doing
> {code:java}
> function find_available_uid() {
> for ((i=1001; i<=2000; i++))
> do
> grep -q $i /etc/passwd
> if [ "$?" -ne 0 ]
> then
> newUid=$i
> break
> fi
> done
> }
> {code}
> This will only check local user. Network manged users are not directly present inside passwd file.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)