Adding --chown=USER:GROUP alias for simple usecases of the
[rsync/rsync-patches.git] / remote-option.diff
index 045d314..35efdbf 100644 (file)
@@ -52,7 +52,7 @@ diff --git a/options.c b/options.c
 +                                      "Remote option must start with a dash: %s\n", arg);
 +                              return 0;
 +                      }
-+                      if (remote_option_cnt+3 > remote_option_alloc) {
++                      if (remote_option_cnt+2 >= remote_option_alloc) {
 +                              remote_option_alloc += 16;
 +                              remote_options = realloc_array(remote_options,
 +                                                      const char *, remote_option_alloc);
@@ -68,8 +68,8 @@ diff --git a/options.c b/options.c
                case OPT_WRITE_BATCH:
                        /* batch_name is already set */
                        write_batch = 1;
-@@ -1826,6 +1852,11 @@ void server_options(char **args, int *argc_p)
- #endif
+@@ -1840,6 +1866,11 @@ void server_options(char **args, int *argc_p)
        argstr[x] = '\0';
  
 +      if (x > (int)sizeof argstr) { /* Not possible... */
@@ -80,15 +80,10 @@ diff --git a/options.c b/options.c
        args[ac++] = argstr;
  
  #ifdef ICONV_OPTION
-@@ -2048,6 +2079,21 @@ void server_options(char **args, int *argc_p)
+@@ -2061,6 +2092,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 +94,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
@@ -141,7 +136,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
-@@ -1020,16 +1021,16 @@ This is a good way to backup data without using a super-user, and to store
+@@ -1026,16 +1027,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 +161,7 @@ diff --git a/rsync.yo b/rsync.yo
  
  This option is overridden by both bf(--super) and bf(--no-super).
  
-@@ -1275,6 +1276,36 @@ machine for use with the bf(--relative) option.  For instance:
+@@ -1288,6 +1289,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 +198,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
-@@ -1746,7 +1777,7 @@ option if you wish to override this.
+@@ -1764,7 +1795,7 @@ option if you wish to override this.
  Here's a example command that requests the remote side to log what is
  happening: