X-Git-Url: http://git.samba.org/?a=blobdiff_plain;f=remote-option.diff;h=d5aea213782c18975c81cae2c8923e36d18af58c;hb=refs%2Fheads%2Fb3.0.x;hp=cc1ccc143ce08a993c58a9f74c6068bfdcab6f25;hpb=e2e42a01ba5a2258edf1510280bb83864a0c8748;p=rsync.git%2Fpatches.git diff --git a/remote-option.diff b/remote-option.diff index cc1ccc1..d5aea21 100644 --- a/remote-option.diff +++ b/remote-option.diff @@ -11,10 +11,11 @@ To use this patch, run these commands for a successful build: ./configure (optional if already run) make +based-on: 40afd365cc8ca968fd16e161d24df5b8a8a520cc diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -174,6 +174,10 @@ int link_dest = 0; +@@ -172,6 +172,10 @@ int link_dest = 0; int basis_dir_cnt = 0; char *dest_option = NULL; @@ -25,7 +26,7 @@ diff --git a/options.c b/options.c int verbose = 0; int quiet = 0; int output_motd = 1; -@@ -387,6 +391,7 @@ void usage(enum logcode F) +@@ -386,6 +390,7 @@ void usage(enum logcode F) rprintf(F," --timeout=SECONDS set I/O timeout in seconds\n"); rprintf(F," --contimeout=SECONDS set daemon connection timeout in seconds\n"); rprintf(F," -I, --ignore-times don't skip files that match in size and mod-time\n"); @@ -33,7 +34,7 @@ diff --git a/options.c b/options.c rprintf(F," --size-only skip files that match in size\n"); rprintf(F," --modify-window=NUM compare mod-times with reduced accuracy\n"); rprintf(F," -T, --temp-dir=DIR create temporary files in directory DIR\n"); -@@ -645,6 +650,7 @@ static struct poptOption long_options[] = { +@@ -644,6 +649,7 @@ static struct poptOption long_options[] = { {"password-file", 0, POPT_ARG_STRING, &password_file, 0, 0, 0 }, {"blocking-io", 0, POPT_ARG_VAL, &blocking_io, 1, 0, 0 }, {"no-blocking-io", 0, POPT_ARG_VAL, &blocking_io, 0, 0, 0 }, @@ -41,7 +42,7 @@ diff --git a/options.c b/options.c {"protocol", 0, POPT_ARG_INT, &protocol_version, 0, 0, 0 }, {"checksum-seed", 0, POPT_ARG_INT, &checksum_seed, 0, 0, 0 }, {"server", 0, POPT_ARG_NONE, 0, OPT_SERVER, 0, 0 }, -@@ -1140,6 +1146,26 @@ int parse_arguments(int *argc_p, const char ***argv_p) +@@ -1139,6 +1145,26 @@ int parse_arguments(int *argc_p, const char ***argv_p) } break; @@ -68,27 +69,10 @@ diff --git a/options.c b/options.c case OPT_WRITE_BATCH: /* batch_name is already set */ write_batch = 1; -@@ -1832,6 +1858,11 @@ void server_options(char **args, int *argc_p) - - argstr[x] = '\0'; - -+ if (x > (int)sizeof argstr) { /* Not possible... */ -+ rprintf(FERROR, "argstr overflow in server_options().\n"); -+ exit_cleanup(RERR_MALLOC); -+ } -+ - args[ac++] = argstr; - - #ifdef ICONV_OPTION -@@ -2053,6 +2084,21 @@ void server_options(char **args, int *argc_p) +@@ -2074,6 +2100,16 @@ void server_options(char **args, int *argc_p) else if (remove_source_files) args[ac++] = "--remove-sent-files"; -+ if (ac > MAX_SERVER_ARGS) { /* Not possible... */ -+ rprintf(FERROR, "argc overflow in server_options().\n"); -+ exit_cleanup(RERR_MALLOC); -+ } -+ + if (remote_option_cnt) { + int j; + if (ac + remote_option_cnt > MAX_SERVER_ARGS) { @@ -99,9 +83,9 @@ diff --git a/options.c b/options.c + args[ac++] = (char*)remote_options[j]; + } + - *argc_p = ac; - return; - + if (ac > MAX_SERVER_ARGS) { /* Not possible... */ + rprintf(FERROR, "argc overflow in server_options().\n"); + exit_cleanup(RERR_MALLOC); diff --git a/pipe.c b/pipe.c --- a/pipe.c +++ b/pipe.c @@ -133,7 +117,7 @@ diff --git a/pipe.c b/pipe.c diff --git a/rsync.yo b/rsync.yo --- a/rsync.yo +++ b/rsync.yo -@@ -412,6 +412,7 @@ to the detailed description below for a complete description. verb( +@@ -429,6 +429,7 @@ to the detailed description below for a complete description. verb( --progress show progress during transfer -P same as --partial --progress -i, --itemize-changes output a change-summary for all updates @@ -141,7 +125,7 @@ diff --git a/rsync.yo b/rsync.yo --out-format=FORMAT output updates using the specified FORMAT --log-file=FILE log what we're doing to the specified FILE --log-file-format=FMT log updates using the specified FMT -@@ -1026,16 +1027,16 @@ This is a good way to backup data without using a super-user, and to store +@@ -1103,16 +1104,16 @@ This is a good way to backup data without using a super-user, and to store ACLs from incompatible systems. The bf(--fake-super) option only affects the side where the option is used. @@ -166,7 +150,7 @@ diff --git a/rsync.yo b/rsync.yo This option is overridden by both bf(--super) and bf(--no-super). -@@ -1281,6 +1282,36 @@ machine for use with the bf(--relative) option. For instance: +@@ -1384,6 +1385,36 @@ machine for use with the bf(--relative) option. For instance: quote(tt( rsync -avR --rsync-path="cd /a/b && rsync" host:c/d /e/)) @@ -203,7 +187,7 @@ diff --git a/rsync.yo b/rsync.yo dit(bf(-C, --cvs-exclude)) This is a useful shorthand for excluding a broad range of files that you often don't want to transfer between systems. It uses a similar algorithm to CVS to determine if -@@ -1752,7 +1783,7 @@ option if you wish to override this. +@@ -1883,7 +1914,7 @@ option if you wish to override this. Here's a example command that requests the remote side to log what is happening: