Date: Thu, 04 Jan 2001 20:14:02 +0200 From: Mark Murray <mark@grondar.za> To: Paul Richards <paul@freebsd-services.co.uk> Cc: Dag-Erling Smorgrav <des@ofug.org>, Paul Richards <paul@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.sbin/pkg_install/update pkg_update.pl Message-ID: <200101041814.f04IE6Y07071@gratis.grondar.za> In-Reply-To: <3A54A329.3A84087F@freebsd-services.co.uk> ; from Paul Richards <paul@freebsd-services.co.uk> "Thu, 04 Jan 2001 16:22:01 GMT." References: <3A54A329.3A84087F@freebsd-services.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
> > > > > "+REQUIRES" since ">+" is a valid open mode.
> > > > This would not be a problem if you used sysopen() instead of open().
> > > Even better - properly sanitise $file using taint-like checking.
>
> Taint wouldn't actually solve this problem, since + is a valid part of
> the filename.
Aaaah! but you could deal with it by making sure there is a space in front
of it!
open FOO, "> $bar" or die "...";
is pretty darn safe, particularly if you have already sanitised $bar.
(say)
if (/^(+?[a-zA-Z0-9]+)$/) {
open FOO, "< $1" or die "...";
:
}
has very few (if any) nasty surprises waiting in the wings. Illegally
long file name is about the nastiest.
M
--
Mark Murray
Warning: this .sig is umop ap!sdn
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200101041814.f04IE6Y07071>
