alpha_strcpy(smb_user_name,tmp,SAFE_NETBIOS_CHARS,sizeof(smb_user_name)-1);
}
+char* sub_get_smb_name( void )
+{
+ return smb_user_name;
+}
+
/*******************************************************************
Setup the strings used by substitutions. Called per packet. Ensure
%U name is set correctly also.
fstring user2;
struct passwd *ret;
+ if ( *user == '\0' ) {
+ DEBUG(10,("Get_Pwnam: empty username!\n"));
+ return NULL;
+ }
+
fstrcpy(user2, user);
DEBUG(5,("Finding user %s\n", user));
BOOL lp_file_list_changed(void)
{
struct file_lists *f = file_lists;
- DEBUG(6, ("lp_file_list_changed()\n"));
+ char *username;
+
+ DEBUG(6, ("lp_file_list_changed()\n"));
+
+ /* get the username for substituion -- preference to the current_user_info */
+ if ( strlen( current_user_info.smb_name ) != 0 )
+ username = current_user_info.smb_name;
+ else
+ username = sub_get_smb_name();
+
while (f) {
pstring n2;
pstring n2;
BOOL bRetval;
param_opt_struct *data, *pdata;
+ char *username;
pstrcpy(n2, pszFname);
- standard_sub_basic(current_user_info.smb_name, n2,sizeof(n2));
+
+ /* get the username for substituion -- preference to the current_user_info */
+
+ if ( strlen( current_user_info.smb_name ) != 0 )
+ username = current_user_info.smb_name;
+ else
+ username = sub_get_smb_name();
+
+ standard_sub_basic( username, n2,sizeof(n2) );
add_to_file_list(pszFname, n2);
/* Try and turn on server signing on the first non-guest sessionsetup. */
srv_set_signing(vuser->session_key, response_blob);
}
+
+ /* fill in the current_user_info struct */
+ set_current_user_info( &vuser->user );
+
return vuser->vuid;
}
if (sess_vuid == -1) {
ret = NT_STATUS_LOGON_FAILURE;
} else {
+ /* current_user_info is changed on new vuid */
+ reload_services( True );
+
set_message(outbuf,4,0,True);
SSVAL(outbuf, smb_vwv3, 0);
nt_status = NT_STATUS_LOGON_FAILURE;
} else {
+ /* current_user_info is changed on new vuid */
+ reload_services( True );
+
set_message(outbuf,4,0,True);
SSVAL(outbuf, smb_vwv3, 0);
return ERROR_NT(NT_STATUS_LOGON_FAILURE);
}
+ /* current_user_info is changed on new vuid */
+ reload_services( True );
+
if (!server_info->guest && !srv_check_sign_mac(inbuf)) {
exit_server("reply_sesssetup_and_X: bad smb signature");
}