forked from pool/rpmlint
Accepting request 39288 from Base:System
Copy from Base:System/rpmlint based on submit request 39288 from user dirkmueller OBS-URL: https://build.opensuse.org/request/show/39288 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpmlint?expand=0&rev=60
This commit is contained in:
parent
23044a1498
commit
e04756ff4b
@ -40,6 +40,8 @@ class BrandingPolicyCheck(AbstractCheck.AbstractCheck):
|
||||
|
||||
# verify that it doesn't conflict with branding
|
||||
for r in pkg_conflicts:
|
||||
if r.startswith("otherproviders("):
|
||||
continue
|
||||
if r.find('-theme-') >= 0 or r.find('-branding-') >= 0:
|
||||
printError(pkg,'suse-branding-branding-conflict', r)
|
||||
|
||||
|
@ -1,3 +1,13 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 29 11:54:25 CEST 2010 - dmueller@suse.de
|
||||
|
||||
- check for gethostbyname calls (bnc#506945)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 29 11:33:37 CEST 2010 - dmueller@suse.de
|
||||
|
||||
- fix branding check (bnc#579556)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Apr 28 11:16:25 CEST 2010 - dmueller@suse.de
|
||||
|
||||
|
@ -23,7 +23,7 @@ Name: rpmlint
|
||||
BuildRequires: rpm-python
|
||||
Summary: Rpm correctness checker
|
||||
Version: 0.95
|
||||
Release: 5
|
||||
Release: 6
|
||||
Source0: %{name}-%{version}.tar.bz2
|
||||
Source1: config
|
||||
Source1001: config.in
|
||||
@ -63,7 +63,7 @@ Patch4: invalid-filerequires.diff
|
||||
Patch5: suse-bzip-bigger-than-100k.diff
|
||||
Patch6: suse-filesystem.diff
|
||||
Patch7: suse-pkg-config-check.diff
|
||||
Patch8: suse-debuginfo.diff
|
||||
Patch8: suse-binarieschecks.diff
|
||||
Patch9: no-doc-for-lib.diff
|
||||
Patch10: add-scoring-support.diff
|
||||
Patch11: suse-file-var-run.diff
|
||||
|
@ -1,26 +1,39 @@
|
||||
Index: BinariesCheck.py
|
||||
===================================================================
|
||||
--- BinariesCheck.py.orig
|
||||
--- BinariesCheck.py
|
||||
+++ BinariesCheck.py
|
||||
@@ -37,6 +37,8 @@ class BinaryInfo:
|
||||
@@ -37,6 +37,9 @@
|
||||
unused_regex = re.compile('^\s+(\S+)')
|
||||
exit_call_regex = re.compile('\s+FUNC\s+.*?\s+(_?exit(?:@\S+)?)(?:\s|$)')
|
||||
fork_call_regex = re.compile('\s+FUNC\s+.*?\s+(fork(?:@\S+)?)(?:\s|$)')
|
||||
+ debuginfo_regex=re.compile('^\s+\[\s*\d+\]\s+\.debug_.*\s+')
|
||||
+ symtab_regex=re.compile('^\s+\[\s*\d+\]\s+\.symtab\s+')
|
||||
+ gethostbyname_call_regex = re.compile('\s+FUNC\s+.*?\s+(gethostbyname(?:@\S+)?)(?:\s|$)')
|
||||
|
||||
def __init__(self, pkg, path, file, is_ar, is_shlib):
|
||||
self.readelf_error = False
|
||||
@@ -51,6 +53,8 @@ class BinaryInfo:
|
||||
@@ -50,7 +53,10 @@
|
||||
self.stack = False
|
||||
self.exec_stack = False
|
||||
self.exit_calls = []
|
||||
+ self.calls_gethostbyname = False
|
||||
fork_called = False
|
||||
+ self.debuginfo = 0
|
||||
+ self.symtab=0
|
||||
self.tail = ''
|
||||
|
||||
is_debug = path.endswith('.debug')
|
||||
@@ -103,6 +107,14 @@ class BinaryInfo:
|
||||
@@ -93,6 +99,11 @@
|
||||
self.exec_stack = True
|
||||
continue
|
||||
|
||||
+ r = BinaryInfo.gethostbyname_call_regex.search(l)
|
||||
+ if r:
|
||||
+ self.calls_gethostbyname = True
|
||||
+ continue
|
||||
+
|
||||
if is_shlib:
|
||||
r = BinaryInfo.exit_call_regex.search(l)
|
||||
if r:
|
||||
@@ -103,6 +114,14 @@
|
||||
fork_called = True
|
||||
continue
|
||||
|
||||
@ -35,7 +48,7 @@ Index: BinariesCheck.py
|
||||
if self.non_pic:
|
||||
self.non_pic = 'TEXTREL' in res[1]
|
||||
|
||||
@@ -259,6 +271,17 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||
@@ -259,6 +278,17 @@
|
||||
bin_info = BinaryInfo(
|
||||
pkg, pkgfile.path, fname, is_ar, is_shlib)
|
||||
|
||||
@ -53,7 +66,18 @@ Index: BinariesCheck.py
|
||||
# so name in library
|
||||
if is_shlib:
|
||||
has_lib = True
|
||||
@@ -509,6 +532,14 @@ with the intended shared libraries only.
|
||||
@@ -294,6 +324,10 @@
|
||||
printError(
|
||||
pkg, 'shlib-with-non-pic-code', fname)
|
||||
|
||||
+ # gethostbyname ?
|
||||
+ if bin_info.calls_gethostbyname:
|
||||
+ printError(pkg, 'binary-or-shlib-calls-gethostbyname', fname)
|
||||
+
|
||||
# rpath ?
|
||||
if bin_info.rpath:
|
||||
for p in bin_info.rpath:
|
||||
@@ -509,6 +543,14 @@
|
||||
'ldd-failed',
|
||||
'''Executing ldd on this file failed, all checks could not be run.''',
|
||||
|
||||
@ -68,3 +92,14 @@ Index: BinariesCheck.py
|
||||
'executable-stack',
|
||||
'''The binary declares the stack as executable. Executable stack is usually an
|
||||
error as it is only needed if the code contains GCC trampolines or similar
|
||||
@@ -521,6 +563,10 @@
|
||||
make the stack executable. Usual suspects include use of a non-GNU linker or
|
||||
an old GNU linker version.''',
|
||||
|
||||
+'binary-or-shlib-calls-gethostbyname',
|
||||
+'''The binary calls gethostbyname(). Please port the code to use
|
||||
+getaddrinfo().''',
|
||||
+
|
||||
'shared-lib-calls-exit',
|
||||
'''This library package calls exit() or _exit(), probably in a non-fork()
|
||||
context. Doing so from a library is strongly discouraged - when a library
|
Loading…
Reference in New Issue
Block a user