summaryrefslogtreecommitdiff
path: root/server/responder/nss/nsssrv.c
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-04-06 15:54:00 -0400
committerSimo Sorce <ssorce@redhat.com>2009-04-07 14:27:18 -0400
commit65f90758d4df5581bc94746d47a1548ed8ff738b (patch)
tree754b1c1ae79db7d74190b69f69d10405f445d111 /server/responder/nss/nsssrv.c
parent1e13ce7e631f8e5ab0de0b5d1abaa6496259a552 (diff)
downloadsssd-65f90758d4df5581bc94746d47a1548ed8ff738b.tar.gz
sssd-65f90758d4df5581bc94746d47a1548ed8ff738b.tar.bz2
sssd-65f90758d4df5581bc94746d47a1548ed8ff738b.zip
Unify name parsing and reposnder headers
Use common sss_parse_name function in all responders Simplify responder headers by combining common,cmd,dp in one header and add name parse structure as part of the common responder context.
Diffstat (limited to 'server/responder/nss/nsssrv.c')
-rw-r--r--server/responder/nss/nsssrv.c28
1 files changed, 5 insertions, 23 deletions
diff --git a/server/responder/nss/nsssrv.c b/server/responder/nss/nsssrv.c
index 4f9713b1..834c42d9 100644
--- a/server/responder/nss/nsssrv.c
+++ b/server/responder/nss/nsssrv.c
@@ -123,7 +123,7 @@ static int nss_get_config(struct nss_ctx *nctx,
struct confdb_ctx *cdb)
{
TALLOC_CTX *tmpctx;
- const char *domain, *name;
+ char *domain, *name;
const char **domains;
char **filter_list;
int ret, num, i, j;
@@ -150,8 +150,8 @@ static int nss_get_config(struct nss_ctx *nctx,
"filterUsers", &filter_list);
if (ret != EOK) goto done;
for (i = 0; filter_list[i]; i++) {
- ret = nss_parse_name(tmpctx, nctx, filter_list[i],
- &domain, &name);
+ ret = sss_parse_name(tmpctx, nctx->rctx->names,
+ filter_list[i], &domain, &name);
if (ret != EOK) {
DEBUG(1, ("Invalid name in filterUsers list: [%s] (%d)\n",
filter_list[i], ret));
@@ -192,8 +192,8 @@ static int nss_get_config(struct nss_ctx *nctx,
"filterGroups", &filter_list);
if (ret != EOK) goto done;
for (i = 0; filter_list[i]; i++) {
- ret = nss_parse_name(tmpctx, nctx, filter_list[i],
- &domain, &name);
+ ret = sss_parse_name(tmpctx, nctx->rctx->names,
+ filter_list[i], &domain, &name);
if (ret != EOK) {
DEBUG(1, ("Invalid name in filterGroups list: [%s] (%d)\n",
filter_list[i], ret));
@@ -235,22 +235,6 @@ done:
return ret;
}
-static void *nss_pcre_malloc(size_t size)
-{
- return talloc_named_const(NULL, size, "nss_pcre_malloc");
-}
-
-static void nss_pcre_free(void *ctx)
-{
- talloc_free(ctx);
-}
-
-void nss_pcre_setup(void)
-{
- pcre_malloc = nss_pcre_malloc;
- pcre_free = nss_pcre_free;
-}
-
int nss_process_init(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct confdb_ctx *cdb)
@@ -260,8 +244,6 @@ int nss_process_init(TALLOC_CTX *mem_ctx,
struct nss_ctx *nctx;
int ret;
- nss_pcre_setup();
-
nctx = talloc_zero(mem_ctx, struct nss_ctx);
if (!nctx) {
DEBUG(0, ("fatal error initializing nss_ctx\n"));