diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2015-07-16 17:00:12 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-08-05 11:28:19 +0200 |
commit | 225dc6914cdc8920b02a129b98ece1ed97b99c03 (patch) | |
tree | 39ef3e048f6460b4f70001197e25b1b8d14b4193 /src/util/mmap_cache.h | |
parent | 39b31427e2d11ca318df11fd48db33a7cc610aa7 (diff) | |
download | sssd-225dc6914cdc8920b02a129b98ece1ed97b99c03.tar.gz sssd-225dc6914cdc8920b02a129b98ece1ed97b99c03.tar.xz sssd-225dc6914cdc8920b02a129b98ece1ed97b99c03.zip |
mmap_cache: "Override" functions for initgr mmap cache
Functions sss_mc_get_strs_offset and sss_mc_get_strs_len provides
data about strings for individual memory caches (passwd, ...)
Their are used in generic responder mmap cache code to find a record
in mmap cache (sss_mc_find_record). Data provided from functions sss_mc_get_*
are used for checking the validity of record. So in case of corrupted record
the whole mmap cache can be invalidated.
Functions sss_mc_get_strs_offset and sss_mc_get_strs_len did not provide
data for initgroups mmap cache and therefore particular record could not be
invalidated.
Resolves:
https://fedorahosted.org/sssd/ticket/2716
Reviewed-by: Michal Židek <mzidek@redhat.com>
Diffstat (limited to 'src/util/mmap_cache.h')
-rw-r--r-- | src/util/mmap_cache.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util/mmap_cache.h b/src/util/mmap_cache.h index a8703d5da..b5917b3c0 100644 --- a/src/util/mmap_cache.h +++ b/src/util/mmap_cache.h @@ -79,7 +79,7 @@ typedef uint32_t rel_ptr_t; #define SSS_MC_MAJOR_VNO 1 -#define SSS_MC_MINOR_VNO 0 +#define SSS_MC_MINOR_VNO 1 #define SSS_MC_HEADER_UNINIT 0 /* after ftruncate or before reset */ #define SSS_MC_HEADER_ALIVE 1 /* current and in use */ @@ -139,6 +139,10 @@ struct sss_mc_grp_data { struct sss_mc_initgr_data { rel_ptr_t name; /* ptr to name string, rel. to struct base addr */ + rel_ptr_t strs; /* ptr to concatenation of all strings */ + uint32_t reserved; + uint32_t strs_len; /* length of strs */ + uint32_t data_len; /* all initgroups data len */ uint32_t num_groups; /* number of groups */ uint32_t gids[0]; /* array of all groups * string with name is stored after gids */ |