On Wed, Apr 20, 2016 at 5:15 PM, Ron Yorston <[email protected]> wrote:
> Denys Vlasenko wrote:
>>Downside: "busybox BOGUSNAME" has a small chance of actually working
>>as some applet, if hash(BOGUSNAME) is matching something.
>
> Whatever you do, don't run 'busybox rwok -rf /'.
Exactly.
But that in real world usage is not much of a problem.
Chances of mistakenly typing "busybox rwok -rf /" are about the same
as chances of mistakenly typing "busybox rm -rf /".
More importantly, people aren't typically type "busybox foo ..." -
they rely on symlinked names and they just type "foo ...".
And there is no "rwok" symlink. "rwok -rf /" won't work.
This patch amounts to inventing a poor man's Lempel-Ziv
for applet names, and the logical step is just to use gzip
(since we have its decompressor anyway).
There is a case when applet names are not necessary at all.
They are needed for four users: FEATURE_INSTALLER,
FEATURE_TAB_COMPLETION + FEATURE_SH_STANDALONE,
ASH_HELP + FEATURE_SH_STANDALONE,
and the last one is unconditional:
$ busybox
BusyBox v1.25.0.git (2016-04-21 15:51:50 CEST) multi-call binary.
...
Currently defined functions:
[, [[, acpid, add-shell, addgroup, adduser, adjtimex, ar, arp,
arping, ash...
Yes. This list also requires applet names[].
If you add an option to make this output disable-able,
then even gzipped applet names[] can be dropped in some .configs,
leaving only a name hash table.
Care to cook up such a patch?
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox