summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorpaul <paul@FreeBSD.org>2000-12-30 00:14:01 +0000
committerpaul <paul@FreeBSD.org>2000-12-30 00:14:01 +0000
commitb792d44931869a1f312f6efea7733cbec9901766 (patch)
tree658406df10bacea60f992ddf8536027d185e4124 /usr.sbin
parentd01d160690f81591a5c903f4a17d7a9757d895d6 (diff)
downloadFreeBSD-src-b792d44931869a1f312f6efea7733cbec9901766.zip
FreeBSD-src-b792d44931869a1f312f6efea7733cbec9901766.tar.gz
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.
Diffstat (limited to 'usr.sbin')
-rwxr-xr-xusr.sbin/pkg_install/update/pkg_update.pl4
1 files 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 b868c0e..e4f6804 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;
}
OpenPOWER on IntegriCloud