-   Linux - General (
-   -   Preserve the ownership (

juno 01-09-2003 01:43 AM

Preserve the ownership
After I gzip a file , then gunzip the file , the owner will be changed to me , how can I preserve the ownership to the original owner.


# ll abc.prn
-rw-rw-rw- UserA abc.prn
# whoami
# gzip abc.prn
# ll
-rw-rw-rw- UserB abc.prn.gz
#gunzip abc.prn.gz
-rw-rw-rw- UserB abc.prn

How to preserve the owner of the file abc.prn to original owner ( UserA) ? Thx.

trickykid 01-16-2003 01:38 PM

Most likely this isn't possible, cause if a regular user had the power to create a file that another person owns, what would prevent that person to gain access to anything the other owner has that maybe he doesn't want anyone to have access to.

Your best option is to either su to the other user to gzip the file or just change the ownership, etc afterwards.

All times are GMT -5. The time now is 12:22 PM.