]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw: RGWUser::init no longer overwrites user_id 20074/head
authorCasey Bodley <cbodley@redhat.com>
Thu, 5 Oct 2017 20:39:30 +0000 (16:39 -0400)
committerNathan Cutler <ncutler@suse.com>
Tue, 23 Jan 2018 10:36:49 +0000 (11:36 +0100)
commit816397e8366a02822cac4d5c8d3575127ec77347
tree09b249ee482749b2ad8747e1b76a289d94bc3cae
parent351a689d438c60bb805e9af18fc260922e57bea9
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>
(cherry picked from commit 4e65c9e9af86e832cb96d57d487771aa28251e7c)
src/rgw/rgw_user.cc