SHA256
1
0
forked from pool/rpmlint

- fix stripping of unknown polkit suffixes (bnc#711485)

OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=58
This commit is contained in:
Dirk Mueller 2011-08-19 16:36:40 +00:00 committed by Git OBS Bridge
parent 73364494d6
commit 63c279c07c
2 changed files with 15 additions and 6 deletions

View File

@ -21,12 +21,12 @@ class PolkitCheck(AbstractCheck.AbstractCheck):
AbstractCheck.AbstractCheck.__init__(self, "CheckPolkitPrivs")
self.privs = {}
for file in POLKIT_PRIVS_FILES:
if os.path.exists(file):
self._parsefile(file)
for filename in POLKIT_PRIVS_FILES:
if os.path.exists(filename):
self._parsefile(filename)
def _parsefile(self,file):
for line in open(file):
def _parsefile(self,filename):
for line in file(filename):
line = line.split('#')[0].split('\n')[0]
if len(line):
line = re.split(r'\s+', line)
@ -54,12 +54,15 @@ class PolkitCheck(AbstractCheck.AbstractCheck):
if not bn in POLKIT_PRIVS_WHITELIST:
printError(pkg, "polkit-unauthorized-file", f)
bn = bn.split('.')[0]
if bn.endswith(".restrictive") or bn.endswith(".standard") or bn.endswith(".relaxed"):
bn = bn.split('.')[0]
if not bn in permfiles:
permfiles[bn] = 1
for f in permfiles:
f = pkg.dirName() + "/etc/polkit-default-privs.d/" + f
if os.path.exists(f+".restrictive"):
self._parsefile(f + ".restrictive")
elif os.path.exists(f+".standard"):
@ -69,6 +72,7 @@ class PolkitCheck(AbstractCheck.AbstractCheck):
else:
self._parsefile(f)
for f in files:
if f in pkg.ghostFiles():
continue

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Aug 19 18:36:04 CEST 2011 - dmueller@suse.de
- fix stripping of unknown polkit suffixes (bnc#711485)
-------------------------------------------------------------------
Fri Aug 12 18:07:43 CEST 2011 - dmueller@suse.de