🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
15 messages
15 total messages Started by Steve Thu, 29 Jan 2009 09:08
inncheck complaining about control.ctl.local
#80080
Author: Steve
Date: Thu, 29 Jan 2009 09:08
11 lines
1141 bytes
Running INN 2.5.0 (20090126 snapshot), inncheck produces the following error:

news@drooper:~/etc$ inncheck -pedantic
/usr/local/news/etc/control.ctl.local:0: file missing

Isn't the .local file supposed to be optional?

-- 
pub   1024D/228761E7 2003-06-04 Steven Crook
      Key fingerprint = 1CD9 95E1 E9CE 80D6 C885  B7EB B471 80D5 2287 61E7
uid                  Steven Crook <steve@mixmin.net>
Re: inncheck complaining about control.ctl.local
#80072
Author: Julien ÉLIE
Date: Thu, 29 Jan 2009 18:30
31 lines
2270 bytes
Hi Steve",

> Running INN 2.5.0 (20090126 snapshot), inncheck produces the following error:
>
> news@drooper:~/etc$ inncheck -pedantic
> /usr/local/news/etc/control.ctl.local:0: file missing
>
> Isn't the .local file supposed to be optional?

It is optional; controlchan works fine without this file.

What inncheck reports is not necessarily errors.
For instance, even without "-pedanting", you can have:

    % inncheck
    /home/news/etc/nntpsend.ctl:0: file missing

and, of course, nntpsend.ctl is not mandatory.

inncheck only tells you a few things that have changed from a standard installation.


Note that control.ctl.local will contain the encoding of your local newsgroups
file, so it is better to have control.ctl.local (though the default for that
will be UTF-8 in case you do not define it).

-- 
Julien ÉLIE

« Donner un César à une tragédienne ? Mais c'est absurde ! » (Astérix) 
Re: inncheck complaining about control.ctl.local
#80130
Author: Julien ÉLIE
Date: Wed, 18 Feb 2009 21:32
18 lines
1855 bytes
Hi Steve,

> news@drooper:~/etc$ inncheck -pedantic
> /usr/local/news/etc/control.ctl.local:0: file missing
>
> Isn't the .local file supposed to be optional?

As told before, it is optional but installed during
a fresh "make install".
I think that I should make sure with innupgrade that
the file is properly created during "make update".  It will
be dealt with for the 2.5.0 release.

-- 
Julien ÉLIE

« Ils se souviendront de la marmite de poisson ! » (Astérix) 
Re: inncheck complaining about file permissions.
#80131
Author: D. Stussy
Date: Thu, 19 Feb 2009 01:43
20 lines
2027 bytes
"Julien ÉLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:gnhuq7$g98$1@news.trigofacile.com...
> > news@drooper:~/etc$ inncheck -pedantic
> > /usr/local/news/etc/control.ctl.local:0: file missing
> >
> > Isn't the .local file supposed to be optional?
>
> As told before, it is optional but installed during a fresh "make
install".
> I think that I should make sure with innupgrade that
> the file is properly created during "make update".  It will
> be dealt with for the 2.5.0 release.

Can we also fix the UNIX file permissions check?  It complains if the
permssions are not "660".  However, "440" (read-only) is just as valid for
many of the files (binaries, ~news/etc, etc.).  It should not complain as
INN never writes to those.  "640" or "460" (why?) are just as possible, and
world-readable for some files might be OK (but discouraged).

Re: inncheck complaining about file permissions.
#80133
Author: Julien ÉLIE
Date: Thu, 19 Feb 2009 07:22
15 lines
1978 bytes
Hi D. Stussy,

> Can we also fix the UNIX file permissions check?  It complains if the
> permssions are not "660".  However, "440" (read-only) is just as valid for
> many of the files (binaries, ~news/etc, etc.).  It should not complain as
> INN never writes to those.  "640" or "460" (why?) are just as possible, and
> world-readable for some files might be OK (but discouraged).

Who complains?  Do you have an example of such a file?

-- 
Julien ÉLIE

« Ils se souviendront de la marmite de poisson ! » (Astérix) 
Re: inncheck complaining about file permissions.
#80135
Author: D. Stussy
Date: Fri, 20 Feb 2009 04:19
57 lines
3974 bytes
"Julien ÉLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:gnj1bp$lhr$1@news.trigofacile.com...
> > Can we also fix the UNIX file permissions check?  It complains if the
> > permssions are not "660".  However, "440" (read-only) is just as valid
for
> > many of the files (binaries, ~news/etc, etc.).  It should not complain
as
> > INN never writes to those.  "640" or "460" (why?) are just as possible,
and
> > world-readable for some files might be OK (but discouraged).
>
> Who complains?  Do you have an example of such a file?

# /var/lib/news/bin/inncheck
/var/lib/news/etc/control.ctl:0: mode 440, should be 644
/var/lib/news/etc/expire.ctl:0: mode 440, should be 644
/var/lib/news/etc/incoming.conf:0: mode 440, should be 640
/var/lib/news/etc/inn.conf:0: mode 444, should be 644
/var/lib/news/etc/moderators:0: mode 444, should be 644
/var/lib/news/etc/newsfeeds:0: mode 440, should be 644
/var/lib/news/etc/overview.fmt:0: mode 440, should be 644
/var/lib/news/etc/passwd.nntp:0: mode 440, should be 640
/var/lib/news/etc/readers.conf:0: mode 440, should be 644

# ls -al ~news/etc
total 256
dr-xr-xr-x  3 newsserv news  4096 Feb 13 00:00 .
dr-xr-x--x  8 newsserv news  4096 Feb 18 08:09 ..
-r--r-----  1 newsserv news 96612 Feb 13 00:00 control.ctl
-r--r-----  1 newsserv news  6982 Feb 13 00:00 cycbuff.conf
-r--r-----  1 newsserv news    12 Feb 13 00:00 distrib.pats
-r--r-----  1 newsserv news    14 Feb 13 00:00 expire.ctl
-r--r-----  1 newsserv news  1951 Feb 13 00:00 incoming.conf
-r--r--r--  1 newsserv news  2298 Feb 13 00:00 inn.conf
-r--r-----  1 newsserv news  2621 Feb 13 00:00 innfeed.conf
-r--r-----  1 newsserv news 72291 Feb 13 00:00 innreport.conf
-r--r--r--  1 newsserv news   622 Feb 13 00:00 moderators
-r--r-----  1 newsserv news   550 Feb 13 00:00 news2mail.conf
-r--r-----  1 newsserv news  4829 Feb 13 00:00 newsfeeds
-r--r-----  1 newsserv news   100 Feb 13 00:00 nocem.ctl
-r--r-----  1 newsserv news   340 Dec 28 21:50 overview.fmt
-r--r-----  1 newsserv news     0 Feb  4 08:34 passwd.nntp
dr-xr-x---  2 newsserv news  4096 Feb  6 22:22 pgp
-r--r-----  1 newsserv news  1146 Feb 13 00:00 readers.conf
-r--r-----  1 newsserv news   118 Feb 13 00:00 sasl.conf
-r--r-----  1 newsserv news   527 Feb 13 00:00 storage.conf
-r--r-----  1 newsserv news    73 Feb 13 00:00 subscriptions

It also complains that some things should be permitted "read-others" when
they aren't.  I have found that only inn.conf need be readable by others
(i.e. the mail server user - when a mail->news gateway is used).  My
moderators file is read-others so the web server may display the moderators
file, but that's not required either.

No difference if pedantic mode is used.

Re: inncheck complaining about file permissions.
#80136
Author: Julien ÉLIE
Date: Fri, 20 Feb 2009 07:06
36 lines
2723 bytes
Hi D. Stussy,

>> Who complains?  Do you have an example of such a file?
>
> # /var/lib/news/bin/inncheck
> /var/lib/news/etc/control.ctl:0: mode 440, should be 644

During "make install":
../support/install-sh -c -o news -g news -m 0644 -B .OLD control.ctl /home/news/etc/control.ctl


> /var/lib/news/etc/incoming.conf:0: mode 440, should be 640

During "make install":
../support/install-sh -c -o news -g news -m 0640 -B .OLD incoming.conf /home/news/etc/incoming.conf


The rights are correct (for both STABLE and CURRENT).

You probably did not install INN from the official ftp.isc.org release.
Please check with the maintainer of the package you are using with your
distribution.


> It also complains that some things should be permitted "read-others" when
> they aren't.  I have found that only inn.conf need be readable by others
> (i.e. the mail server user - when a mail->news gateway is used).

If you want to use different rights, please do and do not follow what inncheck
writes regarding permissions.

-- 
Julien ÉLIE

« En vérité, le chemin importe peu, la volonté d'arriver suffit à tout. »
Re: inncheck complaining about file permissions.
#80144
Author: Jeffrey M. Vinocur
Date: Sat, 21 Feb 2009 01:28
18 lines
1823 bytes
In article <gnlkqh$er9$1@news.trigofacile.com>,
Julien ÉLIE  <iulius@nom-de-mon-site.com.invalid> wrote:
>
>If you want to use different rights, please do and do not follow what inncheck
>writes regarding permissions.

Well, I think he has a point -- I don't know if inncheck is
sophisticated enough to do this sort of thing, but in principle I
think it would be nice to have it accept a variety of reasonable
options for permissions.  Certainly one can make a good case for
a config where files outside of db, run, spool, and tmp are
readonly for the news user.  Or for a config where nearly
everything is no access for non-news users.


-- 
Jeffrey M. Vinocur
jeff@litech.org
Re: inncheck complaining about file permissions.
#80145
Author: Russ Allbery
Date: Sat, 21 Feb 2009 02:17
18 lines
2080 bytes
jeff@litech.org (Jeffrey M. Vinocur) writes:

> Well, I think he has a point -- I don't know if inncheck is
> sophisticated enough to do this sort of thing, but in principle I think
> it would be nice to have it accept a variety of reasonable options for
> permissions.  Certainly one can make a good case for a config where
> files outside of db, run, spool, and tmp are readonly for the news user.
> Or for a config where nearly everything is no access for non-news users.

It really needs to accept a permission range for each file instead of a
specific set of permissions that it wants, I think.  It's a bit fiddly to
implement that due to the way that permissions are encoded.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: inncheck complaining about file permissions.
#80146
Author: D. Stussy
Date: Sat, 21 Feb 2009 06:35
62 lines
4180 bytes
"Julien ÉLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:gnlkqh$er9$1@news.trigofacile.com...
> >> Who complains?  Do you have an example of such a file?
> >
> > # /var/lib/news/bin/inncheck
> > /var/lib/news/etc/control.ctl:0: mode 440, should be 644
>
> During "make install":
> ../support/install-sh -c -o news -g news -m 0644 -B .OLD control.ctl
/home/news/etc/control.ctl
>
> > /var/lib/news/etc/incoming.conf:0: mode 440, should be 640
>
> During "make install":
> ../support/install-sh -c -o news -g news -m 0640 -B .OLD incoming.conf
/home/news/etc/incoming.conf
>
> The rights are correct (for both STABLE and CURRENT).
>
> You probably did not install INN from the official ftp.isc.org release.
> Please check with the maintainer of the package you are using with your
> distribution.

Actually, I have, but of course, I've modified the files to account for my
peering configuration.  I saw NO REASON why they should remain writable by
the news user, so as a security precaution, I changed the permissions to
read-only.  However, that doesn't answer the question of why inncheck
thinks that these must be writable files?

> > It also complains that some things should be permitted "read-others"
when
> > they aren't.  I have found that only inn.conf need be readable by
others
> > (i.e. the mail server user - when a mail->news gateway is used).
>
> If you want to use different rights, please do and do not follow what
inncheck
> writes regarding permissions.

Inncheck should be complaining about UNSAFE permissions (e.g.
"write-others"), not about permissions that work, are equally [or more]
secure, but are different than the installation script.

Why would ~news/etc/control.ctl NEED to be read-others?
Why would ~news/etc/incoming.conf NEED to be write-owner?  INN doesn't
update the file - ever.

------
Mr. Allbery's comment:  As far as a permission check goes, use a mask
before comparison.  For example:

Given:  A data file that should be read-owner and read-group.

Mask (bitwise and) the UNIX permissions with 0553, then compare to 0440.
This would ignore the write-owner, write-group, and read-others bits.  It
would require read-owner and read-group, while flagging execute-any,
write-others, and any special bits (setuid, setgid, etc).

I assumed no extended POSIX ACLs.  I don't see why those would be needed at
all for the news server, but they may be enabled for the filesystem.

Re: inncheck complaining about file permissions.
#80148
Author: Julien ÉLIE
Date: Sat, 21 Feb 2009 10:53
37 lines
2622 bytes
Hi Jeffrey,

> I think it would be nice to have it accept a variety of reasonable
> options for permissions.  Certainly one can make a good case for
> a config where files outside of db, run, spool, and tmp are
> readonly for the news user.  Or for a config where nearly
> everything is no access for non-news users.

Why wouldn't the files in etc be writable by the news user?


I see that /etc/news/incoming.conf is made 644 by Debian whereas
INN installs it as 640 and D. Stussy wants it to be 440.

How can we handle that?
Only putting a bitwise mask of 0133 to the mode of this file?
It will be the best we could...


Similarly, /var/spool/news/articles is made 775 by Debian whereas
INN installs it as 755.

Should we only check it with a bitwise mask of 0002?

Should we also allow both the news user/group and "root" as users
and groups?


I do not see a way to satisfy everybody (except for something like
*664* and *775*, which is not very appealing...).  I do not know
what to do as for the permissions checks in inncheck.

-- 
Julien ÉLIE

« Tous les champignons sont comestibles. Certains, une fois seulement. » 
Re: inncheck complaining about file permissions.
#80149
Author: Ralf Döblitz
Date: Sat, 21 Feb 2009 13:54
24 lines
2901 bytes
Russ Allbery <rra@stanford.edu> wrote:
> jeff@litech.org (Jeffrey M. Vinocur) writes:
> 
>> Well, I think he has a point -- I don't know if inncheck is
>> sophisticated enough to do this sort of thing, but in principle I think
>> it would be nice to have it accept a variety of reasonable options for
>> permissions.  Certainly one can make a good case for a config where
>> files outside of db, run, spool, and tmp are readonly for the news user.
>> Or for a config where nearly everything is no access for non-news users.
> 
> It really needs to accept a permission range for each file instead of a
> specific set of permissions that it wants, I think.  It's a bit fiddly to
> implement that due to the way that permissions are encoded.

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.

Ralf
-- 
Ralf Döblitz   *   Schapenstraße 6   *   38104 Braunschweig   *   Germany
Phone: +49-531-2361223   Fax: +49-531-2361224  mailto:doeblitz@doeblitz.net
Homepage: http://www.escape.de/users/selene/
Mit UTF-8 kann man gleichzeitig äöüßÄÖÜæœłø‱¼½¾¤¹²³¢€£¥¶§¬÷×±©®™¡¿ verwenden…
Re: inncheck complaining about file permissions.
#80166
Author: Julien ÉLIE
Date: Mon, 23 Feb 2009 20:10
82 lines
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. » 
Re: inncheck complaining about file permissions.
#80168
Author: Julien ÉLIE
Date: Tue, 24 Feb 2009 20:56
16 lines
2002 bytes
Hi D. Stussy,

> I have found that only inn.conf need be readable by others

However, Debian for instance installs <pathetc> as root/root.  It is therefore
needed for inn.conf to be readable by others.
Maybe it would be up to the packager to modify the permissions in inncheck
to better match the system.  As for INN official releases, we could just do
min/max rights as I suggested in a previous post.

-- 
Julien ÉLIE

« A killfile on Usenet can get you peace and quiet.  A killfile in the
  real world can get you twenty years to life. » (Nils Nieuwjaar) 
Re: inncheck complaining about file permissions.
#80172
Author: Jeffrey M. Vinocur
Date: Wed, 25 Feb 2009 00:41
27 lines
2163 bytes
In article <gnomfm$bjs$1@news.trigofacile.com>,
Julien ÉLIE  <iulius@nom-de-mon-site.com.invalid> wrote:
>
>Why wouldn't the files in etc be writable by the news user?

I wasn't very clear there, but I think you caught on later to
what I was trying to say.

(Of course, it may be the administrator's discretion to make
files in etc something like 440 as a check to prevent inadvertent
editing or what have you, even though the news user could just
adjust the permissions back and then write.)

But I was really trying to talk about the case where the files
are not even owned by news, which is a reasonable configuration
that some people would prefer from a security point of view.

Obviously this case requires something more than a naive
comparison of the permissions bit, since 600 may be perfectly
acceptable for a file owned by news.news, and 640 may be
perfectly acceptable for a file owned by root.news, but neither
one is acceptable for a file owned by root.root.


-- 
Jeffrey M. Vinocur
jeff@litech.org
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads