summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2012-11-29 16:04:41 -0800
committerYehuda Sadeh <yehuda@inktank.com>2012-11-29 16:06:11 -0800
commitbea3ecf0746e57f6ac4fb32ef3f13bd328447992 (patch)
treef5cdcc1b3c51d6e8242df8dbbefd13cc064ac99a
parentc26dc1885d62fad4c28882b023ef62c4d195b132 (diff)
downloadceph-bea3ecf0746e57f6ac4fb32ef3f13bd328447992.tar.gz
rgw: treat lack of swift token as anonymous user access
Fixes: 3534 If a swift token hasn't been provided, set user as anonymous. Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r--src/rgw/rgw_rest_swift.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc
index ee55aed3254..3a7007b6df8 100644
--- a/src/rgw/rgw_rest_swift.cc
+++ b/src/rgw/rgw_rest_swift.cc
@@ -612,6 +612,13 @@ RGWOp *RGWHandler_ObjStore_Obj_SWIFT::op_copy()
int RGWHandler_ObjStore_SWIFT::authorize()
{
+ if (!s->os_auth_token) {
+ /* anonymous access */
+ rgw_get_anon_user(s->user);
+ s->perm_mask = RGW_PERM_FULL_CONTROL;
+ return 0;
+ }
+
bool authorized = rgw_swift->verify_swift_token(store, s);
if (!authorized)
return -EPERM;