libnet: only create local private krb5.conf if joining an AD domain
authorMichael Adam <obnox@samba.org>
Wed, 15 Jun 2016 22:15:00 +0000 (00:15 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 17 Jun 2016 06:13:55 +0000 (08:13 +0200)
This prevents irritating warning messages.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jun 17 08:13:55 CEST 2016 on sn-devel-144

source3/libnet/libnet_join.c

index abb9cff..0a23e0d 100644 (file)
@@ -2515,9 +2515,11 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx,
 
 #ifdef HAVE_ADS
 
-       create_local_private_krb5_conf_for_domain(
-               r->out.dns_domain_name, r->out.netbios_domain_name,
-               sitename, smbXcli_conn_remote_sockaddr(cli->conn));
+       if (r->out.domain_is_ad) {
+               create_local_private_krb5_conf_for_domain(
+                       r->out.dns_domain_name, r->out.netbios_domain_name,
+                       sitename, smbXcli_conn_remote_sockaddr(cli->conn));
+       }
 
        if (r->out.domain_is_ad &&
            !(r->in.join_flags & WKSSVC_JOIN_FLAGS_JOIN_UNSECURE)) {