Don't allow an empty flag name to --info & --debug.
authorWayne Davison <wayned@samba.org>
Fri, 18 Dec 2015 22:46:28 +0000 (14:46 -0800)
committerWayne Davison <wayned@samba.org>
Fri, 18 Dec 2015 22:46:28 +0000 (14:46 -0800)
NEWS
OLDNEWS
options.c

diff --git a/NEWS b/NEWS
index 10719884b91989a548e16d1126d1257d83da869f..740cb3407676f60bdcb70d6b0dd18534bbf5f34d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -20,9 +20,13 @@ Changes since 3.1.1:
       right.
     - Don't create an empty backup dir for a transferred file that doesn't
       exist yet.
+    - Fixed a bug where --link-dest and --xattrs could cause rsync to exit if
+      a filename had a matching dir of the same name in the alt-dest area.
     - Allow more than 32 group IDs per user in the daemon's gid=LIST config.
     - Fix the logging of %b & %c via --log-file (daemon logging was already
       correct, as was --out-format='%b/%c').
+    - Fix erroneous acceptance of --info=5 & --debug=5 (an empty flag name is
+      not valid).
 
   ENHANCEMENTS:
 
diff --git a/OLDNEWS b/OLDNEWS
index 5a33d7aea83b428f5afc55241483a38fe229f3d3..295ab2e7bab1f944067beef49aced5e374412523 100644 (file)
--- a/OLDNEWS
+++ b/OLDNEWS
@@ -3650,7 +3650,7 @@ Changes since 2.4.6:
 \f
 Partial Protocol History
        RELEASE DATE    VER.    DATE OF COMMIT* PROTOCOL
-       ?? Aug 2015     3.1.2                   31
+       ?? Dec 2015     3.1.2                   31
        22 Jun 2014     3.1.1                   31
        28 Sep 2013     3.1.0   31 Aug 2008     31
        23 Sep 2011     3.0.9                   30
index 7e93ea1e509979f666a27e013225e3468a1b0772..74239bf29cbf5058f660ea6404181dcb5cec9c59 100644 (file)
--- a/options.c
+++ b/options.c
@@ -411,16 +411,17 @@ static void parse_output_words(struct output_struct *words, short *levels,
        const char *s;
        int j, len, lev;
 
-       if (!str)
-               return;
-
-       while (*str) {
+       for ( ; str; str = s) {
                if ((s = strchr(str, ',')) != NULL)
                        len = s++ - str;
                else
                        len = strlen(str);
-               while (len && isDigit(str+len-1))
-                       len--;
+               if (!len)
+                       continue;
+               if (!isDigit(str)) {
+                       while (len && isDigit(str+len-1))
+                               len--;
+               }
                lev = isDigit(str+len) ? atoi(str+len) : 1;
                if (lev > MAX_OUT_LEVEL)
                        lev = MAX_OUT_LEVEL;
@@ -448,9 +449,6 @@ static void parse_output_words(struct output_struct *words, short *levels,
                                words[j].help, len, str);
                        exit_cleanup(RERR_SYNTAX);
                }
-               if (!s)
-                       break;
-               str = s;
        }
 }