On Thu, Apr 21, 2016 at 9:06 PM, Tito <[email protected]> wrote: > > > On 04/21/2016 06:02 PM, Denys Vlasenko wrote: >> >> 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 /". > > > Hi, > you forget Murphy's law.... > I still wonder if all this machinery is really needed > just to remove the applets name table which was the > cleanest solution in this case.
I mostly agree. That's why I'm pushing it on Ron. If he really wants this, *he* will have to work on a patch :) > It looks to me that we are doing this just because we can and > accept by the way chances of the user mistankenly typing > this or that or small chances of collisions... Collisions are impossible: hash is chosen at compile time so that all applet names hash to unique integers. All defined applets will always work correctly, without aliasing. > Why not use: > > handle = dlopen(NULL, RTLD_LAZY); > asprintf(&function_name, "%s_main", argv[0]); > *(void **) (&function_main) = dlsym(handle, function_name); > > its as exotic and needs no table at all and has no chances of chances > ;-) I use static builds most of the time, there this won't work. >> $ 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, > > > How will you than know what applets are compiled in > by trying them one by one? 8-) Since it's a config option, presumably whoever turns that option off in his build knows what he's doing. _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
