summaryrefslogtreecommitdiff
path: root/server/responder
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-03-27 13:47:14 -0400
committerSimo Sorce <ssorce@redhat.com>2009-03-27 13:54:17 -0400
commita19c42b15aff752310a6a6bb43d0e62534e8d117 (patch)
tree8ac079648cd7438b7c43a47f9f2237aa0e180224 /server/responder
parent403c91f8fc9023a80bd009af493b3bc937564700 (diff)
downloadsssd-a19c42b15aff752310a6a6bb43d0e62534e8d117.tar.gz
sssd-a19c42b15aff752310a6a6bb43d0e62534e8d117.tar.bz2
sssd-a19c42b15aff752310a6a6bb43d0e62534e8d117.zip
Fix uninitailized pointer and cut&paste error
The structure we copy the domain pointerr on is not zero when allocated. We need to zero it ourselves or we get segfaults later on. A cut&paste error caused us to call the wrong getpw function.
Diffstat (limited to 'server/responder')
-rw-r--r--server/responder/nss/nsssrv_cmd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/responder/nss/nsssrv_cmd.c b/server/responder/nss/nsssrv_cmd.c
index 498825ea..a9378783 100644
--- a/server/responder/nss/nsssrv_cmd.c
+++ b/server/responder/nss/nsssrv_cmd.c
@@ -720,7 +720,7 @@ static void nss_cmd_getpwuid_dp_callback(uint16_t err_maj, uint32_t err_min,
}
}
- nss_cmd_getpwnam_callback(dctx, LDB_SUCCESS, dctx->res);
+ nss_cmd_getpwuid_callback(dctx, LDB_SUCCESS, dctx->res);
return;
}
@@ -861,6 +861,8 @@ static void nss_cmd_setpwent_callback(void *ptr, int status,
if (dctx->add_domain) {
pctx->doms[pctx->num].domain = dctx->domain->name;
+ } else {
+ pctx->doms[pctx->num].domain = NULL;
}
pctx->doms[pctx->num].res = talloc_steal(pctx->doms, res);
pctx->doms[pctx->num].cur = 0;
@@ -1902,6 +1904,8 @@ static void nss_cmd_setgrent_callback(void *ptr, int status,
if (dctx->add_domain) {
gctx->doms[gctx->num].domain = dctx->domain->name;
+ } else {
+ gctx->doms[gctx->num].domain = NULL;
}
gctx->doms[gctx->num].res = talloc_steal(gctx->doms, res);
gctx->doms[gctx->num].cur = 0;