Author: jmcd
Date: 2005-07-13 20:04:26 +0000 (Wed, 13 Jul 2005)
New Revision: 8432

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=8432

Log:
Fix #2077 - login to trusted domain doesn't allow home drive map and login
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 <[EMAIL PROTECTED]> for the fix.

Modified:
   branches/SAMBA_3_0/source/auth/auth_util.c
   branches/SAMBA_3_0/source/include/auth.h
   branches/SAMBA_3_0/source/rpc_server/srv_netlog_nt.c


Changeset:
Modified: branches/SAMBA_3_0/source/auth/auth_util.c
===================================================================
--- branches/SAMBA_3_0/source/auth/auth_util.c  2005-07-13 16:47:42 UTC (rev 
8431)
+++ branches/SAMBA_3_0/source/auth/auth_util.c  2005-07-13 20:04:26 UTC (rev 
8432)
@@ -1327,6 +1327,9 @@
                return nt_status;
        }
 
+       (*server_info)->login_server = unistr2_tdup(mem_ctx, 
+                                                   &(info3->uni_logon_srv));
+
        (*server_info)->ptok = token; 
 
        SAFE_FREE(lgroupSIDs);

Modified: branches/SAMBA_3_0/source/include/auth.h
===================================================================
--- branches/SAMBA_3_0/source/include/auth.h    2005-07-13 16:47:42 UTC (rev 
8431)
+++ branches/SAMBA_3_0/source/include/auth.h    2005-07-13 20:04:26 UTC (rev 
8432)
@@ -69,6 +69,8 @@
        
        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? */
        

Modified: branches/SAMBA_3_0/source/rpc_server/srv_netlog_nt.c
===================================================================
--- branches/SAMBA_3_0/source/rpc_server/srv_netlog_nt.c        2005-07-13 
16:47:42 UTC (rev 8431)
+++ branches/SAMBA_3_0/source/rpc_server/srv_netlog_nt.c        2005-07-13 
20:04:26 UTC (rev 8432)
@@ -764,8 +764,13 @@
                        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, 

Reply via email to