ignore password flags in become conflict check
since all the --ask pass options end up triggering the same code and are functionally equivalent, ignore them when it comes to checking privilege escalation conflicts. This allows using -K when --become-method=su and so on.
This commit is contained in:
parent
a6f6a80caa
commit
f1fcab4610
1 changed files with 3 additions and 6 deletions
|
@ -191,12 +191,9 @@ class CLI(object):
|
||||||
|
|
||||||
if runas_opts:
|
if runas_opts:
|
||||||
# Check for privilege escalation conflicts
|
# Check for privilege escalation conflicts
|
||||||
if (op.su or op.su_user or op.ask_su_pass) and \
|
if (op.su or op.su_user) and (op.sudo or op.sudo_user) or \
|
||||||
(op.sudo or op.sudo_user or op.ask_sudo_pass) or \
|
(op.su or op.su_user) and (op.become or op.become_user) or \
|
||||||
(op.su or op.su_user or op.ask_su_pass) and \
|
(op.sudo or op.sudo_user) and (op.become or op.become_user):
|
||||||
(op.become or op.become_user or op.become_ask_pass) or \
|
|
||||||
(op.sudo or op.sudo_user or op.ask_sudo_pass) and \
|
|
||||||
(op.become or op.become_user or op.become_ask_pass):
|
|
||||||
|
|
||||||
self.parser.error("Sudo arguments ('--sudo', '--sudo-user', and '--ask-sudo-pass') "
|
self.parser.error("Sudo arguments ('--sudo', '--sudo-user', and '--ask-sudo-pass') "
|
||||||
"and su arguments ('-su', '--su-user', and '--ask-su-pass') "
|
"and su arguments ('-su', '--su-user', and '--ask-su-pass') "
|
||||||
|
|
Loading…
Reference in a new issue