On Tuesday 05 August 2003 02:38, Ben Reser wrote:
> On Mon, Aug 04, 2003 at 07:47:00PM -0400, David Walser wrote:
> > Ben Reser wrote:
> > > Perms on any file in /etc/rc.d/init.d should be 0700. rpmlint
> > > should test for this.
> >
> > What!? Why?
>
> My intention is for rpmlint to make sure they are executable by at
> least root. I guess it's okay for them to be readable but they
> should be owned by root and at least 0500, if not 0700. Group and
> World perms don't really matter for what I'm trying to get at...
ok, here is a patch for the latest rpmlint.
is it what you wanted ?
--
Micka�l Scherer
--- InitScriptCheck.py 2003-07-22 21:25:51.000000000 +0200
+++ InitScriptCheck.py.new 2003-08-05 14:09:09.000000000 +0200
@@ -37,6 +37,11 @@
list=[]
for f in pkg.files().keys():
if rc_regex.search(f):
+ if (pkg.files()[f][1] != 'root' ):
+ printError(pkg,'init-script-bad-owner',f)
+ if not (pkg.files()[f][0] & 07500):
+ printError(pkg,'init-script-bad-perms',f)
+
basename=basename_regex.search(f).group(1)
list.append(basename)
if dot_in_name_regex.match(basename):
@@ -141,6 +146,12 @@
'init-script-name-with-dot',
'''The init script name should not contains a dot in the name.
-it would not be taken in account by chkconfig'''
-)
+it would not be taken in account by chkconfig''',
+
+'init-script-bad-owner',
+'''The init script should be owned by root.''',
+
+'init-script-bad-perms',
+'''The init script should be readable and executable by root.'''
+ )
# InitScriptCheck.py ends here