winbindd: add_trusted_domain_from_auth() should not use dns_name = ""
authorStefan Metzmacher <metze@samba.org>
Tue, 23 Jan 2018 22:19:32 +0000 (23:19 +0100)
committerRalph Boehme <slow@samba.org>
Sat, 10 Feb 2018 07:35:16 +0000 (08:35 +0100)
Check whether the DNS domain name in the info6 struct is actually more
then just an empty string. If it is we want to call add_trusted_domain()
with NULL as DNS domain name argument.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13257

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/winbindd/winbindd_util.c

index 5f4f905db4c3e1a8ba8f0d06b88c9e97057e7345..6292cce9d51dbf1e4a913fd0bb8eadc2f1ab7b8a 100644 (file)
@@ -336,7 +336,9 @@ bool add_trusted_domain_from_auth(uint16_t validation_level,
        }
 
        if (validation_level == 6) {
-               dns_domainname = &info6->dns_domainname[0];
+               if (!strequal(info6->dns_domainname, "")) {
+                       dns_domainname = info6->dns_domainname;
+               }
        }
 
        status = add_trusted_domain(info3->logon_dom,