Skip to content

Commit f1a65d0

Browse files
authored
Merge pull request ceph#61244 from awojno-bloomberg/fix-bucket-sync-status
rgw: fix radosgw-admin use after free in bucket sync status Reviewed-By: Adam Emerson <[email protected]> Reviewed-By: Oguzhan Ozmen <[email protected]>
2 parents 4f27a0f + ffaf5cb commit f1a65d0

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/rgw/radosgw-admin/radosgw-admin.cc

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2543,19 +2543,19 @@ static void sync_status(Formatter *formatter)
25432543

25442544
struct indented {
25452545
int w; // indent width
2546-
std::string_view header;
2547-
indented(int w, std::string_view header = "") : w(w), header(header) {}
2546+
std::string header;
2547+
indented(int w, std::string header = "") : w(w), header(header) {}
25482548
};
25492549
std::ostream& operator<<(std::ostream& out, const indented& h) {
25502550
return out << std::setw(h.w) << h.header << std::setw(1) << ' ';
25512551
}
25522552

25532553
struct bucket_source_sync_info {
25542554
const RGWZone& _source;
2555-
std::string_view error;
2555+
std::string error;
25562556
std::map<int,std::string> shards_behind;
25572557
int total_shards;
2558-
std::string_view status;
2558+
std::string status;
25592559
rgw_bucket bucket_source;
25602560

25612561
bucket_source_sync_info(const RGWZone& source): _source(source) {}
@@ -3075,14 +3075,12 @@ static int bucket_sync_status(rgw::sal::Driver* driver, const RGWBucketInfo& inf
30753075
}
30763076
if (pipe.source.zone.value_or(rgw_zone_id()) == z->second.id) {
30773077
bucket_source_sync_info source_sync_info(z->second);
3078-
auto ret = bucket_source_sync_status(dpp(), static_cast<rgw::sal::RadosStore*>(driver), static_cast<rgw::sal::RadosStore*>(driver)->svc()->zone->get_zone(), z->second,
3078+
bucket_source_sync_status(dpp(), static_cast<rgw::sal::RadosStore*>(driver), static_cast<rgw::sal::RadosStore*>(driver)->svc()->zone->get_zone(), z->second,
30793079
c->second,
30803080
info, pipe,
30813081
source_sync_info);
30823082

3083-
if (ret == 0) {
3084-
bucket_sync_info.source_status_info.emplace_back(std::move(source_sync_info));
3085-
}
3083+
bucket_sync_info.source_status_info.emplace_back(std::move(source_sync_info));
30863084
}
30873085
}
30883086
}

0 commit comments

Comments
 (0)