[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-2300-g8717085

Volker Lendecke vlendec at samba.org
Tue May 6 10:15:18 GMT 2008


The branch, v3-3-test has been updated
       via  8717085dba832cfe6d7b807a10f779e495adc326 (commit)
      from  a159ec5f1f3ec8e9232b8f3230a996a3f9986bc1 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit 8717085dba832cfe6d7b807a10f779e495adc326
Author: Volker Lendecke <vl at samba.org>
Date:   Sat May 3 02:41:10 2008 +0200

    Fix a valgrind bug in the new [ug]id2sid cache
    
    When we're given a SID, it is not always padded with zeros. Only look at the
    initialized parts in the SID.

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

Summary of changes:
 source/passdb/lookup_sid.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/passdb/lookup_sid.c b/source/passdb/lookup_sid.c
index 4341bc0..debd67b 100644
--- a/source/passdb/lookup_sid.c
+++ b/source/passdb/lookup_sid.c
@@ -1027,7 +1027,7 @@ static bool fetch_uid_from_cache( uid_t *puid, const DOM_SID *psid )
 	DATA_BLOB cache_value;
 
 	if (!memcache_lookup(NULL, SID_UID_CACHE,
-			     data_blob_const(psid, sizeof(*psid)),
+			     data_blob_const(psid, ndr_size_dom_sid(psid, 0)),
 			     &cache_value)) {
 		return false;
 	}
@@ -1045,11 +1045,11 @@ static bool fetch_uid_from_cache( uid_t *puid, const DOM_SID *psid )
 void store_uid_sid_cache(const DOM_SID *psid, uid_t uid)
 {
 	memcache_add(NULL, SID_UID_CACHE,
-		     data_blob_const(psid, sizeof(*psid)),
+		     data_blob_const(psid, ndr_size_dom_sid(psid, 0)),
 		     data_blob_const(&uid, sizeof(uid)));
 	memcache_add(NULL, UID_SID_CACHE,
 		     data_blob_const(&uid, sizeof(uid)),
-		     data_blob_const(psid, sizeof(*psid)));
+		     data_blob_const(psid, ndr_size_dom_sid(psid, 0)));
 }
 
 /*****************************************************************
@@ -1081,7 +1081,7 @@ static bool fetch_gid_from_cache(gid_t *pgid, const DOM_SID *psid)
 	DATA_BLOB cache_value;
 
 	if (!memcache_lookup(NULL, SID_UID_CACHE,
-			     data_blob_const(psid, sizeof(*psid)),
+			     data_blob_const(psid, ndr_size_dom_sid(psid, 0)),
 			     &cache_value)) {
 		return false;
 	}
@@ -1099,11 +1099,11 @@ static bool fetch_gid_from_cache(gid_t *pgid, const DOM_SID *psid)
 void store_gid_sid_cache(const DOM_SID *psid, gid_t gid)
 {
 	memcache_add(NULL, SID_GID_CACHE,
-		     data_blob_const(psid, sizeof(*psid)),
+		     data_blob_const(psid, ndr_size_dom_sid(psid, 0)),
 		     data_blob_const(&gid, sizeof(gid)));
 	memcache_add(NULL, GID_SID_CACHE,
 		     data_blob_const(&gid, sizeof(gid)),
-		     data_blob_const(psid, sizeof(*psid)));
+		     data_blob_const(psid, ndr_size_dom_sid(psid, 0)));
 }
 
 /*****************************************************************


-- 
Samba Shared Repository


More information about the samba-cvs mailing list