rsync icon indicating copy to clipboard operation
rsync copied to clipboard

feat: insert `--` between RSH and rsync commands

Open TheoTechnicguy opened this issue 1 year ago • 1 comments

Hi there!

I ran into some minor issue whilst tinkering with rsync and a new remote shell program. I noticed that rsync does not add the now common -- indicating the end of parsable arguments to the program between the RSH flags and rsync command.

Effectively, this changes the generated command from

ssh [opts] <destination> rsync [opts] src dst

to

ssh [opts] <destination> -- rsync [opts] src dst

To the best of my knowledge, this practice is a POSIX-compatible convention, in use by virtually all applications in my daily use.

I have tested this change with the test scripts (2 tests skipped: crtimes and protected-regular) and with the current SSH implementation (OpenSSH_9.9p1, OpenSSL 3.3.2 3 Sep 2024; I can assert, however, that I have used this practice for 3+ years with OpenSSH). As such, I do not believe there to be any significant impact; nevertheless, I would be very appreciative of input about situations I did not think about. Do you know any other commonly used remote shells I should test?

Furthermore, I was unable to find contributing guidance, so please do not hesitate to indicate code formatting, commenting or other requirements I did not follow.

Cheers and many thanks for a utility I have had the pleasure of using for years (and will continue to)!


Edit: I did some digging and traced back the origin of the -- terminator.

TheoTechnicguy avatar Oct 28 '24 14:10 TheoTechnicguy

@TheoTechnicguy this is failing the hardlinks test: image

tridge avatar Aug 23 '25 07:08 tridge