X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/221ddb945658d0a77b19242bfb93b55e9f86b4aa..5b36173d11398362d867d5a7fc50d5f9207f5396:/options.c diff --git a/options.c b/options.c index e11d20ea..69eac5c7 100644 --- a/options.c +++ b/options.c @@ -83,6 +83,7 @@ int safe_symlinks = 0; int copy_unsafe_links = 0; int size_only = 0; int bwlimit = 0; +size_t bwlimit_writemax = 0; int delete_after = 0; int only_existing = 0; int opt_ignore_existing = 0; @@ -514,26 +515,30 @@ int parse_arguments(int *argc, const char ***argv, int frommain) break; case OPT_EXCLUDE: + if (am_server || sanitize_paths) + return 0; /* Impossible... */ add_exclude(&exclude_list, poptGetOptArg(pc), 0); break; case OPT_INCLUDE: + if (am_server || sanitize_paths) + return 0; /* Impossible... */ add_exclude(&exclude_list, poptGetOptArg(pc), XFLG_DEF_INCLUDE); break; case OPT_EXCLUDE_FROM: + if (am_server || sanitize_paths) + return 0; /* Impossible... */ arg = poptGetOptArg(pc); - if (sanitize_paths) - arg = alloc_sanitize_path(arg, curr_dir); add_exclude_file(&exclude_list, arg, XFLG_FATAL_ERRORS); break; case OPT_INCLUDE_FROM: + if (am_server || sanitize_paths) + return 0; /* Impossible... */ arg = poptGetOptArg(pc); - if (sanitize_paths) - arg = alloc_sanitize_path(arg, curr_dir); add_exclude_file(&exclude_list, arg, XFLG_FATAL_ERRORS | XFLG_DEF_INCLUDE); break; @@ -724,6 +729,12 @@ int parse_arguments(int *argc, const char ***argv, int frommain) if (do_progress && !verbose) verbose = 1; + if (bwlimit) { + bwlimit_writemax = (size_t)bwlimit * 128; + if (bwlimit_writemax < 512) + bwlimit_writemax = 512; + } + if (files_from) { char *colon; if (*argc != 2 && !(am_server && am_sender && *argc == 1)) {