OPTION(rgw_max_slo_entries, OPT_INT, 1000) // default number of max entries in slo
OPTION(rgw_olh_pending_timeout_sec, OPT_INT, 3600) // time until we retire a pending olh change
-OPTION(rgw_user_max_buckets, OPT_U32, 1000) // global option to set max buckets count for all user
+OPTION(rgw_user_max_buckets, OPT_INT, 1000) // global option to set max buckets count for all user
OPTION(rgw_objexp_gc_interval, OPT_U32, 60 * 10) // maximum time between round of expired objects garbage collecting
OPTION(rgw_objexp_time_step, OPT_U32, 4096) // number of seconds for rounding the timestamps
int remove_bad = false;
int check_head_obj_locator = false;
int max_buckets = -1;
+ bool max_buckets_specified = false;
map<string, bool> categories;
string caps;
int check_objects = false;
cerr << "ERROR: failed to parse max buckets: " << err << std::endl;
return EINVAL;
}
+ max_buckets_specified = true;
} else if (ceph_argparse_witharg(args, i, &val, "--max-entries", (char*)NULL)) {
max_entries = (int)strict_strtol(val.c_str(), 10, &err);
if (!err.empty()) {
if (gen_secret_key)
user_op.set_gen_secret(); // assume that a key pair should be created
- if (max_buckets >= 0)
+ if (max_buckets_specified)
user_op.set_max_buckets(max_buckets);
if (system_specified)
map<string, RGWAccessKey> swift_keys;
map<string, RGWSubUser> subusers;
__u8 suspended;
- uint32_t max_buckets;
+ int32_t max_buckets;
uint32_t op_mask;
RGWUserCaps caps;
__u8 system;
<< dendl;
return -EACCES;
}
+ if (s->user->max_buckets < 0) {
+ return -EPERM;
+ }
if (s->user->max_buckets) {
RGWUserBuckets buckets;
bool system;
bool exclusive;
- uint32_t max_buckets;
- uint32_t default_max_buckets = s->cct->_conf->rgw_user_max_buckets;
+ int32_t max_buckets;
+ int32_t default_max_buckets = s->cct->_conf->rgw_user_max_buckets;
RGWUserAdminOpState op_state;
RESTArgs::get_string(s, "user-caps", caps, &caps);
RESTArgs::get_bool(s, "generate-key", true, &gen_key);
RESTArgs::get_bool(s, "suspended", false, &suspended);
- RESTArgs::get_uint32(s, "max-buckets", default_max_buckets, &max_buckets);
+ RESTArgs::get_int32(s, "max-buckets", default_max_buckets, &max_buckets);
RESTArgs::get_bool(s, "system", false, &system);
RESTArgs::get_bool(s, "exclusive", false, &exclusive);
bool suspended;
bool system;
- uint32_t max_buckets;
+ int32_t max_buckets;
RGWUserAdminOpState op_state;
RESTArgs::get_string(s, "user-caps", caps, &caps);
RESTArgs::get_bool(s, "generate-key", false, &gen_key);
RESTArgs::get_bool(s, "suspended", false, &suspended);
- RESTArgs::get_uint32(s, "max-buckets", RGW_DEFAULT_MAX_BUCKETS, &max_buckets);
+ RESTArgs::get_int32(s, "max-buckets", RGW_DEFAULT_MAX_BUCKETS, &max_buckets);
RESTArgs::get_string(s, "key-type", key_type_str, &key_type_str);
RESTArgs::get_bool(s, "system", false, &system);
rgw_user user_id;
std::string user_email;
std::string display_name;
- uint32_t max_buckets;
+ int32_t max_buckets;
__u8 suspended;
__u8 system;
__u8 exclusive;
info = user_info;
}
- void set_max_buckets(uint32_t mb) {
+ void set_max_buckets(int32_t mb) {
max_buckets = mb;
max_buckets_specified = true;
}
__u8 get_suspension_status() { return suspended; }
int32_t get_key_type() {return key_type; }
uint32_t get_subuser_perm() { return perm_mask; }
- uint32_t get_max_buckets() { return max_buckets; }
+ int32_t get_max_buckets() { return max_buckets; }
uint32_t get_op_mask() { return op_mask; }
RGWQuotaInfo& get_bucket_quota() { return bucket_quota; }
RGWQuotaInfo& get_user_quota() { return user_quota; }