forked from pool/rpmlint
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
This commit is contained in:
parent
a16aad926b
commit
bc064ea45e
@ -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"):
|
||||
|
2
config
2
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")
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user