policycoreutils: sandbox: check for paths up front
When launching a sandbox x environment we should check up front to make sure that the seunshare and sandboxsh files exist and bail politely if they do not exist. Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Dan Walsh <dwalsh@redhat.com>
This commit is contained in:
parent
1701e786ea
commit
74bb5c01d6
|
@ -174,6 +174,15 @@ class Sandbox:
|
||||||
def __x_callback(self, option, opt, value, parser):
|
def __x_callback(self, option, opt, value, parser):
|
||||||
self.__mount = True
|
self.__mount = True
|
||||||
setattr(parser.values, option.dest, True)
|
setattr(parser.values, option.dest, True)
|
||||||
|
if not os.path.exists(SEUNSHARE):
|
||||||
|
raise ValueError(_("""
|
||||||
|
%s is required for the action you want to perform.
|
||||||
|
""") % SEUNSHARE)
|
||||||
|
|
||||||
|
if not os.path.exists(SANDBOXSH):
|
||||||
|
raise ValueError(_("""
|
||||||
|
%s is required for the action you want to perform.
|
||||||
|
""") % SANDBOXSH)
|
||||||
|
|
||||||
def __validdir(self, option, opt, value, parser):
|
def __validdir(self, option, opt, value, parser):
|
||||||
if not os.path.isdir(value):
|
if not os.path.isdir(value):
|
||||||
|
|
Loading…
Reference in New Issue