From: Orit Wasserman Date: Wed, 20 Jan 2016 16:24:38 +0000 (+0100) Subject: rgw: fix subuser rm command failure X-Git-Tag: v10.0.4~185^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F7301%2Fhead;p=ceph.git rgw: fix subuser rm command failure Fixes: 14375 Signed-off-by: Orit Wasserman --- diff --git a/src/rgw/rgw_user.cc b/src/rgw/rgw_user.cc index 81b96bb203dc..fb313d0071b4 100644 --- a/src/rgw/rgw_user.cc +++ b/src/rgw/rgw_user.cc @@ -1428,14 +1428,17 @@ int RGWSubUserPool::execute_remove(RGWUserAdminOpState& op_state, map::iterator siter; siter = subuser_map->find(subuser_str); - + if (siter == subuser_map->end()){ + set_err_msg(err_msg, "subuser not found: " + subuser_str); + return -EINVAL; + } if (!op_state.has_existing_subuser()) { set_err_msg(err_msg, "subuser not found: " + subuser_str); return -EINVAL; } // always purge all associate keys - user->keys.remove_subuser_keys(op_state, &subprocess_msg, defer_user_update); + user->keys.remove_subuser_keys(op_state, &subprocess_msg, true); // remove the subuser from the user info subuser_map->erase(siter);