diff -r -u samba-3.0.20pre1/source/auth/auth_util.c samba-3.0.20pre1.jpj/source/auth/auth_util.c --- samba-3.0.20pre1/source/auth/auth_util.c 2005-06-21 16:29:04.000000000 -0500 +++ samba-3.0.20pre1.jpj/source/auth/auth_util.c 2005-07-07 08:59:25.000000000 -0500 @@ -1138,6 +1138,7 @@ /* If the server didn't give us one, just use the one we sent them */ nt_domain = domain; } + /* try to fill the SAM account.. If getpwnam() fails, then try the add user script (2.2.x behavior). @@ -1327,6 +1328,8 @@ return nt_status; } + (*server_info)->login_server = unistr2_tdup(mem_ctx, &(info3->uni_logon_srv)); + (*server_info)->ptok = token; SAFE_FREE(lgroupSIDs); diff -r -u samba-3.0.20pre1/source/include/auth.h samba-3.0.20pre1.jpj/source/include/auth.h --- samba-3.0.20pre1/source/include/auth.h 2005-02-25 11:59:38.000000000 -0600 +++ samba-3.0.20pre1.jpj/source/include/auth.h 2005-07-07 08:18:14.000000000 -0500 @@ -69,6 +69,8 @@ DATA_BLOB user_session_key; DATA_BLOB lm_session_key; + + char *login_server; uint32 sam_fill_level; /* How far is this structure filled? */ diff -r -u samba-3.0.20pre1/source/rpc_server/srv_netlog_nt.c samba-3.0.20pre1.jpj/source/rpc_server/srv_netlog_nt.c --- samba-3.0.20pre1/source/rpc_server/srv_netlog_nt.c 2005-06-21 16:29:09.000000000 -0500 +++ samba-3.0.20pre1.jpj/source/rpc_server/srv_netlog_nt.c 2005-07-11 19:53:40.000000000 -0500 @@ -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,