From owner-cvs-all Thu Jan 4 10:14:57 2001 From owner-cvs-all@FreeBSD.ORG Thu Jan 4 10:14:54 2001 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from gratis.grondar.za (grouter.grondar.za [196.7.18.65]) by hub.freebsd.org (Postfix) with ESMTP id 9694E37B400; Thu, 4 Jan 2001 10:14:41 -0800 (PST) Received: from grondar.za (root@gratis.grondar.za [196.7.18.133]) by gratis.grondar.za (8.11.1/8.11.1) with ESMTP id f04IE6Y07071; Thu, 4 Jan 2001 20:14:08 +0200 (SAST) (envelope-from mark@grondar.za) Message-Id: <200101041814.f04IE6Y07071@gratis.grondar.za> To: Paul Richards Cc: Dag-Erling Smorgrav , Paul Richards , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.sbin/pkg_install/update pkg_update.pl References: <3A54A329.3A84087F@freebsd-services.co.uk> In-Reply-To: <3A54A329.3A84087F@freebsd-services.co.uk> ; from Paul Richards "Thu, 04 Jan 2001 16:22:01 GMT." Date: Thu, 04 Jan 2001 20:14:02 +0200 From: Mark Murray Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > > > > "+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