question on permissions

Sri Ramkrishna sramkris at
Tue Dec 4 09:33:13 EST 2001

On Mon, Dec 03, 2001 at 04:05:12PM -0600, Dave Dykstra wrote:
> On Mon, Dec 03, 2001 at 01:21:29PM -0800, Sri Ramkrishna wrote:
> > I have a question regarding how rsync changes ownership when syncing two
> > areas.  Currently, I have this situation:
> > 
> > I have two areas over a WAN, we are trying to mirror from one site to
> > another.  One site is not controlled by us and has different unix
> > groups.  
> > 
> > When we copy one to the other, we are running rsync on an account that
> > exists at both places (different UIDs though)  In one area we have no
> > problems the groups/owners exist at both places.  However in another
> > area, the owner exists but the group name does not.
> > 
> > When we run rsync between the two we get a lot of chown errors.  Now
> > this makes sense as some OSs (we are using HPUX 11) do not allow a
> > person to change the ownership of a file.  However, we have another area
> > where both the group and the ownership exist on both ends but we have no
> > chown errors.  Can anybody explain this behavior?  In the end, the area
> > still gets owned by the uid and gid of the rsync running on our end.
> > 
> > Thanks,
> > sri
> Are you using rsync --daemon mode on one side?  There are several tricky
> issues related to that, alluded to under the "--owner" option in the
> rsync man page.

Well, no, I'm not using --daemon mode at all.  I'm just rsh and forking a rsync
process on the other side.

> What user id are you doing the transfers under?

Well the login id is the same between the sites.  But the uid of the user id is
different. (shouldn't matter)  We have some wierd permission problems so when I
run the rsync on our end I'm running it this way:

su - ptmda some_rsync_script

I had to do this because we use something called Powerbroker to share 
accounts and somehow there is some confusion with how it gets executed
under what ID.  

We just added the group that we didn't have that the other site did and that
solved our problem with chown errors.  Very weird.  So it looks like both the
group and the owner must exist at both sites in order to avoid errors?  

> Also, rsync enforces bsd-style ownership and group semantics, regardless of
> whether or not the underlying operating system permits more freedom with
> chown and chgrp.  That means it won't allow doing a chown to another user
> if you're not root, and the only groups it will allow a non-privileged
> user to chgrp to are those which groups which the user belongs to.

I think thats it right there.  The owner did not belong to the group.  We
changed it so that the owner had the missing group in there and that fixed it.
Thanks!!  Much appreciated!


More information about the rsync mailing list