const char *args;
if (str_begins(line, "AUTH\t", &args)) {
- if (conn->auth->set->debug) {
- e_debug(conn->event, "client in: %s",
- auth_line_hide_pass(conn, line));
- }
+ e_debug(conn->event, "client in: %s",
+ auth_line_hide_pass(conn, line));
return auth_request_handler_auth_begin(conn->request_handler,
args);
}
if (str_begins(line, "CONT\t", &args)) {
- if (conn->auth->set->debug) {
- e_debug(conn->event, "client in: %s",
- cont_line_hide_pass(conn, line));
- }
+ e_debug(conn->event, "client in: %s",
+ cont_line_hide_pass(conn, line));
return auth_request_handler_auth_continue(conn->request_handler,
args);
}
if (str_begins(line, "CANCEL\t", &args)) {
- if (conn->auth->set->debug)
- e_debug(conn->event, "client in: %s", line);
+ e_debug(conn->event, "client in: %s", line);
return auth_client_cancel(conn, args);
}
for (i = 0; i < count; i++)
ldap_value->values[i] = p_strdup(ctx->pool, vals[i]);
- if (ctx->debug != NULL) {
- str_printfa(ctx->debug, " %s%s=", attr, suffix);
- if (count == 0)
- str_append(ctx->debug, "<no values>");
- else if (ldap_field_hide_password(ctx, attr))
- str_append(ctx->debug, PASSWORD_HIDDEN_STR);
- else {
- str_append(ctx->debug, ldap_value->values[0]);
- for (i = 1; i < count; i++) {
- str_printfa(ctx->debug, ",%s",
- ldap_value->values[0]);
- }
+ str_printfa(ctx->debug, " %s%s=", attr, suffix);
+ if (count == 0)
+ str_append(ctx->debug, "<no values>");
+ else if (ldap_field_hide_password(ctx, attr))
+ str_append(ctx->debug, PASSWORD_HIDDEN_STR);
+ else {
+ str_append(ctx->debug, ldap_value->values[0]);
+ for (i = 1; i < count; i++) {
+ str_printfa(ctx->debug, ",%s",
+ ldap_value->values[0]);
}
}
hash_table_insert(ctx->ldap_attrs,
ctx->iter_dn_values = iter_dn_values;
hash_table_create(&ctx->ldap_attrs, pool, 0, strcase_hash, strcasecmp);
ctx->var = str_new(ctx->pool, 256);
- if (event_want_debug(ctx->ldap_request->auth_request->event))
- ctx->debug = t_str_new(256);
+ ctx->debug = t_str_new(256);
ctx->ldap_msg = res;
ctx->ld = conn->ld;
ldap_value = hash_table_lookup(ctx->ldap_attrs, field_name);
if (ldap_value == NULL) {
/* requested ldap attribute wasn't returned at all */
- if (ctx->debug != NULL)
- str_printfa(ctx->debug, "; %s missing", field_name);
+ str_printfa(ctx->debug, "; %s missing", field_name);
*value_r = db_ldap_field_get_default(data);
return 1;
}
hash_table_lookup(ctx->ldap_attrs, field->ldap_attr_name);
if (ldap_value != NULL)
ldap_value->used = TRUE;
- else if (ctx->debug != NULL && *field->ldap_attr_name != '\0')
+ else if (*field->ldap_attr_name != '\0')
str_printfa(ctx->debug, "; %s missing", field->ldap_attr_name);
str_truncate(ctx->var, 0);
*_ctx = NULL;
- if (ctx->debug != NULL)
- db_ldap_result_finish_debug(ctx);
+ db_ldap_result_finish_debug(ctx);
hash_table_destroy(&ctx->ldap_attrs);
pool_unref(&ctx->pool);
}
static int auth_request_lua_log_debug(lua_State *L)
{
- if (global_auth_settings->debug) {
- struct auth_request *request = auth_lua_check_auth_request(L, 1);
- const char *msg = luaL_checkstring(L, 2);
- e_debug(authdb_event(request), "db-lua: %s", msg);
- }
+ struct auth_request *request = auth_lua_check_auth_request(L, 1);
+ const char *msg = luaL_checkstring(L, 2);
+ e_debug(authdb_event(request), "db-lua: %s", msg);
return 0;
}