Fixes: #6678
We don't want to allow regular users to write to secondary zones,
otherwise we'd end up with data inconsistencies.
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
return -EPERM;
}
+ if (!s->system_request && (required_mask & RGW_OP_TYPE_MODIFY) && !store->zone.is_master) {
+ ldout(s->cct, 5) << "NOTICE: modify request to a non-master zone by a non-system user, permission denied" << dendl;
+ return -EPERM;
+ }
+
return 0;
}
return -EIO;
}
+ is_master = (name == region.master_zone) || (region.master_zone.empty() && name == "default");
+
+ ldout(cct, 2) << "zone " << name << " is " << (is_master ? "" : "NOT ") << "master" << dendl;
+
return 0;
}
rgw_bucket user_uid_pool;
string name;
+ bool is_master;
RGWAccessKey system_key;
map<string, RGWZonePlacementInfo> placement_pools;
+ RGWZoneParams() : is_master(false) {}
+
static int get_pool_name(CephContext *cct, string *pool_name);
void init_name(CephContext *cct, RGWRegion& region);
int init(CephContext *cct, RGWRados *store, RGWRegion& region);