autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/10] Proper file name escaping in Autoconf programs and Perl


From: Russ Allbery
Subject: Re: [PATCH 1/10] Proper file name escaping in Autoconf programs and Perl modules.
Date: Tue, 04 Dec 2007 13:48:13 -0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Ralf Wildenhues <address@hidden> writes:

> This includes escaping of characters special to the shell as well as
> special to Perl, e.g., leading `<' or `>'.  For example, when $file
> starts with `>', `open ">$file"' wrongly tries to append to a different
> file.

The best fix here from a Perl perspective would be to use the
three-argument form of open everywhere rather than just appending
characters to the file name argument of the two-argument form.  You then
require Perl 5.006, but that's not a bad requirement these days.

When using the two-argument form, files with leading or trailing
whitespace will still cause you problems even with an explicit mode
character always prepended.

-- 
Russ Allbery (address@hidden)             <http://www.eyrie.org/~eagle/>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]