Force a standard umask before adding/deleting packages. If not done and
authorsthen <sthen@openbsd.org>
Wed, 19 Apr 2023 18:07:43 +0000 (18:07 +0000)
committersthen <sthen@openbsd.org>
Wed, 19 Apr 2023 18:07:43 +0000 (18:07 +0000)
the user has a restrictive mask, various items (new directories, @sample'd
files, /var/db/pkg entries, mandoc databases) end up not readable.

feedback/ok espie@

usr.sbin/pkg_add/OpenBSD/AddDelete.pm

index f0603b0..bdf04f6 100644 (file)
@@ -1,5 +1,5 @@
 # ex:ts=8 sw=4:
-# $OpenBSD: AddDelete.pm,v 1.96 2022/05/16 14:13:19 espie Exp $
+# $OpenBSD: AddDelete.pm,v 1.97 2023/04/19 18:07:43 sthen Exp $
 #
 # Copyright (c) 2007-2010 Marc Espie <espie@openbsd.org>
 #
@@ -73,6 +73,8 @@ sub do_the_main_work
                return;
        }
 
+       umask 0022;
+
        my $handler = sub { $state->fatal("Caught SIG#1", shift); };
        local $SIG{'INT'} = $handler;
        local $SIG{'QUIT'} = $handler;