r8432: Fix #2077 - login to trusted domain doesn't allow home drive map and login
authorJim McDonough <jmcd@samba.org>
Wed, 13 Jul 2005 20:04:26 +0000 (20:04 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:00:05 +0000 (11:00 -0500)
scripts to be executed.

We were filling in our name as the server which processed the login, even
when it was done by a trusted DC.

Thanks to John Janosik <jpjanosi@us.ibm.com> for the fix.
(This used to be commit 0446319a3b8096df385978449ffaa231bc5cfd0c)

source3/auth/auth_util.c
source3/include/auth.h
source3/rpc_server/srv_netlog_nt.c

index 49df15533a72b67c91edbc14520f8a4856b92130..6624631b53dd5c5df1153abb787d55c779212d2c 100644 (file)
@@ -1327,6 +1327,9 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
                return nt_status;
        }
 
+       (*server_info)->login_server = unistr2_tdup(mem_ctx, 
+                                                   &(info3->uni_logon_srv));
+
        (*server_info)->ptok = token; 
 
        SAFE_FREE(lgroupSIDs);
index 91751e718040e56aff1b98c7a23c57a7396d2a40..7282f4d38b272e88f18dd2dab79455bddaf1af83 100644 (file)
@@ -69,6 +69,8 @@ typedef struct auth_serversupplied_info
        
        DATA_BLOB user_session_key;
        DATA_BLOB lm_session_key;
+
+        char *login_server; /* which server authorized the login? */
        
        uint32 sam_fill_level;  /* How far is this structure filled? */
        
index a6fe9ef31af8f8c1d4f177edfb858dcff81478cd..7880a724b5c70d225bcd9579b813d709c8419021 100644 (file)
@@ -764,8 +764,13 @@ NTSTATUS _net_sam_logon(pipes_struct *p, NET_Q_SAM_LOGON *q_u, NET_R_SAM_LOGON *
                        return NT_STATUS_UNSUCCESSFUL;
                }
                
-               pstrcpy(my_name, global_myname());
-
+               
+               if(server_info->login_server) {
+                       pstrcpy(my_name, server_info->login_server);
+               } else {
+                       pstrcpy(my_name, global_myname());
+               }
+               
                if (!NT_STATUS_IS_OK(status 
                                     = nt_token_to_group_list(p->mem_ctx, 
                                                              &domain_sid,