From 841d904f88884f896735da1292e42615eaaea64f Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 2 Apr 2017 19:28:13 -0700 Subject: perl: change to the new, safer 3-operand form of open() The 2-operand form was inherently unsafe. Use the 3-operand form instead, which guarantees that arbitrary filenames are supported. This also means we can remove a few instances of sysopen() which was used for exactly this reason, however, at least in theory sysopen() isn't portable. Signed-off-by: H. Peter Anvin --- tools/syncfiles.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/syncfiles.pl b/tools/syncfiles.pl index 4da87f9c..b93e3ed2 100755 --- a/tools/syncfiles.pl +++ b/tools/syncfiles.pl @@ -67,7 +67,7 @@ $first_file = $ARGV[0]; die unless (defined($first_file)); foreach $file (@ARGV) { - open(FILE, "< $file\0") or die; + open(FILE, '<', $file) or die; # First, read the syntax hints %hints = %def_hints; @@ -116,7 +116,7 @@ foreach $file (@ARGV) { # Write the file back out if (!$first) { - open(FILE, "> $file\0") or die; + open(FILE, '>', $file) or die; print FILE @lines; close(FILE); } -- cgit v1.2.1