Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
}; /* RGWDeleteBucketRequest */
+static inline bool valid_s3_object_name(const string& name) {
+ if (name.size() > 1024) {
+ // Name too long
+ return false;
+ }
+ if (check_utf8(name.c_str(), name.size())) {
+ // Object names must be valid UTF-8.
+ return false;
+ }
+ return true;
+}
+
/*
put object
*/
assert(rados_ctx);
RGWOp::init(rados_ctx->store, get_state(), this);
op = this; // assign self as op: REQUIRED
+
+ if (! valid_s3_object_name(obj_name))
+ return -ERR_INVALID_OBJECT_NAME;
+
return 0;
}