]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw: RGWUser::init no longer overwrites user_id 18436/head
authorCasey Bodley <cbodley@redhat.com>
Thu, 5 Oct 2017 20:39:30 +0000 (16:39 -0400)
committerAbhishek Lekshmanan <abhishek@suse.com>
Fri, 20 Oct 2017 14:57:42 +0000 (16:57 +0200)
commit8b420c4627faca27f61f472597c6f67cca2efa2f
treec4800fd3f097e356398ce96674c438359c5e4757
parent5a4850c8c66b75d02fc2597e1ca744c6b0303836
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