mirror of
https://github.com/ceph/ceph
synced 2025-01-02 00:52:22 +00:00
OSDCap: remove grants added during failed parsing
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>
This commit is contained in:
parent
0ee6a951dd
commit
42a63f34cc
@ -206,6 +206,9 @@ bool OSDCap::parse(const string& str, ostream *err)
|
||||
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";
|
||||
|
Loading…
Reference in New Issue
Block a user