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:57:30 -0700
commitfcd65139135d907098a47427d8503ac6d6042f81 (patch)
tree023fb3e9c6ac940caa9015476bfd2c2035608d4d
parenta8f9d57a15ad7a69d53aa8fc6090fd1b394b616a (diff)
downloadceph-fcd65139135d907098a47427d8503ac6d6042f81.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 522dbbb7b5b..48c7b2a31df 100644
--- a/src/rgw/rgw_rados.cc
+++ b/src/rgw/rgw_rados.cc
@@ -693,14 +693,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;