forked from pool/rpmlint
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=485
This commit is contained in:
parent
471cf0d4d9
commit
94d6d5f985
@ -24,24 +24,39 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
|||||||
chroot_call_regex = create_regexp_call('chroot')
|
chroot_call_regex = create_regexp_call('chroot')
|
||||||
# 401eb8: e8 c3 f0 ff ff callq 400f80 <chdir@plt>
|
# 401eb8: e8 c3 f0 ff ff callq 400f80 <chdir@plt>
|
||||||
objdump_call_regex = re.compile(br'callq?\s(.*)')
|
objdump_call_regex = re.compile(br'callq?\s(.*)')
|
||||||
+ debuginfo_regex=re.compile('^\s+\[\s*\d+\]\s+\.debug_.*\s+')
|
+ debuginfo_regex = re.compile('^\s+\[\s*\d+\]\s+\.debug_.*\s+')
|
||||||
+ symtab_regex=re.compile('^\s+\[\s*\d+\]\s+\.symtab\s+')
|
+ symtab_regex = re.compile('^\s+\[\s*\d+\]\s+\.symtab\s+')
|
||||||
+ gethostbyname_call_regex = gethostbyname_call_regex = create_regexp_call(r'(gethostbyname|gethostbyname2|gethostbyaddr|gethostbyname_r|gethostbyname2_r|gethostbyaddr_r)')
|
+ gethostbyname_call_regex = create_regexp_call(r'(gethostbyname|gethostbyname2|gethostbyaddr|gethostbyname_r|gethostbyname2_r|gethostbyaddr_r)')
|
||||||
|
|
||||||
forbidden_functions = Config.getOption("WarnOnFunction")
|
forbidden_functions = Config.getOption("WarnOnFunction")
|
||||||
if forbidden_functions:
|
if forbidden_functions:
|
||||||
@@ -84,7 +88,10 @@ class BinaryInfo(object):
|
@@ -84,7 +87,10 @@ class BinaryInfo(object):
|
||||||
self.exec_stack = False
|
self.exec_stack = False
|
||||||
self.exit_calls = []
|
self.exit_calls = []
|
||||||
self.forbidden_calls = []
|
self.forbidden_calls = []
|
||||||
+ self.calls_gethostbyname = False
|
+ self.calls_gethostbyname = False
|
||||||
fork_called = False
|
fork_called = False
|
||||||
+ self.debuginfo = 0
|
+ self.debuginfo = False
|
||||||
+ self.symtab=0
|
+ self.symtab = False
|
||||||
self.tail = ''
|
self.tail = ''
|
||||||
|
|
||||||
self.setgid = False
|
self.setgid = False
|
||||||
@@ -161,6 +168,9 @@ class BinaryInfo(object):
|
@@ -121,6 +127,14 @@ class BinaryInfo(object):
|
||||||
|
self.non_pic = False
|
||||||
|
continue
|
||||||
|
|
||||||
|
+ if BinaryInfo.debuginfo_regex.search(l):
|
||||||
|
+ self.debuginfo = True
|
||||||
|
+ continue
|
||||||
|
+
|
||||||
|
+ if BinaryInfo.symtab_regex.search(l):
|
||||||
|
+ self.symtab = True
|
||||||
|
+ continue
|
||||||
|
+
|
||||||
|
r = BinaryInfo.soname_regex.search(l)
|
||||||
|
if r:
|
||||||
|
self.soname = r.group(1)
|
||||||
|
@@ -161,6 +175,9 @@ class BinaryInfo(object):
|
||||||
if BinaryInfo.chroot_call_regex.search(l):
|
if BinaryInfo.chroot_call_regex.search(l):
|
||||||
self.chroot = True
|
self.chroot = True
|
||||||
|
|
||||||
@ -51,29 +66,14 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
|||||||
if BinaryInfo.forbidden_functions:
|
if BinaryInfo.forbidden_functions:
|
||||||
for r_name, func in BinaryInfo.forbidden_functions.items():
|
for r_name, func in BinaryInfo.forbidden_functions.items():
|
||||||
ret = func['f_regex'].search(l)
|
ret = func['f_regex'].search(l)
|
||||||
@@ -177,6 +187,14 @@ class BinaryInfo(object):
|
@@ -392,13 +409,26 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||||
fork_called = True
|
|
||||||
continue
|
|
||||||
|
|
||||||
+ if BinaryInfo.debuginfo_regex.search(l):
|
|
||||||
+ self.debuginfo=1
|
|
||||||
+ continue
|
|
||||||
+
|
|
||||||
+ if BinaryInfo.symtab_regex.search(l):
|
|
||||||
+ self.symtab=1
|
|
||||||
+ continue
|
|
||||||
+
|
|
||||||
# check if we don't have a string that will automatically
|
|
||||||
# waive the presence of a forbidden call
|
|
||||||
if self.forbidden_calls:
|
|
||||||
@@ -392,13 +410,26 @@ class BinariesCheck(AbstractCheck.Abstra
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# stripped ?
|
# stripped ?
|
||||||
- if 'not stripped' in pkgfile.magic:
|
- if 'not stripped' in pkgfile.magic:
|
||||||
+ if 'not stripped' in pkgfile.magic and \
|
+ if ('not stripped' in pkgfile.magic and
|
||||||
+ (os.environ.get('BUILD_DIR', '') == '' or
|
+ (os.environ.get('BUILD_DIR', '') == '' or
|
||||||
+ os.environ.get('BUILD_DEBUG', '') != ''):
|
+ os.environ.get('BUILD_DEBUG', '') != '')):
|
||||||
printWarning(pkg, 'unstripped-binary-or-object', fname)
|
printWarning(pkg, 'unstripped-binary-or-object', fname)
|
||||||
|
|
||||||
# inspect binary file
|
# inspect binary file
|
||||||
@ -86,15 +86,15 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
|||||||
+ pass
|
+ pass
|
||||||
+ elif not bin_info.symtab:
|
+ elif not bin_info.symtab:
|
||||||
+ printError(pkg, 'static-library-without-symtab', fname)
|
+ printError(pkg, 'static-library-without-symtab', fname)
|
||||||
+ elif not bin_info.debuginfo and \
|
+ elif (not bin_info.debuginfo and
|
||||||
+ (os.environ.get('BUILD_DIR', '') == '' or \
|
+ (os.environ.get('BUILD_DIR', '') == '' or
|
||||||
+ os.environ.get('BUILD_DEBUG','') != ''):
|
+ os.environ.get('BUILD_DEBUG', '') != '')):
|
||||||
+ printWarning(pkg, 'static-library-without-debuginfo', fname)
|
+ printWarning(pkg, 'static-library-without-debuginfo', fname)
|
||||||
+
|
+
|
||||||
if is_shlib:
|
if is_shlib:
|
||||||
has_lib = True
|
has_lib = True
|
||||||
|
|
||||||
@@ -453,6 +484,10 @@ class BinariesCheck(AbstractCheck.Abstra
|
@@ -453,6 +483,10 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||||
printWarning(pkg, ec, fname,
|
printWarning(pkg, ec, fname,
|
||||||
BinaryInfo.forbidden_functions[ec]['f_name'])
|
BinaryInfo.forbidden_functions[ec]['f_name'])
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
|||||||
# rpath ?
|
# rpath ?
|
||||||
if bin_info.rpath:
|
if bin_info.rpath:
|
||||||
for p in bin_info.rpath:
|
for p in bin_info.rpath:
|
||||||
@@ -666,6 +701,14 @@ with the intended shared libraries only.
|
@@ -666,6 +700,14 @@ with the intended shared libraries only.
|
||||||
'ldd-failed',
|
'ldd-failed',
|
||||||
'''Executing ldd on this file failed, all checks could not be run.''',
|
'''Executing ldd on this file failed, all checks could not be run.''',
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
|||||||
'executable-stack',
|
'executable-stack',
|
||||||
'''The binary declares the stack as executable. Executable stack is usually an
|
'''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
|
error as it is only needed if the code contains GCC trampolines or similar
|
||||||
@@ -678,6 +721,10 @@ don\'t define a proper .note.GNU-stack s
|
@@ -678,6 +720,10 @@ don\'t define a proper .note.GNU-stack s
|
||||||
make the stack executable. Usual suspects include use of a non-GNU linker or
|
make the stack executable. Usual suspects include use of a non-GNU linker or
|
||||||
an old GNU linker version.''',
|
an old GNU linker version.''',
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
|||||||
'shared-lib-calls-exit',
|
'shared-lib-calls-exit',
|
||||||
'''This library package calls exit() or _exit(), probably in a non-fork()
|
'''This library package calls exit() or _exit(), probably in a non-fork()
|
||||||
context. Doing so from a library is strongly discouraged - when a library
|
context. Doing so from a library is strongly discouraged - when a library
|
||||||
@@ -696,6 +743,12 @@ that use prelink, make sure that prelink
|
@@ -696,6 +742,12 @@ that use prelink, make sure that prelink
|
||||||
placing a blacklist file in /etc/prelink.conf.d. For more information, see
|
placing a blacklist file in /etc/prelink.conf.d. For more information, see
|
||||||
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=256900#49''',
|
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=256900#49''',
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user