summaryrefslogtreecommitdiffstats
path: root/src/sss_client/nss_mc_common.c
Commit message (Collapse)AuthorAgeFilesLines
* mmap_cache: Use two chains for hash collision.Lukas Slebodnik2013-09-231-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
* Rename _SSS_MC_SPECIALMichal Zidek2013-09-131-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.
* Fix sss_client breakage.Lukas Slebodnik2013-03-181-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
* Reuse sss_open_cloexec at other places in code.Lukas Slebodnik2013-03-131-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
* Potential resource leak in sss_nss_mc_get_recordJakub Hrozek2013-01-081-0/+1
| | | | https://fedorahosted.org/sssd/ticket/1748
* explicit null dereferenced in sss_nss_mc_get_record()Pavel Březina2013-01-071-0/+5
| | | | https://fedorahosted.org/sssd/ticket/1724
* Add a macro to copy with barriersSimo Sorce2012-12-131-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
* Add memory barrier to mmap cache client code loopSimo Sorce2012-12-051-0/+3
| | | | Fixes https://fedorahosted.org/sssd/ticket/1694
* Fix errors reported by rpmlintJan Cholasta2012-11-221-3/+2
|
* Add close on exec support for old platformsSimo Sorce2012-06-211-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.
* Do not leak file descriptors in client libs.Simo Sorce2012-06-211-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.
* sss_client: Add common shared memory cache utilsSimo Sorce2012-03-191-0/+272