*** sesssetup.c 2005-05-09 10:35:08.000000000 +0100 --- sesssetup_new.c 2005-05-09 10:34:51.000000000 +0100 *************** *** 253,258 **** --- 253,259 ---- pw = smb_getpwnam( user, real_username, True ); if (!pw) { + if (!NT_STATUS_IS_OK(ret = do_map_to_guest(NT_STATUS_NO_SUCH_USER, &server_info, user, domain))) { DEBUG(1,("Username %s is invalid on this system\n",user)); SAFE_FREE(user); SAFE_FREE(client); *************** *** 260,265 **** --- 261,267 ---- data_blob_free(&session_key); return ERROR_NT(NT_STATUS_LOGON_FAILURE); } + } else { /* setup the string used by %U */ *************** *** 275,280 **** --- 277,283 ---- data_blob_free(&session_key); return ERROR_NT(ret); } + } /* make_server_info_pw does not set the domain. Without this we end up * with the local netbios name in substitutions for %D. */