]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MonCap: handle any whitespace (not just space)
authorSage Weil <sage@inktank.com>
Wed, 12 Feb 2014 21:10:39 +0000 (13:10 -0800)
committerSage Weil <sage@inktank.com>
Wed, 12 Feb 2014 21:10:51 +0000 (13:10 -0800)
Backport: emperor, dumpling
Reported-by: Dmitry Borodaenko <dborodaenko@mirantis.com>
Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/MonCap.cc
src/test/mon/moncap.cc

index 644d614bdf94a58d9f8a456840ed58f2e41f1293..e8d3f7e8bb3fb851da966c2592d27b4f4901c91d 100644 (file)
@@ -349,7 +349,7 @@ struct MonCapParser : qi::grammar<Iterator, MonCap()>
     unquoted_word %= +char_("a-zA-Z0-9_.-");
     str %= quoted_string | unquoted_word;
 
-    spaces = +lit(' ');
+    spaces = +(lit(' ') | lit('\n') | lit('\t'));
 
     // command := command[=]cmd [k1=v1 k2=v2 ...]
     str_match = '=' >> str >> qi::attr(string());
index 238442b90d8fc7897149bf7091173e42c51b6c92..d381319fd9f49907aa03c743bb976b0a7a298b3c 100644 (file)
@@ -29,7 +29,8 @@ const char *parse_good[] = {
   " allow rwx",
   "allow rwx ",
   " allow rwx ",
-  " allow   rwx ",
+  " allow\t   rwx ",
+  "\tallow\nrwx\t",
   "allow service=foo x",
   "allow service=\"froo\" x",
   "allow profile osd",