]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
radosgw: receiving unexpected error code while accessing an non-existing object by... 245/head
authorLi Wang <liwang@ubuntukylin.com>
Thu, 25 Apr 2013 15:36:56 +0000 (23:36 +0800)
committerYehuda Sadeh <yehuda@inktank.com>
Thu, 25 Apr 2013 18:36:50 +0000 (11:36 -0700)
commit303e739e5b34ad1aaedb0025ffc6da1a9e04c320
treec8f880d465aeed43f3174d1b767404b34e9668f9
parentcd7e52cc76878eed0f084f7b9a6cf7c792b716c6
radosgw: receiving unexpected error code while accessing an non-existing object by authorized not-owner user

This patch fixes a bug in radosgw swift compatibility code,
that is, if a not-owner but authorized user access a non-existing
object in a container, he wiil receive unexpected error code,
to repeat this bug, do the following steps,

1 User1 creates a container, and grants the read/write permission to user2

curl -X PUT -i -k -H "X-Auth-Token: $user1_token" $url/$container
curl -X POST -i -k -H "X-Auth-Token: $user1_token" -H "X-Container-Read:
$user2" -H "X-Container-Write: $user2" $url/$container

2 User2 queries the object 'obj' in the newly created container
by using HEAD instruction, note the container currently is empty

curl -X HEAD -i -k -H "X-Auth-Token: $user2_token" $url/$container/obj

3 The response received by user2 is '401 Authorization Required',
rather than the expected '404 Not Found', the details are as follows,

HTTP/1.1 401 Authorization Required
Date: Tue, 16 Apr 2013 01:52:49 GMT
Server: Apache/2.2.22 (Ubuntu)
Accept-Ranges: bytes
Content-Length: 12
Vary: Accept-Encoding

Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_acl.cc
src/rgw/rgw_common.cc