Mention new SSH_* vars.
[rsync/rsync.git] / options.c
index 780a2b5..69eac5c 100644 (file)
--- 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;
@@ -290,6 +291,7 @@ void usage(enum logcode F)
   rprintf(F,"     --bwlimit=KBPS          limit I/O bandwidth, KBytes per second\n");
   rprintf(F,"     --write-batch=PREFIX    write batch fileset starting with PREFIX\n");
   rprintf(F,"     --read-batch=PREFIX     read batch fileset starting with PREFIX\n");
+  rprintf(F,"     --checksum-seed=NUM     set block/file checksum seed\n");
 #ifdef INET6
   rprintf(F," -4  --ipv4                  prefer IPv4\n");
   rprintf(F," -6  --ipv6                  prefer IPv6\n");
@@ -386,6 +388,7 @@ static struct poptOption long_options[] = {
   {"from0",           '0', POPT_ARG_NONE,   &eol_nulls, 0, 0, 0},
   {"no-implied-dirs",  0,  POPT_ARG_VAL,    &implied_dirs, 0, 0, 0 },
   {"protocol",         0,  POPT_ARG_INT,    &protocol_version, 0, 0, 0 },
+  {"checksum-seed",    0,  POPT_ARG_INT,    &checksum_seed, 0, 0, 0 },
 #ifdef INET6
   {"ipv4",            '4', POPT_ARG_VAL,    &default_af_hint, AF_INET, 0, 0 },
   {"ipv6",            '6', POPT_ARG_VAL,    &default_af_hint, AF_INET6, 0, 0 },
@@ -512,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;
@@ -722,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)) {
@@ -911,6 +924,12 @@ void server_options(char **args,int *argc)
                args[ac++] = arg;
        }
 
+       if (checksum_seed) {
+               if (asprintf(&arg, "--checksum-seed=%d", checksum_seed) < 0)
+                       goto oom;
+               args[ac++] = arg;
+       }
+
        if (keep_partial)
                args[ac++] = "--partial";