Jonathan Chen -X (jonachen - The Armada Group, Inc. at Cisco)
2005-Dec-28 17:23 UTC
Permission problem with rsync in daemon mode
RHEL 3 rsync version 2.5.7 protocol version 26 Hello all, I got rsync working mostly fine. I setup rsync in daemon mode for retrievel by another hosts. In terms of retrieving it works fine, but not when it comes to dir ownership. Command used sudo rsync --archive --compress -vv --sparse --progress -e ssh jon@linuxhost::netegrity /users/jon/test/ The /users/jon/test/ is owned by jon:jon while the "netegrity" dir on the rsync server has root:root ownership. So when I try execute the above command, I get the correct ownership for netegrity, but somehow the "test" directory ownership changes(maybe access permission changed too?) to root:root instead of jon:jon. I don''t know why that happens. If I execute the command without "sudo" all ownership goes to jon:jon Thanks for any help as to what I''m doing wrong in rsyncd.conf?? Part of rsyncd.conf hosts allow = 64.104.129.227/28 log file = /tools/logs/sync/sync.log lock file = /tools/logs/sync/syncd.lock uid = cdemgr gid = cdemgr use chroot = no list = yes dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz *.jar refuse options = delete [netegrity] comment = /tools/netegrity path = /tools/netegrity -- To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
On Wed, 2005-12-28 at 09:21 -0800, Jonathan Chen -X wrote:> sudo rsync --archive --compress -vv --sparse --progress -e ssh > jon@linuxhost::netegrity /users/jon/test/ > > The /users/jon/test/ is owned by jon:jon while the "netegrity" dir on > the rsync server has root:root ownership. So when I try execute the > above command, I get the correct ownership for netegrity, but somehow > the "test" directory ownership changes(maybe access permission changed > too?) to root:root instead of jon:jon. I don''t know why that happens. > If I execute the command without "sudo" all ownership goes to jon:jonrsync is copying the server''s netegrity directory onto your test directory, and you told rsync to preserve ownership (--archive), so it sets the ownership of test to match netegrity, i.e. root:root. (When rsync lacks the privileges to give test to root:root, it simply skips that step without complaining; some consider this behavior wrong.) If you don''t want to preserve ownership at all, use -rltpD instead of --archive, which means -rltpogD. Alternatively, use a wildcard to copy only the files inside netegrity but not netegrity itself, in which case no attributes of test will be changed to match netegrity: rsync <...> jon@linuxhost::netegrity/* /users/jon/test/ -- Matt McCutchen, ``hashproduct'''' hashproduct@verizon.net -- http://hashproduct.metaesthetics.net/
Jonathan Chen -X (jonachen - The Armada Group, Inc. at Cisco)
2005-Dec-28 17:56 UTC
Permission problem with rsync in daemon mode
Matt, Thanks for clearing some things up. Still I want ''netegrity'' dir ownership/permission to be the same but not the ''test'' dir ownership/permission to be changed. Is it possible without the ''--archive'' switches?> -----Original Message----- > From: Matt McCutchen [mailto:hashproduct@verizon.net] > Sent: Wednesday, December 28, 2005 9:49 AM > To: Jonathan Chen -X (jonachen - The Armada Group, Inc. at Cisco) > Cc: rsync@lists.samba.org > Subject: Re: Permission problem with rsync in daemon mode > > On Wed, 2005-12-28 at 09:21 -0800, Jonathan Chen -X wrote: > > sudo rsync --archive --compress -vv --sparse --progress -e ssh > > jon@linuxhost::netegrity /users/jon/test/ > > > > The /users/jon/test/ is owned by jon:jon while the > "netegrity" dir on > > the rsync server has root:root ownership. So when I try > execute the > > above command, I get the correct ownership for netegrity, > but somehow > > the "test" directory ownership changes(maybe access > permission changed > > too?) to root:root instead of jon:jon. I don''t know why > that happens. > > If I execute the command without "sudo" all ownership goes > to jon:jon > > rsync is copying the server''s netegrity directory onto your > test directory, and you told rsync to preserve ownership > (--archive), so it sets the ownership of test to match > netegrity, i.e. root:root. (When rsync lacks the privileges > to give test to root:root, it simply skips that step without > complaining; some consider this behavior wrong.) > > If you don''t want to preserve ownership at all, use -rltpD > instead of --archive, which means -rltpogD. > > Alternatively, use a wildcard to copy only the files inside > netegrity but not netegrity itself, in which case no > attributes of test will be changed to match netegrity: > rsync <...> jon@linuxhost::netegrity/* /users/jon/test/ > > -- > Matt McCutchen, ``hashproduct'''' > hashproduct@verizon.net -- http://hashproduct.metaesthetics.net/ >
On Wed, Dec 28, 2005 at 09:21:37AM -0800, Jonathan Chen -X (jonachen - The Armada Group, Inc. at Cisco) wrote:> sudo rsync --archive --compress -vv --sparse --progress -e ssh > jon@linuxhost::netegrity /users/jon/test/ > > The /users/jon/test/ is owned by jon:jon while the "netegrity" dir on > the rsync server has root:root ownership.The "netegrity" in that command is a module name, not a directory, so that name is not duplicated in the destination. If the module contains a nested netegrity directory, then switching your source to use "jon@linuxhost::netegrity/netegrity" will ensure that the parent directory''s permissions/ownership don''t affect the test dir. If not, switching the destination to "/users/jon/test/netegrity" will put the contents of the module in that directory (which may be what you were expecting to happen). ..wayne..
Jonathan Chen -X (jonachen - The Armada Group, Inc. at Cisco)
2005-Dec-28 18:30 UTC
Permission problem with rsync in daemon mode
Apologize for the confusion. I am aware the module name is not duplicated on the destination. So it would copy "/tools/netegrity/siteminder/" to destination ~jon/test/siteminder with permission like below. drwxr-xr-x 3 cdemgr cdemgr 4096 Apr 5 2005 siteminder The "/tools/netegrity/" permission is like above. Still I just don''t understand why it changes the ~jon/test ownership to ''cdemgr''too. Where did I misconfigure or assume?> -----Original Message----- > From: Wayne Davison [mailto:wayned@samba.org] > Sent: Wednesday, December 28, 2005 10:06 AM > To: Jonathan Chen -X (jonachen - The Armada Group, Inc. at Cisco) > Cc: rsync@lists.samba.org > Subject: Re: Permission problem with rsync in daemon mode > > On Wed, Dec 28, 2005 at 09:21:37AM -0800, Jonathan Chen -X > (jonachen - The Armada Group, Inc. at Cisco) wrote: > > sudo rsync --archive --compress -vv --sparse --progress -e ssh > > jon@linuxhost::netegrity /users/jon/test/ > > > > The /users/jon/test/ is owned by jon:jon while the > "netegrity" dir on > > the rsync server has root:root ownership. > > The "netegrity" in that command is a module name, not a > directory, so that name is not duplicated in the destination. > If the module contains a nested netegrity directory, then > switching your source to use > "jon@linuxhost::netegrity/netegrity" will ensure that the > parent directory''s permissions/ownership don''t affect the > test dir. If not, switching the destination to > "/users/jon/test/netegrity" will put the contents of the > module in that directory (which may be what you were > expecting to happen). > > ..wayne.. >
On Wed, Dec 28, 2005 at 10:27:59AM -0800, Jonathan Chen -X (jonachen - The Armada Group, Inc. at Cisco) wrote:> Still I just don''t understand why it changes the ~jon/test ownership to > ''cdemgr''too.This is because the directory ''.'' is copied when rsync copies an entire directory (as it is when copying an entire module or a directory with a trailing slash). As Matt mentioned, you can specify ''*'' to get all the contents of a directory without including the directory itself. ..wayne..
Jonathan Chen -X (jonachen - The Armada Group, Inc. at Cisco)
2005-Dec-28 19:07 UTC
Permission problem with rsync in daemon mode
Yup that''s what it seems. I tried to do [netegrity] comment = /apps/tools/netegrity path = /apps/tools/netegrity exclude = ./ ../ To just see it works or not and it doesnot. I wish you can specify in the conf file to ignore main dir hidden files or have path be "path /apps/tools/netegrity/*" instead of the above one. Matt''s method works like a charm, but prefer to have configs in rsyncd.conf instead though. Thanks!> -----Original Message----- > From: Wayne Davison [mailto:wayned@samba.org] > Sent: Wednesday, December 28, 2005 10:39 AM > To: Jonathan Chen -X (jonachen - The Armada Group, Inc. at Cisco) > Cc: rsync@lists.samba.org > Subject: Re: Permission problem with rsync in daemon mode > > On Wed, Dec 28, 2005 at 10:27:59AM -0800, Jonathan Chen -X > (jonachen - The Armada Group, Inc. at Cisco) wrote: > > Still I just don''t understand why it changes the ~jon/test > ownership > > to ''cdemgr''too. > > This is because the directory ''.'' is copied when rsync copies > an entire directory (as it is when copying an entire module > or a directory with a trailing slash). As Matt mentioned, > you can specify ''*'' to get all the contents of a directory > without including the directory itself. > > ..wayne.. >