From 3f5fcfde05954ec79d27fed6a721a692e98786e8 Mon Sep 17 00:00:00 2001 From: espie Date: Fri, 17 Jan 2014 15:46:16 +0000 Subject: [PATCH] make ArcCheck less confusing, don't archive stuff that WON'T survive extraction anyways (those metadatas ARE in the packing-list anyways). --- usr.sbin/pkg_add/OpenBSD/ArcCheck.pm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pkg_add/OpenBSD/ArcCheck.pm b/usr.sbin/pkg_add/OpenBSD/ArcCheck.pm index 94f9bdc1d21..67db4c4476b 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.22 2013/12/23 16:34:51 espie Exp $ +# $OpenBSD: ArcCheck.pm,v 1.23 2014/01/17 15:46:16 espie Exp $ # # Copyright (c) 2005-2006 Marc Espie # @@ -98,6 +98,7 @@ sub verify_modes } package OpenBSD::Ustar; +use POSIX; # prepare item and introduce long names where needed. sub prepare_long @@ -117,6 +118,20 @@ sub prepare_long $self->fatal("No group name for #1 (uid #2)", $item->name, $entry->{gid}); } + # if we're going to set the group or owner, sguid bits won't + # survive the extraction + if (defined $item->{group} || defined $item->{owner}) { + $entry->{mode} &= ~(S_ISUID|S_ISGID); + } + # likewise, we skip links on extractions, so hey, don't even care + # about modes and stuff. + if ($entry->isSymLink) { + $entry->{mode} = 0777; + $entry->{uid} = 0; + $entry->{gid} = 0; + $entry->{uname} = 'root'; + $entry->{gname} = 'wheel'; + } $entry->set_name($item->name); my ($prefix, $name) = split_name($entry->name); -- 2.20.1