Parse list of standard users and groups from the setup package's uidgid
file.
This commit is contained in:
parent
9542aca479
commit
49f105abf9
@ -3,7 +3,12 @@
|
||||
# System wide rpmlint default configuration. Do not modify, override/add
|
||||
# options in /etc/rpmlint/config and/or ~/.rpmlintrc as needed.
|
||||
|
||||
import os.path
|
||||
import re
|
||||
|
||||
from Config import *
|
||||
import Pkg
|
||||
|
||||
|
||||
setOption("ReleaseExtension", '\.(fc|rhe?l|el)\d+(?=\.|$)')
|
||||
setOption("UseVersionInChangeLog", 1)
|
||||
@ -234,15 +239,35 @@ setOption("ValidLicenses", (
|
||||
'Freely redistributable without restriction',
|
||||
))
|
||||
|
||||
# Standard users & groups from the setup package:
|
||||
setOption("StandardUsers",
|
||||
("root", "bin", "daemon", "adm", "lp", "sync", "shutdown", "halt",
|
||||
"mail", "news", "uucp", "operator", "games", "gopher", "ftp",
|
||||
"nobody"))
|
||||
setOption("StandardGroups",
|
||||
("root", "bin", "daemon", "sys", "adm", "tty", "disk", "lp", "mem",
|
||||
"kmem", "wheel", "mail", "news", "uucp", "man", "games", "gopher",
|
||||
"dip", "ftp", "lock", "nobody", "users"))
|
||||
# Get standard users and groups from the setup package's uidgid file
|
||||
setOption('StandardUsers', [])
|
||||
setOption('StandardGroups', [])
|
||||
setup_pkg = None
|
||||
try:
|
||||
setup_pkg = Pkg.InstalledPkg('setup')
|
||||
except:
|
||||
pass
|
||||
if setup_pkg:
|
||||
uidgid_regex = re.compile('^\s*(\S+)\s+(-|\d+)\s+(-|\d+)\s')
|
||||
for uidgid_file in [x for x in setup_pkg.files() if x.endswith('/uidgid')]:
|
||||
if os.path.exists(uidgid_file):
|
||||
fobj = open(uidgid_file)
|
||||
try:
|
||||
for line in fobj.read().strip().splitlines():
|
||||
res = uidgid_regex.search(line)
|
||||
if res:
|
||||
name = res.group(1)
|
||||
if res.group(2) != '-':
|
||||
getOption('StandardUsers').append(name)
|
||||
if res.group(3) != '-':
|
||||
getOption('StandardGroups').append(name)
|
||||
del res
|
||||
del line
|
||||
finally:
|
||||
fobj.close()
|
||||
del fobj
|
||||
del uidgid_regex, uidgid_file
|
||||
del setup_pkg
|
||||
|
||||
# Output filters
|
||||
addFilter("source-or-patch-not-[bg]zipped")
|
||||
|
@ -68,6 +68,9 @@ rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue May 19 2009 Ville Skyttä <ville.skytta at iki.fi>
|
||||
- Parse list of standard users and groups from the setup package's uidgid file.
|
||||
|
||||
* Mon May 18 2009 Ville Skyttä <ville.skytta at iki.fi>
|
||||
- Sync Fedora license list with Wiki revision 1.43.
|
||||
- Filter out warning about .k5login man page hiddenness (#496735).
|
||||
|
Loading…
Reference in New Issue
Block a user