do {
list<rgw_bi_log_entry> entries;
ret = store->list_objects(bucket, max_entries - count, prefix, delim,
- marker, result, common_prefixes, true, ns,
- &truncated, NULL);
+ marker, result, common_prefixes, true,
+ ns, false, &truncated, NULL);
if (ret < 0) {
cerr << "ERROR: store->list_objects(): " << cpp_strerror(-ret) << std::endl;
return -ret;
if (delete_children) {
ret = store->list_objects(bucket, max, prefix, delim, marker,
objs, common_prefixes,
- false, ns, (bool *)false, NULL);
+ false, ns, true, NULL, NULL);
if (ret < 0)
return ret;
objs.clear();
ret = store->list_objects(bucket, max, prefix, delim, marker, objs, common_prefixes,
- false, ns, (bool *)false, NULL);
+ false, ns, true, NULL, NULL);
if (ret < 0)
return ret;
}
do {
vector<RGWObjEnt> result;
int r = store->list_objects(bucket, max, prefix, delim, marker,
- result, common_prefixes, false, ns,
+ result, common_prefixes, false,
+ ns, true,
&is_truncated, NULL);
if (r < 0) {
/** Store basic data on an object */
struct RGWObjEnt {
std::string name;
+ std::string ns;
std::string owner;
std::string owner_display_name;
uint64_t size;
void RGWObjEnt::dump(Formatter *f) const
{
encode_json("name", name, f);
+ encode_json("namespace", ns, f);
encode_json("owner", owner, f);
encode_json("owner_display_name", owner_display_name, f);
encode_json("size", size, f);
#define MAX_LIST_OBJS 100
int r = store->list_objects(bucket, MAX_LIST_OBJS, obj_prefix, delim, marker,
objs, common_prefixes,
- true, no_ns, &is_truncated, NULL);
+ true, no_ns, true, &is_truncated, NULL);
if (r < 0)
return r;
return;
ret = store->list_objects(s->bucket, max, prefix, delimiter, marker, objs, common_prefixes,
- !!(s->prot_flags & RGW_REST_SWIFT), no_ns, &is_truncated, NULL);
+ !!(s->prot_flags & RGW_REST_SWIFT), no_ns, true, &is_truncated, NULL);
}
int RGWGetBucketLogging::verify_permission()
}
marker_meta = marker.get_meta();
ret = store->list_objects(s->bucket, max_uploads, prefix, delimiter, marker_meta, objs, common_prefixes,
- !!(s->prot_flags & RGW_REST_SWIFT), mp_ns, &is_truncated, &mp_filter);
+ !!(s->prot_flags & RGW_REST_SWIFT), mp_ns, true, &is_truncated, &mp_filter);
if (!objs.empty()) {
vector<RGWObjEnt>::iterator iter;
RGWMultipartUploadEntry entry;
*/
int RGWRados::list_objects(rgw_bucket& bucket, int max, string& prefix, string& delim,
string& marker, vector<RGWObjEnt>& result, map<string, bool>& common_prefixes,
- bool get_content_type, string& ns, bool *is_truncated, RGWAccessListFilter *filter)
+ bool get_content_type, string& ns, bool enforce_ns,
+ bool *is_truncated, RGWAccessListFilter *filter)
{
int count = 0;
bool truncated;
string obj = eiter->first;
string key = obj;
- if (!rgw_obj::translate_raw_obj_to_obj_in_ns(obj, ns)) {
+ bool check_ns = rgw_obj::translate_raw_obj_to_obj_in_ns(obj, ns);
+
+ if (enforce_ns && !check_ns) {
if (!ns.empty()) {
/* we've iterated past the namespace we're searching -- done now */
truncated = false;
RGWObjEnt ent = eiter->second;
ent.name = obj;
+ ent.ns = ns;
result.push_back(ent);
count++;
}
*/
virtual int list_objects(rgw_bucket& bucket, int max, std::string& prefix, std::string& delim,
std::string& marker, std::vector<RGWObjEnt>& result, map<string, bool>& common_prefixes,
- bool get_content_type, string& ns, bool *is_truncated, RGWAccessListFilter *filter);
+ bool get_content_type, string& ns, bool enforce_ns, bool *is_truncated, RGWAccessListFilter *filter);
virtual int create_pool(rgw_bucket& bucket);