diff options
author | Sumit Bose <sbose@redhat.com> | 2013-04-16 10:48:17 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-05-02 19:33:56 +0200 |
commit | f427b36b0cecc426856ab3f77a9c684ac355659d (patch) | |
tree | affce4dbe27b9dfc3d66639b35f4a42da04db058 /src/responder/nss/nsssrv.c | |
parent | f0944fdd627bd684ff36c9670dc857ffdedc343f (diff) | |
download | sssd-f427b36b0cecc426856ab3f77a9c684ac355659d.tar.gz sssd-f427b36b0cecc426856ab3f77a9c684ac355659d.tar.bz2 sssd-f427b36b0cecc426856ab3f77a9c684ac355659d.zip |
Add idmap context to nss context
This allows the nss responder to use libsss_idmap to convert between
different SID representations.
Diffstat (limited to 'src/responder/nss/nsssrv.c')
-rw-r--r-- | src/responder/nss/nsssrv.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/responder/nss/nsssrv.c b/src/responder/nss/nsssrv.c index 709912c2..ee8fecb0 100644 --- a/src/responder/nss/nsssrv.c +++ b/src/responder/nss/nsssrv.c @@ -391,6 +391,16 @@ static void nss_dp_reconnect_init(struct sbus_connection *conn, /* nss_shutdown(rctx); */ } +static void *idmap_talloc(size_t size, void *pvt) +{ + return talloc_size(pvt, size); +} + +static void idmap_free(void *ptr, void *pvt) +{ + talloc_free(ptr); +} + int nss_process_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct confdb_ctx *cdb) @@ -401,6 +411,7 @@ int nss_process_init(TALLOC_CTX *mem_ctx, struct nss_ctx *nctx; int memcache_timeout; int ret, max_retries; + enum idmap_error_code err; int hret; int fd_limit; @@ -457,6 +468,14 @@ int nss_process_init(TALLOC_CTX *mem_ctx, nss_dp_reconnect_init, iter); } + err = sss_idmap_init(idmap_talloc, nctx, idmap_free, + &nctx->idmap_ctx); + if (err != IDMAP_SUCCESS) { + DEBUG(SSSDBG_FATAL_FAILURE, ("sss_idmap_init failed.\n")); + ret = EFAULT; + goto fail; + } + /* Create the lookup table for netgroup results */ hret = sss_hash_create(nctx, 10, &nctx->netgroups); if (hret != HASH_SUCCESS) { |