summaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2009-12-30 12:02:52 -0800
committerWayne Davison <wayned@samba.org>2009-12-30 12:29:47 -0800
commit2b2a47383124f9b62834778f61d2ccb1e55f6a0d (patch)
treeccd3546c3b25302694285821531cf3f63d1723c6 /options.c
parent4c4a2962097e618480d37ffffbb2a2714a6ecbf5 (diff)
downloadrsync-2b2a47383124f9b62834778f61d2ccb1e55f6a0d.tar.gz
rsync-2b2a47383124f9b62834778f61d2ccb1e55f6a0d.tar.bz2
rsync-2b2a47383124f9b62834778f61d2ccb1e55f6a0d.zip
Add understanding of RSYNC_PROTECT_ARGS environment var.
Diffstat (limited to 'options.c')
-rw-r--r--options.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/options.c b/options.c
index fa3bdcd6..580f86f8 100644
--- a/options.c
+++ b/options.c
@@ -1780,12 +1780,17 @@ int parse_arguments(int *argc_p, const char ***argv_p)
}
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
- if (!am_server)
protect_args = 1;
- else
-#endif
+#else
protect_args = 0;
+#endif
+ }
}
if (human_readable > 1 && argc == 2 && !am_server) {