From a0b2c74647e9aafe35b14751d6607b50e2814318 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 12 Feb 2014 13:12:25 -0800 Subject: [PATCH] osd/OSDCap: handle any whitespace (not just space) Backport: emperor, dumpling Signed-off-by: Sage Weil --- src/osd/OSDCap.cc | 3 ++- src/test/osd/osdcap.cc | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/osd/OSDCap.cc b/src/osd/OSDCap.cc index e315835f4babb..383674fd76653 100644 --- a/src/osd/OSDCap.cc +++ b/src/osd/OSDCap.cc @@ -182,7 +182,8 @@ struct OSDCapParser : qi::grammar str %= quoted_string | unquoted_word; estr %= equoted_string | unquoted_word; - spaces = +lit(' '); + spaces = +(lit(' ') | lit('\n') | lit('\t')); + // match := [pool[=] [namespace[=]] | auid <123>] [object_prefix ] pool_name %= -(spaces >> lit("pool") >> (lit('=') | spaces) >> str); diff --git a/src/test/osd/osdcap.cc b/src/test/osd/osdcap.cc index 8fc3ddd812a1b..a9aefd729e371 100644 --- a/src/test/osd/osdcap.cc +++ b/src/test/osd/osdcap.cc @@ -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", -- 2.39.5