From bc064ea45e62047e4e6a1b9e129d84c2bc65e816df8bdab9484f210d1e266341 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Fri, 26 Feb 2010 00:10:53 +0000 Subject: [PATCH] Accepting request 33497 from Base:System Copy from Base:System/rpmlint based on submit request 33497 from user lnussel OBS-URL: https://build.opensuse.org/request/show/33497 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpmlint?expand=0&rev=53 --- CheckPolkitPrivs.py | 14 +++++++------- config | 2 +- rpmlint.changes | 5 +++++ rpmlint.spec | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CheckPolkitPrivs.py b/CheckPolkitPrivs.py index e923e2f..e43f2de 100644 --- a/CheckPolkitPrivs.py +++ b/CheckPolkitPrivs.py @@ -8,20 +8,20 @@ from Filter import * import AbstractCheck +import Config import re import os from xml.dom.minidom import parse -_whitelist = () +POLKIT_PRIVS_WHITELIST = Config.getOption('PolkitPrivsWhiteList', ()) # set of file names +POLKIT_PRIVS_FILES = Config.getOption('PolkitPrivsFiles', [ "/etc/polkit-default-privs.standard" ]) class PolkitCheck(AbstractCheck.AbstractCheck): def __init__(self): AbstractCheck.AbstractCheck.__init__(self, "CheckPolkitPrivs") self.privs = {} - files = [ "/etc/polkit-default-privs.standard" ] - - for file in files: + for file in POLKIT_PRIVS_FILES: if os.path.exists(file): self._parsefile(file) @@ -36,7 +36,6 @@ class PolkitCheck(AbstractCheck.AbstractCheck): self.privs[priv] = value def check(self, pkg): - global _whitelist if pkg.isSource(): return @@ -52,7 +51,7 @@ class PolkitCheck(AbstractCheck.AbstractCheck): if f.startswith("/etc/polkit-default-privs.d/"): bn = f[28:] - if not bn in _whitelist: + if not bn in POLKIT_PRIVS_WHITELIST: printError(pkg, "polkit-unauthorized-file", f) bn = bn.split('.')[0] @@ -76,7 +75,8 @@ class PolkitCheck(AbstractCheck.AbstractCheck): # catch xml exceptions try: - if f.startswith("/usr/share/PolicyKit/policy/"): + if f.startswith("/usr/share/PolicyKit/policy/")\ + or f.startswith("/usr/share/polkit-1/actions/"): f = pkg.dirName() + f xml = parse(f) for a in xml.getElementsByTagName("action"): diff --git a/config b/config index a60f633..de99bbd 100644 --- a/config +++ b/config @@ -27,7 +27,7 @@ addCheck("CheckIconSizes") addCheck("BrandingPolicyCheck") addCheck("CheckSUIDPermissions") # polkit-default-privs would need to be installed always -#addCheck("CheckPolkitPrivs") +addCheck("CheckPolkitPrivs") addCheck("CheckDBUSServices") addCheck("CheckDBusPolicy") addCheck("CheckFilelist") diff --git a/rpmlint.changes b/rpmlint.changes index 5491e56..439abc1 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Feb 25 14:20:42 UTC 2010 - lnussel@suse.de + +- update and enable CheckPolkitPrivs + ------------------------------------------------------------------- Fri Feb 19 11:05:54 UTC 2010 - puzel@novell.com diff --git a/rpmlint.spec b/rpmlint.spec index 3402288..3f69bfe 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -23,7 +23,7 @@ Name: rpmlint BuildRequires: rpm-python Summary: Rpm correctness checker Version: 0.92 -Release: 3 +Release: 4 Source0: %{name}-%{version}.tar.bz2 Source1: config Source1001: config.in