]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Allow wildcard in supported keystone roles.
authorChristophe Courtaut <christophe.courtaut@gmail.com>
Mon, 22 Jul 2013 13:15:38 +0000 (15:15 +0200)
committerSage Weil <sage@inktank.com>
Fri, 13 Dec 2013 22:44:28 +0000 (14:44 -0800)
http://tracker.ceph.com/issues/4365 fixes #4365

Signed-off-by: Christophe Courtaut <christophe.courtaut@gmail.com>
(cherry picked from commit 60195581273aee259e8c83d0b471af859d928342)

src/rgw/rgw_keystone.cc

index bb5091e2d1ee5c781e16fea62d0d6f2b6cef96e3..7c74665412969c6eed08bc060c6d0f274915053c 100644 (file)
@@ -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;
       }
   }