diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-01-20 18:19:46 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-01-20 18:19:46 +0000 |
commit | b6c8bf0180b8199b05387f4e9ee918699493722e (patch) | |
tree | 83d4b22581840b9b0c818567866702c4ac0e7c81 /usr.bin/vi/build/recover | |
parent | 3da8a1bc93ad47067121b21397399cc5a4ce3193 (diff) |
Use sysopen() when opening recover files. This is purely paranoia
since we check that the filename matches '^recover' and hence the
first character cannot play games with perl's magic open().
Diffstat (limited to 'usr.bin/vi/build/recover')
-rw-r--r-- | usr.bin/vi/build/recover | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/vi/build/recover b/usr.bin/vi/build/recover index 72ab98c4bde..967572746f6 100644 --- a/usr.bin/vi/build/recover +++ b/usr.bin/vi/build/recover @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # -# $OpenBSD: recover,v 1.2 1999/10/11 20:07:19 millert Exp $ +# $OpenBSD: recover,v 1.3 2000/01/20 18:19:45 millert Exp $ # # Script to (safely) recover nvi edit sessions. # @@ -54,7 +54,7 @@ foreach $file (readdir(RECDIR)) { # Slurp in the recover.* file and search for X-vi-recover-path # (which should point to an existing vi.* file). - open(RECFILE, $file) || die "$0: can't open $file: $!\n"; + sysopen(RECFILE, $file, O_RDONLY) || die "$0: can't open $file: $!\n"; @recfile = <RECFILE>; close(RECFILE); @backups = grep(s/^X-vi-recover-path:\s*(.*)[\r\n]*$/$1/, @recfile); |