You are not logged in.
Pages: 1
If user Joe tars up a directory containing the following files:
x.txt owned by root -rw-------
y.txt owned by Joe -rw-------
z.txt owned by Jane -rw-------
and gives the tarball (probably owned be Joe) to his friend Jack, when Jack untars the tarball, who will own the files? Will they all belong to Jack or will the permissions be preserved? Can Jack open up x.txt (owned by root)?
Offline
Why don't you try?
1) Joe won't be able to tar up x.txt, since it's not readable for him
2) see 'man tar' -> flag '-p'
3) when untarring, Jack will be able to preserve only those permissions that he can regularly chmod/chown, so on most systems he wouldn't be able to create files owned by other users
EDIT: I guess the message is that untarring for the system is just 'the process tar, run with these and these privileges, is creating, chmodding and chowning files. So that should give you an idea what's possible and what's not.
Last edited by bender02 (2008-10-17 07:43:21)
Offline
Why don't you try?
1) Joe won't be able to tar up x.txt, since it's not readable for him
2) see 'man tar' -> flag '-p'
3) when untarring, Jack will be able to preserve only those permissions that he can regularly chmod/chown, so on most systems he wouldn't be able to create files owned by other usersEDIT: I guess the message is that untarring for the system is just 'the process tar, run with these and these privileges, is creating, chmodding and chowning files. So that should give you an idea what's possible and what's not.
Ok so if Joe tars up a directory owned by Joe and gives it to Jack, can Jack open those files?
Offline
Again, why the heck don't you try? [EDIT: don't take me wrong, what i'm just trying to say is that when you figure out something for yourself, without someone telling you, you actually learn a lot more and better.]
Ok so if Joe tars up a directory owned by Joe and gives it to Jack, can Jack open those files?
If the permissions on the tar file itself allow Jack read the tarball, then yes, jack can open these files. Untarring that tar file would by default create the files owned by Jack.
An addition to 2) in my previous post - also see the flag '--same-owner'.
Last edited by bender02 (2008-10-17 08:26:17)
Offline
Pages: 1