Unix file ownership for wide open directories

Matt McCutchen matt at mattmccutchen.net
Fri Oct 30 10:30:37 MDT 2009


On Fri, 2009-10-30 at 12:16 -0400, JESSE CARROLL wrote:
> Forgive me if the answer is obvious but I've googled and searched the
> archives but I can't seem to find a good solution. 
> 
> Scenario on a Solaris system: 
> 
> ls -ld /foo 
> drwxrwxrwx   2 user1    other        512 Oct 30 16:05 /foo 
> 
> ls -l /foo/* 
> total 0 
> -rw-r--r--   1 user1    other         10 Oct 30 16:05 /foo/file_a 
> -rw-r--r--   1 user2    staff          30 Oct 30 16:05 /foo/file_b 
> 
> (Yes I know wide open directories are evil, but the application folks
> do strange things.) 
> 
> If I use rsync as user1 all the files on the destination server are
> owned by user1. I.E. 
> 
> ls -l /foo/* 
> total 0 
> -rw-r--r--   1 user1    other         10 Oct 30 16:05 /foo/file_a 
> -rw-r--r--   1 user1    other         30 Oct 30 16:05 /foo/file_b 

> Any suggestions on preserving the file ownership in this case? 

The -o (--owner) option?

-- 
Matt





More information about the rsync mailing list