am I missing something, or are permissions always preserved?
Dave Dykstra
dwd at drdykstra.us
Tue Dec 24 13:09:00 EST 2002
When preserve_perms is not set, rsync sets a default permission based on
the original permissions and the umask. A comment in flist.c says that is
what GNU cp does, so that's why rsync does it. Comments in generator.c
and receiver.c indicate that if a file already exists and preserve_perms
isn't set, the original permissions should be preserved.
- Dave
On Sat, Dec 21, 2002 at 12:30:55PM -0800, Ben wrote:
> They seem to be for me, even when I don't pass in the --perms flag. This
> is a problem because I'm rsyncing to a samba mount with fixed
> permissions.
>
> Looking at rsync.c (for version 2.5.5) starting at line 204, I see this
> code snippet:
>
> #ifdef HAVE_CHMOD
> if (!S_ISLNK(st->st_mode)) {
> if (st->st_mode != file->mode) {
> updated = 1;
> if (do_chmod(fname,file->mode) != 0) {
> rprintf(FERROR,"failed to set permissions on %s : %s\n",
> fname,strerror(errno));
> return 0;
> }
> }
> }
> #endif
>
> I would have expected to see a test for the setting of perserve_perms,
> but it's not there. Is this a bug or is there there a reason
> perserve_perms isn't checked?
>
> --
> To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
> Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html
More information about the rsync
mailing list