1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-23 08:18:51 -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:
Xavier Chantry 2009-07-17 19:33:13 +02:00 committed by Dan McGee
parent 8ebc07744a
commit a3ecbec6b5

View File

@ -116,6 +116,9 @@ class pmrule:
if not f.ismodified():
success = 0
elif case == "MODE":
if not os.path.isfile(filename):
success = 0
else:
mode = os.lstat(filename)[ST_MODE]
if int(value,8) != S_IMODE(mode):
success = 0