Article View: news.software.nntp
Article #80166Re: inncheck complaining about file permissions.
From: Julien ÉLIE
Date: Mon, 23 Feb 2009 20:10
Date: Mon, 23 Feb 2009 20:10
82 lines
4187 bytes
4187 bytes
Hi Ralf,
> It shouldn't be very difficult. Mask out don't-care-bits by bitwise AND,
> and compare for bits that must be set. Mask out by bitwise OR and
> compare for bits that must be unset.
Thanks.
I have added support for a "min" and a "max" value as for permissions.
if ( (($mode & @$m[0]) ne @$m[0]) or (($mode | @$m[1]) ne @$m[1]) ) {
printf "$pfx$f:0: mode %o, should be between %o and %o\n", $mode, @$m[0], @$m[1];
printf "chmod %o $f\n", @$m[1]
}
I am about to commit that change to INN 2.4.6.
I suggest the following (very liberal) permissions. Please tell me if you agree
or not with them.
%modes = (
'active', [0600, $INN::Config::filemode], # 0664 on my system
'incoming.conf', [0400, 0660],
'inn.conf', [0400, 0664],
'moderators', [0400, 0664],
'newsfeeds', [0400, 0664],
'overview.fmt', [0400, 0664],
'passwd.nntp', [0400, 0660],
);
%prog_modes = (
'inews', [0500, $INN::Config::inewsmode], # 0555
'innd', [0500, 0550],
'newsboot', [0500, 0550],
'nnrpd', [0500, 0555],
'rnews', [0500, $INN::Config::rnewsmode], # 04550 (sic)
);
&checkperm($paths{'innbind'}, [04500, 04550]);
&checkperm($paths{'history'}, [0600, $INN::Config::filemode]); # 0664
&checkperm($paths{'innddir'}, [0750, 0775]); # It is pathrun.
@directories = (
'archive', 'badnews', 'batchdir', 'ctlprogs', 'most_logs', 'newsbin',
'newsetc', 'newslib', 'oldlogs', 'rnewsprogs', 'spooltemp', 'spool', 'spoolnews'
);
foreach ( @directories ) {
&checkperm($paths{$_}, [0755, 0775]);
}
@newsbin_private = (
'ctlinnd', 'expire', 'expirerm', 'inncheck', 'innstat', 'innwatch',
'makehistory', 'news.daily', 'overchan', 'prunehistory', 'scanlogs',
'tally.control', 'writelog'
);
foreach ( @newsbin_private ) {
&checkperm("$newsbin/$_", [0500, 0550]);
}
@newsbin_public = (
'archive', 'batcher', 'buffchan', 'convdate', 'cvtbatch',
'filechan', 'getlist', 'grephistory', 'innconfval', 'innxmit',
'nntpget', 'nntpsend', 'sendxbatches', 'send-ihave', 'send-nntp', 'send-uucp',
'shlock', 'shrinkfile'
);
foreach ( @newsbin_public ) {
&checkperm("$newsbin/$_", [0500, 0555]);
}
@rnews_programs = (
'bunbatch', 'c7unbatch', 'decode', 'encode', 'gunbatch'
);
foreach ( @rnews_programs ) {
&checkperm("$rnewsprogs/$_", [0500, 0555]);
}
--
Julien ÉLIE
« L'ordinateur obéit à vos ordres, pas à vos intentions. »
Technical Details
Message-ID:
<gnuvrr$b6v$1@news.trigofacile.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder1.news.weretis.net!weretis.net!news.trigofacile.com!not-for-mailReferences:
<slrngo2sg3.380.steve@news.mixmin.net> <gnj1bp$lhr$1@news.trigofacile.com> <gnlb1b$sgn$1@aux.snarked.org> <gnlkqh$er9$1@news.trigofacile.com> <gnnlcd$r5o$1@puck.litech.org> <87ocwwy1n8.fsf@windlord.stanford.edu> <gnp13f$6ve$3@msgid.netzverwaltung.net>Show Full Headers
Complete Article Headers
Message-ID: <gnuvrr$b6v$1@news.trigofacile.com> Subject: Re: inncheck complaining about file permissions. Date: Mon, 23 Feb 2009 21:10:01 +0100 From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> References: <slrngo2sg3.380.steve@news.mixmin.net> <gnj1bp$lhr$1@news.trigofacile.com> <gnlb1b$sgn$1@aux.snarked.org> <gnlkqh$er9$1@news.trigofacile.com> <gnnlcd$r5o$1@puck.litech.org> <87ocwwy1n8.fsf@windlord.stanford.edu> <gnp13f$6ve$3@msgid.netzverwaltung.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder1.news.weretis.net!weretis.net!news.trigofacile.com!not-for-mail Newsgroups: news.software.nntp Organization: TrigoFACILE -- http://www.trigofacile.com/ Lines: 82 NNTP-Posting-Host: aaubervilliers-151-1-24-227.w83-114.abo.wanadoo.fr Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 8bit X-Trace: news.trigofacile.com 1235419835 11487 83.114.143.227 (23 Feb 2009 X-Complaints-To: abuse@trigofacile.com NNTP-Posting-Date: Mon, 23 Feb 2009 20:10:35 +0000 (UTC) In-Reply-To: <gnp13f$6ve$3@msgid.netzverwaltung.net> X-MSMail-Priority: Normal X-Newsreader: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049