Bug 3945 - add arbitrary error reporting (with --error, perhaps)
Summary: add arbitrary error reporting (with --error, perhaps)
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 2.6.9
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
Depends on:
Reported: 2006-07-18 17:40 UTC by moof
Modified: 2008-06-24 01:13 UTC (History)
0 users

See Also:

"deny-rsync" script (595 bytes, application/octet-stream)
2006-10-15 16:23 UTC, Matt McCutchen
no flags Details
slightly improved "deny-rsync" script (722 bytes, text/plain)
2006-10-15 16:35 UTC, Matt McCutchen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description moof 2006-07-18 17:40:31 UTC
On occasion, it's useful for a remote host to deny rsync'ing; this is trivially done with ssh keys that force a particular command to be given. However, there's no easy way to correctly signal back _why_ the error failed. So, I'm requesting something akin to

rsync --server --error "In failover mode; rsync prohibited"

where it would spew back an appropriate error code and also the given reason.
Since errcode.h doesn't have RERR_ADMINPROHIB, it might be a good thing to create it - regardless of the decision to implement the flag --error.
Comment 1 Matt McCutchen 2006-10-15 16:23:21 UTC
Created attachment 2185 [details]
"deny-rsync" script

I wrote a quick-and-dirty shell script that speaks enough of the rsync protocol to return an error message.  "deny-rsync foo" does what you propose "rsync --server --error foo" to do.
Comment 2 Matt McCutchen 2006-10-15 16:35:07 UTC
Created attachment 2186 [details]
slightly improved "deny-rsync" script

I fixed a few bloopers in the script and generalized it a bit.
Comment 3 Spammer 2007-04-28 04:27:02 UTC
Created attachment 2505
Comment 4 Matt McCutchen 2008-06-23 19:42:47 UTC
Wayne, please consider adding the "deny-rsync" script to support/ ; then this bug could be closed.
Comment 5 Wayne Davison 2008-06-24 01:13:14 UTC
The support dir now has an improved version of the deny-rsync script.  Thanks for the script and the reminder!