mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-23 00:08:50 -05:00
pactest : safety check with MODE
check that the file exists first, otherwise pactest just breaks. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
8ebc07744a
commit
a3ecbec6b5
@ -116,9 +116,12 @@ class pmrule:
|
|||||||
if not f.ismodified():
|
if not f.ismodified():
|
||||||
success = 0
|
success = 0
|
||||||
elif case == "MODE":
|
elif case == "MODE":
|
||||||
mode = os.lstat(filename)[ST_MODE]
|
if not os.path.isfile(filename):
|
||||||
if int(value,8) != S_IMODE(mode):
|
|
||||||
success = 0
|
success = 0
|
||||||
|
else:
|
||||||
|
mode = os.lstat(filename)[ST_MODE]
|
||||||
|
if int(value,8) != S_IMODE(mode):
|
||||||
|
success = 0
|
||||||
elif case == "TYPE":
|
elif case == "TYPE":
|
||||||
if value == "dir":
|
if value == "dir":
|
||||||
if not os.path.isdir(filename):
|
if not os.path.isdir(filename):
|
||||||
|
Loading…
Reference in New Issue
Block a user