diff options
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PkgCreate.pm | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm index c3c2fcdda96..4185361a936 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm @@ -1,6 +1,6 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: PkgCreate.pm,v 1.166 2020/01/13 13:11:31 espie Exp $ +# $OpenBSD: PkgCreate.pm,v 1.167 2020/01/26 12:50:17 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org> # @@ -131,6 +131,7 @@ sub handle_options if (defined $state->opt('u')) { $state->{userlist} = $state->parse_userdb($state->opt('u')); } + $state->{wrkobjdir} = $state->defines('WRKOBJDIR'); } sub parse_userdb @@ -291,6 +292,12 @@ sub compute_checksum } elsif (!-e $chk) { push(@{$state->{bad_symlinks}{$chk}}, $fname); } + if (defined $state->{wrkobjdir} && + $value =~ m/^\Q$state->{wrkobjdir}\E\//) { + $state->error( + "bad symlink: #1 (points into WRKOBJDIR)", + $fname); + } $result->make_symlink($value); } elsif (-f _) { my ($dev, $ino, $size, $mtime) = (stat _)[0,1,7, 9]; |