1
0
mirror of https://github.com/ceph/ceph synced 2025-03-11 02:39:05 +00:00

OSDCap: parse 'pool=<poolname>' in addition to 'pool <poolname>'

This was used in releases before 0.49, and was the documented way
to use it in several places, so support it again for backwards
compatibility.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
This commit is contained in:
Josh Durgin 2012-09-28 11:14:03 -07:00
parent 67ab9659fb
commit 2e1ea3f057
3 changed files with 7 additions and 4 deletions

View File

@ -145,8 +145,8 @@ struct OSDCapParser : qi::grammar<Iterator, OSDCap(), ascii::space_type>
unquoted_word %= +(alnum | '_' | '-');
str %= quoted_string | unquoted_word;
// match := [pool <poolname> | auid <123>] [object_prefix <prefix>]
pool_name %= -(lit("pool") >> str);
// match := [pool[=]<poolname> | auid <123>] [object_prefix <prefix>]
pool_name %= -(lit("pool") >> -lit("=") >> str);
object_prefix %= -(lit("object_prefix") >> str);
match = ( (lit("auid") >> int_ >> object_prefix) [_val = phoenix::construct<OSDCapMatch>(_1, _2)] |
(pool_name >> object_prefix) [_val = phoenix::construct<OSDCapMatch>(_1, _2)]);

View File

@ -13,10 +13,12 @@
* OSDCaps: Hold the capabilities associated with a single authenticated
* user key. These are specified by text strings of the form
* "allow r" (which allows reading anything on the OSD)
* "allow rwx auid foo[,bar,baz]" (which allows full access to listed auids)
* "allow rwx pool foo[,bar,baz]" (which allows full access to listed pools)
* "allow rwx auid foo" (which allows full access to listed auids)
* "allow rwx pool foo" (which allows full access to listed pools)
* "allow *" (which allows full access to EVERYTHING)
*
* The full grammar is documented in the parser in OSDCap.cc.
*
* The OSD assumes that anyone with * caps is an admin and has full
* message permissions. This means that only the monitor and the OSDs
* should get *

View File

@ -24,6 +24,7 @@ const char *parse_good[] = {
"allow r",
"allow rwx",
"allow r pool foo ",
"allow r pool=foo",
" allow wx pool taco",
"allow pool foo r",
"allow pool taco wx",