Changeset View
Changeset View
Standalone View
Standalone View
stand/efi/loader/main.c
Show First 20 Lines • Show All 1,433 Lines • ▼ Show 20 Lines | command_chain(int argc, char *argv[]) | ||||
name = argv[1]; | name = argv[1]; | ||||
if ((fd = open(name, O_RDONLY)) < 0) { | if ((fd = open(name, O_RDONLY)) < 0) { | ||||
command_errmsg = "no such file"; | command_errmsg = "no such file"; | ||||
return (CMD_ERROR); | return (CMD_ERROR); | ||||
} | } | ||||
#ifdef LOADER_VERIEXEC | |||||
if (verify_file(fd, name, 0, VE_MUST) < 0) { | |||||
sprintf(command_errbuf, "can't verify: %s", name); | |||||
close(fd); | |||||
return (CMD_ERROR); | |||||
} | |||||
#endif | |||||
if (fstat(fd, &st) < -1) { | if (fstat(fd, &st) < -1) { | ||||
command_errmsg = "stat failed"; | command_errmsg = "stat failed"; | ||||
close(fd); | close(fd); | ||||
return (CMD_ERROR); | return (CMD_ERROR); | ||||
} | } | ||||
status = BS->AllocatePool(EfiLoaderCode, (UINTN)st.st_size, &buf); | status = BS->AllocatePool(EfiLoaderCode, (UINTN)st.st_size, &buf); | ||||
if (status != EFI_SUCCESS) { | if (status != EFI_SUCCESS) { | ||||
▲ Show 20 Lines • Show All 93 Lines • Show Last 20 Lines |