[gvfs] gvfs-test: Call root shell with "privileged" option
- From: Martin Pitt <martinpitt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] gvfs-test: Call root shell with "privileged" option
- Date: Mon, 8 Jun 2015 08:34:29 +0000 (UTC)
commit 5e0deba248c5b23243d65ceccc612a4a635c5e3e
Author: Martin Pitt <martin pitt ubuntu com>
Date: Mon Jun 8 10:17:44 2015 +0200
gvfs-test: Call root shell with "privileged" option
bash, dash etc. drop suid root privileges without -p.
test/gvfs-test | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/test/gvfs-test b/test/gvfs-test
index 5decf88..1d299d7 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'))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]