From ee020fd1ddea39b9e81d58e10a52a0df847b7fe4 Mon Sep 17 00:00:00 2001 From: espie Date: Sun, 25 Feb 2018 14:19:26 +0000 Subject: [PATCH] sprinkle quite a few more calls to safe --- usr.sbin/pkg_add/OpenBSD/PkgCheck.pm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm b/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm index 23e8a07bd97..a61cfb97ce1 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgCheck.pm @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: PkgCheck.pm,v 1.64 2017/03/14 23:30:36 espie Exp $ +# $OpenBSD: PkgCheck.pm,v 1.65 2018/02/25 14:19:26 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -561,32 +561,34 @@ sub remove for my $i (@OpenBSD::PackageInfo::info) { if (-e $dir.$i) { if ($state->verbose) { - $state->say("unlink(#1)", $dir.$i); + $state->say("unlink(#1)", + $state->safe($dir.$i)); } unless ($state->{not}) { unlink($dir.$i) or $state->errsay("#1: Couldn't delete #2: #3", - $name, $dir.$i, $!); + $state->safe($name), + $state->safe($dir.$i), $!); } } } if (-f $dir) { if ($state->verbose) { - $state->say("unlink(#1)", $dir); + $state->say("unlink(#1)", $state->safe($dir)); } unless ($state->{not}) { unlink($dir) or $state->errsay("#1: Couldn't delete #2: #3", - $name, $dir, $!); + $state->safe($name), $state->safe($dir), $!); } } elsif (-d $dir) { if ($state->verbose) { - $state->say("rmdir(#1)", $dir); + $state->say("rmdir(#1)", $state->safe($dir)); } unless ($state->{not}) { rmdir($dir) or $state->errsay("#1: Couldn't delete #2: #3", - $name, $dir, $!); + $state->safe($name), $state->safe($dir), $!); } } } @@ -596,7 +598,7 @@ sub may_remove my ($self, $state, $name) = @_; if ($state->{force}) { $self->remove($state, $name); - } elsif ($state->confirm("Remove wrong package $name")) { + } elsif ($state->confirm("Remove wrong package ".$state->safe($name))) { $self->remove($state, $name); } $state->{bogus}{$name} = 1; -- 2.20.1