samba-bugs at samba.org
2014-Mar-10 22:04 UTC
[Bug 10494] New: remove-source-files fails with symlinks
https://bugzilla.samba.org/show_bug.cgi?id=10494
Summary: remove-source-files fails with symlinks
Product: rsync
Version: 3.1.0
Platform: x64
OS/Version: Linux
Status: NEW
Severity: major
Priority: P5
Component: core
AssignedTo: wayned at samba.org
ReportedBy: afried at deteque.com
QAContact: rsync-qa at samba.org
Up thru 3.0.9 transferring symlinks using "-L --remove-source-files"
properly
transferred the files and removed the symlinks.
Beginning with 3.1.0 this no longer works; the files transfer properly but the
symlinks on the source server fail to get deleted. This error message is
displayed:
ERROR: Skipping sender remove for changed file: [transferred file name]
I have not been able to find a workaround to this problem, other than
downgrading from 3.1.0 back to 3.0.9.
--
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
samba-bugs at samba.org
2015-Jul-12 20:28 UTC
[Bug 10494] remove-source-files fails with symlinks
https://bugzilla.samba.org/show_bug.cgi?id=10494
Wayne Davison <wayned at samba.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #1 from Wayne Davison <wayned at samba.org> ---
That's weird, as it means that the source symlink must differ in size or
modify
time from what rsync put into the source file list. However, since that safety
check is only really needed for regular files, I've added some code that
should
avoid this failure for symlinks and devices.
--
You are receiving this mail because:
You are the QA Contact for the bug.
samba-bugs at samba.org
2019-Mar-14 15:29 UTC
[Bug 10494] remove-source-files fails with symlinks
https://bugzilla.samba.org/show_bug.cgi?id=10494
--- Comment #2 from Adrian Torregrosa <adrian.torregrosa.ext at 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.
samba-bugs at samba.org
2019-Mar-14 16:36 UTC
[Bug 10494] remove-source-files fails with symlinks
https://bugzilla.samba.org/show_bug.cgi?id=10494
--- Comment #3 from Adrian Torregrosa <adrian.torregrosa.ext at nokia.com>
---
Another option that I tried and verified, and that could make more sense, would
be to replace
141 if (do_lstat(fname, &st) < 0) {
with
141 if (do_stat(fname, &st) < 0) {
--
You are receiving this mail because:
You are the QA Contact for the bug.
samba-bugs at samba.org
2019-Mar-16 16:20 UTC
[Bug 10494] remove-source-files fails with symlinks
https://bugzilla.samba.org/show_bug.cgi?id=10494 --- Comment #4 from Wayne Davison <wayne at opencoder.net> --- In my prior testing I apparently missed that the symlink verification issue was caused by -L (--copy-links). I have amended the change to use do_stat() when --copy-links is enabled. -- You are receiving this mail because: You are the QA Contact for the bug.
samba-bugs at samba.org
2019-Mar-20 13:18 UTC
[Bug 10494] remove-source-files fails with symlinks
https://bugzilla.samba.org/show_bug.cgi?id=10494 --- Comment #5 from Adrian Torregrosa <adrian.torregrosa.ext at nokia.com> --- I embedded the modified sender.c into 3.1.3's original source code, compiled and tested, and I found it to have solved the problem: first I tried uploading a softlink and deleting, then I tried uploading a normal file and deleting. It worked the two times. -- You are receiving this mail because: You are the QA Contact for the bug.