Store domain_is_ad info as early as possible in libnetjoin.
authorGünther Deschner <gd@samba.org>
Thu, 28 Feb 2008 10:29:56 +0000 (11:29 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 28 Feb 2008 10:38:01 +0000 (11:38 +0100)
Guenther
(This used to be commit c4ba68aa94888eace393b91a669e22b27ffaba3e)

source3/libnet/libnet_join.c

index 31eec8056195e7d5a600454d464fff14131bcce0..d2242ffb2c860bb51d498155456141c94a4af675 100644 (file)
@@ -152,9 +152,24 @@ static ADS_STATUS libnet_join_connect_ads(TALLOC_CTX *mem_ctx,
                libnet_join_set_error_string(mem_ctx, r,
                        "failed to connect to AD: %s",
                        ads_errstr(status));
+               return status;
        }
 
-       return status;
+       if (!r->out.netbios_domain_name) {
+               r->out.netbios_domain_name = talloc_strdup(mem_ctx,
+                                                          r->in.ads->server.workgroup);
+               ADS_ERROR_HAVE_NO_MEMORY(r->out.netbios_domain_name);
+       }
+
+       if (!r->out.dns_domain_name) {
+               r->out.dns_domain_name = talloc_strdup(mem_ctx,
+                                                      r->in.ads->config.realm);
+               ADS_ERROR_HAVE_NO_MEMORY(r->out.dns_domain_name);
+       }
+
+       r->out.domain_is_ad = true;
+
+       return ADS_SUCCESS;
 }
 
 /****************************************************************