[buug] User/Group turbulence

Jon McClintock jammer at weak.org
Fri Apr 4 17:49:59 PST 2003


On Fri, Apr 04, 2003 at 05:16:09PM -0800, Bill Honeycutt wrote:
> I use:
> 	tar zxvf <filename>
> 
> Maybe someone could explain what happens when the root authority is 
> used, why it generates the files with the original uid:gid.  Does tar 
> maintain root privileges while the file is being expanded...or does the 
> priivilege level change during processing?
> 
> May as well learn something here ;-)

Tar stores the permissions and ownership of each file in the archive.
But it stores numeric values, not the string values. When you unpack the 
archive, it tries to restore those values as best it can. Which means
that as root, it'll create the files with those funky owners, whereas
as a normal user, it'll create the files owned by that user, because
a normal user can't create files owned by someone else.

-Jon




More information about the buug mailing list