root+tar's '--same-owner --preserve' options

marty marty at goodoldmarty.com
Wed Mar 12 12:31:01 PDT 2008


>> >  According to my quick checking, Busybox and bsd Tar do not preserve
>> >  permissions or ownership by default for root. Solaris and GNU Tar do.
>> >  Packages shouldn't depend on either behavior, and should use options
>> >  explicitly.
>> >

Some, if not all of the packages will blindly assume GNU Tar is on a Linux
system and when they find GNU Tar they will expect it to act like GNU tar.
Imposing changes is likely to cause bigger problems than those you are trying to
prevent. We also have a built-in RBAC system which might provide a solution.

> If adding the commands to the individual tar command is not an option,
> then write a wrapper:
> 
> #!/bin/sh
> tar(){
>  $(which tar) --numeric-owner --preserve --xattrs --selinux $@
> }
> 

And suggesting a wrapper to fix something that needless changes will break makes
the whole situation sillier.

Producing a non-standard version of GNU Tar is simply a conflict, even if the
purpose is valid. If you feel this is such a compelling issue you might:
(a) change roots path order to /sbin/:/bin
(b) add a --no-preserve-nothin wrapper called tar in /sbin.
That should achieve your goal in a more amicable manner.

Marty B.

-- 
Building a better mousetrap only results in better mice. C. Darwin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxfromscratch.org/pipermail/hlfs-dev/attachments/20080312/25fbf7cc/attachment.sig>


More information about the hlfs-dev mailing list