Project

General

Profile

Bug #21679

rgw: swift api allows "/" in bucket names

Added by Abhishek Lekshmanan over 6 years ago. Updated over 6 years ago.

Status:
Fix Under Review
Priority:
Normal
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

currently a misconfigured keystone url (with an ending "/") will lead to buckets created being prepended with a "/" which later becomes unusable as bucket instances do not have these while bucket names do, and subsequent ops on the buckets would fail

$keystone endpoint list
+----------------------------------+-----------+---------------------------------+---------------------------+---------------------------------+----------------------------------+
|                id                |   region  |            publicurl            |        internalurl        |             adminurl            |            service_id            |
+----------------------------------+-----------+---------------------------------+---------------------------+---------------------------------+----------------------------------+
| 6f9217e5c2fb44a8b904098d242bf247 | regionOne | http://localhost:8000/swift/v1/ | http://localhost:8000/v1/ | http://localhost:8000/swift/v1/ | 1f4bc3d123794c848bf83c345ae7c7a1 |

$ swift post foobar
$ swift list 
/foobar
$ s3 list
/foobar
$ swift upload foobar somefile 
404

History

#1 Updated by Abhishek Lekshmanan over 6 years ago

  • Description updated (diff)

#2 Updated by Abhishek Lekshmanan over 6 years ago

while creating bucket instance, we replace a "/" by ":" in `rgw_bucket_instance_key_to_oid` in rgw_bucket.cc as this distinguishes tenanted users, and this would mean that the bucket would no longer be accessible as the bucket instance when converting back ignores the first ":", easiest way out would be to enforce no slash rule in swift containers as well, which is done in https://github.com/ceph/ceph/pull/13992

#3 Updated by Yehuda Sadeh over 6 years ago

  • Assignee set to Abhishek Lekshmanan

#5 Updated by Abhishek Lekshmanan over 6 years ago

  • Status changed from New to Fix Under Review

Also available in: Atom PDF