diff mbox

[1/2] sandbox: do not try setup directories without -X or -M

Message ID 20160923172416.25050-1-plautrba@redhat.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Petr Lautrbach Sept. 23, 2016, 5:24 p.m. UTC
sandbox tried to copy all affected files to the new home
or tmp even though -M or -X was not specified and there was no new
directory.

Fixes:
$ sandbox ls ~
/usr/bin/sandbox: [Errno 17] File exists: '/root'

Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
---
 policycoreutils/sandbox/sandbox | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/policycoreutils/sandbox/sandbox b/policycoreutils/sandbox/sandbox
index 4ed57c1..9cc13c2 100644
--- a/policycoreutils/sandbox/sandbox
+++ b/policycoreutils/sandbox/sandbox
@@ -503,7 +503,8 @@  sandbox [-h] [-l level ] [-[X|M] [-H homedir] [-T tempdir]] [-I includefile ] [-
         try:
             self.__parse_options()
             self.__gen_context()
-            self.__setup_dir()
+            if self.__mount:
+                self.__setup_dir()
             return self.__execute()
         except KeyboardInterrupt:
             sys.exit(0)