Restore 3.0 behaviour with empty /etc/hosts
authorVolker Lendecke <vl@samba.org>
Fri, 29 Feb 2008 21:38:10 +0000 (22:38 +0100)
committerKarolin Seeger <ks@sernet.de>
Mon, 3 Mar 2008 10:40:12 +0000 (11:40 +0100)
Jeremy, in 3.0 we allowed get_mydnsdomname and get_mydnsfullname to fail
without filling in anything useful. Worked fine. Without this patch and a empty
/etc/hosts and no DNS configured, session setup would return
NT_STATUS_BAD_NETWORK_NAME. This is confusing at best, BAD_NETWORK_NAME afaik
is only ever returned from tcon normally.

This restores the 3.0 behaviour.

Comments?

Volker

source/libsmb/ntlmssp.c

index 35c20ed6475fe5306c00a0b025f79c9ad1993402..7082ea7e4e782d392748e350ee31141cf247f706 100644 (file)
@@ -566,13 +566,16 @@ static NTSTATUS ntlmssp_server_negotiate(struct ntlmssp_state *ntlmssp_state,
        /* This should be a 'netbios domain -> DNS domain' mapping */
        dnsdomname = get_mydnsdomname(ntlmssp_state->mem_ctx);
        if (!dnsdomname) {
-               return NT_STATUS_BAD_NETWORK_NAME;
+               dnsdomname = talloc_strdup(ntlmssp_state->mem_ctx, "");
+       }
+       if (!dnsdomname) {
+               return NT_STATUS_NO_MEMORY;
        }
        strlower_m(dnsdomname);
 
        dnsname = get_mydnsfullname();
-       if (!dnsdomname) {
-               return NT_STATUS_INVALID_COMPUTER_NAME;
+       if (!dnsname) {
+               dnsname = "";
        }
 
        /* This creates the 'blob' of names that appears at the end of the packet */