Bug 13207 - rsyncd doesn't send output of failed pre-xfer exec script to client
rsyncd doesn't send output of failed pre-xfer exec script to client
Status: NEW
Product: rsync
Classification: Unclassified
Component: core
3.1.1
x64 Linux
: P5 normal
: ---
Assigned To: Wayne Davison
Rsync QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-01-09 18:41 UTC by dana
Modified: 2018-01-09 18:41 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dana 2018-01-09 18:41:17 UTC
Hello,

The rsyncd.conf documentation says:

>If the pre-xfer exec command fails, the transfer is aborted before it begins. Any output from the script on stdout (up to several KB) will be displayed to the user when aborting, but is NOT displayed if the script returns success.

However, i can't actually get it to do this. In fact, i don't get any meaningful output at all.

My pre-xfer script:

#!/bin/sh
echo $RSYNC_HOST_ADDR
return 1

My rsyncd.conf:

[testing]
path          = /home/dana
read only     = true
pre-xfer exec = /home/dana/rsync.sh

The client command and its output:

% rsync -vvvv --debug=all 172.17.66.1::testing/foo .
opening tcp connection to 172.17.66.1 port 873
sending daemon args: --server --sender -vvvve.LsfxC --debug=ALL . testing/foo  (6 args)
(Client) Protocol versions: remote=31, negotiated=31
rsync: read error: Connection reset by peer (54)
rsync error: error in socket IO (code 10) at io.c(785) [Receiver=3.1.2]
[Receiver] _exit_cleanup(code=10, file=io.c, line=785): about to call exit(10)

The rsyncd log output:

2018-01-09 12:25:45 rsyncd[7770]: connect from myhostname (172.17.66.100)
2018-01-09 12:25:45 rsyncd[7770]: rsync on testing/foo from myhostname (172.17.66.100)
2018-01-09 12:25:45 rsyncd[7770]: pre-xfer exec returned failure (256):
2018-01-09 12:25:45 rsyncd[7770]: 172.17.66.100
2018-01-09 12:25:46 rsyncd[7770]: rsync error: requested action not supported (code 4) at clientserver.c(973) [sender=3.1.1]

As you can see, i get the script output in the log — but not on the client side.

The server side is running rsync 3.1.1 on Ubuntu 16.04. I have tried launching `rsync --daemon` manually, just to make sure that systemd wasn't interfering with the I/O somehow, and it did the same thing.

The client side is running rsync 3.1.2 on macOS 10.12. I also tested 3.1.1 from the same machine as the server and again got the same result.

Am i doing something wrong? Is there some prerequisite for seeing this output? (If so, it might be helpful to mention it in the documentation.)

Thanks!