summaryrefslogtreecommitdiffstats
path: root/server/responder/nss
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-02-28 02:22:11 -0500
committerSimo Sorce <ssorce@redhat.com>2009-02-28 02:31:34 -0500
commitfcecd2ae67c315a900c374dec2cad3401b3f8bb5 (patch)
tree6568f0c7031c197e7312c884c738f12f593873cb /server/responder/nss
parent24480f7fa3bf3f40bd9fb7c865f9e3b329bf3ed8 (diff)
downloadsssd-fcecd2ae67c315a900c374dec2cad3401b3f8bb5.tar.gz
sssd-fcecd2ae67c315a900c374dec2cad3401b3f8bb5.tar.xz
sssd-fcecd2ae67c315a900c374dec2cad3401b3f8bb5.zip
Fix confdb issues.
Avoid uninitialized memory messages in valgrind (in _btreemap_get_keys). Do not free memory we just stored in the btree (in confdb_get_domains_list). Streamline confdb_get_domains() and remove extra calls when we already have all the information handy. Do not store basedn in domain info, the base dn is always calculated out of the domain name. Remove the "provider" attribute, it was really used only to distinguish between LOCAL and other domains, directly check for LOCAL as a special case instead.
Diffstat (limited to 'server/responder/nss')
-rw-r--r--server/responder/nss/nsssrv_cmd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/responder/nss/nsssrv_cmd.c b/server/responder/nss/nsssrv_cmd.c
index 76da6e063..f14724b9e 100644
--- a/server/responder/nss/nsssrv_cmd.c
+++ b/server/responder/nss/nsssrv_cmd.c
@@ -121,7 +121,7 @@ static int nss_parse_name(struct nss_dom_ctx *dctx, const char *fullname)
return EINVAL;
}
- dctx->check_provider = info->has_provider;
+ dctx->check_provider = strcasecmp(domain, "LOCAL");
dctx->legacy = info->legacy;
dctx->domain = talloc_strdup(dctx, domain);
@@ -660,7 +660,7 @@ static int nss_cmd_getpwuid(struct cli_ctx *cctx)
dctx->cmdctx = cmdctx;
dctx->domain = talloc_strdup(dctx, domains[i]);
if (!dctx->domain) return ENOMEM;
- dctx->check_provider = info->has_provider;
+ dctx->check_provider = strcasecmp(domains[i], "LOCAL");
dctx->legacy = info->legacy;
@@ -858,7 +858,7 @@ static int nss_cmd_setpwent_ext(struct cli_ctx *cctx, bool immediate)
dctx->cmdctx = cmdctx;
dctx->domain = talloc_strdup(dctx, domains[i]);
if (!dctx->domain) return ENOMEM;
- dctx->check_provider = info->has_provider;
+ dctx->check_provider = strcasecmp(domains[i], "LOCAL");
dctx->legacy = info->legacy;
if (dctx->check_provider) {
@@ -1564,7 +1564,7 @@ static int nss_cmd_getgrgid(struct cli_ctx *cctx)
dctx->cmdctx = cmdctx;
dctx->domain = talloc_strdup(dctx, domains[i]);
if (!dctx->domain) return ENOMEM;
- dctx->check_provider = info->has_provider;
+ dctx->check_provider = strcasecmp(domains[i], "LOCAL");
dctx->legacy = info->legacy;
DEBUG(4, ("Requesting info for [%lu@%s]\n",
@@ -1760,7 +1760,7 @@ static int nss_cmd_setgrent_ext(struct cli_ctx *cctx, bool immediate)
dctx->cmdctx = cmdctx;
dctx->domain = talloc_strdup(dctx, domains[i]);
if (!dctx->domain) return ENOMEM;
- dctx->check_provider = info->has_provider;
+ dctx->check_provider = strcasecmp(domains[i], "LOCAL");
dctx->legacy = info->legacy;
if (dctx->check_provider) {