SHA256
1
0
forked from pool/rpmlint

Accepting request 725256 from devel:openSUSE:Factory:rpmlint

- Update to version master:
  * Allow /usr/etc as discussed on opensuse-factory and opensuse-packaging

- whitelist systemd-portabled dbus files (boo#1145639)

- Update to version master:
  * Allow /usr/etc as discussed on opensuse-factory and opensuse-packaging

- Add user/group zabbix and zabbixs (bsc#1144018)

- Update add-check-for-a-non-zero-.text-segment-in-.a-archive.patch patch to align with:
  38fc30cafe99d38059ca54b98bc87f5544f0bb4e

- Add Development/Languages/Go group.

- Update add-check-for-a-non-zero-.text-segment-in-.a-archive.patch patch to align with:
  80126f7c7854d962cc64e54a6ab7e97067bb490d

- Update add-check-for-a-non-zero-.text-segment-in-.a-archive.patch patch to align with:
  c59324fd68

- Update add-check-for-a-non-zero-.text-segment-in-.a-archive.patch patch
  to:
  97d6caf9ac

- Add add-check-for-a-non-zero-.text-segment-in-.a-archive.patch
  as a backport of:
  2c809f3435

OBS-URL: https://build.opensuse.org/request/show/725256
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpmlint?expand=0&rev=321
This commit is contained in:
Dominique Leuenberger 2019-09-05 10:33:03 +00:00 committed by Git OBS Bridge
commit 9e877a4100
7 changed files with 147 additions and 3 deletions

View File

@ -3,4 +3,4 @@
<param name="url">https://github.com/openSUSE/rpmlint-tests.git</param>
<param name="changesrevision">75524278ef7de3efc70f0fa14016f1aac4e77d36</param></service><service name="tar_scm">
<param name="url">https://github.com/openSUSE/rpmlint-checks.git</param>
<param name="changesrevision">2d11e76027fc32be4005f955a71fab84c3a5407d</param></service></servicedata>
<param name="changesrevision">0528a49399ccabaae220fa8b452b8f9a082e48c9</param></service></servicedata>

View File

@ -0,0 +1,77 @@
diff --git a/BinariesCheck.py b/BinariesCheck.py
index 36d73f8..0fb91db 100644
--- a/BinariesCheck.py
+++ b/BinariesCheck.py
@@ -73,6 +73,10 @@ class BinaryInfo(object):
mktemp_call_regex = create_regexp_call('mktemp')
lto_section_name_prefix = '.gnu.lto_.'
+ # [Nr] Name Type Address Off Size ES Flg Lk Inf Al
+ # [ 1] .text PROGBITS 0000000000000000 000040 000000 00 AX 0 0 1
+ section_regex = re.compile(r'.*\] (?P<section>\S*)\s*\S+\s*\S*\s*\S*\s*(?P<size>\w*)')
+
def __init__(self, pkg, path, fname, is_ar, is_shlib):
self.readelf_error = False
self.needed = []
@@ -92,6 +96,7 @@ class BinaryInfo(object):
self.symtab = False
self.tail = ''
self.lto_sections = False
+ self.no_text_in_archive = False
self.setgid = False
self.setuid = False
@@ -102,6 +107,7 @@ class BinaryInfo(object):
self.mktemp = False
is_debug = path.endswith('.debug')
+ is_archive = path.endswith('.a')
# Currently this implementation works only on specific
# architectures due to reliance on arch specific assembly.
if (pkg.arch.startswith('armv') or pkg.arch == 'aarch64'):
@@ -117,6 +123,24 @@ class BinaryInfo(object):
('readelf', '-W', '-S', '-l', '-d', '-s', path))
if not res[0]:
lines = res[1].splitlines()
+
+ # For an archive, test if all .text sections are empty
+ if is_archive:
+ has_text_segment = False
+ non_zero_text_segment = False
+
+ for line in lines:
+ r = self.section_regex.search(line)
+ if r:
+ sn = r.group('section')
+ if sn == '.preinit_array' or sn == '.init_array' or sn == '.fini_array' or sn.startswith('.text'):
+ has_text_segment = True
+ size = int(r.group('size'), 16)
+ if size > 0:
+ non_zero_text_segment = True
+ if has_text_segment and not non_zero_text_segment:
+ self.no_text_in_archive = True
+
for line in lines:
if BinaryInfo.lto_section_name_prefix in line:
self.lto_sections = True
@@ -522,6 +546,9 @@ class BinariesCheck(AbstractCheck.AbstractCheck):
if bin_info.lto_sections:
printError(pkg, 'lto-bytecode', fname)
+ if bin_info.no_text_in_archive:
+ printError(pkg, 'lto-no-text-in-archive', fname)
+
for ec in bin_info.forbidden_calls:
printWarning(pkg, ec, fname,
BinaryInfo.forbidden_functions[ec]['f_name'])
@@ -846,6 +873,10 @@ implementations only strip if the permission is 0755).''',
'lto-bytecode',
'''This executable contains a LTO section. LTO bytecode is not portable
and should not be distributed in static libraries or e.g. Python modules.''',
+
+'lto-no-text-in-archive',
+'''This archive does not contain a non-empty .text section. The archive
+was not created with -ffat-lto-objects option.''',
)
# BinariesCheck.py ends here

8
config
View File

@ -102,6 +102,7 @@ setOption('ValidGroups', [
'Amusements/Toys/Screensavers',
'Development/Languages/C and C++',
'Development/Languages/Fortran',
'Development/Languages/Go',
'Development/Languages/Haskell',
'Development/Languages/Java',
'Development/Languages/Lua',
@ -509,6 +510,8 @@ setOption('StandardGroups', (
'xok',
'xrootd',
'xymon',
'zabbix',
'zabbixs',
'zeroinst',
'zkeyadm',
'znc',
@ -704,6 +707,8 @@ setOption('StandardUsers', (
'xrootd',
'xymon',
'yastws',
'zabbix',
'zabbixs',
'zaqar',
'zeroinst',
'znc',
@ -1014,6 +1019,9 @@ setOption("DBUSServices.WhiteList", (
# certmonger (bsc#1129452)
"org.fedorahosted.certmonger.service",
"certmonger.conf",
# systemd-portabled (boo#1145639)
"org.freedesktop.portable1.service",
"org.freedesktop.portable1.conf",
))
setOption("PAMModules.WhiteList", (

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:19113e168c1d6099d1b62c0c329ef85338a9fd1878f78e23c1aa7c735d32b322
size 25432
oid sha256:580b815042f0312cae37d9ca121986fd25964c20bd6a270f5336c0f1b6fd7d12
size 25436

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Aug 20 07:40:56 UTC 2019 - kukuk@suse.com
- Update to version master:
* Allow /usr/etc as discussed on opensuse-factory and opensuse-packaging
-------------------------------------------------------------------
Wed Jul 17 14:51:58 UTC 2019 - jsegitz@suse.de

View File

@ -1,3 +1,55 @@
-------------------------------------------------------------------
Thu Aug 22 08:56:44 UTC 2019 - Ludwig Nussel <lnussel@suse.de>
- whitelist systemd-portabled dbus files (boo#1145639)
-------------------------------------------------------------------
Tue Aug 20 07:40:56 UTC 2019 - kukuk@suse.com
- Update to version master:
* Allow /usr/etc as discussed on opensuse-factory and opensuse-packaging
-------------------------------------------------------------------
Wed Aug 14 08:53:25 UTC 2019 - Marketa Calabkova <mcalabkova@suse.com>
- Add user/group zabbix and zabbixs (bsc#1144018)
-------------------------------------------------------------------
Fri Aug 9 12:01:03 UTC 2019 - Martin Liška <mliska@suse.cz>
- Update add-check-for-a-non-zero-.text-segment-in-.a-archive.patch patch to align with:
38fc30cafe99d38059ca54b98bc87f5544f0bb4e
-------------------------------------------------------------------
Thu Aug 8 13:14:36 UTC 2019 - Dominique Leuenberger <dimstar@opensuse.org>
- Add Development/Languages/Go group.
-------------------------------------------------------------------
Thu Aug 8 12:45:30 UTC 2019 - Martin Liška <mliska@suse.cz>
- Update add-check-for-a-non-zero-.text-segment-in-.a-archive.patch patch to align with:
80126f7c7854d962cc64e54a6ab7e97067bb490d
-------------------------------------------------------------------
Fri Aug 2 07:53:03 UTC 2019 - Martin Liška <mliska@suse.cz>
- Update add-check-for-a-non-zero-.text-segment-in-.a-archive.patch patch to align with:
https://github.com/rpm-software-management/rpmlint/commit/c59324fd68ba86c8382fe09d43f12de32d764354
-------------------------------------------------------------------
Sun Jul 28 15:04:34 UTC 2019 - Martin Liška <mliska@suse.cz>
- Update add-check-for-a-non-zero-.text-segment-in-.a-archive.patch patch
to:
https://github.com/rpm-software-management/rpmlint/commit/97d6caf9ac3eb011e3f30dbc473f079b20fb56f9
-------------------------------------------------------------------
Mon Jul 22 11:44:51 UTC 2019 - Martin Liška <mliska@suse.cz>
- Add add-check-for-a-non-zero-.text-segment-in-.a-archive.patch
as a backport of:
https://github.com/rpm-software-management/rpmlint/commit/2c809f34354d6ea690986541b268d47a3ca59092
-------------------------------------------------------------------
Tue May 14 10:01:51 UTC 2019 - opensuse-packaging@opensuse.org

View File

@ -60,6 +60,7 @@ Patch58: remove-ghostfile-checks.diff
Patch63: fix-diag-sortorder.diff
Patch72: rpmlint-slpp-NUM-NUM.patch
Patch77: suse-rpmlint-all-pie.patch
Patch78: add-check-for-a-non-zero-.text-segment-in-.a-archive.patch
BuildRequires: desktop-file-utils
BuildRequires: obs-service-format_spec_file
BuildRequires: python3-flake8