Commit 2b2a4738 authored by Wayne Davison's avatar Wayne Davison

Add understanding of RSYNC_PROTECT_ARGS environment var.

parent 4c4a2962
...@@ -33,16 +33,13 @@ Changes since 3.0.4: ...@@ -33,16 +33,13 @@ Changes since 3.0.4:
- Changed the way --progress overwrites its prior output in order to make - Changed the way --progress overwrites its prior output in order to make
it nearly impossible for the progress to get overwritten by an error. it nearly impossible for the progress to get overwritten by an error.
- An absolute-path filter rule (i.e. with a '/' modifier) no longer loses
its modifier when sending the filter rules to the remote rsync.
- Fixed some rare bugs in --iconv processing that might cause a multibyte - Fixed some rare bugs in --iconv processing that might cause a multibyte
character to get translated incorrectly. character to get translated incorrectly.
- Improved abnormal-exit error messages. This should help the client side - Improved the propagation of abnormal-exit error messages. This should
to receive errors from the server when it is exiting abnormally, and help the client side to receive errors from the server when it is exiting
should also avoid dying with an "connection unexpectedly closed" exit abnormally, and should also avoid dying with an "connection unexpectedly
when the closed connection is really expected. closed" exit when the closed connection is really expected.
ENHANCEMENTS: ENHANCEMENTS:
...@@ -96,6 +93,9 @@ Changes since 3.0.4: ...@@ -96,6 +93,9 @@ Changes since 3.0.4:
- Added a few more default suffixes for the "dont compress" settings. - Added a few more default suffixes for the "dont compress" settings.
- Added the checking of the RSYNC_PROTECT_ARGS environment variable to allow
the default for the --protect-args command-line option to be overridden.
- Added some Solaris xattr code. - Added some Solaris xattr code.
EXTRAS: EXTRAS:
......
...@@ -1780,12 +1780,17 @@ int parse_arguments(int *argc_p, const char ***argv_p) ...@@ -1780,12 +1780,17 @@ int parse_arguments(int *argc_p, const char ***argv_p)
} }
if (protect_args < 0) { if (protect_args < 0) {
if (am_server)
protect_args = 0;
else if ((arg = getenv("RSYNC_PROTECT_ARGS")) != NULL && *arg)
protect_args = atoi(arg) ? 1 : 0;
else {
#ifdef RSYNC_USE_PROTECTED_ARGS #ifdef RSYNC_USE_PROTECTED_ARGS
if (!am_server)
protect_args = 1; protect_args = 1;
else #else
#endif
protect_args = 0; protect_args = 0;
#endif
}
} }
if (human_readable > 1 && argc == 2 && !am_server) { if (human_readable > 1 && argc == 2 && !am_server) {
......
...@@ -1584,6 +1584,20 @@ side will also be translated ...@@ -1584,6 +1584,20 @@ side will also be translated
from the local to the remote character-set. The translation happens before from the local to the remote character-set. The translation happens before
wild-cards are expanded. See also the bf(--files-from) option. wild-cards are expanded. See also the bf(--files-from) option.
You may also control this option via the RSYNC_PROTECT_ARGS environment
variable. If this variable has a non-zero value, this option will be enabled
by default, otherwise it will be disabled by default. Either state is
overridden by a manually specified positive or negative version of this option
(note that bf(--no-s) and bf(--no-protect-args) are the negative versions).
Since this option was first introduced in 3.0.0, you'll need to make sure it's
disabled if you ever need to interact with a remote rsync that is older than
that.
Rsync can also be configured (at build time) to have this option enabled by
default (with is overridden by both the environment and the command-line).
This option will eventually become a new default setting at some
as-yet-undetermined point in the future.
dit(bf(-T, --temp-dir=DIR)) This option instructs rsync to use DIR as a dit(bf(-T, --temp-dir=DIR)) This option instructs rsync to use DIR as a
scratch directory when creating temporary copies of the files transferred scratch directory when creating temporary copies of the files transferred
on the receiving side. The default behavior is to create each temporary on the receiving side. The default behavior is to create each temporary
...@@ -3129,7 +3143,10 @@ dit(bf(CVSIGNORE)) The CVSIGNORE environment variable supplements any ...@@ -3129,7 +3143,10 @@ dit(bf(CVSIGNORE)) The CVSIGNORE environment variable supplements any
ignore patterns in .cvsignore files. See the bf(--cvs-exclude) option for ignore patterns in .cvsignore files. See the bf(--cvs-exclude) option for
more details. more details.
dit(bf(RSYNC_ICONV)) Specify a default bf(--iconv) setting using this dit(bf(RSYNC_ICONV)) Specify a default bf(--iconv) setting using this
environment variable. environment variable. (First supported in 3.0.0.)
dit(bf(RSYNC_PROTECT_ARGS)) Specify a non-zero numeric value if you want the
bf(--protect-args) option to be enabled by default, or a zero value to make
sure that it is disabled by default. (First supported in 3.1.0.)
dit(bf(RSYNC_RSH)) The RSYNC_RSH environment variable allows you to dit(bf(RSYNC_RSH)) The RSYNC_RSH environment variable allows you to
override the default shell used as the transport for rsync. Command line override the default shell used as the transport for rsync. Command line
options are permitted after the command name, just as in the bf(-e) option. options are permitted after the command name, just as in the bf(-e) option.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment