]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: subuser creation fixes
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 19 Aug 2014 20:15:46 +0000 (13:15 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 3 Nov 2014 17:10:21 +0000 (09:10 -0800)
Fixes: #8587
There were a couple of issues, one when trying to identify whether swift
user exists, we weren't using the correct swift id. The second problem
is that we relied on the gen_access flag in the swift case, where it
doesn't really need to apply.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit 1441ffe8103f03c6b2f625f37adbb2e1cfec66bb)

src/rgw/rgw_user.cc

index 23575d8a0cb3b41afa56d771bd985f38c1c93546..55d1d6a0a7b293618eaace31d0abd9832ffd8b68 100644 (file)
@@ -666,15 +666,6 @@ bool RGWAccessKeyPool::check_existing_key(RGWUserAdminOpState& op_state)
 
   switch (key_type) {
   case KEY_TYPE_SWIFT:
-    kiter = swift_keys->find(kid);
-
-    existing_key = (kiter != swift_keys->end());
-    if (existing_key)
-      break;
-
-    if (swift_kid.empty())
-      return false;
-
     kiter = swift_keys->find(swift_kid);
 
     existing_key = (kiter != swift_keys->end());
@@ -845,7 +836,7 @@ int RGWAccessKeyPool::generate_key(RGWUserAdminOpState& op_state, std::string *e
     } while (!rgw_get_user_info_by_access_key(store, id, duplicate_check));
   }
 
-  if (key_type == KEY_TYPE_SWIFT && gen_access) {
+  if (key_type == KEY_TYPE_SWIFT) {
     id = op_state.build_default_swift_kid();
     if (id.empty()) {
       set_err_msg(err_msg, "empty swift access key");