summaryrefslogtreecommitdiff
path: root/src/sss_client/nss_mc_common.c
AgeCommit message (Collapse)AuthorFilesLines
2013-09-23mmap_cache: Use two chains for hash collision.Lukas Slebodnik1-0/+13
struct sss_mc_rec had two hash members (hash1 and hash2) but only one next member. This was a big problem in case of higher probability of hash collision. structure sss_mc_rec will have two next members (next1, next2) with this patch. next1 is related to hash1 and next2 is related to hash1. Iterating over chains is changed, because we need to choose right next pointer. Right next pointer will be chosen after comparing record hashes. This behaviour is wrapped in function sss_mc_next_slot_with_hash. Adding new record to chain is also changed. The situation is very similar to iterating. We need to choose right next pointer (next1 or next2). Right next pointer will be chosen after comparing record hashes. Adding reference to next slot is wrapped in function sss_mc_chain_slot_to_record_with_hash Size of structure sss_mc_rec was increased from 32 bytes to 40 bytes. Resolves: https://fedorahosted.org/sssd/ticket/2049
2013-09-13Rename _SSS_MC_SPECIALMichal Zidek1-2/+2
If the environment variable _SSS_MC_SPECIAL is set to "NO", the mmap cache is skipped in the client code. The name is not very descriptive. This patch renames the variable to SSS_NSS_USE_MEMCACHE.
2013-03-18Fix sss_client breakage.Lukas Slebodnik1-1/+1
Adding missing dependencies for linker. Missing dependency was introduced by commit 22d381367c27910fe82f476a76b9f4ede555e35a in changed file src/sss_client/nss_mc_common.c All function declaration for io.c was moved from util.h to separate file io.h, https://fedorahosted.org/sssd/ticket/1838
2013-03-13Reuse sss_open_cloexec at other places in code.Lukas Slebodnik1-17/+2
Functions open_cloexec and openat_cloexec were renamed with prefix "sss_" and moved to separete file. Replacing duplicated code of function sss_open_cloexec everywhere in the source code. https://fedorahosted.org/sssd/ticket/1794
2013-01-08Potential resource leak in sss_nss_mc_get_recordJakub Hrozek1-0/+1
https://fedorahosted.org/sssd/ticket/1748
2013-01-07explicit null dereferenced in sss_nss_mc_get_record()Pavel Březina1-0/+5
https://fedorahosted.org/sssd/ticket/1724
2012-12-13Add a macro to copy with barriersSimo Sorce1-17/+30
We have 2 places where we memcpy memory and need barriers protection. Use a macro so we can consolidate code in one place. Second fix for: https://fedorahosted.org/sssd/ticket/1694
2012-12-05Add memory barrier to mmap cache client code loopSimo Sorce1-0/+3
Fixes https://fedorahosted.org/sssd/ticket/1694
2012-11-22Fix errors reported by rpmlintJan Cholasta1-3/+2
2012-06-21Add close on exec support for old platformsSimo Sorce1-1/+16
Older platfroms like RHEL5 do not have support for O_CLOEXC and need an explicit fcntl after the fd is created. Add it conditionally so it can be clearly removed once we declared those platfroms obsolete and unsupported.
2012-06-21Do not leak file descriptors in client libs.Simo Sorce1-1/+1
We need to make sure the mc socket is not leaked otherwise child processes will pile up leaked file descriptors. Add O_CLOEXEC when opening the cache.
2012-03-19sss_client: Add common shared memory cache utilsSimo Sorce1-0/+272