CONFIG_BUSYBOX_EXEC_PATH="/bin/busybox" and --install -s

Denys Vlasenko vda.linux at googlemail.com
Wed Sep 5 11:14:07 UTC 2007


On Tuesday 04 September 2007 17:29, Natanael Copa wrote:
> I'm upgrading to busybox-1.7.0 and ran into a warning message upn
> executing --install -s:
> 
> busybox: /bin/busybox: Invalid argument
> 
> THe problem is that i have set CONFIG_BUSYBOX_EXEC_PATH="/bin/busybox"
> 
> in applets/applets.c (around row 581) xmalloc_readlink_or_warn() is
> called:
> 
>         if (ENABLE_FEATURE_INSTALLER && strcmp(argv[1], "--install") == 0) {
>                 const char *busybox;
>                 busybox = xmalloc_readlink_or_warn(bb_busybox_exec_path);
>                 if (!busybox)
>                         busybox = bb_busybox_exec_path;
> 
> There is no xmalloc_realink() without the "_or_warn". There is a
> xmalloc_realpath() but....

I am adding one.

> It looks too me that nothing else is using this func at all, so it could
> be removed entirely. It does also consume lots of stackspace on uclibc
> by declaring char buf[PATH_MAX+1] on stack.

Thanks to -gc-sections, it never actually links in.

> I'd recommend to add busybox-1.7.0-install-warn.patch to fixes-1.7.0 and
> commit busybox-svn-xmalloc_readlink.patch which declares an
> xmalloc_readlink() and removes xmalloc_realpath() entirely to svn for
> next release.
> 
> Or do you prefer to keep and use xmalloc_realpath() but fix it to use
> char *buf = xmalloc(PATH_MAX+1) as done in the attatched
> busybox-1.7.0-realpath-stack.patch?

Oops.. I didn't read your mail to the end, and created another patch myself :(
basically diplicating your first suggestion.

I will apply this patch to svn and add it to 1.7.0 fixes.

Thanks!
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3.patch
Type: text/x-diff
Size: 2678 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070905/0004a0c8/attachment-0002.bin 


More information about the busybox mailing list