diff options
author | Wayne Davison <wayne@opencoder.net> | 2022-01-17 17:11:58 -0800 |
---|---|---|
committer | Wayne Davison <wayne@opencoder.net> | 2022-01-17 18:09:36 -0800 |
commit | d9eaffe5643328eaa465c19e34940c29ea470641 (patch) | |
tree | 97cb84c04e0f03ef381efc74f3834c52854eb2e1 /options.c | |
parent | 6197385d1f83b75f12c85b5445f00a7c94b0bf3c (diff) | |
download | rsync-d9eaffe5643328eaa465c19e34940c29ea470641.tar.gz |
Complain about --old-args with --protect-args.
Diffstat (limited to 'options.c')
-rw-r--r-- | options.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1933,10 +1933,18 @@ int parse_arguments(int *argc_p, const char ***argv_p) } if (old_style_args < 0) { - if (!am_server && (arg = getenv("RSYNC_OLD_ARGS")) != NULL && *arg) + if (!am_server && protect_args <= 0 && (arg = getenv("RSYNC_OLD_ARGS")) != NULL && *arg) { + protect_args = 0; old_style_args = atoi(arg); - else + } else old_style_args = 0; + } else if (old_style_args) { + if (protect_args > 0) { + snprintf(err_buf, sizeof err_buf, + "--protect-args conflicts with --old-args.\n"); + return 0; + } + protect_args = 0; } if (protect_args < 0) { |