From: Jason Dillaman Date: Thu, 27 Jul 2017 16:56:18 +0000 (-0400) Subject: mon: fixed regex match on RBD profile blacklist add command X-Git-Tag: v12.1.3~65^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4fb824b7e838b9a729af8e919e1e96c20442ae73;p=ceph.git mon: fixed regex match on RBD profile blacklist add command Signed-off-by: Jason Dillaman --- diff --git a/src/mon/MonCap.cc b/src/mon/MonCap.cc index f6f2b74f4ea1..5eaa6a30e2ad 100644 --- a/src/mon/MonCap.cc +++ b/src/mon/MonCap.cc @@ -279,7 +279,7 @@ void MonCapGrant::expand_profile_mon(const EntityName& name) const profile_grants.back().command_args["blacklistop"] = StringConstraint( StringConstraint::MATCH_TYPE_EQUAL, "add"); profile_grants.back().command_args["addr"] = StringConstraint( - StringConstraint::MATCH_TYPE_REGEX, "^[^/]/[0-9]*$"); + StringConstraint::MATCH_TYPE_REGEX, "^[^/]+/[0-9]+$"); } if (profile == "role-definer") { @@ -328,8 +328,8 @@ mon_rwxa_t MonCapGrant::get_allowed(CephContext *cct, break; case StringConstraint::MATCH_TYPE_REGEX: { - boost::regex pattern(p->second.value, - boost::regex::basic | boost::regex::no_except); + boost::regex pattern( + p->second.value, boost::regex::extended | boost::regex::no_except); if (pattern.empty() || !boost::regex_match(q->second, pattern)) return 0; }