summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-06-14 14:53:54 -0700
committerYehuda Sadeh <yehuda@inktank.com>2013-06-14 14:53:54 -0700
commit7c5f20e391bb34f4bc56f0ed86aee4cc3eebf368 (patch)
tree30f083d38dec1d325f9074ee4ca4adee3cd23ea7
parentbcfbd0a3ffae6947464d930f636c8b35d1331e9d (diff)
downloadceph-wip-5362.tar.gz
rgw: escape prefix correctly when listing objectswip-5362
Fixes: #5362 When listing objects prefix needs to be escaped correctly (the same as with the marker). Otherwise listing objects with prefix that starts with underscore doesn't work. Backport: bobtail, cuttlefish Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r--src/rgw/rgw_rados.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc
index b22217994ba..7a2f2d04d3b 100644
--- a/src/rgw/rgw_rados.cc
+++ b/src/rgw/rgw_rados.cc
@@ -735,14 +735,18 @@ int RGWRados::list_objects(rgw_bucket& bucket, int max, string& prefix, string&
}
result.clear();
- rgw_obj marker_obj;
+ rgw_obj marker_obj, prefix_obj;
marker_obj.set_ns(ns);
marker_obj.set_obj(marker);
string cur_marker = marker_obj.object;
+ prefix_obj.set_ns(ns);
+ prefix_obj.set_obj(prefix);
+ string cur_prefix = prefix_obj.object;
+
do {
std::map<string, RGWObjEnt> ent_map;
- int r = cls_bucket_list(bucket, cur_marker, prefix, max - count, ent_map,
+ int r = cls_bucket_list(bucket, cur_marker, cur_prefix, max - count, ent_map,
&truncated, &cur_marker);
if (r < 0)
return r;