summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2016-05-08 09:21:33 +0000
committerMarc Espie <espie@cvs.openbsd.org>2016-05-08 09:21:33 +0000
commitdd82ddfc11feb4772979ba7da00bb21a99cbcae0 (patch)
treea2ca8fd2ded6582095f4998f27b477b16261c814 /usr.sbin/pkg_add
parente5b66a923f049f4d4c5ed922736e66a60dd8242a (diff)
allow root files to be root-writable.
common work with aja@, okay aja@
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/ArcCheck.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/ArcCheck.pm b/usr.sbin/pkg_add/OpenBSD/ArcCheck.pm
index 0f5fad9a4f4..d863f36eb43 100644
--- a/usr.sbin/pkg_add/OpenBSD/ArcCheck.pm
+++ b/usr.sbin/pkg_add/OpenBSD/ArcCheck.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: ArcCheck.pm,v 1.32 2016/04/02 12:18:44 espie Exp $
+# $OpenBSD: ArcCheck.pm,v 1.33 2016/05/08 09:21:32 espie Exp $
#
# Copyright (c) 2005-2006 Marc Espie <espie@openbsd.org>
#
@@ -192,7 +192,12 @@ sub prepare_long
}
# disallow writable files/dirs without explicit annotation
if (!defined $item->{mode}) {
- $entry->{mode} &= ~(S_IWUSR|S_IWGRP|S_IWOTH);
+ # if there's an owner, we have to be explicit
+ if (defined $item->{owner}) {
+ $entry->{mode} &= ~(S_IWUSR|S_IWGRP|S_IWOTH);
+ } else {
+ $entry->{mode} &= ~(S_IWGRP|S_IWOTH);
+ }
# and make libraries non-executable
if ($item->is_a_library) {
$entry->{mode} &= ~(S_IXUSR|S_IXGRP|S_IXOTH);