diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2015-06-08 10:17:44 +0200 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2015-06-08 10:17:44 +0200 |
commit | 5e0deba248c5b23243d65ceccc612a4a635c5e3e (patch) | |
tree | f701f5e7e58346f31a20d0d704895074243527f7 /test | |
parent | ffe8bdf494ff25d89c4f9fae539fd7edd02b5f9f (diff) | |
download | gvfs-5e0deba248c5b23243d65ceccc612a4a635c5e3e.tar.gz |
gvfs-test: Call root shell with "privileged" option
bash, dash etc. drop suid root privileges without -p.
Diffstat (limited to 'test')
-rwxr-xr-x | test/gvfs-test | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/gvfs-test b/test/gvfs-test index 5decf886..1d299d73 100755 --- a/test/gvfs-test +++ b/test/gvfs-test @@ -148,7 +148,7 @@ class GvfsTestCase(unittest.TestCase): ''' assert in_testbed, 'root_command() only works under gvfs-testbed' - rootsh = subprocess.Popen(['./rootsh'], stdin=subprocess.PIPE, + rootsh = subprocess.Popen(['./rootsh', '-p'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) # set reasonable path that includes /sbin rootsh.stdin.write(b'export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\n') @@ -1244,14 +1244,14 @@ class Drive(GvfsTestCase): self.load_image('bogus-cd.iso.bz2') def cleanup(): - rootsh = subprocess.Popen(['./rootsh'], stdin=subprocess.PIPE) + rootsh = subprocess.Popen(['./rootsh', '-p'], stdin=subprocess.PIPE) rootsh.communicate(b'''rm /run/udev/rules.d/40-scsi_debug-fake-mediaplayer.rules pkill --signal HUP udevd || pkill --signal HUP systemd-udevd ''') # create udev rule to turn it into a music player self.addCleanup(cleanup) - rootsh = subprocess.Popen(['./rootsh'], stdin=subprocess.PIPE) + rootsh = subprocess.Popen(['./rootsh', '-p'], stdin=subprocess.PIPE) rootsh.communicate(b'''export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin mkdir -p /run/udev/rules.d echo 'SUBSYSTEM=="block", ATTRS{model}=="scsi_debug*", ENV{ID_MEDIA_PLAYER}="MockTune"' > /run/udev/rules.d/40-scsi_debug-fake-mediaplayer.rules @@ -1311,7 +1311,7 @@ pkill --signal HUP udevd || pkill --signal HUP systemd-udevd '''Start mock polkit with list of allowed actions.''' self.stop_polkit() - self.mock_polkit = subprocess.Popen(['./rootsh'], + self.mock_polkit = subprocess.Popen(['./rootsh', '-p'], stdin=subprocess.PIPE) self.mock_polkit.stdin.write(('set -e\n/home/test_polkitd.py -r -a %s\n' % ','.join(actions)).encode('ASCII')) |