summaryrefslogtreecommitdiffstats
path: root/src/util/mmap_cache.h
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2015-07-13 10:40:06 +0200
committerJakub Hrozek <jhrozek@redhat.com>2015-08-05 12:43:42 +0200
commit5c5a094438ac6c81d99066ec58778cab23e0a939 (patch)
treee7b237907783045742b787c672bb2a2f8252992d /src/util/mmap_cache.h
parenta45f9034e912b6242459a8d576f60ff829508bc3 (diff)
downloadsssd-5c5a094438ac6c81d99066ec58778cab23e0a939.tar.gz
sssd-5c5a094438ac6c81d99066ec58778cab23e0a939.tar.xz
sssd-5c5a094438ac6c81d99066ec58778cab23e0a939.zip
NSS: Initgr memory cache should work with fq names
We need to stored two versions of name to the initgroups memory cache. Otherwise it could be stored many times if sssd is configured with case_sensitive = false. It would be impossible to invalidate all version of names after user login. As a result of this wrong user groups could be returned from initgroups memory cache. Therefore we store raw name provided by glibc function and internal sanitized fully qualified name, which is unique for particular user. This patch also increase average space for initgroups because there are also stored two quite long names in case of fq names. Resolves: https://fedorahosted.org/sssd/ticket/2712 Reviewed-by: Michal Židek <mzidek@redhat.com> (cherry picked from commit dda0258705de7255e6ec54b7f9adbde83a220996)
Diffstat (limited to 'src/util/mmap_cache.h')
-rw-r--r--src/util/mmap_cache.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/util/mmap_cache.h b/src/util/mmap_cache.h
index b5917b3c0..22c1ae62d 100644
--- a/src/util/mmap_cache.h
+++ b/src/util/mmap_cache.h
@@ -138,14 +138,15 @@ 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 unique_name; /* ptr to unique name string, rel. to struct base addr */
+ rel_ptr_t name; /* ptr to raw 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 */
+ * string with name and unique_name is stored
+ * after gids */
};
#pragma pack()