Re: pkg_add default umask [Re: 7.3: multitail can't read /etc/multitail.conf]
Am So., 16. Apr. 2023 um 15:32 Uhr schrieb Stuart Henderson : > You probably ran pkg_add with a restrictive umask set. Indeed. > umask 0077 That might explain the problems I have with man mut... Best Martin
pkg_add default umask [Re: 7.3: multitail can't read /etc/multitail.conf]
On 2023/04/16 15:19, Martin Schröder wrote: > After upgrade to 7.3: > --*- multitail 6.4.2 (C) 2003-2014 by folk...@vanheusden.com -*-- > > The following problem occured: > - > do_load_config: error loading configfile '/etc/multitail.conf' > If this is a bug, please report the following information: > The last system call returned: 13 which means "Permission denied" > [20230416T15:14:06+0200(106/15)] ms@wyvern 1002:~ > > l /etc/multitail.conf > -rw--- 1 root wheel 45040 Apr 16 14:33 /etc/multitail.conf > > A >sudo chmod a+r /etc/multitail.conf > fixed the problem. > > Have I somehow misconfigured my system or is this a bug? > > Best > Martin > You probably ran pkg_add with a restrictive umask set. If you do that, permissions on @sample files and some others (e.g. /var/db/pkg) follow what the umask is set to. This comes up every now and again. Personally I would be quite happy for pkg_add/pkg_delete to force a standard umask, but I think there was some objection when I floated the diff before. Index: OpenBSD/PkgAdd.pm === RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm,v retrieving revision 1.138 diff -u -p -r1.138 PkgAdd.pm --- OpenBSD/PkgAdd.pm 29 Jul 2022 14:26:45 - 1.138 +++ OpenBSD/PkgAdd.pm 16 Apr 2023 13:31:30 - @@ -1309,6 +1309,7 @@ sub main { my ($self, $state) = @_; + umask 0022; $state->progress->set_header(''); $self->do_quirks($state); Index: OpenBSD/PkgDelete.pm === RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/PkgDelete.pm,v retrieving revision 1.48 diff -u -p -r1.48 PkgDelete.pm --- OpenBSD/PkgDelete.pm1 Feb 2022 16:54:09 - 1.48 +++ OpenBSD/PkgDelete.pm16 Apr 2023 13:31:30 - @@ -383,6 +383,7 @@ sub main { my ($self, $state) = @_; + umask 0022; if ($state->{exclude}) { my $names = {}; for my $l (@{$state->{setlist}}) {
Re: pkg_add and umask
On Wed, Sep 21, 2016 at 10:44:37AM BST, Stuart Henderson wrote: > Related to the forwarded mail below, the mandoc.db files are also > affected by umask. > > Would it make sense for pkg_add and pkg_delete to just force a sane > umask before starting operations? Please do - it would be very nice indeed. This bit me in the arse a while back. Cheers, Raf > - Forwarded message from Marc Espie <es...@nerim.net> - > > From: Marc Espie <es...@nerim.net> > Date: Tue, 10 Mar 2015 13:13:53 +0100 > To: Alessandro DE LAURENZIS <just22@gmail.com>, ports <ports@openbsd.org> > User-Agent: Mutt/1.5.22 (2013-10-16) > Subject: Re: pkg_add and umask [was misc@: Re: Cannot connect to CUPS web > interface in -current] > Mail-Followup-To: Alessandro DE LAURENZIS <just22@gmail.com>, ports > <ports@openbsd.org> > > On Tue, Mar 10, 2015 at 10:54:34AM +, Stuart Henderson wrote: > > Moving to ports@ ... > > > > On 2015/03/10 11:32, Alessandro DE LAURENZIS wrote: > > > Hello Stuart, > > > > > > On Tue 10/03/2015 08:28, Stuart Henderson wrote: > > > > Is this while building the port, or just installing from packages? > > > > > > Installing from packages. Isn't that expected? > > > > Not sure. > > > > So: > > > > 1. Database files in /var/db/pkg are affected by umask ("pkg_add moo" with > > umask > > 077, then you can't "pkg_info moo" as a normal user) > > > > 2. Normal installed files from the package are not affected by umask > > > > 3. @sample'd files with an explicit @mode are not affected by umask > > > > 4. @sample'd files *without* an explicit mode (e.g. normal files installed > > in > > /etc) are affected by umask > > > > ... > > > > 1 could be argued either way, but I think current behaviour is ok. > > > > 2 and 3 seem correct to me > > > > 4 is surprising to me. Marc, is that intentional? > > I kindof think 4 should be forbidden or default'd to something sane, indeed. > > > - End forwarded message - >
pkg_add and umask
Related to the forwarded mail below, the mandoc.db files are also affected by umask. Would it make sense for pkg_add and pkg_delete to just force a sane umask before starting operations? - Forwarded message from Marc Espie <es...@nerim.net> - From: Marc Espie <es...@nerim.net> Date: Tue, 10 Mar 2015 13:13:53 +0100 To: Alessandro DE LAURENZIS <just22@gmail.com>, ports <ports@openbsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Subject: Re: pkg_add and umask [was misc@: Re: Cannot connect to CUPS web interface in -current] Mail-Followup-To: Alessandro DE LAURENZIS <just22@gmail.com>, ports <ports@openbsd.org> On Tue, Mar 10, 2015 at 10:54:34AM +, Stuart Henderson wrote: > Moving to ports@ ... > > On 2015/03/10 11:32, Alessandro DE LAURENZIS wrote: > > Hello Stuart, > > > > On Tue 10/03/2015 08:28, Stuart Henderson wrote: > > > Is this while building the port, or just installing from packages? > > > > Installing from packages. Isn't that expected? > > Not sure. > > So: > > 1. Database files in /var/db/pkg are affected by umask ("pkg_add moo" with > umask > 077, then you can't "pkg_info moo" as a normal user) > > 2. Normal installed files from the package are not affected by umask > > 3. @sample'd files with an explicit @mode are not affected by umask > > 4. @sample'd files *without* an explicit mode (e.g. normal files installed in > /etc) are affected by umask > > ... > > 1 could be argued either way, but I think current behaviour is ok. > > 2 and 3 seem correct to me > > 4 is surprising to me. Marc, is that intentional? I kindof think 4 should be forbidden or default'd to something sane, indeed. - End forwarded message -
Re: pkg_add and umask [was misc@: Re: Cannot connect to CUPS web interface in -current]
On Tue, Mar 10, 2015 at 10:54:34AM +, Stuart Henderson wrote: Moving to ports@ ... On 2015/03/10 11:32, Alessandro DE LAURENZIS wrote: Hello Stuart, On Tue 10/03/2015 08:28, Stuart Henderson wrote: Is this while building the port, or just installing from packages? Installing from packages. Isn't that expected? Not sure. So: 1. Database files in /var/db/pkg are affected by umask (pkg_add moo with umask 077, then you can't pkg_info moo as a normal user) 2. Normal installed files from the package are not affected by umask 3. @sample'd files with an explicit @mode are not affected by umask 4. @sample'd files *without* an explicit mode (e.g. normal files installed in /etc) are affected by umask ... 1 could be argued either way, but I think current behaviour is ok. 2 and 3 seem correct to me 4 is surprising to me. Marc, is that intentional? I kindof think 4 should be forbidden or default'd to something sane, indeed.
pkg_add and umask [was misc@: Re: Cannot connect to CUPS web interface in -current]
Moving to ports@ ... On 2015/03/10 11:32, Alessandro DE LAURENZIS wrote: Hello Stuart, On Tue 10/03/2015 08:28, Stuart Henderson wrote: Is this while building the port, or just installing from packages? Installing from packages. Isn't that expected? Not sure. So: 1. Database files in /var/db/pkg are affected by umask (pkg_add moo with umask 077, then you can't pkg_info moo as a normal user) 2. Normal installed files from the package are not affected by umask 3. @sample'd files with an explicit @mode are not affected by umask 4. @sample'd files *without* an explicit mode (e.g. normal files installed in /etc) are affected by umask ... 1 could be argued either way, but I think current behaviour is ok. 2 and 3 seem correct to me 4 is surprising to me. Marc, is that intentional?
Re: pkg_add and umask [was misc@: Re: Cannot connect to CUPS web interface in -current]
On Tue, Mar 10, 2015 at 12:13:53PM GMT, Marc Espie wrote: On Tue, Mar 10, 2015 at 10:54:34AM +, Stuart Henderson wrote: Moving to ports@ ... On 2015/03/10 11:32, Alessandro DE LAURENZIS wrote: Hello Stuart, On Tue 10/03/2015 08:28, Stuart Henderson wrote: Is this while building the port, or just installing from packages? Installing from packages. Isn't that expected? Not sure. So: 1. Database files in /var/db/pkg are affected by umask (pkg_add moo with umask 077, then you can't pkg_info moo as a normal user) 2. Normal installed files from the package are not affected by umask 3. @sample'd files with an explicit @mode are not affected by umask 4. @sample'd files *without* an explicit mode (e.g. normal files installed in /etc) are affected by umask ... 1 could be argued either way, but I think current behaviour is ok. 2 and 3 seem correct to me 4 is surprising to me. Marc, is that intentional? I kindof think 4 should be forbidden or default'd to something sane, indeed. Hi Marc, This bit me in the arse a year ago but I hadn't reported it as I was fairly new to OpenBSD back then. It would, indeed, be nice to have a sane default and able to use 'pkg_add' without issues - those that use, i.e. UMASK=077, that is :^) Regards, Raf