summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/substitute.c3
-rw-r--r--source3/rpc_server/srv_netlog_nt.c1
2 files changed, 4 insertions, 0 deletions
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index 48d8e35dae..2d1b2ab1fa 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -68,6 +68,9 @@ void sub_set_smb_name(const char *name)
{
fstring tmp;
+ /* don't let anonymous logins override the name */
+ if (! *name) return;
+
fstrcpy(tmp,name);
trim_string(tmp," "," ");
strlower(tmp);
diff --git a/source3/rpc_server/srv_netlog_nt.c b/source3/rpc_server/srv_netlog_nt.c
index 12841a2e08..dee0866b12 100644
--- a/source3/rpc_server/srv_netlog_nt.c
+++ b/source3/rpc_server/srv_netlog_nt.c
@@ -566,6 +566,7 @@ NTSTATUS _net_sam_logon(pipes_struct *p, NET_Q_SAM_LOGON *q_u, NET_R_SAM_LOGON *
nt_workstation, nt_domain));
pstrcpy(current_user_info.smb_name, nt_username);
+ sub_set_smb_name(nt_username);
/*
* Convert to a UNIX username.