]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Allow wildcard in supported keystone roles. 455/head 562/head
authorChristophe Courtaut <christophe.courtaut@gmail.com>
Mon, 22 Jul 2013 13:15:38 +0000 (15:15 +0200)
committerChristophe Courtaut <christophe.courtaut@gmail.com>
Tue, 3 Sep 2013 09:31:47 +0000 (11:31 +0200)
http://tracker.ceph.com/issues/4365 fixes #4365

Signed-off-by: Christophe Courtaut <christophe.courtaut@gmail.com>
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;
       }
   }