Craig Barratt's --checksum-seed option.
[rsync/rsync-patches.git] / checksum-seed.diff
1 --- options.c   2004-04-17 10:07:23.000000000 -0700
2 +++ options.c   2004-05-01 16:24:44.380672000 -0700
3 @@ -290,6 +290,7 @@
4    rprintf(F,"     --bwlimit=KBPS          limit I/O bandwidth, KBytes per second\n");
5    rprintf(F,"     --write-batch=PREFIX    write batch fileset starting with PREFIX\n");
6    rprintf(F,"     --read-batch=PREFIX     read batch fileset starting with PREFIX\n");
7 +  rprintf(F,"     --checksum-seed=NUM     set block/file checksum seed\n");
8    rprintf(F," -h, --help                  show this help screen\n");
9  #ifdef INET6
10    rprintf(F," -4                          prefer IPv4\n");
11 @@ -386,6 +387,7 @@
12    {"from0",           '0', POPT_ARG_NONE,   &eol_nulls, 0, 0, 0},
13    {"no-implied-dirs",  0,  POPT_ARG_VAL,    &implied_dirs, 0, 0, 0 },
14    {"protocol",         0,  POPT_ARG_INT,    &protocol_version, 0, 0, 0 },
15 +  {"checksum-seed",    0,  POPT_ARG_INT,    &checksum_seed, 0, 0, 0 },
16  #ifdef INET6
17    {0,                '4', POPT_ARG_VAL,    &default_af_hint, AF_INET, 0, 0 },
18    {0,                '6', POPT_ARG_VAL,    &default_af_hint, AF_INET6, 0, 0 },
19 @@ -911,6 +913,11 @@
20                         goto oom;
21                 args[ac++] = arg;
22         }
23 +       if (checksum_seed) {
24 +               if (asprintf(&arg, "--checksum_seed=%d", checksum_seed) < 0)
25 +                       goto oom;
26 +               args[ac++] = arg;
27 +       }
28  
29         if (keep_partial)
30                 args[ac++] = "--partial";
31 --- rsync.yo    2004-04-30 11:02:43.000000000 -0700
32 +++ rsync.yo    2004-05-01 16:59:48.546313600 -0700
33 @@ -348,6 +348,7 @@
34       --bwlimit=KBPS          limit I/O bandwidth, KBytes per second
35       --write-batch=PREFIX    write batch fileset starting with PREFIX
36       --read-batch=PREFIX     read batch fileset starting with PREFIX
37 +     --checksum-seed=NUM     set block/file checksum seed
38   -h, --help                  show this help screen
39  
40  
41 @@ -897,6 +898,20 @@
42  using the fileset whose filenames start with PREFIX. See the "BATCH
43  MODE" section for details.
44  
45 +dit(bf(--checksum-seed=NUM)) Set the MD4 checksum seed to the integer
46 +NUM.  This 4 byte checksum seed is included in each block and file
47 +MD4 checksum calculation.  By default the checksum seed is generated
48 +by the server and defaults to the current time(), or 32761 if
49 +bf(--write-batch) or bf(--read-batch) are specified.  This option
50 +is used to set a specific checksum seed, which is useful for
51 +applications that want repeatable block and file checksums, or
52 +in the case where the user wants a more random checksum seed.
53 +Note that setting NUM to 0 causes rsync to use the default of time()
54 +for checksum seed.  Note also that --write-batch and --read-batch
55 +set the checksum seed to 32761, so --checksum-seed=NUM needs to
56 +follow these options if you want to specify a different checksum
57 +seed in batch mode.
58 +
59  enddit()
60  
61  manpagesection(EXCLUDE PATTERNS)