LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Preserve the ownership (http://www.linuxquestions.org/questions/linux-general-1/preserve-the-ownership-40807/)

juno 01-09-2003 02: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.

eg.

# ll abc.prn
-rw-rw-rw- UserA abc.prn
# whoami
UserB
# gzip abc.prn
# ll
-rw-rw-rw- UserB abc.prn.gz
#gunzip abc.prn.gz
#ll
-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 02: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 05:12 AM.