From: Yehuda Sadeh Date: Fri, 30 Nov 2012 00:04:41 +0000 (-0800) Subject: rgw: treat lack of swift token as anonymous user access X-Git-Tag: v0.56~135 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bea3ecf0746e57f6ac4fb32ef3f13bd328447992;p=ceph.git 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 --- diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index ee55aed32542..3a7007b6df8b 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;