svn commit: samba r22230 - in branches: SAMBA_3_0/source/nsswitch SAMBA_3_0_25/source/nsswitch

idra at samba.org idra at samba.org
Sun Apr 15 23:58:40 GMT 2007


Author: idra
Date: 2007-04-15 23:58:39 +0000 (Sun, 15 Apr 2007)
New Revision: 22230

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22230

Log:

Let's just cast here, the 2 calls have different allocation mechanisms.
We just let domname and name hang on the mem ctx until the call returns,
and the context will be destroyed.

Simo.


Modified:
   branches/SAMBA_3_0/source/nsswitch/idmap.c
   branches/SAMBA_3_0_25/source/nsswitch/idmap.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/idmap.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/idmap.c	2007-04-15 21:14:37 UTC (rev 22229)
+++ branches/SAMBA_3_0/source/nsswitch/idmap.c	2007-04-15 23:58:39 UTC (rev 22230)
@@ -811,7 +811,7 @@
 {
 	NTSTATUS ret;
 	struct idmap_domain *dom;
-	const char *domname, *name;
+	char *domname, *name;
 	enum lsa_SidType sid_type;
 	BOOL wbret;
 
@@ -825,14 +825,16 @@
 		/* by default calls to winbindd are disabled
 		   the following call will not recurse so this is safe */
 		winbind_on();
-		wbret = winbind_lookup_sid(ctx, map->sid, &domname, &name, &sid_type);
+		wbret = winbind_lookup_sid(ctx, map->sid,
+						(const char **)&domname,
+						(const char **)&name,
+						&sid_type);
 		winbind_off();
 	} else {
-		char *tmp_dom, *tmp_name;
-		wbret = winbindd_lookup_name_by_sid(ctx, map->sid, &tmp_dom,
-						    &tmp_name, &sid_type);
-		domname = tmp_dom;
-		name = tmp_name;
+		wbret = winbindd_lookup_name_by_sid(ctx, map->sid,
+							&domname,
+							&name,
+							&sid_type);
 	}
 
 	/* check if this is a valid SID and then map it */

Modified: branches/SAMBA_3_0_25/source/nsswitch/idmap.c
===================================================================
--- branches/SAMBA_3_0_25/source/nsswitch/idmap.c	2007-04-15 21:14:37 UTC (rev 22229)
+++ branches/SAMBA_3_0_25/source/nsswitch/idmap.c	2007-04-15 23:58:39 UTC (rev 22230)
@@ -811,7 +811,7 @@
 {
 	NTSTATUS ret;
 	struct idmap_domain *dom;
-	const char *domname, *name;
+	char *domname, *name;
 	enum lsa_SidType sid_type;
 	BOOL wbret;
 
@@ -825,10 +825,16 @@
 		/* by default calls to winbindd are disabled
 		   the following call will not recurse so this is safe */
 		winbind_on();
-		wbret = winbind_lookup_sid(ctx, map->sid, &domname, &name, &sid_type);
+		wbret = winbind_lookup_sid(ctx, map->sid,
+						(const char **)&domname,
+						(const char **)&name,
+						&sid_type);
 		winbind_off();
 	} else {
-		wbret = winbindd_lookup_name_by_sid(ctx, map->sid, &domname, &name, &sid_type);
+		wbret = winbindd_lookup_name_by_sid(ctx, map->sid,
+							&domname,
+							&name,
+							&sid_type);
 	}
 
 	/* check if this is a valid SID and then map it */



More information about the samba-cvs mailing list