diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2015-08-03 12:58:03 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-08-05 11:28:23 +0200 |
commit | ea7839cec593b4a7c678fab52ab864518db6699b (patch) | |
tree | 716e36963c228528264f5e491ef6e9ee92762b0d /src/responder | |
parent | 225dc6914cdc8920b02a129b98ece1ed97b99c03 (diff) | |
download | sssd-ea7839cec593b4a7c678fab52ab864518db6699b.tar.gz sssd-ea7839cec593b4a7c678fab52ab864518db6699b.tar.xz sssd-ea7839cec593b4a7c678fab52ab864518db6699b.zip |
mmap: Invalidate initgroups memory cache after any change
Initgroups memory cache was invalidated only in case on removed user.
it should be invalidated also after changes in group membership.
Resolves:
https://fedorahosted.org/sssd/ticket/2716
Reviewed-by: Michal Židek <mzidek@redhat.com>
Diffstat (limited to 'src/responder')
-rw-r--r-- | src/responder/nss/nsssrv_cmd.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c index 4505f2a99..778618e40 100644 --- a/src/responder/nss/nsssrv_cmd.c +++ b/src/responder/nss/nsssrv_cmd.c @@ -3939,14 +3939,6 @@ void nss_update_initgr_memcache(struct nss_ctx *nctx, ret, strerror(ret)); } - ret = sss_mmap_cache_initgr_invalidate(nctx->initgr_mc_ctx, - &delete_name); - if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_CRIT_FAILURE, - "Internal failure in memory cache code: %d [%s]\n", - ret, strerror(ret)); - } - /* Also invalidate his groups */ changed = true; } else { @@ -3994,6 +3986,15 @@ void nss_update_initgr_memcache(struct nss_ctx *nctx, ret, strerror(ret)); } } + + to_sized_string(&delete_name, name); + ret = sss_mmap_cache_initgr_invalidate(nctx->initgr_mc_ctx, + &delete_name); + if (ret != EOK && ret != ENOENT) { + DEBUG(SSSDBG_CRIT_FAILURE, + "Internal failure in memory cache code: %d [%s]\n", + ret, strerror(ret)); + } } done: |