]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw/pubsub: do init/validation in init_processing()
authorCasey Bodley <cbodley@redhat.com>
Sat, 9 Mar 2024 16:08:17 +0000 (11:08 -0500)
committerCasey Bodley <cbodley@redhat.com>
Fri, 12 Apr 2024 19:34:30 +0000 (15:34 -0400)
commit4e5dd9c8e54c22bb6fa0a97456f00258e8ac24f5
tree6715abbb70eea7670a2670e7cbb376fef5693d07
parent6c0c2c4026666c31f3cbda95cf23b5519d2ac557
rgw/pubsub: do init/validation in init_processing()

verify_permission() should do permission checks and nothing else!

admin/system users ignore errors from verify_permission() and go on to
call execute() regardless. that means that execute() can't rely on any
initialization that happened during verify_permission(), at risk of
crashing on admin/system requests. it also means that any permission
checks in execute() won't get overridden for admin/system users,
breaking their superuser access

by moving all parameter validation and initialization into
init_processing(), we can prepare all the state that verify_permission()
will need to do it's thing

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 88a35fed3507e37ad191995b014cbd5b089280d0)
src/rgw/rgw_rest_pubsub.cc