svn commit: samba r14931 - branches/SAMBA_3_0/source/libads trunk/source/libads

jmcd at samba.org jmcd at samba.org
Thu Apr 6 01:46:02 GMT 2006


Author: jmcd
Date: 2006-04-06 01:46:01 +0000 (Thu, 06 Apr 2006)
New Revision: 14931

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

Log:
Fix #1374: can't join an OU with name that contains '#'

I had to eliminate "\" as an OU path separator, because it is the escape
char in LDAP.  We still accept "/", but using the escape char is just
not a good choice.


Modified:
   branches/SAMBA_3_0/source/libads/ldap.c
   trunk/source/libads/ldap.c


Changeset:
Modified: branches/SAMBA_3_0/source/libads/ldap.c
===================================================================
--- branches/SAMBA_3_0/source/libads/ldap.c	2006-04-05 23:54:12 UTC (rev 14930)
+++ branches/SAMBA_3_0/source/libads/ldap.c	2006-04-06 01:46:01 UTC (rev 14931)
@@ -1083,7 +1083,8 @@
 /**
  * Build an org unit string
  *  if org unit is Computers or blank then assume a container, otherwise
- *  assume a \ separated list of organisational units
+ *  assume a / separated list of organisational units.
+ * jmcd: '\' is now used for escapes so certain chars can be in the ou (e.g. #)
  * @param ads connection to ads server
  * @param org_unit Organizational unit
  * @return org unit string - caller must free
@@ -1104,7 +1105,10 @@
 		return SMB_STRDUP("cn=Computers");
 	}
 
-	return ads_build_path(org_unit, "\\/", "ou=", 1);
+	/* jmcd: removed "\\" from the separation chars, because it is
+	   needed as an escape for chars like '#' which are valid in an
+	   OU name */
+	return ads_build_path(org_unit, "/", "ou=", 1);
 }
 
 /**

Modified: trunk/source/libads/ldap.c
===================================================================
--- trunk/source/libads/ldap.c	2006-04-05 23:54:12 UTC (rev 14930)
+++ trunk/source/libads/ldap.c	2006-04-06 01:46:01 UTC (rev 14931)
@@ -1083,7 +1083,8 @@
 /**
  * Build an org unit string
  *  if org unit is Computers or blank then assume a container, otherwise
- *  assume a \ separated list of organisational units
+ *  assume a / separated list of organisational units.
+ * jmcd: '\' is now used for escapes so certain chars can be in the ou (e.g. #)
  * @param ads connection to ads server
  * @param org_unit Organizational unit
  * @return org unit string - caller must free
@@ -1104,7 +1105,10 @@
 		return SMB_STRDUP("cn=Computers");
 	}
 
-	return ads_build_path(org_unit, "\\/", "ou=", 1);
+	/* jmcd: removed "\\" from the separation chars, because it is
+	   needed as an escape for chars like '#' which are valid in an
+	   OU name */
+	return ads_build_path(org_unit, "/", "ou=", 1);
 }
 
 /**



More information about the samba-cvs mailing list