Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luminous: rgw: zone compression type is not validated #18434

Merged
merged 1 commit into from Oct 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/rgw/rgw_admin.cc
Expand Up @@ -9,6 +9,7 @@
#include <boost/optional.hpp>

#include "auth/Crypto.h"
#include "compressor/Compressor.h"

#include "common/armor.h"
#include "common/ceph_json.h"
Expand Down Expand Up @@ -4250,6 +4251,13 @@ int main(int argc, const char **argv)
cerr << "ERROR: --placement-id not specified" << std::endl;
return EINVAL;
}
// validate compression type
if (compression_type && *compression_type != "random"
&& !Compressor::get_comp_alg_type(*compression_type)) {
std::cerr << "Unrecognized compression type" << std::endl;
return EINVAL;
}

RGWZoneParams zone(zone_id, zone_name);
int ret = zone.init(g_ceph_context, store);
if (ret < 0) {
Expand Down