Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #524 Shim unable to locate grubx64 in PXE boot mode when grubx… #551

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions netboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,10 @@ static EFI_STATUS parseDhcp4()
UINT8 *dir = pkt_v4->BootpBootFile;

for (i = dir_len; i >= 0; i--) {
if (dir[i] == '/')
break;
if ((dir[i] == '/') || (dir[i] == '\\'))
break;
}

dir_len = (i >= 0) ? i + 1 : 0;

full_path = AllocateZeroPool(dir_len + template_len);
Expand All @@ -277,6 +278,11 @@ static EFI_STATUS parseDhcp4()
strncpy(full_path, (CHAR8 *)dir, dir_len);
if (full_path[dir_len-1] == '/' && template[0] == '/')
full_path[dir_len-1] = '\0';
// check for paths with back slash condition
if (full_path[dir_len-1] == '\\' && template[0] == '/') {
full_path[dir_len-1] = '\0';
template[0] = '\\';
}
}
if (dir_len == 0 && dir[0] != '/' && template[0] == '/')
template_ofs++;
Expand Down