[PATCH] fix sid_to_uid() return correct sidtype

Stefan (metze) Metzmacher metze at metzemix.de
Wed Feb 19 21:20:35 GMT 2003


At 21:07 19.02.2003 +0000, jra at dp.samba.org wrote:
>On Wed, Feb 19, 2003 at 10:03:57PM +0100, Stefan (metze) Metzmacher wrote:
> > HI all,
> >
> > here's a small fix for returning the correct sidtype in sid_to_uid() and
> > sid_to_gid()
> >
> > this should be applied to all branches with the new uid <-> sid caching 
> code
>
>No attachment - please try again.
>
>Jeremy.

mailman filtered it out...:-(

next try :-)



metze
-----------------------------------------------------------------------------
Stefan "metze" Metzmacher <metze at metzemix.de> 
-------------- next part --------------
diff -Npur --exclude=CVS --exclude=*.bak --exclude=*.o --exclude=*.po --exclude=*.so --exclude=.#* --exclude=Makefile --exclude=stamp-h --exclude=configure --exclude=findsmb --exclude=*proto*.h --exclude=build_env.h --exclude=tdbsam2_parse_info.h --exclude=config.* --exclude=bin --exclude=*.configure HEAD/source/smbd/uid.c HEAD-fix/source/smbd/uid.c
--- HEAD/source/smbd/uid.c	Mon Feb 17 17:44:12 2003
+++ HEAD-fix/source/smbd/uid.c	Wed Feb 19 21:56:51 2003
@@ -792,8 +792,10 @@ BOOL sid_to_uid(const DOM_SID *psid, uid
 {
 	fstring sid_str;
 
-	if (fetch_uid_from_cache(puid, psid))
+	if (fetch_uid_from_cache(puid, psid)) {
+		*sidtype = SID_NAME_USER;
 		return True;
+	}
 
 	/* if we know its local then don't try winbindd */
 	if (sid_compare_domain(get_global_sam_sid(), psid) == 0) {
@@ -879,9 +881,11 @@ BOOL sid_to_gid(const DOM_SID *psid, gid
 
 	*sidtype = SID_NAME_UNKNOWN;
 
-	if (fetch_gid_from_cache(pgid, psid))
+	if (fetch_gid_from_cache(pgid, psid)) {
+		*sidtype = SID_NAME_DOM_GRP;
 		return True;
-
+	}
+	
 	/*
 	 * First we must look up the name and decide if this is a group sid.
 	 */


More information about the samba-technical mailing list