Dirk Mueller 2017-10-01 20:20:21 +00:00 committed by Git OBS Bridge
parent 12c3f3df1b
commit 946eb5c616
2 changed files with 39 additions and 15 deletions

View File

@ -11,11 +11,11 @@ info message alongside that gives a better rationale.
FilesCheck.py | 32 ++++++++++++++++++++++++++------
1 file changed, 26 insertions(+), 6 deletions(-)
diff --git a/FilesCheck.py b/FilesCheck.py
index 0b93e73..6a97601 100644
--- a/FilesCheck.py
+++ b/FilesCheck.py
@@ -848,12 +848,15 @@ class FilesCheck(AbstractCheck.AbstractCheck):
Index: rpmlint-rpmlint-1.10/FilesCheck.py
===================================================================
--- rpmlint-rpmlint-1.10.orig/FilesCheck.py
+++ rpmlint-rpmlint-1.10/FilesCheck.py
@@ -863,12 +863,15 @@ class FilesCheck(AbstractCheck.AbstractC
elif interpreter or mode_is_exec or script_regex.search(f):
if interpreter:
res = interpreter_regex.search(interpreter)
@ -37,13 +37,8 @@ index 0b93e73..6a97601 100644
elif not nonexec_file and not \
(lib_path_regex.search(f) and
f.endswith('.la')):
@@ -1280,10 +1283,27 @@ executed.''',
'wrong-script-interpreter',
'''This script uses an interpreter which is either an inappropriate one
or located in an inappropriate directory for packaged system software.
+
Alternatively, if the file should not be executed, then ensure that
it is not marked as executable.
@@ -1303,6 +1306,22 @@ Alternatively, if the file isn't suppose
it is not marked as being executable.
''',
+'env-script-interpreter',
@ -65,6 +60,3 @@ index 0b93e73..6a97601 100644
'non-executable-script',
'''This text file contains a shebang or is located in a path dedicated for
executables, but lacks the executable bits and cannot thus be executed. If
--
2.14.1

View File

@ -51,3 +51,35 @@ index f26c0c3..bfffda5 100644
--
2.14.1
diff --git a/FilesCheck.py b/FilesCheck.py
index 6a97601..abb3fa7 100644
--- a/FilesCheck.py
+++ b/FilesCheck.py
@@ -196,7 +196,7 @@ devel_regex = re.compile(r'(.*)-(debug(info|source)?|devel|headers|source|static
debuginfo_package_regex = re.compile(r'-debug(info)?$')
debugsource_package_regex = re.compile(r'-debugsource$')
use_debugsource = Config.getOption('UseDebugSource', False)
-lib_regex = re.compile(r'lib(?:64)?/lib[^/]*(?:\.so\.[\d\.]+|\.so)$')
+lib_regex = re.compile(r'/lib(?:64)?/lib[^/]+(?:\.so\.[\d\.]+|-[\d\.]+\.so)$')
ldconfig_regex = re.compile(r'^[^#]*ldconfig', re.MULTILINE)
depmod_regex = re.compile(r'^[^#]*depmod', re.MULTILINE)
install_info_regex = re.compile(r'^[^#]*install-info', re.MULTILINE)
diff --git a/test/test_files.py b/test/test_files.py
index bfffda5..0192c13 100644
--- a/test/test_files.py
+++ b/test/test_files.py
@@ -71,11 +71,13 @@ def test_lib_regex():
assert all(
lib_regex.search(x) for x in
('/lib/libnsl-2.26.so',
- '/lib64/libSegFault.so',
+ '/usr/lib64/libgnomeui.so.3',
'/lib64/libgcc_s.so.1'))
# false positives
assert not any(
lib_regex.search(x) for x in
('/usr/share/gdb/auto-load/usr/lib/libglib-2.0.so.0.4600.1-gdb.py',
+ '/usr/share/doc/findlib/lib-1.0.so',
+ '/usr/lib64/libvulkan_radeon.so',
'/usr/lib64/rsocket/binary',))