https://bugzilla.samba.org/show_bug.cgi?id=10494

--- Comment #2 from Adrian Torregrosa <adrian.torregrosa....@nokia.com> ---
We have found this same problem using rsync 3.1.2.

I have downloaded the source code for version 3.1.3, and found the following
lines in sender.c:

146         if (S_ISREG(file->mode) /* Symlinks & devices don't need this
check: */
147          && (st.st_size != F_LENGTH(file) || st.st_mtime != file->modtime
148 #ifdef ST_MTIME_NSEC
149          || (NSEC_BUMP(file) && (uint32)st.ST_MTIME_NSEC !=
F_MOD_NSEC(file))
150 #endif
151         )) {
152                 rprintf(FERROR_XFER, "ERROR: Skipping sender remove for
changed file: %s\n", fname);
153                 return;
154         }

I added some debugging info, compiled and tested, and found out that when
trying to retrieve symlinks the "file" pointer refers to the hard file, whereas
the "st" register refers to the symlink. Therefore "S_ISREG(file->mode)" will
be true, so will be "st.st_size != F_LENGTH(file)" and most likely "st.st_mtime
!= file->modtime" too. As a result the error gets printed and the symlink is
not deleted, as intended.

I have tried modifying the first condition and it worked as expected:
146         if (S_ISREG(st.st_mode) /* Symlinks & devices don't need this
check: */

Best regards.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to