<div dir="ltr"><div dir="ltr">On Fri, Sep 2, 2022 at 1:19 AM c.buhtz wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">  4. `--protect-args` activates the "new" behavior<br></blockquote><div><br></div><div>Essentially, just in a way that has a couple drawbacks: it would have refused to work with rsyncs older than 3.0.0, and it would have refused to work with a remote rrsync setup (since the "protected" args are sent via the protocol where rrsync can't see them to verify them).</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  5. `--old-args` and `--protect-args` are the opposite of each other?</blockquote><div><br></div><div>Yes, protecting the args prevents things like remote space splitting and such.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">My goals are<br>
  1. Use the "new" arg protection way introduced with 3.2.4<br>
  2. Scripts/applications using that "new way" should work with old and <br>
new versions of rsync without checking for the rsync version on the <br>
current system.<br></blockquote><div><br></div><div>The easiest way to do that in a script or even in a user's shell-rc files is to export 2 environment variables:</div><div><br></div><div>export RSYNC_OLD_ARGS=0</div><div>export RSYNC_PROTECT_ARGS=1</div><div><br></div><div>If rsync is 3.2.4 or newer, it will see the newer env var and continue with its new-style arg protection (since the 0 tells it you don't want --old-args to be used).  An older rsync will not even notice that variable and will instead ensure that --protect-args is enabled by default, giving it a similar style of arg protection, just one that will complain if a remote rsync is 2.6.9 (which should be pretty much gone these days) or an rrsync restricted shell.  These variables don't interfere with manual overrides on the command-line -- they just ensure the default is what you want.</div><div><br></div><div>Your suggestion of forcing on --seclude-args (aka --protect-args) via -s is also a reasonable way to go in most instances.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I'm using `-s` here because `--protect-args` will be renamed to `--secluded-args` in rsync 3.2.6.<br></blockquote><div><br></div><div>Just because --secluded-args is its new name doesn't mean that rsync stops accepting the older arg name. But -s is always easier to type.</div><div><br></div><div>..wayne..</div></div></div>