From 05a1e56a35e82d440594ed179e470098fc345712 Mon Sep 17 00:00:00 2001 From: srs5694 Date: Mon, 7 Jan 2013 18:03:53 -0500 Subject: [PATCH] Fixed bug that could hang system if a filesystem name was shorter than three characters. --- NEWS.txt | 6 ++++++ docs/refind/configfile.html | 2 +- docs/refind/getting.html | 6 +++--- refind.spec | 4 ++-- refind/main.c | 7 ++++--- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/NEWS.txt b/NEWS.txt index 9102215..fe96fcf 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,3 +1,9 @@ +0.6.4 (1/?/2013): +----------------- + +- Fixed bug that could cause a hang on boot if any partition had a name + that was less than three characters long. + 0.6.3 (1/6/2013): ----------------- diff --git a/docs/refind/configfile.html b/docs/refind/configfile.html index eb85930..3b8e271 100644 --- a/docs/refind/configfile.html +++ b/docs/refind/configfile.html @@ -400,7 +400,7 @@ menuentry "Windows via shell script" {
mm 0003003E 8 -pci
 fs0:\EFI\Microsoft\Boot\bootmgfw.efi
-

This example writes data to the computer's PCI bus via the EFI shell's mm command and then launches Windows. Chances are you won't need to engage in such operations, and I do not recommend you try this exact example unless you know what you're doing! This command was required to activate the video hardware on a computer of a person with whom I corresponded prior to booting Windows, but such needs are rare.

+

This example writes data to the computer's PCI bus via the EFI shell's mm command and then launches Windows. Chances are you won't need to engage in such operations, and I do not recommend you try this exact example unless you know what you're doing! This command was required to activate the video hardware on a computer of a person with whom I corresponded prior to booting Windows, but such needs are rare. Another example of a similar approach can be found in this forum thread. A few pointers on finding addresses for your hardware can be found in this post.

You can combine these OS stanzas with the global refind.conf options presented earlier. The result would contain just two entries on the rEFInd boot menu (for Gentoo and Windows, since the Ubuntu entry is disabled), unless rEFInd found other boot options on an external or optical disk.

diff --git a/docs/refind/getting.html b/docs/refind/getting.html index 1b25ff7..0e720d2 100644 --- a/docs/refind/getting.html +++ b/docs/refind/getting.html @@ -117,7 +117,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

href="installing.html">Installing rEFInd page.
  • A + href="http://sourceforge.net/projects/refind/files/0.6.3/refind-0.6.3-2.x86_64.rpm/download">A binary RPM file—If you use an RPM-based x86-64 Linux system such as Fedora or openSUSE, you can install the binary RPM package rather than use the binary zip file. (I don't provide an @@ -126,13 +126,13 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

    rEFInd page) as part of the installation process. Distribution maintainers can examine the refind.spec file in the source package and tweak it to their needs. The source + href="http://sourceforge.net/projects/refind/files/0.6.3/refind-0.6.3-2.src.rpm/download">source RPM file might or might not build on your system as-is; it relies on assumptions about the locations of the GNU-EFI development files.
  • A + href="http://sourceforge.net/projects/refind/files/0.6.3/refind_0.6.3-2_amd64.deb/download">A binary Debian package—If you use an x86-64 version of Debian, Ubuntu, Mint, or another Debian-based distribution, you can install from this package, which was converted from the binary RPM diff --git a/refind.spec b/refind.spec index aaa3145..152e2ad 100644 --- a/refind.spec +++ b/refind.spec @@ -1,7 +1,7 @@ Summary: EFI boot manager software Name: refind -Version: 0.6.3 -Release: 2%{?dist} +Version: 0.6.3.2 +Release: 1%{?dist} License: GPLv3 URL: http://www.rodsbooks.com/refind/ Group: System Environment/Base diff --git a/refind/main.c b/refind/main.c index 46062c7..669cdb8 100644 --- a/refind/main.c +++ b/refind/main.c @@ -128,7 +128,7 @@ static VOID AboutrEFInd(VOID) if (AboutMenu.EntryCount == 0) { AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT); - AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.6.3"); + AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.6.3.2"); AddMenuInfoLine(&AboutMenu, L""); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer"); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith"); @@ -908,7 +908,7 @@ static BOOLEAN ShouldScan(REFIT_VOLUME *Volume, CHAR16 *Path) { if (VolName != NULL) { if ((StriCmp(VolName, Volume->VolName) == 0) && (StriCmp(DontScanDir, Path) == 0)) ScanIt = FALSE; - if ((VolName[0] == L'f') && (VolName[1] == L's') && (VolName[2] >= L'0') && (VolName[2] <= L'9')) { + if ((StrLen(VolName) > 2) && (VolName[0] == L'f') && (VolName[1] == L's') && (VolName[2] >= L'0') && (VolName[2] <= L'9')) { VolNum = Atoi(VolName + 2); if ((VolNum == Volume->VolNumber) && (StriCmp(DontScanDir, Path) == 0)) ScanIt = FALSE; @@ -1032,7 +1032,8 @@ static VOID ScanEfiFiles(REFIT_VOLUME *Volume) { SplitVolumeAndFilename(&Directory, &VolName); CleanUpPathNameSlashes(Directory); Length = StrLen(Directory); - if ((Length > 0) && (VolName[0] == L'f') && (VolName[1] == L's') && (VolName[2] >= L'0') && (VolName[2] <= L'9')) + if ((Length > 0) && (StrLen(VolName) > 2) && (VolName[0] == L'f') && (VolName[1] == L's') && + (VolName[2] >= L'0') && (VolName[2] <= L'9')) VolNum = Atoi(VolName + 2); if ((Length > 0) && ((VolName == NULL) || (StriCmp(VolName, Volume->VolName) == 0) || (Volume->VolNumber == VolNum))) ScanLoaderDir(Volume, Directory, MatchPatterns); -- 2.39.2