diff options
author | Christophe Courtaut <christophe.courtaut@gmail.com> | 2013-07-22 15:15:38 +0200 |
---|---|---|
committer | Christophe Courtaut <christophe.courtaut@gmail.com> | 2013-09-03 11:31:47 +0200 |
commit | 60195581273aee259e8c83d0b471af859d928342 (patch) | |
tree | 093f76052c67310da7bee9db5ac586e59a3f13d5 | |
parent | 1c5e58a85ef7f26b2c617ecb6c08de5632bb0fe3 (diff) | |
download | ceph-60195581273aee259e8c83d0b471af859d928342.tar.gz |
rgw: Allow wildcard in supported keystone roles.
http://tracker.ceph.com/issues/4365 fixes #4365
Signed-off-by: Christophe Courtaut <christophe.courtaut@gmail.com>
-rw-r--r-- | src/rgw/rgw_keystone.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rgw/rgw_keystone.cc b/src/rgw/rgw_keystone.cc index bb5091e2d1e..7c746654129 100644 --- a/src/rgw/rgw_keystone.cc +++ b/src/rgw/rgw_keystone.cc @@ -1,4 +1,5 @@ #include <errno.h> +#include <fnmatch.h> #include "common/errno.h" #include "common/ceph_json.h" @@ -13,7 +14,7 @@ bool KeystoneToken::User::has_role(const string& r) { list<Role>::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; } } |