From owner-cvs-all Sat Sep 1 17:32:40 2001 Delivered-To: cvs-all@freebsd.org Received: from obsecurity.dyndns.org (adsl-63-207-60-54.dsl.lsan03.pacbell.net [63.207.60.54]) by hub.freebsd.org (Postfix) with ESMTP id EE5E937B401; Sat, 1 Sep 2001 17:32:30 -0700 (PDT) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id AD02066E8E; Sat, 1 Sep 2001 17:32:30 -0700 (PDT) Date: Sat, 1 Sep 2001 17:32:30 -0700 From: Kris Kennaway To: Josef Karthauser Cc: Paul Richards , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.sbin/pkg_install/update pkg_update.pl Message-ID: <20010901173230.A17955@xor.obsecurity.org> References: <200012300014.eBU0E1238805@freefall.freebsd.org> <20010902012740.A11122@tao.org.uk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="xHFwDpU9dbj6ez1V" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010902012740.A11122@tao.org.uk>; from joe@tao.org.uk on Sun, Sep 02, 2001 at 01:27:40AM +0100 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --xHFwDpU9dbj6ez1V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 02, 2001 at 01:27:40AM +0100, Josef Karthauser wrote: > On Fri, Dec 29, 2000 at 04:14:01PM -0800, Paul Richards wrote: > > paul 2000/12/29 16:14:01 PST > >=20 > > Modified files: > > usr.sbin/pkg_install/update pkg_update.pl=20 > > Log: > > Change open modes from ">$file" to "> $file" because it's much safer = should > > $file not be what you expect, particularly should $file turn out to be > > "+REQUIRES" since ">+" is a valid open mode. > > =20 > > This isn't currently a problem since $file is constructed safely but = it removes the potential of future problems. > > =20 > > Pointed out by Anton Berezin. > > =20 > > Revision Changes Path > > 1.3 +3 -3 src/usr.sbin/pkg_install/update/pkg_update.pl >=20 > Sorry I've taken so long to get around to this one. >=20 > Are you sure? The perl docs for 'open' explicitly say that the + needs > to come before the >. >=20 > If the filename begins with '<' or nothing, the file is opened for > input. If the filename begins with '>', the file is truncated and > opened for output, being created if necessary. If the filename > begins with '>>', the file is opened for appending, again being > created if necessary. You can put a '+' in front of the '>' or '<' > to indicate that you want both read and write access to the file; > thus '+<' is almost always preferred for read/write updates--the > '+>' mode would clobber the file first. You can't usually use > either read-write mode for updating textfiles, since they have > variable length records. See the -i switch in perlrun for a better > approach. The file is created with permissions of 0666 modified > by the process' umask value. Is there any remaining need for this pkg_update implementation now that knu's portupgrade does such a complete job? Kris --xHFwDpU9dbj6ez1V Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7kX4eWry0BWjoQKURAkaPAKDdB8PU6UeU4YSLnBBlf/M3B6P9zQCfe0Hs NkgxC5wHfaiZ7y61FNm7kWE= =12tJ -----END PGP SIGNATURE----- --xHFwDpU9dbj6ez1V-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message