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

herb at samba.org herb at samba.org
Mon Feb 26 22:19:23 GMT 2007


Author: herb
Date: 2007-02-26 22:19:23 +0000 (Mon, 26 Feb 2007)
New Revision: 21548

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

Log:
prevent segv (reference to -1 element of array)

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-02-26 20:14:35 UTC (rev 21547)
+++ branches/SAMBA_3_0/source/nsswitch/idmap.c	2007-02-26 22:19:23 UTC (rev 21548)
@@ -497,7 +497,8 @@
 	/**** finished adding idmap_passdb backend ****/
 
 	/* sort domains so that the default is the last one */
-	if (def_dom_num != num_domains-1) { /* default is not last, move it */
+	/* don't sort if no default domain defined */
+	if (def_dom_num != -1 && def_dom_num != num_domains-1) { /* default is not last, move it */
 		struct idmap_domain *tmp;
 
 		if (pdb_dom_num > def_dom_num) {

Modified: branches/SAMBA_3_0_25/source/nsswitch/idmap.c
===================================================================
--- branches/SAMBA_3_0_25/source/nsswitch/idmap.c	2007-02-26 20:14:35 UTC (rev 21547)
+++ branches/SAMBA_3_0_25/source/nsswitch/idmap.c	2007-02-26 22:19:23 UTC (rev 21548)
@@ -497,7 +497,8 @@
 	/**** finished adding idmap_passdb backend ****/
 
 	/* sort domains so that the default is the last one */
-	if (def_dom_num != num_domains-1) { /* default is not last, move it */
+	/* don't sort if no default domain defined */
+	if (def_dom_num != -1 && def_dom_num != num_domains-1) { /* default is not last, move it */
 		struct idmap_domain *tmp;
 
 		if (pdb_dom_num > def_dom_num) {



More information about the samba-cvs mailing list