From: Christophe Courtaut Date: Mon, 22 Jul 2013 13:15:38 +0000 (+0200) Subject: rgw: Allow wildcard in supported keystone roles. X-Git-Tag: v0.67.5~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9bd1ebe960aae69f6528a33809a58c13481f8df3;p=ceph.git rgw: Allow wildcard in supported keystone roles. http://tracker.ceph.com/issues/4365 fixes #4365 Signed-off-by: Christophe Courtaut (cherry picked from commit 60195581273aee259e8c83d0b471af859d928342) --- diff --git a/src/rgw/rgw_keystone.cc b/src/rgw/rgw_keystone.cc index bb5091e2d1ee5..7c74665412969 100644 --- a/src/rgw/rgw_keystone.cc +++ b/src/rgw/rgw_keystone.cc @@ -1,4 +1,5 @@ #include +#include #include "common/errno.h" #include "common/ceph_json.h" @@ -13,7 +14,7 @@ bool KeystoneToken::User::has_role(const string& r) { list::iterator iter; for (iter = roles.begin(); iter != roles.end(); ++iter) { - if (r.compare((*iter).name) == 0) { + if (fnmatch(r.c_str(), ((*iter).name.c_str()), 0) == 0) { return true; } }