Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 01 Aug 2002 12:01:08 -0700
From:      Bakul Shah <bakul@bitblocks.com>
To:        Maxim Sobolev <sobomax@FreeBSD.org>
Cc:        Bruce Evans <bde@zeta.org.au>, current@FreeBSD.org, obrien@FreeBSD.org
Subject:   Re: pkg_add broken by POLA breakage in tar 
Message-ID:  <200208011901.PAA26093@marlborough.cnchost.com>
In-Reply-To: Your message of "Thu, 01 Aug 2002 20:34:45 %2B0300." <3D497135.92A17316@FreeBSD.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
> Well, OK, now I am really confused. So what should we be bound to? To
> the POLA (old GNU tar in 4.6-release and downward was not fully
> preserving permissions unless -p is specified, even when invoked by
> root)? Or to what other systems do? Bruce, what do you think?

Okay, I did some more research and now I am sorry I got
involved!

In addition to SUN, SGI says -p (restore permissions) is the
default when run as super-user.  HPUX says the same thing.
Further it says it conforms to SVID2, SVID3, XPG2, XPG3 (I
don't know if this is just boiler plate or actual conformance
-- I don't have the standards).  Ultrix is not clear.
Version 7 tar(1) man page is not entirely clear about this.

I checked out the earliest version of tar from FreeBSD cvs
and that indeed does not default to -p for the superuser.
my guess is John Gilmore originally created gnu tar from
reading of the man page.  If so, that would explain the
difference.  I don't have the V7 sources so can't check but
given that companies with the Unix licence (and the orig.
sources) all do the same I believe the V7 man page just
missed out some details.  I don't know what POSIX says.

{Net,Open}BSD & Linux do what gnu tar does.

If it were upto me I'd choose what POSIX says.  If it is
ambiguous and doesn't clearly specify the super user case,
I'd choose -p to be the default for root since a usability
point of view I really don't see the point of respecting
umask while extracting an archive --  a weird umask can
produce some very surprising results!  But clearly, for
portability one should always specify -p even as root and
scripts using tar should be fixed!

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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