summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-05-15 10:36:35 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-05-15 10:36:35 +0000
commitc9c06544725f13ba2733b26546e11e9e36450ddf (patch)
treed8630d2dbf93a0cf6bf3293ebfcb75d4aade2949
parentc8c7a57ff8c332061ef4b4968daddaa953fe4455 (diff)
make sure to give all special files to root/wheel, and strip them of write
and suid bits.
-rw-r--r--usr.sbin/pkg_add/pkg_create15
1 files changed, 14 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/pkg_create b/usr.sbin/pkg_add/pkg_create
index 6a57557cd87..fa438583763 100644
--- a/usr.sbin/pkg_add/pkg_create
+++ b/usr.sbin/pkg_add/pkg_create
@@ -1,6 +1,6 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_create,v 1.97 2007/05/12 14:00:35 espie Exp $
+# $OpenBSD: pkg_create,v 1.98 2007/05/15 10:36:34 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -183,6 +183,19 @@ sub verify_checksum
$self->verify_checksum_filename($infodir, $self->{name}, $stash);
}
+sub prepare_for_archival
+{
+ my ($self, $arc) = @_;
+
+ my $o = $arc->prepare_long($self);
+ $o->{uname} = 'root';
+ $o->{gname} = 'wheel';
+ $o->{uid} = 0;
+ $o->{gid} = 0;
+ $o->{mode} &= 0555; # zap all write and suid modes
+ return $o;
+}
+
# override for CONTENTS: we cannot checksum this.
package OpenBSD::PackingElement::FCONTENTS;
sub makesum_plist