summaryrefslogtreecommitdiffstats
path: root/src/responder/nss/nsssrv_mmap_cache.h
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2012-12-19 21:17:40 -0500
committerJakub Hrozek <jhrozek@redhat.com>2012-12-20 19:55:19 +0100
commit0e6c9d03cacf24de4265ee0f902c216ba5a131c9 (patch)
treef78a96e457e363838b34fabc9deab47976a2d2d9 /src/responder/nss/nsssrv_mmap_cache.h
parent6acf7c92ab38ad388295b2d57cc97c4598aa95cc (diff)
downloadsssd-0e6c9d03cacf24de4265ee0f902c216ba5a131c9.tar.gz
sssd-0e6c9d03cacf24de4265ee0f902c216ba5a131c9.tar.xz
sssd-0e6c9d03cacf24de4265ee0f902c216ba5a131c9.zip
mmap cache: invalidate cache on fatal error
If a fatal EFAULT error is returned by the internal function that frees used memory invalidate the whole cache and reinit it. This way we avoid further corruption and insure clients see consistent data. Also insure we use the right context in init() and we use talloc_zfree() in reinit so that if the init() later fails we do not leave around a pointer to free memory in the callers.
Diffstat (limited to 'src/responder/nss/nsssrv_mmap_cache.h')
-rw-r--r--src/responder/nss/nsssrv_mmap_cache.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/responder/nss/nsssrv_mmap_cache.h b/src/responder/nss/nsssrv_mmap_cache.h
index 0da637970..25cec40cc 100644
--- a/src/responder/nss/nsssrv_mmap_cache.h
+++ b/src/responder/nss/nsssrv_mmap_cache.h
@@ -36,7 +36,7 @@ errno_t sss_mmap_cache_init(TALLOC_CTX *mem_ctx, const char *name,
enum sss_mc_type type, size_t n_elem,
time_t valid_time, struct sss_mc_ctx **mcc);
-errno_t sss_mmap_cache_pw_store(struct sss_mc_ctx *mcc,
+errno_t sss_mmap_cache_pw_store(struct sss_mc_ctx **_mcc,
struct sized_string *name,
struct sized_string *pw,
uid_t uid, gid_t gid,
@@ -44,7 +44,7 @@ errno_t sss_mmap_cache_pw_store(struct sss_mc_ctx *mcc,
struct sized_string *homedir,
struct sized_string *shell);
-errno_t sss_mmap_cache_gr_store(struct sss_mc_ctx *mcc,
+errno_t sss_mmap_cache_gr_store(struct sss_mc_ctx **_mcc,
struct sized_string *name,
struct sized_string *pw,
gid_t gid, size_t memnum,