The branch, master has been updated
       via  1e3c4b3... s3:smbd: also fill the memcache with sid<->id mappings 
in ldapsam_sid_to_id()
       via  d267325... s3:smbd: make idmap cache persistent for 
"ldapsam:trusted".
      from  5b75201... util: str_list_unique() bugfix

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 1e3c4b381a9e77906e5ac12f3406ffc72fd4c14a
Author: Michael Adam <[email protected]>
Date:   Fri Nov 13 16:16:50 2009 +0100

    s3:smbd: also fill the memcache with sid<->id mappings in 
ldapsam_sid_to_id()
    
    not only the persistent idmap cache.
    
    Michael

commit d2673253e3f3fead7b467b4e359482a4e8875fc9
Author: Michael Adam <[email protected]>
Date:   Fri Nov 13 15:51:33 2009 +0100

    s3:smbd: make idmap cache persistent for "ldapsam:trusted".
    
    This stores the mappings found in the idmap cache (which lives
    inside gencache). This cache is already read in sid_to_Xid()
    and Xid_to_sid() for ldapsam:trusted, this fills the opposite
    direction, massively reducing the number of ldap roundtrips
    across smbd restarts.
    
    Michael

-----------------------------------------------------------------------

Summary of changes:
 source3/passdb/pdb_ldap.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index d4a2fbe..cce2cf1 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -1038,6 +1038,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates 
*ldap_state,
                        /* We've got a uid, feed the cache */
                        uid_t uid = strtoul(temp, NULL, 10);
                        store_uid_sid_cache(pdb_get_user_sid(sampass), uid);
+                       idmap_cache_set_sid2uid(pdb_get_user_sid(sampass), uid);
                }
        }
 
@@ -2449,6 +2450,7 @@ for gidNumber(%lu)\n",(unsigned long)map->gid));
 
        if (lp_parm_bool(-1, "ldapsam", "trusted", false)) {
                store_gid_sid_cache(&map->sid, map->gid);
+               idmap_cache_set_sid2gid(&map->sid, map->gid);
        }
 
        TALLOC_FREE(ctx);
@@ -4967,6 +4969,8 @@ static bool ldapsam_sid_to_id(struct pdb_methods *methods,
 
                id->gid = strtoul(gid_str, NULL, 10);
                *type = (enum lsa_SidType)strtoul(value, NULL, 10);
+               store_gid_sid_cache(sid, id->gid);
+               idmap_cache_set_sid2gid(sid, id->gid);
                ret = True;
                goto done;
        }
@@ -4983,6 +4987,8 @@ static bool ldapsam_sid_to_id(struct pdb_methods *methods,
 
        id->uid = strtoul(value, NULL, 10);
        *type = SID_NAME_USER;
+       store_uid_sid_cache(sid, id->uid);
+       idmap_cache_set_sid2uid(sid, id->uid);
 
        ret = True;
  done:


-- 
Samba Shared Repository

Reply via email to