a subtle(?) tar extraction permission problem
cs at zip.com.au
cs at zip.com.au
Mon Jun 28 01:18:26 UTC 2004
On 12:43 27 Jun 2004, Robert P. J. Day <rpjday at mindspring.com> wrote:
| On Sat, 26 Jun 2004, Cameron Simpson wrote:
| >I think you'll find the tarball also has "a/b/c" in it too.
| sure, but the attributes of *those* directories don't get changed when
| i do the extraction.
Odd.
| >1: Don't extract as root?
| not an option. a single package/tarball might want to put files/dirs
| in various places, owned by various accounts.
Yucko. Another reason I install non-RPM (or whatever the native package system is)
stuff in /opt, thus:
http://www.cskk.ezoshosting.com/cs/css/syncopt.html
Of course, that won't work without a little special fiddling for things what
_need_ particular accounts and odd privileges (eg mail transports or suchlike).
| >2: Note perms, extract, fix perms.
| ouch. that would work, but it would definitely be a bit messy.
Should automate pretty readily if you peruse the tarball TOC.
| >3: Extract only the files - avoid the directories.
|
| tempting, but i'm wondering what would happen if the tarball has a
| directory that doesn't exist yet. it will have to be created, of
| course,
Which is easy.
| at which point i'd have to take care of setting its original
| attributes.
Well, you _could_ pull those from the tarball:
- scan toc, noting files
- compute needed dirs (all antecedants of file paths)
- for each dir needed, if [ ! -d "$dir/." ] add the dir to the
extract list for the tarball
- extract
Sounds easy enough to me. Want code?
Cheers,
--
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/
Sam Jones <samjones at leo.unm.edu> on the Nine Types of User:
Princess (unfair, perhaps, as these tend, overwhelmingly, to be males) -
"I need a Mac, and someone's got the one I like reserved,
would you please garrote him and put him in the paper
recycling bin?"
Advantages: Flatters you with their high standards for your service.
Disadvantages: Impresses you with their obliviousness to other people on
this planet.
Symptoms: Inability to communicate except by complaining.
Real Case: One asked a scon to remove the message of the day because he
(the user) didn't like it.
More information about the fedora-list
mailing list