Add understanding of RSYNC_PROTECT_ARGS environment var.
[rsync/rsync.git] / options.c
index fa3bdcd..580f86f 100644 (file)
--- 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) {