try {
RGWXMLDecoder::decode_xml("Tagging", tagging, &parser);
} catch (RGWXMLDecoder::err& err) {
- ldout(s->cct, 5) << "Malformed tagging request: " << err << dendl;
+ ldpp_dout(this, 5) << "Malformed tagging request: " << err << dendl;
return -ERR_MALFORMED_XML;
}
char* buf = data.c_str();
bool success = parser.parse(buf, data.length(), 1);
- ldout(s->cct, 20) << "create bucket input data=" << buf << dendl;
+ ldpp_dout(this, 20) << "create bucket input data=" << buf << dendl;
if (!success) {
ldpp_dout(this, 0) << "failed to parse input: " << buf << dendl;
try {
RGWXMLDecoder::decode_xml("Tagging", tagging, &parser);
} catch (RGWXMLDecoder::err& err) {
- ldout(s->cct, 5) << "Malformed tagging request: " << err << dendl;
+ ldpp_dout(this, 5) << "Malformed tagging request: " << err << dendl;
return -EINVAL;
}
return 0;
}
-static int verify_mfa(RGWRados *store, RGWUserInfo *user, const string& mfa_str, bool *verified)
+static int verify_mfa(RGWRados *store, RGWUserInfo *user, const string& mfa_str, bool *verified, const DoutPrefixProvider *dpp)
{
vector<string> params;
get_str_vec(mfa_str, " ", params);
if (params.size() != 2) {
- ldout(store->ctx(), 5) << "NOTICE: invalid mfa string provided: " << mfa_str << dendl;
+ ldpp_dout(dpp, 5) << "NOTICE: invalid mfa string provided: " << mfa_str << dendl;
return -EINVAL;
}
auto i = user->mfa_ids.find(serial);
if (i == user->mfa_ids.end()) {
- ldout(store->ctx(), 5) << "NOTICE: user does not have mfa device with serial=" << serial << dendl;
+ ldpp_dout(dpp, 5) << "NOTICE: user does not have mfa device with serial=" << serial << dendl;
return -EACCES;
}
int ret = store->check_mfa(user->user_id, serial, pin);
if (ret < 0) {
- ldout(store->ctx(), 20) << "NOTICE: failed to check MFA, serial=" << serial << dendl;
+ ldpp_dout(dpp, 20) << "NOTICE: failed to check MFA, serial=" << serial << dendl;
return -EACCES;
}
const char *mfa = s->info.env->get("HTTP_X_AMZ_MFA");
if (mfa) {
- ret = verify_mfa(store, s->user, string(mfa), &s->mfa_verified);
+ ret = verify_mfa(store, s->user, string(mfa), &s->mfa_verified, s);
}
return 0;
s->init_state.src_bucket,
s->src_object);
if (!ret) {
- ldout(s->cct, 0) << "failed to parse copy location" << dendl;
+ ldpp_dout(s, 0) << "failed to parse copy location" << dendl;
return -EINVAL; // XXX why not -ERR_INVALID_BUCKET_NAME or -ERR_BAD_URL?
}
}
}
}
- ldout(s->cct, 20) << __func__ << " handler=" << typeid(*handler).name()
+ ldpp_dout(s, 20) << __func__ << " handler=" << typeid(*handler).name()
<< dendl;
return handler;
}
int RGWHandler_REST_S3Website::retarget(RGWOp* op, RGWOp** new_op) {
*new_op = op;
- ldout(s->cct, 10) << __func__ << " Starting retarget" << dendl;
+ ldpp_dout(s, 10) << __func__ << " Starting retarget" << dendl;
if (!(s->prot_flags & RGW_REST_WEBSITE))
return 0;
rgw_obj_key new_obj;
s->bucket_info.website_conf.get_effective_key(s->object.name, &new_obj.name, web_dir());
- ldout(s->cct, 10) << "retarget get_effective_key " << s->object << " -> "
+ ldpp_dout(s, 10) << "retarget get_effective_key " << s->object << " -> "
<< new_obj << dendl;
RGWBWRoutingRule rrule;
// APply a custom HTTP response code
if (redirect_code > 0)
s->err.http_ret = redirect_code; // Apply a custom HTTP response code
- ldout(s->cct, 10) << "retarget redirect code=" << redirect_code
+ ldpp_dout(s, 10) << "retarget redirect code=" << redirect_code
<< " proto+host:" << protocol << "://" << hostname
<< " -> " << s->redirect << dendl;
return -ERR_WEBSITE_REDIRECT;
ret = init_permissions(getop.get());
if (ret < 0) {
- ldout(s->cct, 20) << "serve_errordoc failed, init_permissions ret=" << ret << dendl;
+ ldpp_dout(s, 20) << "serve_errordoc failed, init_permissions ret=" << ret << dendl;
return -1; // Trigger double error handler
}
ret = read_permissions(getop.get());
if (ret < 0) {
- ldout(s->cct, 20) << "serve_errordoc failed, read_permissions ret=" << ret << dendl;
+ ldpp_dout(s, 20) << "serve_errordoc failed, read_permissions ret=" << ret << dendl;
return -1; // Trigger double error handler
}
ret = getop->init_processing();
if (ret < 0) {
- ldout(s->cct, 20) << "serve_errordoc failed, init_processing ret=" << ret << dendl;
+ ldpp_dout(s, 20) << "serve_errordoc failed, init_processing ret=" << ret << dendl;
return -1; // Trigger double error handler
}
ret = getop->verify_op_mask();
if (ret < 0) {
- ldout(s->cct, 20) << "serve_errordoc failed, verify_op_mask ret=" << ret << dendl;
+ ldpp_dout(s, 20) << "serve_errordoc failed, verify_op_mask ret=" << ret << dendl;
return -1; // Trigger double error handler
}
ret = getop->verify_permission();
if (ret < 0) {
- ldout(s->cct, 20) << "serve_errordoc failed, verify_permission ret=" << ret << dendl;
+ ldpp_dout(s, 20) << "serve_errordoc failed, verify_permission ret=" << ret << dendl;
return -1; // Trigger double error handler
}
ret = getop->verify_params();
if (ret < 0) {
- ldout(s->cct, 20) << "serve_errordoc failed, verify_params ret=" << ret << dendl;
+ ldpp_dout(s, 20) << "serve_errordoc failed, verify_params ret=" << ret << dendl;
return -1; // Trigger double error handler
}
if (r != rgw_http_s3_errors.end()) {
http_error_code = r->second.first;
}
- ldout(s->cct, 10) << "RGWHandler_REST_S3Website::error_handler err_no=" << err_no << " http_ret=" << http_error_code << dendl;
+ ldpp_dout(s, 10) << "RGWHandler_REST_S3Website::error_handler err_no=" << err_no << " http_ret=" << http_error_code << dendl;
RGWBWRoutingRule rrule;
bool should_redirect =
// Apply a custom HTTP response code
if (redirect_code > 0)
s->err.http_ret = redirect_code; // Apply a custom HTTP response code
- ldout(s->cct, 10) << "error handler redirect code=" << redirect_code
+ ldpp_dout(s, 10) << "error handler redirect code=" << redirect_code
<< " proto+host:" << protocol << "://" << hostname
<< " -> " << s->redirect << dendl;
return -ERR_WEBSITE_REDIRECT;
err_no = new_err_no;
}
} else {
- ldout(s->cct, 20) << "No special error handling today!" << dendl;
+ ldpp_dout(s, 20) << "No special error handling today!" << dendl;
}
return err_no;
get_v4_canonical_headers(s->info, signed_hdrs, using_qs);
if (canonical_headers) {
using sanitize = rgw::crypt_sanitize::log_content;
- ldout(s->cct, 10) << "canonical headers format = "
+ ldpp_dout(s, 10) << "canonical headers format = "
<< sanitize{*canonical_headers} << dendl;
} else {
throw -EPERM;
* Version 4 requests. It provides a hash of the request payload. If
* there is no payload, you must provide the hash of an empty string. */
if (!is_v4_payload_streamed(exp_payload_hash)) {
- ldout(s->cct, 10) << "delaying v4 auth" << dendl;
+ ldpp_dout(s, 10) << "delaying v4 auth" << dendl;
/* payload in a single chunk */
switch (s->op_type)
utime_t header_time;
if (! rgw_create_s3_canonical_header(s->info, &header_time, string_to_sign,
qsr)) {
- ldout(cct, 10) << "failed to create the canonized auth header\n"
+ ldpp_dout(s, 10) << "failed to create the canonized auth header\n"
<< rgw::crypt_sanitize::auth{s,string_to_sign} << dendl;
throw -EPERM;
}
- ldout(cct, 10) << "string_to_sign:\n"
+ ldpp_dout(s, 10) << "string_to_sign:\n"
<< rgw::crypt_sanitize::auth{s,string_to_sign} << dendl;
if (!qsr && !is_time_skew_ok(header_time)) {
AWSBrowserUploadAbstractor::get_auth_data(const req_state* const s) const
{
if (s->auth.s3_postobj_creds.x_amz_algorithm == AWS4_HMAC_SHA256_STR) {
- ldout(s->cct, 0) << "Signature verification algorithm AWS v4"
+ ldpp_dout(s, 0) << "Signature verification algorithm AWS v4"
<< " (AWS4-HMAC-SHA256)" << dendl;
return get_auth_data_v4(s);
} else {
- ldout(s->cct, 0) << "Signature verification algorithm AWS v2" << dendl;
+ ldpp_dout(s, 0) << "Signature verification algorithm AWS v2" << dendl;
return get_auth_data_v2(s);
}
}
}
int
-rgw::auth::s3::STSEngine::get_session_token(const boost::string_view& session_token,
+rgw::auth::s3::STSEngine::get_session_token(const DoutPrefixProvider* dpp, const boost::string_view& session_token,
STS::SessionToken& token) const
{
string decodedSessionToken = rgw::from_base64(session_token);
buffer::ptr secret(secret_s.c_str(), secret_s.length());
int ret = 0;
if (ret = cryptohandler->validate_secret(secret); ret < 0) {
- ldout(cct, 0) << "ERROR: Invalid secret key" << dendl;
+ ldpp_dout(dpp, 0) << "ERROR: Invalid secret key" << dendl;
return -EINVAL;
}
string error;
ret = keyhandler->decrypt(en_input, dec_output, &error);
if (ret < 0) {
- ldout(cct, 0) << "ERROR: Decryption failed: " << error << dendl;
+ ldpp_dout(dpp, 0) << "ERROR: Decryption failed: " << error << dendl;
return -EPERM;
} else {
dec_output.append('\0');
}
STS::SessionToken token;
- if (int ret = get_session_token(session_token, token); ret < 0) {
+ if (int ret = get_session_token(dpp, session_token, token); ret < 0) {
return result_t::reject(ret);
}
//Authentication