From 28d1c3442149a9ea3838ca5935592b340f66e10b Mon Sep 17 00:00:00 2001 From: Paul Richards Date: Sat, 30 Dec 2000 00:14:01 +0000 Subject: [PATCH] Change open modes from ">$file" to "> $file" because it's much safer should $file not be what you expect, particularly should $file turn out to be "+REQUIRES" since ">+" is a valid open mode. This isn't currently a problem since $file is constructed safely but it removes the potential of future problems. Pointed out by Anton Berezin. --- usr.sbin/pkg_install/update/pkg_update.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/pkg_install/update/pkg_update.pl b/usr.sbin/pkg_install/update/pkg_update.pl index b868c0ec756f..e4f68049d815 100755 --- a/usr.sbin/pkg_install/update/pkg_update.pl +++ b/usr.sbin/pkg_install/update/pkg_update.pl @@ -69,7 +69,7 @@ sub get_requires($$) { return 1; } - if (! open(REQUIRES, "<$file")) { + if (! open(REQUIRES, "< $file")) { error("Can't open $file, $!"); return 0; } @@ -89,7 +89,7 @@ sub put_requires($$) { my $file = "$PKG_DB/$pkg/$PKG_DEP_FILE"; - if (! open(REQUIRES, ">$file")) { + if (! open(REQUIRES, "> $file")) { error("Can't open $file, $!"); return 0; }