Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Sep 2001 17:32:30 -0700
From:      Kris Kennaway <kris@obsecurity.org>
To:        Josef Karthauser <joe@tao.org.uk>
Cc:        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:  <20010901173230.A17955@xor.obsecurity.org>
In-Reply-To: <20010902012740.A11122@tao.org.uk>; from joe@tao.org.uk on Sun, Sep 02, 2001 at 01:27:40AM %2B0100
References:  <200012300014.eBU0E1238805@freefall.freebsd.org> <20010902012740.A11122@tao.org.uk>

next in thread | previous in thread | raw e-mail | index | archive | help

--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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010901173230.A17955>