Index: uid.c
===================================================================
RCS file: /cvsroot/samba/source/smbd/uid.c,v
retrieving revision 1.101
diff -u -r1.101 uid.c
--- uid.c	19 Feb 2003 22:30:57 -0000	1.101
+++ uid.c	26 Feb 2003 12:11:46 -0000
@@ -587,7 +587,7 @@
   Find a uid given a SID.
 *****************************************************************/  
 
-static BOOL fetch_uid_from_cache(uid_t *puid, const DOM_SID *psid, enum SID_NAME_USE sidtype)
+static BOOL fetch_uid_from_cache(uid_t *puid, const DOM_SID *psid, enum SID_NAME_USE *psidtype)
 {
 	struct uid_sid_cache *pc;
 
@@ -595,6 +595,7 @@
 		if (sid_compare(&pc->sid, psid) == 0) {
 			fstring sid;
 			*puid = pc->uid;
+			*psidtype = pc->sidtype;
 			DEBUG(3,("fetch uid from cache %u -> %s\n",
 				(unsigned int)*puid, sid_to_string(sid, psid)));
 			DLIST_PROMOTE(uid_sid_cache_head, pc);
@@ -663,7 +664,7 @@
   Find a gid given a SID.
 *****************************************************************/  
 
-static BOOL fetch_gid_from_cache(gid_t *pgid, const DOM_SID *psid, enum SID_NAME_USE sidtype)
+static BOOL fetch_gid_from_cache(gid_t *pgid, const DOM_SID *psid, enum SID_NAME_USE *psidtype)
 {
 	struct gid_sid_cache *pc;
 
@@ -671,6 +672,7 @@
 		if (sid_compare(&pc->sid, psid) == 0) {
 			fstring sid;
 			*pgid = pc->gid;
+			*psidtype = pc->sidtype;
 			DEBUG(3,("fetch uid from cache %u -> %s\n",
 				(unsigned int)*pgid, sid_to_string(sid, psid)));
 			DLIST_PROMOTE(gid_sid_cache_head, pc);
@@ -723,7 +725,7 @@
 DOM_SID *uid_to_sid(DOM_SID *psid, uid_t uid)
 {
 	uid_t low, high;
-	enum SID_NAME_USE sidtype;
+	enum SID_NAME_USE sidtype = 0;
 	fstring sid;
 
 	if (fetch_sid_from_uid_cache(psid, &sidtype, uid))
@@ -762,7 +764,7 @@
 DOM_SID *gid_to_sid(DOM_SID *psid, gid_t gid)
 {
 	gid_t low, high;
-	enum SID_NAME_USE sidtype;
+	enum SID_NAME_USE sidtype = 0;
 	fstring sid;
 
 	if (fetch_sid_from_gid_cache(psid, &sidtype, gid))
@@ -800,7 +802,7 @@
 {
 	fstring sid_str;
 
-	if (fetch_uid_from_cache(puid, psid, *sidtype))
+	if (fetch_uid_from_cache(puid, psid, sidtype))
 		return True;
 
 	/* if we know its local then don't try winbindd */
@@ -887,7 +889,7 @@
 
 	*sidtype = SID_NAME_UNKNOWN;
 
-	if (fetch_gid_from_cache(pgid, psid, *sidtype))
+	if (fetch_gid_from_cache(pgid, psid, sidtype))
 		return True;
 
 	/*
