CONFIG_BUSYBOX_EXEC_PATH="/bin/busybox" and --install -s
Natanael Copa
natanael.copa at gmail.com
Tue Sep 4 09:29:57 PDT 2007
Hi,
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;
/* -s makes symlinks */
install_links(busybox,
argv[2] && strcmp(argv[2], "-s") == 0);
return 0;
}
There is no xmalloc_realink() without the "_or_warn". There is a
xmalloc_realpath() but....
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:
char *xmalloc_realpath(const char *path)
{
#if defined(__GLIBC__) && !defined(__UCLIBC__)
/* glibc provides a non-standard extension */
return realpath(path, NULL);
#else
char buf[PATH_MAX+1];
/* on error returns NULL (xstrdup(NULL) ==NULL) */
return xstrdup(realpath(path, buf));
#endif
}
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?
-nc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox-1.7.0-install-warn.patch
Type: text/x-patch
Size: 412 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20070904/4a050c85/attachment-0003.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox-svn-xmalloc_readlink.patch
Type: text/x-patch
Size: 2160 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20070904/4a050c85/attachment-0004.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox-1.7.0-realpath-stack.patch
Type: text/x-patch
Size: 457 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20070904/4a050c85/attachment-0005.bin
More information about the busybox
mailing list