Add missing boot.4th verification

During initialization of the forth interpreter
the loader looks for "/boot/boot.4th"
and executes any code found there.
That file was loaded bypassing verification.
Add a call to verify_file to change that.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: sjg
Obtained from: Semihalf
Sponsored by: Stormshield
This commit is contained in:
Marcin Wojtas 2019-03-19 02:45:32 +00:00
parent 3caad0b8f4
commit c42e554dc9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=345289

View File

@ -283,6 +283,12 @@ bf_init(void)
/* try to load and run init file if present */
if ((fd = open("/boot/boot.4th", O_RDONLY)) != -1) {
#ifdef LOADER_VERIEXEC
if (verify_file(fd, "/boot/boot.4th", 0, VE_GUESS) < 0) {
close(fd);
return;
}
#endif
(void)ficlExecFD(bf_vm, fd);
close(fd);
}