summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2006-04-06 01:46:01 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:54 -0500
commit92f139d4c4c7a07dd199b09b24bfc162eb1ab6bf (patch)
treef83682ee1d8b30842d9378606e444de372bb917a /source3/libads
parent52f4dfa6fcc60eb36f7f59747387fd10855046cd (diff)
downloadsamba-92f139d4c4c7a07dd199b09b24bfc162eb1ab6bf.tar.gz
samba-92f139d4c4c7a07dd199b09b24bfc162eb1ab6bf.tar.bz2
samba-92f139d4c4c7a07dd199b09b24bfc162eb1ab6bf.zip
r14931: 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. (This used to be commit 1953f63903e64e0a33eb981c51b8ca4beb673af2)
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/ldap.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index e1cea533a0..c2ebf14d2f 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -1083,7 +1083,8 @@ ADS_STATUS ads_del_dn(ADS_STRUCT *ads, char *del_dn)
/**
* 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 @@ char *ads_ou_string(ADS_STRUCT *ads, const char *org_unit)
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);
}
/**