Merge pull request #970 from jengelh/master
Remove shared-library-without-dependency and library-not-linked-against-libc
This commit is contained in:
commit
3c828527f0
|
@ -170,7 +170,6 @@ Filters = [
|
|||
## Doesn't seem to make sense
|
||||
# 'invalid-ldconfig-symlink',
|
||||
# 'invalid-soname',
|
||||
# 'library-not-linked-against-libc',
|
||||
# 'only-non-binary-in-usr-lib',
|
||||
'outside-libdir-files',
|
||||
#
|
||||
|
|
|
@ -126,7 +126,6 @@ Filters = [
|
|||
# Doesn't seem to make sense
|
||||
'invalid-ldconfig-symlink',
|
||||
'invalid-soname',
|
||||
'library-not-linked-against-libc',
|
||||
'only-non-binary-in-usr-lib',
|
||||
'outside-libdir-files',
|
||||
|
||||
|
|
|
@ -444,11 +444,8 @@ class BinariesCheck(AbstractCheck):
|
|||
dyn_section = self.readelf_parser.dynamic_section_info
|
||||
if not len(dyn_section.needed) and not (dyn_section.soname and
|
||||
self.ldso_soname_regex.search(dyn_section.soname)):
|
||||
if self.is_shobj:
|
||||
msg = 'shared-library-without-dependency-information'
|
||||
else:
|
||||
msg = 'statically-linked-binary'
|
||||
self.output.add_info('E', pkg, msg, pkgfile.name)
|
||||
if not self.is_shobj:
|
||||
self.output.add_info('E', pkg, 'statically-linked-binary', pkgfile.name)
|
||||
else:
|
||||
# linked against libc ?
|
||||
if 'libc.' not in dyn_section.runpaths and \
|
||||
|
@ -458,11 +455,8 @@ class BinariesCheck(AbstractCheck):
|
|||
for lib in dyn_section.needed:
|
||||
if 'libc.' in lib:
|
||||
return
|
||||
if self.is_shobj:
|
||||
msg = 'library-not-linked-against-libc'
|
||||
else:
|
||||
msg = 'program-not-linked-against-libc'
|
||||
self.output.add_info('W', pkg, msg, pkgfile.name)
|
||||
if not self.is_shobj:
|
||||
self.output.add_info('W', pkg, 'program-not-linked-against-libc', pkgfile.name)
|
||||
|
||||
def _check_forbidden_functions(self, pkg, pkgfile):
|
||||
forbidden_functions = self.config.configuration['WarnOnFunction']
|
||||
|
|
|
@ -162,16 +162,9 @@ This library doesn't have the executable bit set. Without this bit set,
|
|||
rpm for instance won't be able identify the file as a library and not
|
||||
generate dependencies or strip debug symbols from it.
|
||||
"""
|
||||
library-not-linked-against-libc="""
|
||||
The library is not dynamically linked against libc.
|
||||
"""
|
||||
program-not-linked-against-libc="""
|
||||
The binary is not dynamically linked against libc.
|
||||
"""
|
||||
shared-library-without-dependency-information="""
|
||||
The listed shared library doesn't include information about which other
|
||||
libraries the library was linked against.
|
||||
"""
|
||||
missing-mandatory-optflags="""
|
||||
This executable was not compiled with expected flags.
|
||||
"""
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -268,12 +268,3 @@ def test_multiple_errors(tmpdir, package, binariescheck):
|
|||
assert 'E: call-to-mktemp' in out
|
||||
assert 'E: missing-call-to-setgroups-before-setuid' in out
|
||||
assert 'W: binary-or-shlib-calls-gethostbyname' in out
|
||||
|
||||
|
||||
@pytest.mark.parametrize('package', ['binary/dependency-info'])
|
||||
def test_dependency_information(tmpdir, package, binariescheck):
|
||||
output, test = binariescheck
|
||||
test.check(get_tested_package(package, tmpdir))
|
||||
out = output.print_results(output.results)
|
||||
assert 'E: shared-library-without-dependency-information /usr/lib64/ruby/enc/gb2312.so' in out
|
||||
assert 'W: library-not-linked-against-libc /usr/lib64/ruby/continuation.so' in out
|
||||
|
|
|
@ -276,17 +276,6 @@ def test_call_gethostbyname(binariescheck):
|
|||
assert 'W: binary-or-shlib-calls-gethostbyname' in out
|
||||
|
||||
|
||||
@pytest.mark.skipif(not IS_X86_64, reason='x86-64 only')
|
||||
def test_missing_dependency(binariescheck):
|
||||
output, test = binariescheck
|
||||
|
||||
with FakePkg('fake') as pkg:
|
||||
pkgfile = pkg.add_file(get_full_path('no-dependency.so'), '/lib64/no-dependency.so')
|
||||
run_elf_checks(test, pkg, pkgfile)
|
||||
out = output.print_results(output.results)
|
||||
assert 'E: shared-library-without-dependency-information' in out
|
||||
|
||||
|
||||
def test_bca_files(binariescheck):
|
||||
output, test = binariescheck
|
||||
|
||||
|
|
Loading…
Reference in New Issue