db99504 SYSDB: Add sysdb_search_with_ts_attr

Authored and Committed by jhrozek 4 years ago
    SYSDB: Add sysdb_search_with_ts_attr
    
    Adds a new public sysdb call sysdb_search_with_ts_attr() that allows to
    search on the timestamp cache attributes, but merge back persistent
    cache attributes. The converse also works, when searching the persistent
    cache the timestamp attributes or even entries matches only in the
    timestamp cache are merged.
    
    What does not work is AND-ed complex filter that contains both
    attributes from the timestamp cache and the persistent cache because
    the searches use the same filter, which doesn't match. We would need to
    decompose the filter ourselves.
    
    Because matching and merging the results can be time-consuming, two
    flags are provided:
        SYSDB_SEARCH_WITH_TS_ONLY_TS_FILTER that only searches the timestamp
        cache, but merges back the corresponding entries from the persistent
        cache
        SYSDB_SEARCH_WITH_TS_ONLY_SYSDB_FILTER that only searches the
        persistent cache but merges back the attributes from the timestamp
        cache
    
    Related:
    https://pagure.io/SSSD/sssd/issue/4012
    
    Reviewed-by: Sumit Bose <sbose@redhat.com>
    
        
file modified
+12 -0
file modified
+8 -8
file modified
+10 -0
file modified
+218 -13