Changeset View
Changeset View
Standalone View
Standalone View
stand/common/module.c
Show First 20 Lines • Show All 460 Lines • ▼ Show 20 Lines | file_loadraw(const char *fname, char *type, int insert) | ||||
if ((fd = open(name, O_RDONLY)) < 0) { | if ((fd = open(name, O_RDONLY)) < 0) { | ||||
snprintf(command_errbuf, sizeof(command_errbuf), | snprintf(command_errbuf, sizeof(command_errbuf), | ||||
"can't open '%s': %s", name, strerror(errno)); | "can't open '%s': %s", name, strerror(errno)); | ||||
free(name); | free(name); | ||||
return(NULL); | return(NULL); | ||||
} | } | ||||
#ifdef LOADER_VERIEXEC | #ifdef LOADER_VERIEXEC | ||||
if (verify_file(fd, name, 0, VE_MUST) < 0) { | /* | ||||
* Permit anything to be loaded as entropy cache. | |||||
* It will change every time the system is booted, | |||||
* so we can't really verify it. | |||||
*/ | |||||
if (strcmp(type, "boot_entropy_cache") && | |||||
strcmp(type, "/boot/entropy") && /* For compatibility. */ | |||||
imp: I'd prefer we use the != 0 on strcmp here rather than have it implicit. | |||||
verify_file(fd, name, 0, VE_MUST) < 0) { | |||||
sprintf(command_errbuf, "can't verify '%s'", name); | sprintf(command_errbuf, "can't verify '%s'", name); | ||||
free(name); | free(name); | ||||
close(fd); | close(fd); | ||||
return(NULL); | return(NULL); | ||||
} | } | ||||
#endif | #endif | ||||
if (archsw.arch_loadaddr != NULL) | if (archsw.arch_loadaddr != NULL) | ||||
▲ Show 20 Lines • Show All 672 Lines • Show Last 20 Lines |
I'd prefer we use the != 0 on strcmp here rather than have it implicit.