1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

Compare commits

...

2 commits

Author SHA1 Message Date
Pete Batard
3e81b38c2d
[misc] try to support folks who use a symlink for their temp dir
* Microsoft's WIM mounting APIs can't use symlinked directories and
  some folks want to use a symlinked temp dir...
* Closes #2084
2023-06-05 14:08:25 +01:00
Pete Batard
71e99add76
[iso] increase ISO → ESP limit for Debian 12
* Debian 12 ARM64 netinst ISOs have doubled in size to be larger than 512 MB,
  so we need to increase MAX_ISO_TO_ESP_SIZE as a result.
* Also add extra NULL checks in process.c as some people seem to run into
  NULL deref issues.
* Also set version to rufus-next and update some URLs/text files.
2023-06-05 13:29:18 +01:00
10 changed files with 66 additions and 25 deletions

View file

@ -25,7 +25,7 @@ Checklist
--------- ---------
- [ ] I looked at https://github.com/pbatard/rufus/wiki/FAQ to see if my question has already been answered. - [ ] I looked at https://github.com/pbatard/rufus/wiki/FAQ to see if my question has already been answered.
- [ ] I performed a search in the issue tracker for similar issues using keywords relevant to my problem, such as the error message I got from the log. - [ ] I performed a search in the issue tracker for similar issues using keywords relevant to my problem, such as the error message I got from the log.
- [ ] I clicked the 'Log' button or pressed <kbd>Ctrl</kbd>-<kbd>L</kbd> in Rufus, or used [DebugView](https://learn.microsoft.com/en-us/sysinternals/downloads/debugview), and copy/pasted the log into the section that says `<FULL LOG>` below. - [ ] I clicked the 'Log' button (🗒️) or pressed <kbd>Ctrl</kbd>-<kbd>L</kbd> in Rufus, or used [DebugView](https://learn.microsoft.com/en-us/sysinternals/downloads/debugview), and copy/pasted the log into the section that says `<FULL LOG>` below.
- [ ] The log I am copying is the FULL log, starting with the line `Rufus version: x.y.z` - I have NOT removed any part of it. - [ ] The log I am copying is the FULL log, starting with the line `Rufus version: x.y.z` - I have NOT removed any part of it.
Additionally (if applicable): Additionally (if applicable):

View file

@ -3,7 +3,7 @@ o Version 4.1 (2023.05.31)
Restore MS-DOS drive creation through the download of binaries from Microsoft Restore MS-DOS drive creation through the download of binaries from Microsoft
Update the log button icon Update the log button icon
Fix UEFI:NTFS incompatibility with Windows Dev Kit 2023 platform Fix UEFI:NTFS incompatibility with Windows Dev Kit 2023 platform
Fix more out of range pointer errors with Ubuntu/Fedora when booting in BIOS mode Fix more GRUB 'out of range pointer' errors with Ubuntu/Fedora when booting in BIOS mode
o Version 4.0 (2023.04.26) o Version 4.0 (2023.04.26)
Fix persistent partition not working with Ubuntu 23.04 Fix persistent partition not working with Ubuntu 23.04

20
configure vendored
View file

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for rufus 4.1. # Generated by GNU Autoconf 2.71 for rufus 4.2.
# #
# Report bugs to <https://github.com/pbatard/rufus/issues>. # Report bugs to <https://github.com/pbatard/rufus/issues>.
# #
@ -611,8 +611,8 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='rufus' PACKAGE_NAME='rufus'
PACKAGE_TARNAME='rufus' PACKAGE_TARNAME='rufus'
PACKAGE_VERSION='4.1' PACKAGE_VERSION='4.2'
PACKAGE_STRING='rufus 4.1' PACKAGE_STRING='rufus 4.2'
PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues' PACKAGE_BUGREPORT='https://github.com/pbatard/rufus/issues'
PACKAGE_URL='https://rufus.ie' PACKAGE_URL='https://rufus.ie'
@ -1269,7 +1269,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures rufus 4.1 to adapt to many kinds of systems. \`configure' configures rufus 4.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1336,7 +1336,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of rufus 4.1:";; short | recursive ) echo "Configuration of rufus 4.2:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@ -1428,7 +1428,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
rufus configure 4.1 rufus configure 4.2
generated by GNU Autoconf 2.71 generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc. Copyright (C) 2021 Free Software Foundation, Inc.
@ -1504,7 +1504,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by rufus $as_me 4.1, which was It was created by rufus $as_me 4.2, which was
generated by GNU Autoconf 2.71. Invocation command line was generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw $ $0$ac_configure_args_raw
@ -2767,7 +2767,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='rufus' PACKAGE='rufus'
VERSION='4.1' VERSION='4.2'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@ -5309,7 +5309,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by rufus $as_me 4.1, which was This file was extended by rufus $as_me 4.2, which was
generated by GNU Autoconf 2.71. Invocation command line was generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@ -5365,7 +5365,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped' ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\ ac_cs_version="\\
rufus config.status 4.1 rufus config.status 4.2
configured by $0, generated by GNU Autoconf 2.71, configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"

View file

@ -1,4 +1,4 @@
AC_INIT([rufus], [4.1], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie]) AC_INIT([rufus], [4.2], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie])
AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies]) AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies])
AC_CONFIG_SRCDIR([src/rufus.c]) AC_CONFIG_SRCDIR([src/rufus.c])
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])

View file

@ -1104,7 +1104,7 @@ out:
// Extract all of the isolinux.bin files we found to identify their versions // Extract all of the isolinux.bin files we found to identify their versions
for (i=0; i<isolinux_path.Index; i++) { for (i=0; i<isolinux_path.Index; i++) {
char isolinux_tmp[MAX_PATH]; char isolinux_tmp[MAX_PATH];
static_sprintf(isolinux_tmp, "%s\\isolinux.tmp", temp_dir); static_sprintf(isolinux_tmp, "%sisolinux.tmp", temp_dir);
size = (size_t)ExtractISOFile(src_iso, isolinux_path.String[i], isolinux_tmp, FILE_ATTRIBUTE_NORMAL); size = (size_t)ExtractISOFile(src_iso, isolinux_path.String[i], isolinux_tmp, FILE_ATTRIBUTE_NORMAL);
if (size == 0) { if (size == 0) {
uprintf(" Could not access %s", isolinux_path.String[i]); uprintf(" Could not access %s", isolinux_path.String[i]);

View file

@ -724,6 +724,21 @@ static __inline DWORD GetModuleFileNameExU(HANDLE hProcess, HMODULE hModule, cha
return ret; return ret;
} }
static __inline DWORD GetFinalPathNameByHandleU(HANDLE hFile, char* lpszFilePath, DWORD cchFilePath, DWORD dwFlags)
{
DWORD ret = 0, err = ERROR_INVALID_DATA;
walloc(lpszFilePath, cchFilePath);
ret = GetFinalPathNameByHandleW(hFile, wlpszFilePath, cchFilePath, dwFlags);
err = GetLastError();
if ((ret != 0)
&& ((ret = wchar_to_utf8_no_alloc(wlpszFilePath, lpszFilePath, cchFilePath)) == 0)) {
err = GetLastError();
}
wfree(lpszFilePath);
SetLastError(err);
return ret;
}
static __inline DWORD GetFileVersionInfoSizeU(const char* lpFileName, LPDWORD lpdwHandle) static __inline DWORD GetFileVersionInfoSizeU(const char* lpFileName, LPDWORD lpdwHandle)
{ {
DWORD ret = 0, err = ERROR_INVALID_DATA; DWORD ret = 0, err = ERROR_INVALID_DATA;

View file

@ -159,6 +159,9 @@ static NTSTATUS PhDestroyHeap(VOID)
*/ */
static PVOID PhAllocate(SIZE_T Size) static PVOID PhAllocate(SIZE_T Size)
{ {
if (PhHeapHandle == NULL)
return NULL;
PF_INIT(RtlAllocateHeap, Ntdll); PF_INIT(RtlAllocateHeap, Ntdll);
if (pfRtlAllocateHeap == NULL) if (pfRtlAllocateHeap == NULL)
return NULL; return NULL;
@ -174,8 +177,10 @@ static PVOID PhAllocate(SIZE_T Size)
*/ */
static VOID PhFree(PVOID Memory) static VOID PhFree(PVOID Memory)
{ {
PF_INIT(RtlFreeHeap, Ntdll); if (PhHeapHandle == NULL)
return;
PF_INIT(RtlFreeHeap, Ntdll);
if (pfRtlFreeHeap != NULL) if (pfRtlFreeHeap != NULL)
pfRtlFreeHeap(PhHeapHandle, 0, Memory); pfRtlFreeHeap(PhHeapHandle, 0, Memory);
} }

View file

@ -3398,9 +3398,30 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
uprintf("Could not get system directory: %s", WindowsErrorString()); uprintf("Could not get system directory: %s", WindowsErrorString());
static_strcpy(system_dir, "C:\\Windows\\System32"); static_strcpy(system_dir, "C:\\Windows\\System32");
} }
// Per documentation, the returned string ends with a backslash
if (GetTempPathU(sizeof(temp_dir), temp_dir) == 0) { if (GetTempPathU(sizeof(temp_dir), temp_dir) == 0) {
uprintf("Could not get temp directory: %s", WindowsErrorString()); uprintf("Could not get temp directory: %s", WindowsErrorString());
static_strcpy(temp_dir, ".\\"); static_strcpy(temp_dir, ".\\");
} else {
// Some folks have found nothing better than configure their Windows installation to use
// a symlink for their temp dir, and it so happens that the Windows WIM mounting facility,
// which we need for applying the WUE options, can't handle symlinked directories. So we
// *attempt* to resolve the actual symlinked temp dir for this super limited number of
// users, with the hope that doing so is not going to break stuff elsewhere...
HANDLE handle = CreateFileU(temp_dir, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
// GetFinalPathNameByHandle returns a UNC path, which should be prefixed by '\\?\' or '\\.\'
if ((GetFinalPathNameByHandleU(handle, temp_dir, sizeof(temp_dir), FILE_NAME_OPENED) == 0) ||
((strstr(temp_dir, "\\\\?\\") != temp_dir) && (strstr(temp_dir, "\\\\.\\") != temp_dir))) {
uprintf("Could not get actual temp directory: %s", WindowsErrorString());
static_strcpy(temp_dir, ".\\");
} else {
// Need to remove the '\\?\' prefix or else we'll get issues with the Fido icon
strcpy(temp_dir, &temp_dir[4]);
// And me must re-append the '\' that gets removed by GetFinalPathNameByHandle()
static_strcat(temp_dir, "\\");
}
CloseHandle(handle);
} }
if (!SHGetSpecialFolderPathU(NULL, app_data_dir, CSIDL_LOCAL_APPDATA, FALSE)) { if (!SHGetSpecialFolderPathU(NULL, app_data_dir, CSIDL_LOCAL_APPDATA, FALSE)) {
uprintf("Could not get app data directory: %s", WindowsErrorString()); uprintf("Could not get app data directory: %s", WindowsErrorString());

View file

@ -75,7 +75,7 @@
#define MAX_PARTITIONS 16 // Maximum number of partitions we handle #define MAX_PARTITIONS 16 // Maximum number of partitions we handle
#define MAX_ESP_TOGGLE 8 // Maximum number of entries we record to toggle GPT ESP back and forth #define MAX_ESP_TOGGLE 8 // Maximum number of entries we record to toggle GPT ESP back and forth
#define MAX_IGNORE_USB 8 // Maximum number of USB drives we want to ignore #define MAX_IGNORE_USB 8 // Maximum number of USB drives we want to ignore
#define MAX_ISO_TO_ESP_SIZE 512 // Maximum size we allow for the ISO → ESP option (in MB) #define MAX_ISO_TO_ESP_SIZE 1024 // Maximum size we allow for the ISO → ESP option (in MB)
#define MAX_DEFAULT_LIST_CARD_SIZE 200 // Size above which we don't list a card without enable HDD or Alt-F (in GB) #define MAX_DEFAULT_LIST_CARD_SIZE 200 // Size above which we don't list a card without enable HDD or Alt-F (in GB)
#define MAX_SECTORS_TO_CLEAR 128 // nb sectors to zap when clearing the MBR/GPT (must be >34) #define MAX_SECTORS_TO_CLEAR 128 // nb sectors to zap when clearing the MBR/GPT (must be >34)
#define MAX_USERNAME_LENGTH 128 // Maximum size we'll accept for a WUE specified username #define MAX_USERNAME_LENGTH 128 // Maximum size we'll accept for a WUE specified username
@ -117,9 +117,9 @@
#define FILES_URL RUFUS_URL "/files" #define FILES_URL RUFUS_URL "/files"
#define FILES_DIR APPLICATION_NAME #define FILES_DIR APPLICATION_NAME
#define FIDO_VERSION "z1" #define FIDO_VERSION "z1"
#define SECURE_BOOT_MORE_INFO_URL "https://github.com/pbatard/rufus/wiki/FAQ#Why_do_I_need_to_disable_Secure_Boot_to_use_UEFINTFS" #define WPPRECORDER_MORE_INFO_URL "https://github.com/pbatard/rufus/wiki/FAQ#bsods-with-windows-to-go-drives-created-from-windows-10-1809-isos"
#define WPPRECORDER_MORE_INFO_URL "https://github.com/pbatard/rufus/wiki/FAQ#BSODs_with_Windows_To_Go_drives_created_from_Windows_10_1809_ISOs" #define SEVENZIP_URL "https://7-zip.org/"
#define SEVENZIP_URL "https://www.7-zip.org" // Generated by following https://randomascii.wordpress.com/2013/03/09/symbols-the-microsoft-way/
#define DISKCOPY_URL "https://msdl.microsoft.com/download/symbols/diskcopy.dll/54505118173000/diskcopy.dll" #define DISKCOPY_URL "https://msdl.microsoft.com/download/symbols/diskcopy.dll/54505118173000/diskcopy.dll"
#define DISKCOPY_USER_AGENT "Microsoft-Symbol-Server/10.0.22621.755" #define DISKCOPY_USER_AGENT "Microsoft-Symbol-Server/10.0.22621.755"
#define DISKCOPY_SIZE 0x16ee00 #define DISKCOPY_SIZE 0x16ee00

View file

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 232, 326 IDD_DIALOG DIALOGEX 12, 12, 232, 326
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 4.1.2045" CAPTION "Rufus 4.2.2047"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0 FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -392,8 +392,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,1,2045,0 FILEVERSION 4,2,2047,0
PRODUCTVERSION 4,1,2045,0 PRODUCTVERSION 4,2,2047,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -411,13 +411,13 @@ BEGIN
VALUE "Comments", "https://rufus.ie" VALUE "Comments", "https://rufus.ie"
VALUE "CompanyName", "Akeo Consulting" VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus" VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "4.1.2045" VALUE "FileVersion", "4.2.2047"
VALUE "InternalName", "Rufus" VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2023 Pete Batard (GPL v3)" VALUE "LegalCopyright", "© 2011-2023 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
VALUE "OriginalFilename", "rufus-4.1.exe" VALUE "OriginalFilename", "rufus-4.2.exe"
VALUE "ProductName", "Rufus" VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "4.1.2045" VALUE "ProductVersion", "4.2.2047"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"