summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-06-14 14:53:54 -0700
committerGreg Farnum <greg@inktank.com>2013-06-17 10:55:53 -0700
commitd582ee2438a3bd307324c5f44491f26fd6a56704 (patch)
treedc28b2d7758cc2e99d51535634b38a3a7264d51a
parentb7143c2f84daafbe2c27d5b2a2d5dc40c3a68d15 (diff)
downloadceph-d582ee2438a3bd307324c5f44491f26fd6a56704.tar.gz
rgw: escape prefix correctly when listing objects
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> Reviewed-by: Greg Farnum <greg@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;