diff options
author | 2009-12-17 11:57:02 +0000 | |
---|---|---|
committer | 2009-12-17 11:57:02 +0000 | |
commit | dfdce8c894c2fbc61f7c965eca8219bd9c1ca751 (patch) | |
tree | 411bc92ce1859fa464dac3099bb3d66be4c4f234 | |
parent | remove extra spaces, fix doc for Ustar (create, not extract), and document (diff) | |
download | wireguard-openbsd-dfdce8c894c2fbc61f7c965eca8219bd9c1ca751.tar.xz wireguard-openbsd-dfdce8c894c2fbc61f7c965eca8219bd9c1ca751.zip |
be slightly more paranoid about shell stuff we run.
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Add.pm | 10 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Delete.pm | 4 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 10 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/SharedItems.pm | 8 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/SharedLibs.pm | 4 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Ustar.pm | 4 |
6 files changed, 21 insertions, 19 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm index 0e02e81fdb2..9a090c899bd 100644 --- a/usr.sbin/pkg_add/OpenBSD/Add.pm +++ b/usr.sbin/pkg_add/OpenBSD/Add.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Add.pm,v 1.99 2009/12/17 11:07:24 espie Exp $ +# $OpenBSD: Add.pm,v 1.100 2009/12/17 11:57:02 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -290,7 +290,7 @@ sub install my $l=[]; push(@$l, "-v") if $state->{very_verbose}; $self->build_args($l); - $state->vsystem($self->command,, @$l, $auth); + $state->vsystem($self->command,, @$l, '--', $auth); } package OpenBSD::PackingElement::NewUser; @@ -330,7 +330,7 @@ sub install my $name = $self->name; $self->SUPER::install($state); - open(my $pipe, '-|', OpenBSD::Paths->sysctl, '-n', $name); + open(my $pipe, '-|', OpenBSD::Paths->sysctl, '-n', '--', $name); my $actual = <$pipe>; chomp $actual; if ($self->{mode} eq '=' && $actual eq $self->{value}) { @@ -343,7 +343,7 @@ sub install $state->say("sysctl -w $name != ". $self->{value}); return; } - $state->vsystem(OpenBSD::Paths->sysctl, $name.'='.$self->{value}); + $state->vsystem(OpenBSD::Paths->sysctl, '--', $name.'='.$self->{value}); } package OpenBSD::PackingElement::DirBase; @@ -573,7 +573,7 @@ sub install return if $state->{not}; my $fullname = $state->{destdir}.$self->fullname; $state->vsystem(OpenBSD::Paths->install_info, - "--info-dir=".dirname($fullname), $fullname); + "--info-dir=".dirname($fullname), '--', $fullname); } package OpenBSD::PackingElement::Shell; diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm index 4cd6910c6a9..3eb10aab77b 100644 --- a/usr.sbin/pkg_add/OpenBSD/Delete.pm +++ b/usr.sbin/pkg_add/OpenBSD/Delete.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Delete.pm,v 1.92 2009/12/17 08:21:09 espie Exp $ +# $OpenBSD: Delete.pm,v 1.93 2009/12/17 11:57:02 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -560,7 +560,7 @@ sub delete unless ($state->{not}) { my $fullname = $state->{destdir}.$self->fullname; $state->vsystem(OpenBSD::Paths->install_info, - "--delete", "--info-dir=".dirname($fullname), $fullname); + "--delete", "--info-dir=".dirname($fullname), '--', $fullname); } $self->SUPER::delete($state); } diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index da1141c1862..1b0f04d972a 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackingElement.pm,v 1.163 2009/11/11 13:00:40 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.164 2009/12/17 11:57:02 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -537,7 +537,7 @@ sub format open my $oldout, '>&STDOUT'; open STDOUT, '>', "$base/$out" or die "Can't write to $base/$out"; system(OpenBSD::Paths->groff, - '-Tascii', '-mandoc', '-Wall', '-mtty-char', @extra, $fname); + '-Tascii', '-mandoc', '-Wall', '-mtty-char', @extra, '--', $fname); open STDOUT, '>&', $oldout; } @@ -1380,12 +1380,12 @@ sub finish_fontdirs $state->say("You may wish to update your font path for ", join(' ', @l)); return if $state->{not}; - run_if_exists($state, OpenBSD::Paths->mkfontscale, @l); - run_if_exists($state, OpenBSD::Paths->mkfontdir, @l); + run_if_exists($state, OpenBSD::Paths->mkfontscale, '--', @l); + run_if_exists($state, OpenBSD::Paths->mkfontdir, '--', @l); map { restore_fontdir($_) } @l; - run_if_exists($state, OpenBSD::Paths->fc_cache, @l); + run_if_exists($state, OpenBSD::Paths->fc_cache, '--', @l); } } diff --git a/usr.sbin/pkg_add/OpenBSD/SharedItems.pm b/usr.sbin/pkg_add/OpenBSD/SharedItems.pm index b1ec0be7eab..76244c4c5a6 100644 --- a/usr.sbin/pkg_add/OpenBSD/SharedItems.pm +++ b/usr.sbin/pkg_add/OpenBSD/SharedItems.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: SharedItems.pm,v 1.16 2009/11/11 13:00:40 espie Exp $ +# $OpenBSD: SharedItems.pm,v 1.17 2009/12/17 11:57:02 espie Exp $ # # Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org> # @@ -88,7 +88,8 @@ sub cleanup $state->progress->show($done, $total); next if $remaining->{users}->{$user}; if ($state->{extra}) { - $state->system(OpenBSD::Paths->userdel, $user); + $state->system(OpenBSD::Paths->userdel, '--', + $user); } else { $state->log->set_context($pkgname); $state->log("You should also run /usr/sbin/userdel $user\n"); @@ -101,7 +102,8 @@ sub cleanup $state->progress->show($done, $total); next if $remaining->{groups}->{$group}; if ($state->{extra}) { - $state->system(OpenBSD::Paths->groupdel, $group); + $state->system(OpenBSD::Paths->groupdel, '--', + $group); } else { $state->log->set_context($pkgname); $state->log("You should also run /usr/sbin/groupdel $group\n"); diff --git a/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm b/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm index 58a3987df81..b85d107c179 100644 --- a/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm +++ b/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: SharedLibs.pm,v 1.40 2009/11/29 10:32:58 espie Exp $ +# $OpenBSD: SharedLibs.pm,v 1.41 2009/12/17 11:57:02 espie Exp $ # # Copyright (c) 2003-2005 Marc Espie <espie@openbsd.org> # @@ -46,7 +46,7 @@ sub init_path($) my $destdir = shift; $path={}; if ($destdir ne '') { - unshift @ldconfig, OpenBSD::Paths->chroot, $destdir; + unshift @ldconfig, OpenBSD::Paths->chroot, '--', $destdir; } open my $fh, "-|", @ldconfig, "-r"; if (defined $fh) { diff --git a/usr.sbin/pkg_add/OpenBSD/Ustar.pm b/usr.sbin/pkg_add/OpenBSD/Ustar.pm index ff7ba96435c..ccd86fa6a06 100644 --- a/usr.sbin/pkg_add/OpenBSD/Ustar.pm +++ b/usr.sbin/pkg_add/OpenBSD/Ustar.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Ustar.pm,v 1.53 2009/12/17 11:07:24 espie Exp $ +# $OpenBSD: Ustar.pm,v 1.54 2009/12/17 11:57:02 espie Exp $ # # Copyright (c) 2002-2007 Marc Espie <espie@openbsd.org> # @@ -527,7 +527,7 @@ sub create my $self = shift; $self->make_basedir($self->name); system(OpenBSD::Paths->mknod, - '-m', $self->{mode}, $self->{destdir}.$self->name, + '-m', $self->{mode}, '--', $self->{destdir}.$self->name, $self->devicetype, $self->{major}, $self->{minor}); $self->set_modes; } |