Parsing has side effects that must be undone if it fails. A
capability string like 'allow rwx pool=bar' will add the grant for
'allow rwx' and then fail on the 'pool=bar'. Thus, the client will
effectively have 'rwx' permissions on all pools.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
if (r && iter == end)
return true;
+ // Make sure no grants are kept after parsing failed!
+ grants.clear();
+
if (err)
*err << "osdcap parse failed, stopped at '" << std::string(iter, end)
<< "' of '" << str << "'\n";