Project

General

Profile

Bug #39385

vstart_runner: check for "-c" doesn't check if the switch belongs to sudo

Added by Rishabh Dave 12 months ago. Updated 5 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
nautilus
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
fs
Pull request ID:
Crash signature:

Description

Following is the the traceback-

2019-04-18 22:22:03,803.803 INFO:__main__:Running ['./bin/ceph', 'auth', 'get-or-create', 'client.manila', 'mds', 'allow *', 'osd', 'allow rw', 'mon', 'allow *']
> /home/rishabh/repos/ceph/add-pos-test-for-vol-client/qa/tasks/vstart_runner.py(273)_perform_checks_and_return_list_of_args()
-> raise RuntimeError("All args after '-c' should be a single " 
(Pdb) p args
['sudo', 'python', '-c', 'import shutil, sys; shutil.copyfileobj(sys.stdin, file(sys.argv[1], "wb"))', '/home/rishabh/repos/ceph/add-pos-test-for-vol-client/build/client.manila.keyring']
(Pdb) q
2019-04-18 22:35:09,441.441 INFO:__main__:test_put_object_versioned (tasks.cephfs.test_volume_client.TestVolumeClient) ... ERROR
2019-04-18 22:35:09,442.442 ERROR:__main__:Traceback (most recent call last):
  File "/home/rishabh/repos/ceph/add-pos-test-for-vol-client/qa/tasks/cephfs/test_volume_client.py", line 989, in test_put_object_versioned
    self._configure_vc_auth(vc_mount, "manila")
  File "/home/rishabh/repos/ceph/add-pos-test-for-vol-client/qa/tasks/cephfs/test_volume_client.py", line 78, in _configure_vc_auth
    self._sudo_write_file(mount.client_remote, mount.get_keyring_path(), out)
  File "/home/rishabh/repos/ceph/add-pos-test-for-vol-client/qa/tasks/cephfs/test_volume_client.py", line 64, in _sudo_write_file
    stdin=data,
  File "../qa/tasks/vstart_runner.py", line 284, in run
    args = self._perform_checks_and_return_list_of_args(args, omit_sudo)
  File "../qa/tasks/vstart_runner.py", line 273, in _perform_checks_and_return_list_of_args
    raise RuntimeError("When using '-c' switch of sudo command, all " 
  File "../qa/tasks/vstart_runner.py", line 273, in _perform_checks_and_return_list_of_args
    raise RuntimeError("When using '-c' switch of sudo command, all " 
  File "/usr/lib64/python2.7/bdb.py", line 49, in trace_dispatch
    return self.dispatch_line(frame)
  File "/usr/lib64/python2.7/bdb.py", line 68, in dispatch_line
    if self.quitting: raise BdbQuit
BdbQuit

Modifying the condition here as follows should fix it -

        if 'sudo' in args and '-c' in args and ('python' not in args or 
           ('python' in args and args.index('-c') < args.index('python')))


Related issues

Copied to ceph-qa-suite - Backport #40238: nautilus: vstart_runner: check for "-c" doesn't check if the switch belongs to sudo Rejected

History

#1 Updated by Rishabh Dave 12 months ago

I was confused if fs tracker was the right place for this bug, but, hopefully, this one is more appropriate.

#2 Updated by Rishabh Dave 12 months ago

  • Status changed from New to In Progress

#3 Updated by Rishabh Dave 12 months ago

  • Assignee set to Rishabh Dave

#5 Updated by Rishabh Dave 11 months ago

  • Status changed from In Progress to Fix Under Review

#6 Updated by Rishabh Dave 11 months ago

  • Pull request ID set to 27718

#7 Updated by Rishabh Dave 10 months ago

  • Pull request ID changed from 27718 to 28199

I've split PR 27718 into several commits.

#8 Updated by Rishabh Dave 10 months ago

  • Status changed from Fix Under Review to Pending Backport

#9 Updated by Nathan Cutler 10 months ago

  • Backport set to nautilus

#10 Updated by Nathan Cutler 10 months ago

  • Copied to Backport #40238: nautilus: vstart_runner: check for "-c" doesn't check if the switch belongs to sudo added

#11 Updated by Nathan Cutler 5 months ago

  • Status changed from Pending Backport to Resolved

While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved" or "Rejected".

Also available in: Atom PDF