Date: Wed, 7 Mar 2007 14:17:45 +0300 From: Ruslan Ermilov <ru@FreeBSD.org> To: Bruce Evans <bde@zeta.org.au> Cc: Greg 'groggy' Lehey <grog@FreeBSD.org>, cvs-src@FreeBSD.org, Tim Kientzle <kientzle@FreeBSD.org>, cvs-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: cvs commit: src/usr.sbin/pkg_install/lib url.c Message-ID: <20070307111745.GB14172@rambler-co.ru> In-Reply-To: <20070307171432.B28541@delplex.bde.org> References: <200703061454.l26Esj7D043245@repoman.freebsd.org> <45EDA7E2.4040300@freebsd.org> <20070306204307.GD43608@rambler-co.ru> <20070306231228.GC68567@wantadilla.lemis.com> <45EE3BC4.8070309@freebsd.org> <20070307171432.B28541@delplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--PmA2V3Z32TCmWXqI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 07, 2007 at 05:15:08PM +1100, Bruce Evans wrote: > On Tue, 6 Mar 2007, Tim Kientzle wrote: >=20 > >>>>>... GNU tar(1) implied the > >>>>>-p option for root, but BSD tar(1) doesn't do that. > >>>> > >>>>Hmmm... This might actually be considered a bsdtar bug. > >>>>I'll look into it. > >>> > >>>That behavior of BSD tar(1) surprised me, to be honest. > > > >It's a trivial fix; there's already a check for whether > >tar is being run by root. If so, it sets _EXTRACT_OWNER > >to restore the owner. I just need to fill in the flags > >associated with -p as well. > > > >One problem that I don't see documented in any GNU tar > >docs I can find: Is there a way to suppress this behavior > >for root in GNU tar? >=20 > >From tar.info: >=20 > %%% > `--no-same-owner' > Do not attempt to restore ownership when extracting. This is the > default behavior for ordinary users, so this option has an effect > only for the superuser. > %%% >=20 You probably wanted this instead: : `--preserve-permissions' : `--same-permissions' : `-p' : When `tar' is extracting an archive, it normally subtracts the : users' umask from the permissions specified in the archive and : uses that number as the permissions to create the destination : file. Specifying this option instructs `tar' that it should use : the permissions directly from the archive. *Note Writing::. :=20 : `--no-same-permissions' : When extracting an archive, subtract the user's umask from files : from the permissions specified in the archive. This is the : default behavior for ordinary users; this option has an effect : only for the superuser. It doesn't say it explicitly that -p is the default option for root, nowehre, but you can guess it from reading the last sentence. ;) Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --PmA2V3Z32TCmWXqI Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.2 (FreeBSD) iD8DBQFF7p9ZqRfpzJluFF4RAgoQAJ9o6jBD8z48YZEq+CL1WOGooFudywCffK7Z h2dF0JBNfGiq1fYWBuFExBI= =voF6 -----END PGP SIGNATURE----- --PmA2V3Z32TCmWXqI--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070307111745.GB14172>