Skip to content
Snippets Groups Projects
Commit 498d223e authored by Timo Sirainen's avatar Timo Sirainen
Browse files

lib-sieve: storage: ldap: Change ldap_debug_level setting type to uint

parent 07b9eec1
No related branches found
No related tags found
No related merge requests found
......@@ -706,9 +706,9 @@ static int db_ldap_set_options(struct ldap_connection *conn)
"deref", set->deref) < 0)
return -1;
#ifdef LDAP_OPT_DEBUG_LEVEL
if (str_to_int(set->debug_level, &value) >= 0 && value != 0) {
if (set->debug_level != 0) {
if (db_ldap_set_opt(conn, LDAP_OPT_DEBUG_LEVEL, &value,
"debug_level", set->debug_level) < 0)
"debug_level", dec2str(set->debug_level)) < 0)
return -1;
}
#endif
......@@ -740,7 +740,6 @@ int sieve_ldap_db_connect(struct ldap_connection *conn)
const struct sieve_ldap_settings *set = conn->lstorage->ldap_set;
struct sieve_storage *storage = &conn->lstorage->storage;
struct timeval start, end;
int debug_level;
bool debug;
#if defined(HAVE_LDAP_SASL) || defined(LDAP_HAVE_START_TLS_S)
int ret;
......@@ -749,9 +748,7 @@ int sieve_ldap_db_connect(struct ldap_connection *conn)
if (conn->conn_state != LDAP_CONN_STATE_DISCONNECTED)
return 0;
debug = FALSE;
if (str_to_int(set->debug_level, &debug_level) >= 0)
debug = debug_level > 0;
debug = set->debug_level > 0;
if (debug)
i_gettimeofday(&start);
......
......@@ -44,7 +44,7 @@ static const struct setting_define sieve_ldap_setting_defines[] = {
DEF(ENUM, scope),
DEF(STR, base),
DEF(UINT, ldap_version),
DEF(STR, debug_level),
DEF(UINT, debug_level),
DEF(STR, ldaprc_path),
SETTING_DEFINE_LIST_END
......@@ -70,7 +70,7 @@ const struct sieve_ldap_settings sieve_ldap_default_settings = {
.scope = "subtree:onelevel:base",
.base = "",
.ldap_version = 3,
.debug_level = "0",
.debug_level = 0,
.ldaprc_path = "",
};
......
......@@ -28,7 +28,7 @@ struct sieve_ldap_settings {
unsigned int ldap_version;
const char *ldaprc_path;
const char *debug_level;
unsigned int debug_level;
/* ... */
struct {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.