{ ERR_NO_SUCH_SUBUSER, {404, "NoSuchSubUser"}},
{ ERR_NO_SUCH_ENTITY, {404, "NoSuchEntity"}},
{ ERR_NO_SUCH_CORS_CONFIGURATION, {404, "NoSuchCORSConfiguration"}},
- { ERR_NO_SUCH_OBJECT_LOCK_CONFIGURATION, {404, "NoSuchObjectLockConfiguration"}},
+ { ERR_NO_SUCH_OBJECT_LOCK_CONFIGURATION, {404, "ObjectLockConfigurationNotFoundError"}},
{ ERR_METHOD_NOT_ALLOWED, {405, "MethodNotAllowed" }},
{ ETIMEDOUT, {408, "RequestTimeout" }},
{ EEXIST, {409, "BucketAlreadyExists" }},
#define RGW_ATTR_OBJECT_LOCK RGW_ATTR_PREFIX "object-lock"
#define RGW_ATTR_OBJECT_RETENTION RGW_ATTR_PREFIX "object-retention"
#define RGW_ATTR_OBJECT_LEGAL_HOLD RGW_ATTR_PREFIX "object-legal-hold"
-#define RGW_ATTR_OBJECT_LOCK_MODE RGW_ATTR_PREFIX "object-lock-mode"
-#define RGW_ATTR_OBJECT_LOCK_UNTIL_DATE RGW_ATTR_PREFIX "object-lock-until-date"
#define RGW_ATTR_PG_VER RGW_ATTR_PREFIX "pg_ver"
#define ERR_MFA_REQUIRED 2044
#define ERR_NO_SUCH_CORS_CONFIGURATION 2045
#define ERR_NO_SUCH_OBJECT_LOCK_CONFIGURATION 2046
-#define ERR_INVALID_BUCKET_STATE 2047
#define ERR_USER_SUSPENDED 2100
#define ERR_INTERNAL_ERROR 2200
#define ERR_NOT_IMPLEMENTED 2201
ldpp_dout(this,0) << "Error caught buffer::error couldn't decode TagSet " << dendl;
}
dump_header(s, RGW_AMZ_TAG_COUNT, obj_tags.count());
- } else if (iter->first.compare(RGW_ATTR_OBJECT_LOCK_MODE) == 0 && get_retention) {
- dump_header(s, "x-amz-object-lock-mode", iter->second.to_str());
- } else if (iter->first.compare(RGW_ATTR_OBJECT_LOCK_UNTIL_DATE) == 0 && get_retention) {
- real_time lock_until_date;
- decode(lock_until_date, iter->second);
- dump_time_header(s, "x-amz-object-lock-retain-until-date", lock_until_date);
+ } else if (iter->first.compare(RGW_ATTR_OBJECT_RETENTION) == 0 && get_retention){
+ RGWObjectRetention retention;
+ decode(retention, iter->second);
+ dump_header(s, "x-amz-object-lock-mode", retention.get_mode());
+ dump_time_header(s, "x-amz-object-lock-retain-until-date", retention.get_retain_until_date());
}
}
}
}
auto iter = s->info.x_meta_map.find("x-amz-bucket-object-lock-enabled");
if (iter != s->info.x_meta_map.end()) {
- if ((iter->second.compare("true") != 0 && (iter->second.compare("false") != 0))) {
+ if (!boost::algorithm::iequals(iter->second, "true") && !boost::algorithm::iequals(iter->second, "false")) {
return -EINVAL;
}
- obj_lock_enabled = iter->second.compare("true") == 0;
+ obj_lock_enabled = boost::algorithm::iequals(iter->second, "true");
}
return 0;
}