From d5e5bc30092eacef2d79254ba670522690cbb159 Mon Sep 17 00:00:00 2001
From: Jan Zeleny <jzeleny@redhat.com>
Date: Wed, 14 Dec 2011 07:20:11 -0500
Subject: [PATCH] Don't give memory context in confdb where not needed

---
 src/confdb/confdb.c                |   39 +++++++++++++++++++++++++++--------
 src/confdb/confdb.h                |    4 +-
 src/db/sysdb_ops.c                 |    6 ++--
 src/monitor/monitor.c              |    8 +++---
 src/monitor/monitor_sbus.c         |    2 +-
 src/providers/data_provider_fo.c   |    7 ++---
 src/providers/data_provider_opts.c |    4 +-
 src/providers/ipa/ipa_dyndns.c     |    2 +-
 src/providers/ldap/ldap_common.c   |    2 +-
 src/responder/autofs/autofssrv.c   |    4 +-
 src/responder/nss/nsssrv.c         |   10 ++++----
 src/responder/pam/pamsrv.c         |    6 ++--
 src/responder/pam/pamsrv_cmd.c     |    4 +-
 src/responder/ssh/sshsrv.c         |    2 +-
 src/responder/sudo/sudosrv.c       |    6 ++--
 src/tools/sss_sync_ops.c           |    6 ++--
 src/util/server.c                  |    8 +++---
 17 files changed, 70 insertions(+), 50 deletions(-)

diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c
index 57023f299b953a26181f30c9384bb882c4251838..480daae407ed406ad162e35922a12f28e79e0fb6 100644
--- a/src/confdb/confdb.c
+++ b/src/confdb/confdb.c
@@ -337,15 +337,22 @@ failed:
     return ret;
 }
 
-int confdb_get_int(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
+int confdb_get_int(struct confdb_ctx *cdb,
                    const char *section, const char *attribute,
                    int defval, int *result)
 {
     char **values = NULL;
     long val;
     int ret;
+    TALLOC_CTX *tmp_ctx;
 
-    ret = confdb_get_param(cdb, ctx, section, attribute, &values);
+    tmp_ctx = talloc_new(NULL);
+    if (tmp_ctx == NULL) {
+        ret = ENOMEM;
+        goto failed;
+    }
+
+    ret = confdb_get_param(cdb, tmp_ctx, section, attribute, &values);
     if (ret != EOK) {
         goto failed;
     }
@@ -379,21 +386,28 @@ int confdb_get_int(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
     return EOK;
 
 failed:
-    talloc_free(values);
+    talloc_free(tmp_ctx);
     DEBUG(1, ("Failed to read [%s] from [%s], error [%d] (%s)\n",
               attribute, section, ret, strerror(ret)));
     return ret;
 }
 
-long confdb_get_long(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
+long confdb_get_long(struct confdb_ctx *cdb,
                      const char *section, const char *attribute,
                      long defval, long *result)
 {
     char **values = NULL;
     long val;
     int ret;
+    TALLOC_CTX *tmp_ctx;
 
-    ret = confdb_get_param(cdb, ctx, section, attribute, &values);
+    tmp_ctx = talloc_new(NULL);
+    if (tmp_ctx == NULL) {
+        ret = ENOMEM;
+        goto failed;
+    }
+
+    ret = confdb_get_param(cdb, tmp_ctx, section, attribute, &values);
     if (ret != EOK) {
         goto failed;
     }
@@ -422,21 +436,28 @@ long confdb_get_long(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
     return EOK;
 
 failed:
-    talloc_free(values);
+    talloc_free(tmp_ctx);
     DEBUG(1, ("Failed to read [%s] from [%s], error [%d] (%s)\n",
               attribute, section, ret, strerror(ret)));
     return ret;
 }
 
-int confdb_get_bool(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
+int confdb_get_bool(struct confdb_ctx *cdb,
                     const char *section, const char *attribute,
                     bool defval, bool *result)
 {
     char **values = NULL;
     bool val;
     int ret;
+    TALLOC_CTX *tmp_ctx;
 
-    ret = confdb_get_param(cdb, ctx, section, attribute, &values);
+    tmp_ctx = talloc_new(NULL);
+    if (tmp_ctx == NULL) {
+        ret = ENOMEM;
+        goto failed;
+    }
+
+    ret = confdb_get_param(cdb, tmp_ctx, section, attribute, &values);
     if (ret != EOK) {
         goto failed;
     }
@@ -471,7 +492,7 @@ int confdb_get_bool(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
     return EOK;
 
 failed:
-    talloc_free(values);
+    talloc_free(tmp_ctx);
     DEBUG(1, ("Failed to read [%s] from [%s], error [%d] (%s)\n",
               attribute, section, ret, strerror(ret)));
     return ret;
diff --git a/src/confdb/confdb.h b/src/confdb/confdb.h
index 819e8ff3116248597ad7b4e752acb5258a4b8c62..18484f023bf208187015cd202b9fe3730819ca6f 100644
--- a/src/confdb/confdb.h
+++ b/src/confdb/confdb.h
@@ -343,7 +343,7 @@ int confdb_get_string(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
  * @return ERANGE - The value stored in the ConfDB was outside the range
  *                  [INT_MIN..INT_MAX]
  */
-int confdb_get_int(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
+int confdb_get_int(struct confdb_ctx *cdb,
                    const char *section, const char *attribute,
                    int defval, int *result);
 
@@ -372,7 +372,7 @@ int confdb_get_int(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
  *                  single-valued, or the value was not a boolean.
  * @return EIO - An I/O error occurred while communicating with the ConfDB
  */
-int confdb_get_bool(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
+int confdb_get_bool(struct confdb_ctx *cdb,
                     const char *section, const char *attribute,
                     bool defval, bool *result);
 
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 41070843b1ce9d65bdef95cbc03dd2c2f0cfa398..7606b8f04a080693e585eb50c15968345ab0d1e4 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -2487,7 +2487,7 @@ errno_t check_failed_login_attempts(struct confdb_ctx *cdb,
                                                 SYSDB_FAILED_LOGIN_ATTEMPTS, 0);
     last_failed_login = (time_t) ldb_msg_find_attr_as_int64(ldb_msg,
                                                     SYSDB_LAST_FAILED_LOGIN, 0);
-    ret = confdb_get_int(cdb, tmp_ctx, CONFDB_PAM_CONF_ENTRY,
+    ret = confdb_get_int(cdb, CONFDB_PAM_CONF_ENTRY,
                          CONFDB_PAM_FAILED_LOGIN_ATTEMPTS,
                          CONFDB_DEFAULT_PAM_FAILED_LOGIN_ATTEMPTS,
                          &allowed_failed_login_attempts);
@@ -2497,7 +2497,7 @@ errno_t check_failed_login_attempts(struct confdb_ctx *cdb,
         ret = EIO;
         goto done;
     }
-    ret = confdb_get_int(cdb, tmp_ctx, CONFDB_PAM_CONF_ENTRY,
+    ret = confdb_get_int(cdb, CONFDB_PAM_CONF_ENTRY,
                          CONFDB_PAM_FAILED_LOGIN_DELAY,
                          CONFDB_DEFAULT_PAM_FAILED_LOGIN_DELAY,
                          &failed_login_delay);
@@ -2612,7 +2612,7 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb,
                                             SYSDB_LAST_ONLINE_AUTH,
                                             0);
 
-    ret = confdb_get_int(cdb, tmp_ctx, CONFDB_PAM_CONF_ENTRY,
+    ret = confdb_get_int(cdb, CONFDB_PAM_CONF_ENTRY,
                          CONFDB_PAM_CRED_TIMEOUT, 0, &cred_expiration);
     if (ret != EOK) {
         DEBUG(1, ("Failed to read expiration time of offline credentials.\n"));
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index 190417c35906ebbc63c0691bec29b105a1b81f3f..07668b391e48d81266863dc9f14e8c5edfa9458e 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -781,7 +781,7 @@ int get_monitor_config(struct mt_ctx *ctx)
     int timeout_seconds;
     char *badsrv = NULL;
 
-    ret = confdb_get_int(ctx->cdb, ctx,
+    ret = confdb_get_int(ctx->cdb,
                          CONFDB_MONITOR_CONF_ENTRY,
                          CONFDB_MONITOR_SBUS_TIMEOUT,
                          10, &timeout_seconds);
@@ -932,7 +932,7 @@ static int get_service_config(struct mt_ctx *ctx, const char *name,
         }
     }
 
-    ret = confdb_get_int(ctx->cdb, svc, path,
+    ret = confdb_get_int(ctx->cdb, path,
                          CONFDB_SERVICE_TIMEOUT,
                          MONITOR_DEF_PING_TIME, &svc->ping_time);
     if (ret != EOK) {
@@ -1031,7 +1031,7 @@ static int get_provider_config(struct mt_ctx *ctx, const char *name,
         return ret;
     }
 
-    ret = confdb_get_int(ctx->cdb, svc, path,
+    ret = confdb_get_int(ctx->cdb, path,
                          CONFDB_DOMAIN_TIMEOUT,
                          MONITOR_DEF_PING_TIME, &svc->ping_time);
     if (ret != EOK) {
@@ -1819,7 +1819,7 @@ static int monitor_config_file(TALLOC_CTX *mem_ctx,
         ctx->file_ctx->mt_ctx = ctx;
     }
 
-    ret = confdb_get_bool(ctx->cdb, ctx,
+    ret = confdb_get_bool(ctx->cdb,
                           CONFDB_MONITOR_CONF_ENTRY,
                           CONFDB_MONITOR_TRY_INOTIFY,
                           true, &use_inotify);
diff --git a/src/monitor/monitor_sbus.c b/src/monitor/monitor_sbus.c
index a1c6ad33819ffd45dd0f94ff966f35c58cc7fc8e..66270a7fa7f69aeabdeffe8dfe4984e3d978465b 100644
--- a/src/monitor/monitor_sbus.c
+++ b/src/monitor/monitor_sbus.c
@@ -192,7 +192,7 @@ errno_t monitor_common_rotate_logs(struct confdb_ctx *confdb,
     }
 
     /* Get new debug level from the confdb */
-    ret = confdb_get_int(confdb, NULL, conf_path,
+    ret = confdb_get_int(confdb, conf_path,
                          CONFDB_SERVICE_DEBUG_LEVEL,
                          old_debug_level,
                          &debug_level);
diff --git a/src/providers/data_provider_fo.c b/src/providers/data_provider_fo.c
index dd73e9d97b85ec4e47b72b6b898aabe49923d6d8..81c94f3373356511297d7dd5207e2eeddbc4914f 100644
--- a/src/providers/data_provider_fo.c
+++ b/src/providers/data_provider_fo.c
@@ -67,7 +67,7 @@ static int be_fo_get_options(struct be_ctx *ctx,
 {
     errno_t ret;
 
-    ret = confdb_get_int(ctx->cdb, ctx, ctx->conf_path,
+    ret = confdb_get_int(ctx->cdb, ctx->conf_path,
                          CONFDB_DOMAIN_RESOLV_TIMEOUT,
                          FO_DEFAULT_SVC_TIMEOUT,
                          &opts->service_resolv_timeout);
@@ -102,10 +102,9 @@ int be_init_failover(struct be_ctx *ctx)
         return ENOMEM;
     }
 
-    ret = confdb_get_int(ctx->cdb, ctx, ctx->conf_path,
+    ret = confdb_get_int(ctx->cdb, ctx->conf_path,
                          CONFDB_DOMAIN_RESOLV_OP_TIMEOUT,
-                         RESOLV_DEFAULT_TIMEOUT,
-                         &resolv_timeout);
+                         RESOLV_DEFAULT_TIMEOUT, &resolv_timeout);
     if (ret != EOK) {
         return ret;
     }
diff --git a/src/providers/data_provider_opts.c b/src/providers/data_provider_opts.c
index 3fdbb055c74243273ea7f8ffa6f0ed792ce57ac1..94849991cfffaf7db9de6f15903988ae22e1ab8f 100644
--- a/src/providers/data_provider_opts.c
+++ b/src/providers/data_provider_opts.c
@@ -85,7 +85,7 @@ int dp_get_options(TALLOC_CTX *memctx,
             break;
 
         case DP_OPT_NUMBER:
-            ret = confdb_get_int(cdb, opts, conf_path,
+            ret = confdb_get_int(cdb, conf_path,
                                  opts[i].opt_name,
                                  opts[i].def_val.number,
                                  &opts[i].val.number);
@@ -99,7 +99,7 @@ int dp_get_options(TALLOC_CTX *memctx,
             break;
 
         case DP_OPT_BOOL:
-            ret = confdb_get_bool(cdb, opts, conf_path,
+            ret = confdb_get_bool(cdb, conf_path,
                                   opts[i].opt_name,
                                   opts[i].def_val.boolean,
                                   &opts[i].val.boolean);
diff --git a/src/providers/ipa/ipa_dyndns.c b/src/providers/ipa/ipa_dyndns.c
index 0d2c34e66f6c367fd6f9dce34c84ca35e42f656f..1e4d97ed8c956037d3dbe2a0171e5d63cd4582c0 100644
--- a/src/providers/ipa/ipa_dyndns.c
+++ b/src/providers/ipa/ipa_dyndns.c
@@ -144,7 +144,7 @@ errno_t ipa_dyndns_init(struct be_ctx *be_ctx,
     errno_t ret;
     int resolv_timeout;
 
-    ret = confdb_get_int(be_ctx->cdb, be_ctx, be_ctx->conf_path,
+    ret = confdb_get_int(be_ctx->cdb, be_ctx->conf_path,
                          CONFDB_DOMAIN_RESOLV_TIMEOUT,
                          RESOLV_DEFAULT_TIMEOUT, &resolv_timeout);
     if (ret != EOK) {
diff --git a/src/providers/ldap/ldap_common.c b/src/providers/ldap/ldap_common.c
index 4f78313bcd172b5caff98bbc1a4189f01300856d..cec3989d005455d77ff4691d0ef3c07476f360ba 100644
--- a/src/providers/ldap/ldap_common.c
+++ b/src/providers/ldap/ldap_common.c
@@ -376,7 +376,7 @@ int ldap_get_options(TALLOC_CTX *memctx,
     }
 
     /* account_cache_expiration must be >= than offline_credentials_expiration */
-    ret = confdb_get_int(cdb, memctx, CONFDB_PAM_CONF_ENTRY,
+    ret = confdb_get_int(cdb, CONFDB_PAM_CONF_ENTRY,
                          CONFDB_PAM_CRED_TIMEOUT, 0,
                          &offline_credentials_expiration);
     if (ret != EOK) {
diff --git a/src/responder/autofs/autofssrv.c b/src/responder/autofs/autofssrv.c
index 76d270704282069f4128ba15221962b1036e3146..096cce9d26a5c641e97f58327eb7a6a22e8f48da 100644
--- a/src/responder/autofs/autofssrv.c
+++ b/src/responder/autofs/autofssrv.c
@@ -62,7 +62,7 @@ autofs_get_config(struct autofs_ctx *actx,
 {
     errno_t ret;
 
-    ret = confdb_get_int(cdb, actx, CONFDB_AUTOFS_CONF_ENTRY,
+    ret = confdb_get_int(cdb, CONFDB_AUTOFS_CONF_ENTRY,
                          CONFDB_AUTOFS_MAP_NEG_TIMEOUT, 15,
                          &actx->neg_timeout);
     if (ret != EOK) {
@@ -142,7 +142,7 @@ autofs_process_init(TALLOC_CTX *mem_ctx,
     autofs_ctx->rctx->pvt_ctx = autofs_ctx;
 
     /* Enable automatic reconnection to the Data Provider */
-    ret = confdb_get_int(autofs_ctx->rctx->cdb, autofs_ctx->rctx,
+    ret = confdb_get_int(autofs_ctx->rctx->cdb,
                          CONFDB_AUTOFS_CONF_ENTRY,
                          CONFDB_SERVICE_RECON_RETRIES,
                          3, &max_retries);
diff --git a/src/responder/nss/nsssrv.c b/src/responder/nss/nsssrv.c
index ef66b22fbf20cb1b7e4bedd0193fd4803abd2ebf..90b07b401556a6ef93d9e060cefd1dc629726090 100644
--- a/src/responder/nss/nsssrv.c
+++ b/src/responder/nss/nsssrv.c
@@ -135,22 +135,22 @@ static int nss_get_config(struct nss_ctx *nctx,
 {
     int ret;
 
-    ret = confdb_get_int(cdb, nctx, CONFDB_NSS_CONF_ENTRY,
+    ret = confdb_get_int(cdb, CONFDB_NSS_CONF_ENTRY,
                          CONFDB_NSS_ENUM_CACHE_TIMEOUT, 120,
                          &nctx->enum_cache_timeout);
     if (ret != EOK) goto done;
 
-    ret = confdb_get_int(cdb, nctx, CONFDB_NSS_CONF_ENTRY,
+    ret = confdb_get_int(cdb, CONFDB_NSS_CONF_ENTRY,
                          CONFDB_NSS_ENTRY_NEG_TIMEOUT, 15,
                          &nctx->neg_timeout);
     if (ret != EOK) goto done;
 
-    ret = confdb_get_bool(cdb, nctx, CONFDB_NSS_CONF_ENTRY,
+    ret = confdb_get_bool(cdb, CONFDB_NSS_CONF_ENTRY,
                          CONFDB_NSS_FILTER_USERS_IN_GROUPS, true,
                          &nctx->filter_users_in_groups);
     if (ret != EOK) goto done;
 
-    ret = confdb_get_int(cdb, nctx, CONFDB_NSS_CONF_ENTRY,
+    ret = confdb_get_int(cdb, CONFDB_NSS_CONF_ENTRY,
                          CONFDB_NSS_ENTRY_CACHE_NOWAIT_PERCENTAGE, 50,
                          &nctx->cache_refresh_percent);
     if (ret != EOK) goto done;
@@ -288,7 +288,7 @@ int nss_process_init(TALLOC_CTX *mem_ctx,
     }
 
     /* Enable automatic reconnection to the Data Provider */
-    ret = confdb_get_int(nctx->rctx->cdb, nctx->rctx,
+    ret = confdb_get_int(nctx->rctx->cdb,
                          CONFDB_NSS_CONF_ENTRY,
                          CONFDB_SERVICE_RECON_RETRIES,
                          3, &max_retries);
diff --git a/src/responder/pam/pamsrv.c b/src/responder/pam/pamsrv.c
index 6cb564a7a2793de2cf76f2aef8c83ef3dfdec75d..18db4da3362e8ef3ace885f6641bca0f0b5d1afd 100644
--- a/src/responder/pam/pamsrv.c
+++ b/src/responder/pam/pamsrv.c
@@ -139,7 +139,7 @@ static int pam_process_init(TALLOC_CTX *mem_ctx,
 
     /* FIXME: "retries" is too generic, either get it from a global config
      * or specify these retries are about the sbus connections to DP */
-    ret = confdb_get_int(pctx->rctx->cdb, pctx->rctx, CONFDB_PAM_CONF_ENTRY,
+    ret = confdb_get_int(pctx->rctx->cdb, CONFDB_PAM_CONF_ENTRY,
                          CONFDB_SERVICE_RECON_RETRIES, 3, &max_retries);
     if (ret != EOK) {
         DEBUG(0, ("Failed to set up automatic reconnection\n"));
@@ -152,13 +152,13 @@ static int pam_process_init(TALLOC_CTX *mem_ctx,
     }
 
     /* Set up the negative cache */
-    ret = confdb_get_int(cdb, pctx, CONFDB_NSS_CONF_ENTRY,
+    ret = confdb_get_int(cdb, CONFDB_NSS_CONF_ENTRY,
                          CONFDB_NSS_ENTRY_NEG_TIMEOUT, 15,
                          &pctx->neg_timeout);
     if (ret != EOK) goto done;
 
     /* Set up the PAM identity timeout */
-    ret = confdb_get_int(cdb, pctx, CONFDB_PAM_CONF_ENTRY,
+    ret = confdb_get_int(cdb, CONFDB_PAM_CONF_ENTRY,
                          CONFDB_PAM_ID_TIMEOUT, 5,
                          &id_timeout);
     if (ret != EOK) goto done;
diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c
index bf51148709cf2b396802a6198e874f013d4c422c..841bbf439a3169bbcbde1d54404ebb46df30f1fc 100644
--- a/src/responder/pam/pamsrv_cmd.c
+++ b/src/responder/pam/pamsrv_cmd.c
@@ -524,7 +524,7 @@ static errno_t filter_responses(struct confdb_ctx *cdb,
         return ENOMEM;
     }
 
-    ret = confdb_get_int(cdb, tmp_ctx, CONFDB_PAM_CONF_ENTRY,
+    ret = confdb_get_int(cdb, CONFDB_PAM_CONF_ENTRY,
                          CONFDB_PAM_VERBOSITY, DEFAULT_PAM_VERBOSITY,
                          &pam_verbosity);
     if (ret != EOK) {
@@ -533,7 +533,7 @@ static errno_t filter_responses(struct confdb_ctx *cdb,
     }
 
 
-    ret = confdb_get_int(cdb, tmp_ctx, CONFDB_PAM_CONF_ENTRY,
+    ret = confdb_get_int(cdb, CONFDB_PAM_CONF_ENTRY,
                          CONFDB_PAM_PWD_EXPIRATION_WARNING,
                          DEFAULT_PAM_PWD_EXPIRATION_WARNING,
                          &pam_expiration_warning);
diff --git a/src/responder/ssh/sshsrv.c b/src/responder/ssh/sshsrv.c
index e5bb5b09c7185c986cb8583c75ce773d6105fa0f..20f44ca9c3005d3d77a266c0da6480e198964958 100644
--- a/src/responder/ssh/sshsrv.c
+++ b/src/responder/ssh/sshsrv.c
@@ -113,7 +113,7 @@ int ssh_process_init(TALLOC_CTX *mem_ctx,
     ssh_ctx->rctx->pvt_ctx = ssh_ctx;
 
     /* Enable automatic reconnection to the Data Provider */
-    ret = confdb_get_int(ssh_ctx->rctx->cdb, ssh_ctx->rctx,
+    ret = confdb_get_int(ssh_ctx->rctx->cdb,
                          CONFDB_SSH_CONF_ENTRY,
                          CONFDB_SERVICE_RECON_RETRIES,
                          3, &max_retries);
diff --git a/src/responder/sudo/sudosrv.c b/src/responder/sudo/sudosrv.c
index c8e36adc941d67454167699e3ffad85679d17a15..137bd3276f612c143536ca8044bfa1eca2af27c3 100644
--- a/src/responder/sudo/sudosrv.c
+++ b/src/responder/sudo/sudosrv.c
@@ -114,7 +114,7 @@ int sudo_process_init(TALLOC_CTX *mem_ctx,
     sudo_ctx->rctx->pvt_ctx = sudo_ctx;
 
     /* Enable automatic reconnection to the Data Provider */
-    ret = confdb_get_int(sudo_ctx->rctx->cdb, sudo_ctx->rctx,
+    ret = confdb_get_int(sudo_ctx->rctx->cdb,
                          CONFDB_SUDO_CONF_ENTRY,
                          CONFDB_SERVICE_RECON_RETRIES,
                          3, &max_retries);
@@ -132,7 +132,7 @@ int sudo_process_init(TALLOC_CTX *mem_ctx,
     /* Get responder options */
 
     /* Get cache_timeout option */
-    ret = confdb_get_int(sudo_ctx->rctx->cdb, sudo_ctx,
+    ret = confdb_get_int(sudo_ctx->rctx->cdb,
                          CONFDB_SUDO_CONF_ENTRY, CONFDB_SUDO_CACHE_TIMEOUT,
                          CONFDB_DEFAULT_SUDO_CACHE_TIMEOUT,
                          &sudo_ctx->cache_timeout);
@@ -143,7 +143,7 @@ int sudo_process_init(TALLOC_CTX *mem_ctx,
     }
 
     /* Get sudo_timed option */
-    ret = confdb_get_bool(sudo_ctx->rctx->cdb, sudo_ctx,
+    ret = confdb_get_bool(sudo_ctx->rctx->cdb,
                           CONFDB_SUDO_CONF_ENTRY, CONFDB_SUDO_TIMED,
                           CONFDB_DEFAULT_SUDO_TIMED,
                           &sudo_ctx->timed);
diff --git a/src/tools/sss_sync_ops.c b/src/tools/sss_sync_ops.c
index 79de8fc8c7487295f415f7a6ff1e68b7866beaae..380e612757524b978da3a8230d4df6eae76e1146 100644
--- a/src/tools/sss_sync_ops.c
+++ b/src/tools/sss_sync_ops.c
@@ -317,7 +317,7 @@ int userdel_defaults(TALLOC_CTX *mem_ctx,
 
     /* remove homedir on user creation? */
     if (!remove_home) {
-        ret = confdb_get_bool(confdb, mem_ctx,
+        ret = confdb_get_bool(confdb,
                              conf_path, CONFDB_LOCAL_REMOVE_HOMEDIR,
                              DFL_REMOVE_HOMEDIR, &dfl_remove_home);
         if (ret != EOK) {
@@ -408,7 +408,7 @@ int useradd_defaults(TALLOC_CTX *mem_ctx,
 
     /* create homedir on user creation? */
     if (!create_home) {
-        ret = confdb_get_bool(confdb, mem_ctx,
+        ret = confdb_get_bool(confdb,
                              conf_path, CONFDB_LOCAL_CREATE_HOMEDIR,
                              DFL_CREATE_HOMEDIR, &data->create_homedir);
         if (ret != EOK) {
@@ -420,7 +420,7 @@ int useradd_defaults(TALLOC_CTX *mem_ctx,
     DEBUG(7, ("Auto create homedir: %s\n", data->create_homedir?"True":"False"));
 
     /* umask to create homedirs */
-    ret = confdb_get_int(confdb, mem_ctx,
+    ret = confdb_get_int(confdb,
                          conf_path, CONFDB_LOCAL_UMASK,
                          DFL_UMASK, (int *) &data->umask);
     if (ret != EOK) {
diff --git a/src/util/server.c b/src/util/server.c
index 10f43fcf5f7b29ed67c6d1ab09b13804abf0883a..95b183632f46852867fb2a36c9517af12fb741d1 100644
--- a/src/util/server.c
+++ b/src/util/server.c
@@ -464,7 +464,7 @@ int server_setup(const char *name, int flags,
 
     if (debug_level == SSSDBG_UNRESOLVED) {
         /* set debug level if any in conf_entry */
-        ret = confdb_get_int(ctx->confdb_ctx, ctx, conf_entry,
+        ret = confdb_get_int(ctx->confdb_ctx, conf_entry,
                              CONFDB_SERVICE_DEBUG_LEVEL,
                              SSSDBG_DEFAULT,
                              &debug_level);
@@ -479,7 +479,7 @@ int server_setup(const char *name, int flags,
 
     /* same for debug timestamps */
     if (debug_timestamps == SSSDBG_TIMESTAMP_UNRESOLVED) {
-        ret = confdb_get_bool(ctx->confdb_ctx, ctx, conf_entry,
+        ret = confdb_get_bool(ctx->confdb_ctx, conf_entry,
                               CONFDB_SERVICE_DEBUG_TIMESTAMPS,
                               SSSDBG_TIMESTAMP_DEFAULT,
                               &dt);
@@ -494,7 +494,7 @@ int server_setup(const char *name, int flags,
 
     /* same for debug microseconds */
     if (debug_microseconds == SSSDBG_MICROSECONDS_UNRESOLVED) {
-        ret = confdb_get_bool(ctx->confdb_ctx, ctx, conf_entry,
+        ret = confdb_get_bool(ctx->confdb_ctx, conf_entry,
                               CONFDB_SERVICE_DEBUG_MICROSECONDS,
                               SSSDBG_MICROSECONDS_DEFAULT,
                               &dm);
@@ -509,7 +509,7 @@ int server_setup(const char *name, int flags,
 
     /* same for debug to file */
     dl = (debug_to_file != 0);
-    ret = confdb_get_bool(ctx->confdb_ctx, ctx, conf_entry,
+    ret = confdb_get_bool(ctx->confdb_ctx, conf_entry,
                           CONFDB_SERVICE_DEBUG_TO_FILES,
                           dl, &dl);
     if (ret != EOK) {
-- 
1.7.6.4

