We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5b98f39 commit acca96aCopy full SHA for acca96a
policycoreutils/sandbox/sandbox
@@ -471,10 +471,15 @@ sandbox [-h] [-l level ] [-[X|M] [-H homedir] [-T tempdir]] [-I includefile ] [-
471
cmds += ["--"] + self.__paths
472
return subprocess.Popen(cmds).wait()
473
474
- selinux.setexeccon(self.__execcon)
475
- rc = subprocess.Popen(self.__cmds).wait()
476
- selinux.setexeccon(None)
477
- return rc
+ pid = os.fork()
+ if pid == 0:
+ rc = os.setsid()
+ if rc:
478
+ return rc
479
+ selinux.setexeccon(self.__execcon)
480
+ os.execv(self.__cmds[0], self.__cmds)
481
+ rc = os.waitpid(pid, 0)
482
+ return os.WEXITSTATUS(rc[1])
483
484
finally:
485
for i in self.__paths:
0 commit comments