summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-01-16 02:22:30 +0000
committerAndrew Tridgell <tridge@samba.org>2002-01-16 02:22:30 +0000
commit9f85d4ad5f2bb5fdb7739b3f90c4bfac705393ce (patch)
tree013b7f83aeb828c9fb42591d07abab9d234f4e84 /source3/utils
parent3fee2ac712c5fe7a85b89ba3a3c19ab8801f0b22 (diff)
downloadsamba-9f85d4ad5f2bb5fdb7739b3f90c4bfac705393ce.tar.gz
samba-9f85d4ad5f2bb5fdb7739b3f90c4bfac705393ce.tar.bz2
samba-9f85d4ad5f2bb5fdb7739b3f90c4bfac705393ce.zip
much better support for organisational units in ADS join
(This used to be commit 7e876057d5e392f85e6fdb0f2c233b0fe76df688)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_ads.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 7baa297230..fec31c6ea3 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -211,6 +211,7 @@ static int net_ads_join(int argc, const char **argv)
char *dn;
void *res;
DOM_SID dom_sid;
+ char *ou_str;
if (argc > 0) org_unit = argv[0];
@@ -224,16 +225,19 @@ static int net_ads_join(int argc, const char **argv)
if (!(ads = ads_startup())) return -1;
- asprintf(&dn, "cn=%s,%s", org_unit, ads->bind_path);
+ ou_str = ads_ou_string(org_unit);
+ asprintf(&dn, "%s,%s", ou_str, ads->bind_path);
+ free(ou_str);
rc = ads_search_dn(ads, &res, dn, NULL);
- free(dn);
ads_msgfree(ads, res);
if (rc.error_type == ADS_ERROR_LDAP && rc.rc == LDAP_NO_SUCH_OBJECT) {
- d_printf("ads_join_realm: organisational unit %s does not exist\n", org_unit);
+ d_printf("ads_join_realm: organisational unit %s does not exist (dn:%s)\n",
+ org_unit, dn);
return -1;
}
+ free(dn);
if (!ADS_ERR_OK(rc)) {
d_printf("ads_join_realm: %s\n", ads_errstr(rc));