X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/da9d12f5d93724cb07a4107aa7aff92be9fb2ddb..59187666b904387f8531f36d804b1501772ebde9:/options.c diff --git a/options.c b/options.c index 1fe70b80..166afdb9 100644 --- a/options.c +++ b/options.c @@ -124,6 +124,7 @@ int quiet = 0; int always_checksum = 0; int list_only = 0; +#define MAX_BATCH_PREFIX_LEN 256 /* Must be less than MAXPATHLEN-13 */ char *batch_prefix = NULL; static int modify_window_set; @@ -244,7 +245,7 @@ void usage(enum logcode F) rprintf(F," --ignore-existing ignore files that already exist on receiving side\n"); rprintf(F," --delete delete files that don't exist on the sending side\n"); rprintf(F," --delete-excluded also delete excluded files on the receiving side\n"); - rprintf(F," --delete-after delete after transferring, not before\n"); + rprintf(F," --delete-after receiver deletes after transferring, not before\n"); rprintf(F," --ignore-errors delete even if there are IO errors\n"); rprintf(F," --max-delete=NUM don't delete more than NUM files\n"); rprintf(F," --partial keep partially transferred files\n"); @@ -602,6 +603,12 @@ int parse_arguments(int *argc, const char ***argv, int frommain) "write-batch and read-batch can not be used together\n"); exit_cleanup(RERR_SYNTAX); } + if (batch_prefix && strlen(batch_prefix) > MAX_BATCH_PREFIX_LEN) { + rprintf(FERROR, + "the batch_prefix string must be %d characters or less.\n", + MAX_BATCH_PREFIX_LEN); + exit_cleanup(RERR_SYNTAX); + } if (do_compression && (write_batch || read_batch)) { rprintf(FERROR, @@ -707,7 +714,7 @@ void server_options(char **args,int *argc) static char mwindow[30]; static char bw[50]; /* Leave room for ``--(write|read)-batch='' */ - static char fext[MAXPATHLEN + 15]; + static char fext[MAX_BATCH_PREFIX_LEN + 15]; int i, x;