]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
rgw: RGWUser::init no longer overwrites user_id
authorCasey Bodley <cbodley@redhat.com>
Thu, 5 Oct 2017 20:39:30 +0000 (16:39 -0400)
committerCasey Bodley <cbodley@redhat.com>
Thu, 5 Oct 2017 20:44:04 +0000 (16:44 -0400)
commit4e65c9e9af86e832cb96d57d487771aa28251e7c
tree33903e97a6a6e84a8cd075131827875dc98053e7
parent58909e799bf1b0596f138a3b8ff7c73d954739b2
rgw: RGWUser::init no longer overwrites user_id

if an admin op specifies a user_id and does not find a user with that
id, but does find a user based on a later field (email, access key,
etc), RGWUser::user_id will be overwritten with the existing user's id

when this happens on 'radosgw-admin user create', RGWUser::execute_add()
will modify that existing user, instead of trying to create a new user
with the given user_id (and failing due to the conflicting email,
access key, etc)

by preserving the original user_id (when specified), this uid conflict
is detected in RGWUser::check_op() and a "user id mismatch" error is
returned

Fixes: http://tracker.ceph.com/issues/21685
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_user.cc