From: Wayne Davison Date: Sun, 2 May 2004 16:24:36 +0000 (+0000) Subject: Craig Barratt's --checksum-seed option. X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/commitdiff_plain/648f0bac247e1709a6dbeaee1b1f2ab77e50b252 Craig Barratt's --checksum-seed option. --- diff --git a/checksum-seed.diff b/checksum-seed.diff new file mode 100644 index 0000000..6847c26 --- /dev/null +++ b/checksum-seed.diff @@ -0,0 +1,61 @@ +--- options.c 2004-04-17 10:07:23.000000000 -0700 ++++ options.c 2004-05-01 16:24:44.380672000 -0700 +@@ -290,6 +290,7 @@ + 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"); + rprintf(F," -h, --help show this help screen\n"); + #ifdef INET6 + rprintf(F," -4 prefer IPv4\n"); +@@ -386,6 +387,7 @@ + {"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 + {0, '4', POPT_ARG_VAL, &default_af_hint, AF_INET, 0, 0 }, + {0, '6', POPT_ARG_VAL, &default_af_hint, AF_INET6, 0, 0 }, +@@ -911,6 +913,11 @@ + goto oom; + 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"; +--- rsync.yo 2004-04-30 11:02:43.000000000 -0700 ++++ rsync.yo 2004-05-01 16:59:48.546313600 -0700 +@@ -348,6 +348,7 @@ + --bwlimit=KBPS limit I/O bandwidth, KBytes per second + --write-batch=PREFIX write batch fileset starting with PREFIX + --read-batch=PREFIX read batch fileset starting with PREFIX ++ --checksum-seed=NUM set block/file checksum seed + -h, --help show this help screen + + +@@ -897,6 +898,20 @@ + using the fileset whose filenames start with PREFIX. See the "BATCH + MODE" section for details. + ++dit(bf(--checksum-seed=NUM)) Set the MD4 checksum seed to the integer ++NUM. This 4 byte checksum seed is included in each block and file ++MD4 checksum calculation. By default the checksum seed is generated ++by the server and defaults to the current time(), or 32761 if ++bf(--write-batch) or bf(--read-batch) are specified. This option ++is used to set a specific checksum seed, which is useful for ++applications that want repeatable block and file checksums, or ++in the case where the user wants a more random checksum seed. ++Note that setting NUM to 0 causes rsync to use the default of time() ++for checksum seed. Note also that --write-batch and --read-batch ++set the checksum seed to 32761, so --checksum-seed=NUM needs to ++follow these options if you want to specify a different checksum ++seed in batch mode. ++ + enddit() + + manpagesection(EXCLUDE PATTERNS)