svn commit: samba r12964 - branches/SAMBA_3_0/source/sam trunk/source/sam

lmuelle at samba.org lmuelle at samba.org
Mon Jan 16 17:21:47 GMT 2006


Author: lmuelle
Date: 2006-01-16 17:21:47 +0000 (Mon, 16 Jan 2006)
New Revision: 12964

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

Log:
Rewind rem_backend in the case we have to workaround the idmap_ prefix.
Else SAFE_FREE seg faults.  Thanks to G?\195?\188nther for pointing me at this.

I've implemented in in this was as we should announce to remove the
idmap_ strip stuff after some time at all.

Modified:
   branches/SAMBA_3_0/source/sam/idmap.c
   trunk/source/sam/idmap.c


Changeset:
Modified: branches/SAMBA_3_0/source/sam/idmap.c
===================================================================
--- branches/SAMBA_3_0/source/sam/idmap.c	2006-01-16 17:05:07 UTC (rev 12963)
+++ branches/SAMBA_3_0/source/sam/idmap.c	2006-01-16 17:21:47 UTC (rev 12964)
@@ -120,6 +120,7 @@
 		char *rem_backend = smb_xstrdup(*remote_backend);
 		fstring params = "";
 		char *pparams;
+		BOOL idmap_prefix_workaround = False;
 		
 		/* get any mode parameters passed in */
 		
@@ -132,6 +133,7 @@
 		/* strip any leading idmap_ prefix of */
 		if ( strncmp( rem_backend, "idmap_", 6) == 0 ) {
 			rem_backend += 6;
+			idmap_prefix_workaround = True;
 			DEBUG(0, ("idmap_init: idmap backend uses deprecated 'idmap_' prefix.  Please replace 'idmap_%s' by '%s' in %s\n", rem_backend, rem_backend, dyn_CONFIGFILE));
 		}
 		
@@ -146,9 +148,13 @@
 			}
 		} else {
 			DEBUG(0, ("idmap_init: could not load remote backend '%s'\n", rem_backend));
+			if (idmap_prefix_workaround)
+				rem_backend -= 6;
 			SAFE_FREE(rem_backend);
 			return False;
 		}
+		if (idmap_prefix_workaround)
+			rem_backend -= 6;
 		SAFE_FREE(rem_backend);
 	}
 

Modified: trunk/source/sam/idmap.c
===================================================================
--- trunk/source/sam/idmap.c	2006-01-16 17:05:07 UTC (rev 12963)
+++ trunk/source/sam/idmap.c	2006-01-16 17:21:47 UTC (rev 12964)
@@ -120,6 +120,7 @@
 		char *rem_backend = smb_xstrdup(*remote_backend);
 		fstring params = "";
 		char *pparams;
+		BOOL idmap_prefix_workaround = False;
 		
 		/* get any mode parameters passed in */
 		
@@ -132,6 +133,7 @@
 		/* strip any leading idmap_ prefix of */
 		if ( strncmp( rem_backend, "idmap_", 6) == 0 ) {
 			rem_backend += 6;
+			idmap_prefix_workaround = True;
 			DEBUG(0, ("idmap_init: idmap backend uses deprecated 'idmap_' prefix.  Please replace 'idmap_%s' by '%s' in %s\n", rem_backend, rem_backend, dyn_CONFIGFILE));
 		}
 		
@@ -146,9 +148,13 @@
 			}
 		} else {
 			DEBUG(0, ("idmap_init: could not load remote backend '%s'\n", rem_backend));
+			if (idmap_prefix_workaround)
+				rem_backend -= 6;
 			SAFE_FREE(rem_backend);
 			return False;
 		}
+		if (idmap_prefix_workaround)
+			rem_backend -= 6;
 		SAFE_FREE(rem_backend);
 	}
 



More information about the samba-cvs mailing list