diff --git a/BUGS b/BUGS index 7bb9ae1..b8fd291 100644 --- a/BUGS +++ b/BUGS @@ -1,5 +1,6 @@ Current - Within the sandbox sudo is not working for tools. + <- Sudo is working now but its always asking for a password. - If a tool runs a script that needs sudo, the password prompt is garbling the screen and stopping input. - When paging the summary window, with the bottom scroll bar showing, the diff --git a/sandbox_fs.py b/sandbox_fs.py index d8860a9..42a1a02 100644 --- a/sandbox_fs.py +++ b/sandbox_fs.py @@ -20,6 +20,9 @@ class OverlayfsMount(): subprocess.check_call(["sudo", "mount", "-t", "overlayfs", "-o", option_string, "overlayfs", self.mount_point], stderr=subprocess.PIPE) + for command in ["chmod", "chown"]: + subprocess.check_call(["sudo", command, "--reference", lower_dir, + mount_point]) def __repr__(self): return "" % (self.mount_point, diff --git a/sandbox_fs_test.py b/sandbox_fs_test.py index 53193da..d56d71c 100755 --- a/sandbox_fs_test.py +++ b/sandbox_fs_test.py @@ -4,6 +4,7 @@ # Licensed under the Artistic License 2.0. import os +import subprocess import tempfile import unittest @@ -23,7 +24,7 @@ class SandboxFilesystemTestCase(unittest.TestCase): def test_sandbox_minimal(self): foo_upper_path = os.path.join(self.sandbox.mount_point, "foo") - open(foo_upper_path, "w").close() + subprocess.check_call(["sudo", "touch", foo_upper_path]) self.assertTrue(os.path.exists(foo_upper_path)) foo_lower_path = os.path.join(self.sandbox.overlay_mounts[0].lower_dir, "foo")