269ccb0
# -*- python -*-
269ccb0
269ccb0
# System wide rpmlint default configuration.  Do not modify, override/add
269ccb0
# options in /etc/rpmlint/config and/or ~/.rpmlintrc as needed.
269ccb0
49f105a
import os.path
49f105a
import re
54cb46a
import sys
49f105a
269ccb0
from Config import *
49f105a
import Pkg
49f105a
269ccb0
54cb46a
setOption("CompressExtension", "gz")
54cb46a
setOption("DefaultPythonVersion", sys.version[:3])
54cb46a
setOption("KernelModuleRPMsOK", False)
8662069
setOption("MaxLineLength", 80)
54cb46a
setOption("NetworkEnabled", True)
c7594a7
setOption("ReleaseExtension", '\.(fc|rhe?l|el)\d+(?=\.|$)')
97d5013
setOption("UseDefaultRunlevels", False)
97d5013
setOption("UseEpoch", False)
97d5013
setOption("UseUTF8", True)
54cb46a
setOption("UseVersionInChangeLog", True)
37bafdf
setOption("ValidSrcPerms", (int("664",8), int("644",8), ))
54cb46a
269ccb0
setOption("ValidShells", (
83a9a35
    "<lua>",
269ccb0
    "/bin/sh",
269ccb0
    "/bin/bash",
269ccb0
    "/sbin/ldconfig",
269ccb0
    "/usr/bin/perl",
269ccb0
    "/usr/bin/python",
269ccb0
))
91f6f96
269ccb0
setOption("DanglingSymlinkExceptions", (
269ccb0
    ['consolehelper$', 'usermode'],
269ccb0
    ['consolehelper-gtk$', 'usermode-gtk'],
269ccb0
))
91f6f96
91f6f96
setOption("ValidLicenses", (
91f6f96
    # These are the short names for all of the Fedora approved licenses.
91f6f96
    # The master list is kept here: http://fedoraproject.org/wiki/Licensing
139a2c4
    # Last synced with revision "2.20, 9 February 2014" of that page.
dde4499
    'AAL',
259364f
    'Abstyles',
ebc9da9
    'Adobe',
5bfc533
    'ADSL',
d892269
    'AFL',
e83f5fc
    'Afmparse',
040d00f
    'AGPLv1',
040d00f
    'AGPLv3',
2be746c
    'AGPLv3+',
1468d1b
    'AGPLv3 with exceptions',
54cb46a
    'AMDPLPA',
e2f06ee
    'AML',
040d00f
    'AMPAS BSD',
e83f5fc
    'APAFML',
e2f06ee
    'APSL 2.0',
e2f06ee
    'APSL 2.0+',
ebc9da9
    'ARL',
e2f06ee
    'Artistic 2.0',
e2f06ee
    'Artistic clarified',
91f6f96
    'ASL 1.0',
91f6f96
    'ASL 1.0+',
91f6f96
    'ASL 1.1',
91f6f96
    'ASL 1.1+',
91f6f96
    'ASL 2.0',
91f6f96
    'ASL 2.0+',
4ba4429
    'Bahyph',
259364f
    'Barr',
32994cd
    'Beerware',
db3d04e
    'BeOpen',
4ba4429
    'Bibtex',
d892269
    'BitTorrent',
91f6f96
    'Boost',
32994cd
    'Borceux',
91f6f96
    'BSD',
54cb46a
    'BSD Protection',
d892269
    'BSD with advertising',
32994cd
    'BSD with attribution',
dde4499
    'CATOSL',
54cb46a
    'CC0',
91f6f96
    'CeCILL',
94babe1
    'CeCILL-B',
94babe1
    'CeCILL-C',
91f6f96
    'CDDL',
94babe1
    'CNRI',
91f6f96
    'Condor',
ed7d0cf
    'Copyright only',
e2f06ee
    'CPAL',
e2f06ee
    'CPL',
259364f
    'Crossword',
d892269
    'Crystal Stacker',
e83f5fc
    'Cube',
4ba4429
    'diffmark',
2be746c
    'DMIT',
5bfc533
    'DOC',
259364f
    'Dotseqn',
32994cd
    'DSDP',
c5e4831
    'dvipdfm',
1f0d2b3
    'ECL 1.0',
1f0d2b3
    'ECL 2.0',
91f6f96
    'eCos',
91f6f96
    'EFL 2.0',
91f6f96
    'EFL 2.0+',
32994cd
    'eGenix',
dde4499
    'Entessa',
1f0d2b3
    'EPL',
1f0d2b3
    'ERPL',
91f6f96
    'EU Datagrid',
e6cf082
    'EUPL 1.1',
c5e4831
    'Eurosym',
5bfc533
    'Fair',
e83f5fc
    'FSFUL',
e83f5fc
    'FSFULLR',
856ccfa
    'FTL',
d892269
    'Giftware',
1f0d2b3
    'GL2PS',
d892269
    'Glide',
32994cd
    'Glulxe',
ebc9da9
    'gnuplot',
91f6f96
    'GPL+',
d892269
    'GPL+ or Artistic',
8159ef4
    'GPL+ with exceptions',
c741dda
    'GPLv1',
94babe1
    'GPLv2 or Artistic',
856ccfa
    'GPLv2+ or Artistic',
91f6f96
    'GPLv2',
d892269
    'GPLv2 with exceptions',
91f6f96
    'GPLv2+',
856ccfa
    'GPLv2+ with exceptions',
91f6f96
    'GPLv3',
856ccfa
    'GPLv3 with exceptions',
91f6f96
    'GPLv3+',
856ccfa
    'GPLv3+ with exceptions',
4ba4429
    'HaskellReport',
91f6f96
    'IBM',
d892269
    'IJG',
ebc9da9
    'ImageMagick',
91f6f96
    'iMatix',
856ccfa
    'Imlib2',
91f6f96
    'Intel ACPI',
91f6f96
    'Interbase',
d892269
    'ISC',
91f6f96
    'Jabber',
39bf2f4
    'JasPer',
220ac74
    'JPython',
4ba4429
    'Julius',
97d5013
    'Knuth',
259364f
    'Latex2e',
9ceb862
    'LBNL BSD',
4ba4429
    'Leptonica',
91f6f96
    'LGPLv2',
91f6f96
    'LGPLv2 with exceptions',
91f6f96
    'LGPLv2+',
94babe1
    'LGPLv2+ or Artistic',
9ceb862
    'LGPLv2+ with exceptions',
91f6f96
    'LGPLv3',
9ceb862
    'LGPLv3 with exceptions',
91f6f96
    'LGPLv3+',
9ceb862
    'LGPLv3+ with exceptions',
259364f
    'Lhcyr',
d892269
    'libtiff',
1f0d2b3
    'LLGPL',
220ac74
    'Logica',
2be746c
    'LOSLA',
91f6f96
    'LPL',
39bf2f4
    'LPPL',
4ba4429
    'MakeIndex',
91f6f96
    'mecab-ipadic',
4ba4429
    'midnight',
8662069
    'MirOS',
91f6f96
    'MIT',
e83f5fc
    'MITNFA',
5bfc533
    'MIT with advertising',
83a9a35
    'mod_macro',
1f0d2b3
    'Motosoto',
91f6f96
    'MPLv1.0',
91f6f96
    'MPLv1.0+',
91f6f96
    'MPLv1.1',
91f6f96
    'MPLv1.1+',
4ba4429
    'MPLv2.0',
8662069
    'MS-PL',
e2f06ee
    'MS-RL',
e83f5fc
    'MTLL',
e83f5fc
    'Mup',
e2f06ee
    'Naumen',
91f6f96
    'NCSA',
5bfc533
    'NetCDF',
91f6f96
    'Netscape',
8662069
    'Newmat',
259364f
    'Newsletr',
e2f06ee
    'NGPL',
4ba4429
    'NLPL',
139a2c4
    'Nmap',
91f6f96
    'Nokia',
e2f06ee
    'NOSL',
c5e4831
    'Noweb',
b7f5315
    'OML',
91f6f96
    'OpenLDAP',
0eee475
    'OpenPBS',
e2f06ee
    'OpenSSL',
856ccfa
    'OReilly',
91f6f96
    'OSL 1.0',
91f6f96
    'OSL 1.0+',
ebc9da9
    'OSL 1.1',
ebc9da9
    'OSL 1.1+',
d892269
    'OSL 2.0',
d892269
    'OSL 2.0+',
1f0d2b3
    'OSL 2.1',
1f0d2b3
    'OSL 2.1+',
d892269
    'OSL 3.0',
d892269
    'OSL 3.0+',
4ba4429
    'Par',
91f6f96
    'Phorum',
91f6f96
    'PHP',
c5e4831
    'PlainTeX',
220ac74
    'Plexus',
1468d1b
    'PostgreSQL',
4ba4429
    'psfrag',
94babe1
    'psutils',
91f6f96
    'Public Domain',
91f6f96
    'Python',
c741dda
    'Qhull',
91f6f96
    'QPL',
54cb46a
    'Rdisc',
139a2c4
    'REX',
c741dda
    'RiceBSD',
e2f06ee
    'Romio',
91f6f96
    'RPSL',
259364f
    'Rsfs',
91f6f96
    'Ruby',
220ac74
    'Saxpath',
8159ef4
    'SCEA',
1f0d2b3
    'SCRIP',
5bfc533
    'Sendmail',
91f6f96
    'Sleepycat',
91f6f96
    'SISSL',
ebc9da9
    'SLIB',
8159ef4
    'SNIA',
0b83184
    'softSurfer',
91f6f96
    'SPL',
e83f5fc
    'STMPL',
e83f5fc
    'SWL',
39bf2f4
    'TCL',
94babe1
    'Teeworlds',
259364f
    'Threeparttable',
94babe1
    'TMate',
2be746c
    'Tolua',
32994cd
    'TORQUEv1.1',
54cb46a
    'TOSL',
139a2c4
    'TPDL',
c5e4831
    'TPL',
39bf2f4
    'UCD',
91f6f96
    'Vim',
91f6f96
    'VNLSL',
e2f06ee
    'VOSTROM',
91f6f96
    'VSL',
91f6f96
    'W3C',
c5e4831
    'Webmin',
259364f
    'Wsuipa',
bbc0784
    'WTFPL',
5bfc533
    'wxWidgets',
5bfc533
    'Xerox',
91f6f96
    'xinetd',
4ba4429
    'xpp',
54cb46a
    'XSkat',
1f0d2b3
    'YPLv1.1',
259364f
    'Zed',
91f6f96
    'Zend',
e2f06ee
    'zlib',
e2f06ee
    'zlib with acknowledgement',
91f6f96
    'ZPLv1.0',
91f6f96
    'ZPLv1.0+',
91f6f96
    'ZPLv2.0',
91f6f96
    'ZPLv2.0+',
ebc9da9
    'ZPLv2.1',
ebc9da9
    'ZPLv2.1+',
91f6f96
    # Documentation licenses
91f6f96
    'CDL',
91f6f96
    'FBSDDL',
91f6f96
    'GFDL',
ebc9da9
    'IEEE',
d345d00
    'LDPL',
ebc9da9
    'OFSFDL',
91f6f96
    'Open Publication',
c741dda
    'Public Use',
e83f5fc
    'Verbatim',
91f6f96
    # Content licenses
91f6f96
    'CC-BY',
5bfc533
    'CC-BY-ND',
e2f06ee
    'CC-BY-SA',
c5e4831
    'DMTF',
91f6f96
    'DSL',
5bfc533
    'EFML',
91f6f96
    'Free Art',
94babe1
    'GeoGratis',
c5e4831
    'Green OpenMusic',
dde4499
    'OAL',
bbc0784
    # Font licenses
1468d1b
    'AMS',
91f6f96
    'Arphic',
856ccfa
    'Baekmuk',
e81b603
    'Bitstream Vera',
1468d1b
    'DoubleStroke',
94babe1
    'Hershey',
1468d1b
    'IPA',
5bfc533
    'Liberation',
5bfc533
    'Lucida',
1468d1b
    'MgOpen',
39bf2f4
    'mplus',
3d3857f
    'OFL',
1468d1b
    'PTFL',
040d00f
    'STIX',
39bf2f4
    'Utopia',
1468d1b
    'Wadalab',
0eee475
    'XANO',
91f6f96
    # Others
91f6f96
    'Redistributable, no modification permitted',
91f6f96
    'Freely redistributable without restriction',
91f6f96
))
91f6f96
54cb46a
setOption('SystemLibPaths', ('/lib', '/lib64', '/usr/lib', '/usr/lib64'))
54cb46a
fd3ffab
# Add systemd dir to ignored path for UsrLibBinaryException
fd3ffab
setOption('UsrLibBinaryException', '^/usr/lib/(perl|python|menu|pkgconfig|systemd|lib[^/]+\.(so|l?a)$)')
fd3ffab
49f105a
# Get standard users and groups from the setup package's uidgid file
49f105a
setOption('StandardUsers', [])
49f105a
setOption('StandardGroups', [])
49f105a
setup_pkg = None
49f105a
try:
49f105a
    setup_pkg = Pkg.InstalledPkg('setup')
49f105a
except:
49f105a
    pass
49f105a
if setup_pkg:
1468d1b
    users = set()
1468d1b
    groups = set()
1468d1b
    uidgid_regex = re.compile(r'^\s*(\S+)\s+(-|\d+)\s+(-|\d+|\(\d+\))\s')
49f105a
    for uidgid_file in [x for x in setup_pkg.files() if x.endswith('/uidgid')]:
49f105a
        if os.path.exists(uidgid_file):
49f105a
            fobj = open(uidgid_file)
49f105a
            try:
49f105a
                for line in fobj.read().strip().splitlines():
49f105a
                    res = uidgid_regex.search(line)
49f105a
                    if res:
49f105a
                        name = res.group(1)
49f105a
                        if res.group(2) != '-':
1468d1b
                            users.add(name)
1468d1b
                        if res.group(3) != '-' and not '(' in res.group(3):
1468d1b
                            groups.add(name)
49f105a
                    del res
49f105a
                del line
49f105a
            finally:
49f105a
                fobj.close()
49f105a
            del fobj
1468d1b
    setOption('StandardUsers', sorted(users))
1468d1b
    setOption('StandardGroups', sorted(groups))
1468d1b
    del uidgid_regex, uidgid_file, users, groups
49f105a
del setup_pkg
269ccb0
269ccb0
# Output filters
54cb46a
addFilter("source-or-patch-not-compressed")
269ccb0
addFilter("%mklibname")
269ccb0
addFilter("no-dependency-on (perl|python)-base")
269ccb0
addFilter("no-dependency-on locales-")
269ccb0
addFilter("(python|perl5)-naming-policy-not-applied")
269ccb0
addFilter("no-(packager-tag|signature)")
269ccb0
addFilter("incoherent-version-in-name")
269ccb0
addFilter("invalid-build-requires")
269ccb0
addFilter("ghost-files-without-postin")
269ccb0
addFilter("postin-without-ghost-file-creation")
269ccb0
addFilter("no-major-in-name")
269ccb0
addFilter("no-provides")
269ccb0
addFilter("executable-in-library-package")
269ccb0
addFilter("non-versioned-file-in-library-package")
269ccb0
addFilter("requires-on-release")
269ccb0
addFilter("jar-not-indexed")
269ccb0
addFilter("outside-libdir-files")
0eee475
addFilter("-debuginfo.* no-documentation")
0eee475
addFilter("-debuginfo.* /usr/lib/debug/")
269ccb0
addFilter("non-standard-dir-in-usr libexec")
0eee475
addFilter("^gpg-pubkey:")
ac7c807
addFilter(" doc-file-dependency .* /bin/sh$")
91f6f96
addFilter("hardcoded-library-path .*/lib/udev(/|$)")
c7594a7
addFilter("not-standard-release-extension")
d345d00
addFilter("explicit-lib-dependency (liberation-fonts|libertas-.*-firmware|libvirt$|.*-(java|python)$)")
19e9607
addFilter("filename-too-long-for-joliet")
140570a
addFilter("symlink-should-be-")
4ef8d3b
addFilter("dangling-\S*symlink /usr/share/doc/HTML/\S+/common .+/common$")
9542aca
addFilter("hidden-file-or-dir .*/man5/\.k5login\.5[^/]+$")
97d5013
addFilter("blender.+ (wrong-script-interpreter|non-executable-script) .+/blender/.+\.py.*BPY.*")
66f16c4
# Fedora 12 and newer no longer need a buildroot defined, to have the buildroot cleaned at the beginning
66f16c4
# of %install, and do not need to define a %clean section unless the default is invalid.
66f16c4
addFilter("no-cleaning-of-buildroot")
66f16c4
addFilter("no-buildroot-tag")
66f16c4
addFilter("no-%clean-section")
6a047fd
# Only EL4 needs the files-attr-not-set check, because rpm 4.4 and newer no longer need a %defattr line
6a047fd
# (it automatically provides one).
6a047fd
addFilter("files-attr-not-set")
3347761
# Don't bother with the non-ghost-in-var-(lock|run) checks on Fedora 15 or newer
3347761
# since they have tmpfs /var/lock and /var/run.
3347761
addFilter("non-ghost-in-var-lock") 
3347761
addFilter("non-ghost-in-var-run")
364c6fd
# Someone thought it was a good idea to make .desktop files executable. They were wrong.
364c6fd
# Nevertheless, I do not yet control the universe, so we squelch the error here.
364c6fd
addFilter("script-without-shebang .*\.desktop$")
e83f5fc
# Some files in /etc/ are not meant to be modified by the sysadmin
e83f5fc
addFilter("non-conffile-in-etc /etc/rpm/.*$")
e83f5fc
addFilter("non-conffile-in-etc /etc/rc.d/init.d/.*$")
139a2c4
# Fixed in rpm >= 4.7.1
139a2c4
addFilter("broken-syntax-in-scriptlet-requires") 
0536d04
# Files that are intentionally not supposed to be readable
0536d04
# Contains passwords
0536d04
addFilter("non-readable /etc/ovirt-engine/isouploader.conf")
364c6fd
8480e39
# https://bugzilla.redhat.com/496737, https://bugzilla.redhat.com/646455
8480e39
for pkg, exe in (("coreutils", "/bin/su"),
8480e39
                 ("krb5-workstation", "/usr/kerberos/bin/ksu"),
8480e39
                 ("passwd", "/usr/bin/passwd"),
8480e39
                 ("sudo", "/usr/bin/sudo(edit)?"),
8480e39
                 ("upstart", "/sbin/initctl"),
8480e39
                 ("usermode", "/usr/sbin/userhelper")):
8480e39
    addFilter("%s.* (setuid-binary|non-standard-executable-perm) %s (root )?04"
8480e39
              % (pkg, exe))