mirror of
https://github.com/ceph/ceph
synced 2025-01-20 18:21:57 +00:00
vstart_runner: upgrade the check for commands to be run as another user
Rectify the condition that checks if command to be issued as another user using sudo is issued as a single argument after "-c". Signed-off-by: Rishabh Dave <ridave@redhat.com>
This commit is contained in:
parent
da441cb381
commit
21a1b30a3e
@ -264,8 +264,8 @@ class LocalRemote(object):
|
||||
# the desired effect.
|
||||
errmsg = 'The entire command to executed as other user should be a ' +\
|
||||
'single argument.\nargs - %s' % (args)
|
||||
if ('sudo' in args or 'python' in args or 'python2' in args or
|
||||
'python3' in args) and '-c' in args:
|
||||
if 'sudo' in args and '-u' in args and '-c' in args and \
|
||||
args.count('-c') == 1:
|
||||
if args.index('-c') != len(args) - 2 and \
|
||||
args[args.index('-c') + 2].find('-') == -1:
|
||||
raise RuntimeError(errmsg)
|
||||
|
Loading…
Reference in New Issue
Block a user