more %U fixes for head
authorAndrew Tridgell <tridge@samba.org>
Wed, 20 Nov 2002 00:39:57 +0000 (00:39 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 20 Nov 2002 00:39:57 +0000 (00:39 +0000)
(This used to be commit ea3787d819df14f8b451780a55d2bf76dc4030ef)

source3/lib/substitute.c
source3/rpc_server/srv_netlog_nt.c

index 48d8e35dae53e60d67745d24ab2abc733950b9b2..2d1b2ab1fa1fd0bc6f4a9bef4854ae86e21122af 100644 (file)
@@ -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);
index 12841a2e087b4248489756676b0d0e0ec66fcd63..dee0866b12a8737c16de1a0b456e2d37acb10eb5 100644 (file)
@@ -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.