trouble with chmod on certain symlinks

Wayne Davison wayned at samba.org
Mon Jan 3 21:52:51 GMT 2005


On Mon, Jan 03, 2005 at 12:55:01AM -0600, John Van Essen wrote:
> Since the problem is that Darwin has no lchown function implemented,
> for portability, this if statement could be:
> 
> #ifdef HAVE_LCHOWN
>         if (change_uid || change_gid) {
> #else
>         if (!S_ISLNK(st->st_mode) && (change_uid || change_gid)) {
> #endif

Yeah, I think that skipping the chown() if lchown() is not available
(and chown() follows symlinks) is a good idea.  I've checked-in a
change similar to the one you suggested.

I'm also going to check-in a configure check that will figure out if
chown() tries to follow a symlink (to the referent, as it should) or
if it affects a symlink.  A system where chown() works like lchown()
will therefore be unaffected by these changes (i.e. it will continue
to work as expected).

..wayne..


More information about the rsync mailing list