]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDCap: handle any whitespace (not just space) 1225/head
authorSage Weil <sage@inktank.com>
Wed, 12 Feb 2014 21:12:25 +0000 (13:12 -0800)
committerSage Weil <sage@inktank.com>
Wed, 12 Feb 2014 21:12:25 +0000 (13:12 -0800)
Backport: emperor, dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/OSDCap.cc
src/test/osd/osdcap.cc

index e315835f4babbe2f709a4234a8431d2ff5015ee9..383674fd7665370b2fb0108191f8c7ca26eb65c0 100644 (file)
@@ -182,7 +182,8 @@ struct OSDCapParser : qi::grammar<Iterator, OSDCap()>
     str %= quoted_string | unquoted_word;
     estr %= equoted_string | unquoted_word;
 
-    spaces = +lit(' ');
+    spaces = +(lit(' ') | lit('\n') | lit('\t'));
+
 
     // match := [pool[=]<poolname> [namespace[=]<namespace>] | auid <123>] [object_prefix <prefix>]
     pool_name %= -(spaces >> lit("pool") >> (lit('=') | spaces) >> str);
index 8fc3ddd812a1ba47df4fa2c9f211c88327a29323..a9aefd729e37154f266c805547176e6e7ad21dce 100644 (file)
@@ -60,6 +60,7 @@ const char *parse_good[] = {
   "  allow pool foo rwx; allow pool bar r  ",
   "  allow     pool foo rwx; allow pool bar r  ",
   " allow wx pool taco",
+  "\tallow\nwx\tpool \n taco\t",
   "allow r   pool    foo    object_prefix   blah   ;   allow   w   auid  5",
   "allow class-read object_prefix rbd_children, allow pool libvirt-pool-test rwx",
   "allow class-read object_prefix rbd-children, allow pool libvirt_pool_test rwx",