How did you echo?
- echo linux_enable="YES" > /boot/loader
- echo linux_enable="YES" >> /boot/loader
The first command will have overwritten "boot/loader" with
linux_enable=YES. IOW the former contents is gone, which is bad.
The second command only will have appended
linux_enable=YES to the end of the program/binary
loader which usually is not that harmful.
I just did this on OpenBSD
Code:
$ mkdir temp
$ cd temp
$ cp /bin/ls .
$ ls -l
total 448
-r-xr-xr-x 1 j65nko j65nko 210416 Aug 23 01:20 ls
$ chmod +w ls
$ ls -l
total 448
-rwxr-xr-x 1 j65nko j65nko 210416 Aug 23 01:20 ls
$ echo echo linux_enable="YES" >>ls
$ ls -l
total 448
-rwxr-xr-x 1 j65nko j65nko 210438 Aug 23 01:21 ls
$ ./ls -l
total 448
-rwxr-xr-x 1 j65nko j65nko 210438 Aug 23 01:21 ls
Here the ls binary with the appended text just executes. Cannot guarantee
loader will do the same or whether BTX will complain
From man loader
Code:
DESCRIPTION
The program called loader is the final stage of FreeBSD's kernel boot-
strapping process. On IA32 (i386) architectures, it is a BTX client. It
is linked statically to libstand(3) and usually located in the directory
/boot.