2015-04-10 16:35:46 +02:00
|
|
|
From: Some One <nobody@opensuse.org>
|
|
|
|
Date: Thu, 9 Apr 2015 14:55:39 +0200
|
|
|
|
Subject: [PATCH] only-reg-files-are-scripts.diff
|
|
|
|
|
2010-10-20 15:23:06 +02:00
|
|
|
===================================================================
|
2015-04-10 16:35:46 +02:00
|
|
|
---
|
|
|
|
InitScriptCheck.py | 5 ++++-
|
|
|
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
diff --git a/InitScriptCheck.py b/InitScriptCheck.py
|
2015-11-26 11:24:13 +01:00
|
|
|
index 0559405..f9b13a1 100644
|
2015-04-10 16:35:46 +02:00
|
|
|
--- a/InitScriptCheck.py
|
|
|
|
+++ b/InitScriptCheck.py
|
|
|
|
@@ -18,7 +18,7 @@ from Filter import addDetails, printError, printWarning
|
2010-10-14 14:32:03 +02:00
|
|
|
import AbstractCheck
|
|
|
|
import Config
|
2008-04-17 04:52:37 +02:00
|
|
|
import Pkg
|
2010-10-14 14:32:03 +02:00
|
|
|
-
|
2008-04-17 04:52:37 +02:00
|
|
|
+import stat
|
|
|
|
|
2010-10-14 14:32:03 +02:00
|
|
|
chkconfig_content_regex = re.compile('^\s*#\s*chkconfig:\s*([-0-9]+)\s+[-0-9]+\s+[-0-9]+')
|
|
|
|
subsys_regex = re.compile('/var/lock/subsys/([^/"\'\n\s;&|]+)', re.MULTILINE)
|
2015-04-10 16:35:46 +02:00
|
|
|
@@ -50,6 +50,9 @@ class InitScriptCheck(AbstractCheck.AbstractCheck):
|
2010-10-20 15:23:06 +02:00
|
|
|
not fname.startswith('/etc/rc.d/init.d/'):
|
2010-10-14 14:32:03 +02:00
|
|
|
continue
|
|
|
|
|
2010-10-20 15:23:06 +02:00
|
|
|
+ if not stat.S_ISREG(pkgfile.mode):
|
|
|
|
+ continue
|
|
|
|
+
|
2010-10-14 14:32:03 +02:00
|
|
|
basename = os.path.basename(fname)
|
2010-10-20 15:23:06 +02:00
|
|
|
initscript_list.append(basename)
|
2014-02-21 15:54:14 +01:00
|
|
|
if pkgfile.mode & int("500", 8) != int("500", 8):
|