samba-bugs at samba.org
2019-Sep-13 22:41 UTC
[Bug 14126] New: The atomic-rsync script can exit 0 when the operation failed.
https://bugzilla.samba.org/show_bug.cgi?id=14126
Bug ID: 14126
Summary: The atomic-rsync script can exit 0 when the operation
failed.
Product: rsync
Version: 3.1.3
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P5
Component: core
Assignee: wayne at opencoder.net
Reporter: cmb at prgmr.com
QA Contact: rsync-qa at samba.org
Created attachment 15469
--> https://bugzilla.samba.org/attachment.cgi?id=15469&action=edit
patch for the issue
The atomic-rsync script uses the call "exit $?" on a failed system()
invocation.
$? is a 16-bit wait status, and exit() expects an 8-bit integer.
The lower 16 bits are used as the exit status.
For instance, if the called program exits 1, $? is 256, with 1 in the high 8
bits.
In this situation atomic-rsync exits 0, but the operation failed.
I made a patch. Now it just exits 1 without trying to pass the child's
status.
--
You are receiving this mail because:
You are the QA Contact for the bug.
samba-bugs at samba.org
2019-Sep-17 07:35 UTC
[Bug 14126] The atomic-rsync script can exit 0 when the operation failed.
https://bugzilla.samba.org/show_bug.cgi?id=14126 --- Comment #1 from Paul Slootman <paul at debian.org> --- Why not exit with $? >> 8? -- You are receiving this mail because: You are the QA Contact for the bug.
samba-bugs at samba.org
2019-Sep-17 22:55 UTC
[Bug 14126] The atomic-rsync script can exit 0 when the operation failed.
https://bugzilla.samba.org/show_bug.cgi?id=14126 --- Comment #2 from Chris Brannon <cmb at prgmr.com> --- (In reply to Paul Slootman from comment #1) That was, in fact, my first try. exit $? >> 8 is recommended for Perl by some sources on the net. However, if the called program gets a signal, "exit $? >> 8" would cause atomic-rsync to exit 0, which is also not the right thing. There are other correct solutions to this problem, but I think the simplest and most expedient is exit 1, especially given that atomic-rsync has been exiting 0 under failure conditions. -- You are receiving this mail because: You are the QA Contact for the bug.
samba-bugs at samba.org
2020-Apr-05 23:24 UTC
[Bug 14126] The atomic-rsync script can exit 0 when the operation failed.
https://bugzilla.samba.org/show_bug.cgi?id=14126
Wayne Davison <wayne at opencoder.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #3 from Wayne Davison <wayne at opencoder.net> ---
Thanks! Fixed in git.
--
You are receiving this mail because:
You are the QA Contact for the bug.
Possibly Parallel Threads
- [Bug 13982] New: rsync calls exit() from signal handler
- [Bug 13820] New: rsync is not preserving ACLs
- [Bug 14163] New: RSYNC_SSL_PORT env should be set for invocation of --rsh command
- [Bug 14338] New: ZSTD support
- [Bug 14371] New: Combined Exclude & Protect Filter Type