Commit Graph

827 Commits

Author SHA1 Message Date
"Robert P. J. Day"
edd9ca5743 More removal of "#if 0" content. 2006-07-01 14:52:12 +00:00
"Robert P. J. Day"
68229837ff Remove all usage of the "register" storage class specifier. 2006-07-01 13:08:46 +00:00
Rob Landley
8bbdb8732f This kind of paranoia is a debug option at best. 2006-06-30 16:36:56 +00:00
Rob Landley
a6e6037219 Fix bug http://bugs.busybox.net/view.php?id=874 where hexdump -C got its
spacing wrong.
2006-06-28 14:36:50 +00:00
Rob Landley
22f383e695 Fix http://bugs.busybox.net/view.php?id=906 which could cause failures in top. 2006-06-27 18:14:12 +00:00
Rob Landley
a892bf8284 Whitespace. (Vim's auto-indent is kind of annoying at times, like "daytime"
and "nighttime"...)
2006-06-25 15:37:28 +00:00
Rob Landley
934da82913 Fix a possible race condition if two processes try to claim the same loop
device at the same time.  We should only CLR_FD if the set status fails,
not if the SET_FD fails.
2006-06-25 15:29:12 +00:00
Rob Landley
c983274565 The logic to make cp -d or -P treat things like regular files should only
trigger for symlinks, not for device nodes.  This should fix "cp -a /dev ."
to work as expected (when run by root, anyway).

While I was there, cleanup headers and make an #ifdef go away...
2006-06-24 21:27:36 +00:00
Rob Landley
8437ede6c2 The type changed too. 2006-06-20 16:43:05 +00:00
Peter Kjellerstedt
5ab8f7de4f Use the new names for tty_baud_to_value() and tty_value_to_baud() again. 2006-06-20 16:35:37 +00:00
Rob Landley
57c1f73dd5 Revert the last two patches to go back to a state before this file was
controversial.
2006-06-20 16:17:24 +00:00
Rob Landley
290fcb4213 Undo all of the ugliness and some of the bloat from 15412. 2006-06-18 23:59:03 +00:00
Rob Landley
ea224be6aa skip_whitespace() shouldn't claim its return value is const, it doesn't know
that and callers wind up typecasting it back.
2006-06-18 20:20:07 +00:00
Mike Frysinger
b000586d02 danf writes: stty doesn't support baud rates > 460800 bps, the attached patch adds support for all baud rates supported by Linux 2.6.16 on x86. 2006-06-17 22:41:28 +00:00
Rob Landley
d9a761d9c3 Revert svn 15333. If you vfork, you must either exec or exit. (The parent is
blocked until you do so.)
2006-06-16 16:35:53 +00:00
Rob Landley
c7ddefc062 Attempt at fixing bug 815 by upgrading bb_spawn() so that builtins are at
the start of the path.  (This should be under the same config option as
the standalone shell, but right now that's buried in the shell menu.)

Also add the ability to specify CONFIG_BUSYBOX_EXEC_PATH with /proc/self/exe
as an overrideable default.
2006-06-14 01:24:33 +00:00
Rob Landley
18958e9309 Random cleanup of platform.h. 2006-06-13 18:28:33 +00:00
Bernhard Reutner-Fischer
2d1a6e7c1f - fix bug #887, in bb_get_chomped_line_from_file(), the last char was removed
unconditionally, even if it was not a newline.
  This was apparently broken by r14254
- whitespace while at it.
2006-06-10 11:04:43 +00:00
Paul Fox
6ab037872f made "test" an ash built-in.
moved the contents of libbb/bb_echo.c back into coreutils/echo.c,
which is a more reasonable place for them than libbb.  this
forces anyone who wants echo and test to be builtin to ash to
also have them available as applets.  their cost is very small,
and the number of people who wouldn't want them as applets is
also very small.

added warning about shell builtins vs. CONFIG_FEATURE_SH_STANDALONE_SHELL,
which conflicts with their use.

thanks to nathanael copa for debugging help.

some string size optimization in test.c may have been lost with
this commit, but this is a good new baseline.
2006-06-08 21:37:26 +00:00
Mike Frysinger
6fb5847faf sometimes daemonizing and vfork()/exit() is ok 2006-06-07 21:48:30 +00:00
Mike Frysinger
ca70774293 bb_xdaemon() isnt available on no-mmu systems 2006-06-07 21:47:34 +00:00
Mike Frysinger
373af43bb0 comment all fields 2006-06-07 21:37:59 +00:00
Mike Frysinger
301ad67912 add reference to proc(5) 2006-06-07 20:24:34 +00:00
Bernhard Reutner-Fischer
19008b8373 - reuse strings and messages. Saves about 600B 2006-06-07 20:17:41 +00:00
Mike Frysinger
828d6bb3bc whitespace 2006-06-07 20:04:13 +00:00
Mike Frysinger
62a2c15376 whitespace 2006-06-07 20:03:13 +00:00
Bernhard Reutner-Fischer
f9437aaf5b - make getopt_ulflags aware of CONFIG_GETOPT_LONG 2006-05-31 14:12:51 +00:00
Bernhard Reutner-Fischer
f3ac9ebc8e - convert xcalloc(1,x) to xzalloc 2006-05-31 13:31:16 +00:00
Bernhard Reutner-Fischer
c418d482ba - s/defined(__uClinux__)/BB_NOMMU/
This needs a second pass to:
+ add bb_daemon(unsigned char no_chdir, unsigned char no_close, const char*flag)
+ eventually globally export argc and argv, so we don't need to pass it to
  bb_daemon().
2006-05-31 10:19:51 +00:00
Rob Landley
bba7f08d27 Add SWAP_LE?? and SWAP_BE?? macros, and make things use them. Converts values
to/from little endian or big endian, which is a NOP if that's what the current
platform already is.
2006-05-29 05:51:12 +00:00
Rob Landley
8bb50782a5 Change llist_add_* to take the address of the list rather than returning the new
head, and change all the callers.
2006-05-26 23:44:51 +00:00
Rob Landley
5edc10275e Slight sanity fix: data is void *, not char *. And it's called data
almost everywhere, so be consistent.
2006-05-26 23:00:10 +00:00
Bernhard Reutner-Fischer
781e42d66c - introduce and use bb_path_wtmp_file for portability (saves 11 Bytes).
- fix last.c to also look at the double-underscore UT_ defines.
2006-05-26 14:41:40 +00:00
Bernhard Reutner-Fischer
76b82cfd6f - make find_mount_point conditional on df and eject; Fixes `make hosttools´ on
hosts where mntent.h does not exist.
2006-05-26 13:38:43 +00:00
Mike Frysinger
4f93a63467 errno and h_errno values are not the same #876 by rfelker 2006-05-26 01:56:42 +00:00
Rob Landley
399d2b5c24 Rich Felker suggested removing dprintf() from watch, and one thing led to
another... This adds bb_xspawn() support, which does vfork/exec.  (I don't
know why using a static instead of a local adds ~40 bytes, but using
the local doesn't work...)
2006-05-25 23:02:40 +00:00
Rob Landley
80b8ff07ca A pending item in my tree I might as well check in: I plan to migrate calloc()
and bb_calloc() calls to bb_xzalloc() which allocates prezeroed memory but
only takes one argument (the size).
2006-05-19 20:36:49 +00:00
Bernhard Reutner-Fischer
b1629b1b2a - remove emacs layout block as suggested by Robert P.J. Day
- use shorter boilerplate while at it
2006-05-19 19:29:19 +00:00
Bernhard Reutner-Fischer
0a8812bdc5 - replace _PATH_DEVNULL with bb_dev_null 2006-05-19 13:12:21 +00:00
Bernhard Reutner-Fischer
38583fd6f2 - use uint32_t instead of __u32
Thanks to Rich Felker for pointing this out.
2006-05-19 12:44:16 +00:00
Bernhard Reutner-Fischer
a2a647dfc1 - include strings.h
Thanks to Rich Felker for pointing this out.
2006-05-19 12:30:00 +00:00
Bernhard Reutner-Fischer
e2e56c7c41 - single KERNEL_VERSION(a,b,c) macro in platform.h
- rename get_kernel_revision() to get_linux_version_code
from Robert P. J. Day
2006-05-19 11:54:02 +00:00
Rob Landley
34b5319d86 Make md5 calculation always go through an the buffer so that A) we don't
handle packets out of sequence if some data goes through the buffer and
some doesn't, B) it works on systems that can't handle aligned access,
C) we just have one code path to worry about.

While we're at it, sizeof() and RESERVE_CONFIG_BUFFER() really don't combine
well, which is why md5sum has been reading and processing data 4 bytes at a
time.  I suspect that the existence of CONFIG_MD5_SIZE_VS_SPEED to do loop
unrolling and such in the algorithm was an attempt to work around that bug.
2006-05-16 02:38:26 +00:00
Bernhard Reutner-Fischer
2f38f27b42 - patch from Robert P. J. Day to use filter instead of findstring. 2006-05-15 10:04:50 +00:00
Mike Frysinger
39440e520c pull Rules.mak from top_srcdir as pointed out by Robert P. J. Day on the mailing list 2006-05-13 02:33:09 +00:00
Rob Landley
f7897ec47b Autodetect parts of a multipart file, from Robert P. Day's suggestion. 2006-05-12 01:42:33 +00:00
Rob Landley
cc848ddbf8 Bug fix from Vladimir Oleynik, and suggestion I add my copyright notice
to the file.
2006-05-11 18:25:24 +00:00
Rob Landley
a6b5b60942 Fiddling with llist to make memory management easier. Specifically, the
option to delete the contents of the list when we delete the list is a
good thing.
2006-05-08 19:03:07 +00:00
Rob Landley
0ea0aefcb5 Remove a link that leaked in from the pending llist_t changes. 2006-05-08 15:08:25 +00:00
Rob Landley
a389651115 Remove bb_strlen() in favor of -fno-builtin-strlen. Saves as many bytes
as the old optimization did (actually does slightly better under gcc 4.0), and
simplifies the code.
2006-05-07 20:20:34 +00:00
Rob Landley
2c39eee805 Migrate endianness macros. 2006-05-05 16:54:40 +00:00
Rob Landley
552b56dfd1 Not quite compiler independent, but we've never tried to be gcc independent
anyway.  This is at least less ugly than what was there before, and fixes
building all sources at once.
2006-05-04 21:22:27 +00:00
Rob Landley
f76cd964ec Whitespace and documentation cleanup from Dennis Vlasenko. 2006-05-03 21:23:15 +00:00
Rob Landley
7818a422bc Portability tweak from Shaun Jackman, don't include asm/page.h directly. 2006-04-25 18:42:23 +00:00
Rob Landley
bbd50b58ea Remove some #if 0 code. 2006-04-18 20:42:39 +00:00
Bernhard Reutner-Fischer
54f75ee300 - BusyBox is under GPL.
in http://www.busybox.net/lists/busybox/2006-April/020364.html Denis Vlasenko
  said when asked which license to use for these files:
  "Sure. LGPL or GPL is fine with me."
  Adjusting accordingly.
2006-04-18 08:24:13 +00:00
Mike Frysinger
1a54030445 use memmove() instead of bcopy() 2006-04-16 05:58:21 +00:00
Mike Frysinger
78bd504947 use memcmp() not bcmp() 2006-04-16 05:51:47 +00:00
Bernhard Reutner-Fischer
c2cb0f32b4 - patch from Denis Vlasenko to add and use bb_xopen3() 2006-04-13 12:45:04 +00:00
Bernhard Reutner-Fischer
d9cf7ac781 - patch from Denis Vlasenko to add and use bb_xchdir() 2006-04-12 18:39:58 +00:00
Bernhard Reutner-Fischer
67f641e75b - patch from Denis Vlasenko to add bb_xbind() and bb_xlisten() 2006-04-12 18:24:37 +00:00
Bernhard Reutner-Fischer
2c99851181 - patch from Denis Vlasenko to add and use bb_xdaemon() 2006-04-12 18:09:26 +00:00
Bernhard Reutner-Fischer
dac7ff15b7 - patch from Denis Vlasenko to add and use bb_xsocket() and to use
bb_xopen some more while at it.
  Also use shorter boilerplate while at it.
2006-04-12 17:55:51 +00:00
Bernhard Reutner-Fischer
cb44816ba3 - add and use bb_opendir(), bb_xopendir().
text    data     bss     dec     hex filename
 889445    9392 1035784 1934621  1d851d busybox.gcc-4.2.orig
 889297    9392 1035784 1934473  1d8489 busybox.gcc-4.2
 889009    9820 1037860 1936689  1d8d31 busybox.gcc-4.1.orig
 888817    9820 1037860 1936497  1d8c71 busybox.gcc-4.1
2006-04-12 07:35:12 +00:00
Rob Landley
c57ec37959 Patch from Rob Sullivan to consolidate crc32 table generation. 2006-04-10 17:07:15 +00:00
Bernhard Reutner-Fischer
fa939aae81 - include proper headers. 2006-04-05 16:21:37 +00:00
Bernhard Reutner-Fischer
421d9e5941 - move buffer allocation schemes to libbb.h
- include the correct headers: applets need busybox.h while lib* need libbb.h
2006-04-03 16:39:31 +00:00
Rob Landley
a13cca9cf4 New version from Tito. 2006-04-02 18:57:20 +00:00
Bernhard Reutner-Fischer
d409c3a2f7 - Rich Felker writes: fix invalid printf format strings
http://busybox.net/lists/busybox/2006-March/019568.html

   text	   data	    bss	    dec	    hex	filename
 900619	  10316	1038724	1949659	 1dbfdb	busybox.oorig
 900603	  10316	1038724	1949643	 1dbfcb	busybox
2006-03-29 22:34:47 +00:00
Rob Landley
ca087713f2 More extern removal from Robert P. Day. 2006-03-29 16:52:56 +00:00
Bernhard Reutner-Fischer
cb8d4319a3 find ./ -name .cvsignore | xargs svn rm 2006-03-29 15:51:19 +00:00
Mike Frysinger
f885513940 just whitespace fixes 2006-03-28 02:35:56 +00:00
Rob Landley
3570915769 More dead code removal. 2006-03-26 21:49:42 +00:00
Rob Landley
1bb31928d5 Bug spotted by Stephane Billiart: losetup depends on loop.c. 2006-03-23 16:49:22 +00:00
Rob Landley
fb3a631310 Very nice patch from Rich Felker to portably set the stream error indicator and
thus remove a lot of nasty old code that didn't.
2006-03-23 15:30:26 +00:00
Rob Landley
8dd4ca787a Patch from Shaun Jackman to make loop.c build only when needed. 2006-03-21 16:22:19 +00:00
Bernhard Reutner-Fischer
263e75d051 - fix order of includes. 2006-03-18 11:59:55 +00:00
Rob Landley
aae8b3405e Whitespace cleanup and minor tweak (return -ERRNO instead of ERRNO so
EPERM doesn't register as a successful read-only mount.
2006-03-18 02:38:10 +00:00
Rob Landley
ea9a471acd Random in-passing tweak. 2006-03-16 14:40:27 +00:00
Rob Landley
31642d75e1 More "extern" removals from Robert P. Day 2006-03-14 21:45:38 +00:00
Rob Landley
386f85eadf Attempt to make a warning go away without increasing size. 2006-03-14 21:13:48 +00:00
Bernhard Reutner-Fischer
df10094870 - revert back to r14406 2006-03-13 19:04:00 +00:00
Rob Landley
c5b1d4d6b1 Patch from Denis Vlasenko to add xstat() and use it. 2006-03-13 15:45:16 +00:00
Rob Landley
bc68cd14cc Patch from Denis Vlasenko turning static const int (which gets emitted into
the busybox binary) into enums (which don't).
2006-03-10 19:22:06 +00:00
Rob Landley
1f305dc0fd Portability patch from rfelker. The bb_asprintf.c thing needs an eventual
follow up in platform.h to set the #ifdef, but the workaround works for
everybody, so...
2006-03-09 22:21:20 +00:00
Bernhard Reutner-Fischer
07a79e75f5 - backout using features which are not available with the previous stable
version of make (3.71.1).
2006-03-09 09:03:37 +00:00
Rob Landley
dfba741457 Robert P. Day removed 8 gazillion occurrences of "extern" on function
definitions.  (That should only be on prototypes.)
2006-03-06 20:47:33 +00:00
Bernhard Reutner-Fischer
e3ec99de82 - remove unused lists *-m 2006-03-02 18:23:13 +00:00
Bernhard Reutner-Fischer
022eb311d5 - use absolute path for top_builddir and top_srcdir.
Fixes make trying to include the very same file in an endless loop.
2006-03-02 17:33:25 +00:00
Bernhard Reutner-Fischer
5d26126b9e - fixes parallel builds (make -j)
- use less resources for the buildsystem itself
2006-03-01 22:54:48 +00:00
Rob Landley
2b26fd5570 A few changes falling out from the effort to make sed handle embedded NUL bytes.
Checking in to reduce the diff between my tree and svn...
2006-02-24 02:30:39 +00:00
Mike Frysinger
992a58c216 document leading + option 2006-02-22 22:56:30 +00:00
Rob Landley
87b9573ff8 Forgot to check this in last night, part of the hash_fd breakup. 2006-02-21 15:04:07 +00:00
Rob Landley
5cf7c2df66 Patch from Devin Bayer to split up hash_fd.c into md5.c and sha1.c. (I tweaked
md5_sha1_sum.c to convert some #ifdef CONFIG to if(ENABLE).)
2006-02-21 06:44:43 +00:00
Mike Frysinger
57f4cb2867 a few more comment touchups 2006-02-21 00:50:37 +00:00
Mike Frysinger
e17c80e604 translate Russian-English to just plain English 2006-02-21 00:37:42 +00:00
"Vladimir N. Oleynik"
7673ccad60 sync with mainstream, but check more 2006-02-20 16:57:36 +00:00
Rob Landley
081d6d4380 getdomainname() isn't guaranteed to null terminate the string if it was
truncated for length.  SVN 14135 made sure that the truncated version would
always be null terminated.  SVN 14144 broke this for no readily apparent
reason, and I have no idea what it was even trying to accomplish.  Reverted.
2006-02-20 16:31:44 +00:00
"Vladimir N. Oleynik"
0c6ff43a0c remove #undef strlen, use #define strlen always but without xfunc/BB_STRLEN_IMPLEMENTATION 2006-02-20 12:15:10 +00:00
"Vladimir N. Oleynik"
d24d083061 correction get(host/domain)name usage, revert 742 bug 2006-02-20 10:44:02 +00:00
Rob Landley
4e9deec8bf svn 14077 was completely broken and apparently never tested. 2006-02-20 02:44:30 +00:00
Mike Frysinger
dce17c6268 rfelker writes in Bug 742: make sure string is null terminated after calling gethostname 2006-02-19 23:03:31 +00:00
Mike Frysinger
294254ce6b rfelker writes in Bug 740: s/u_char/unsigned char/ 2006-02-19 22:59:12 +00:00
"Vladimir N. Oleynik"
06776b3650 type typo. Thanks, Devin Bayer 2006-02-17 09:33:22 +00:00
"Vladimir N. Oleynik"
dd1ccddf1b moved BB_BANNER to applets/version.c file: make kernel like version,
removed depend loop: busybox.h depend with BB_BT, and all sources depend with busybox.h
2006-02-16 15:40:24 +00:00
"Vladimir N. Oleynik"
21e68703ce removed #undef strlen, use builtins and prototuped strlen from xfunc file (only\!) 2006-02-16 14:38:41 +00:00
"Vladimir N. Oleynik"
465300ced9 cleanups after changes by Denis Vlasenko. Size optimization 2006-02-14 10:17:09 +00:00
Rob Landley
b2804551a0 Cleanups from Denis Vlasenko. 2006-02-13 22:04:27 +00:00
Rob Landley
90632d021c Bug fix from Kim B. Heino, manifested via:
echo > foo && zip foo.zip foo && ./busybox unzip foo.zip
2006-02-13 19:40:43 +00:00
Rob Landley
bec26527a1 Save a few bytes in error message. 2006-02-05 03:31:44 +00:00
"Vladimir N. Oleynik"
4fc92206ed destroy bug 679, use getopt_ulflags with new feature: usage option. Removed two strdup 2006-02-02 14:48:54 +00:00
Mike Frysinger
b38673fb9f make the build system puuuuuuuuuuurty 2006-02-02 01:41:53 +00:00
Bernhard Reutner-Fischer
3038557649 - bzero -> memset
text    data     bss     dec     hex filename
1652855   14444 1215616 2882915  2bfd63 busybox.oorig.gcc-3.3
1652823   14444 1215616 2882883  2bfd43 busybox.gcc-3.3
1603655   14412 1215552 2833619  2b3cd3 busybox.oorig.gcc-3.4
1603655   14412 1215552 2833619  2b3cd3 busybox.gcc-3.4
1609755   14508 1215744 2840007  2b55c7 busybox.oorig.gcc-4.0
1609755   14508 1215744 2840007  2b55c7 busybox.gcc-4.0
1590495   13516 1215392 2819403  2b054b busybox.oorig.gcc-4.1-HEAD
1590495   13516 1215392 2819403  2b054b busybox.gcc-4.1-HEAD
1589079   13036 1213248 2815363  2af583 busybox.oorig.gcc-4.2-HEAD
1589079   13036 1213248 2815363  2af583 busybox.gcc-4.2-HEAD
2006-01-31 17:57:48 +00:00
"Vladimir N. Oleynik"
1f17d3287a more obscure 2006-01-31 12:36:51 +00:00
"Vladimir N. Oleynik"
7600eec732 avoid signed<->unsigned warning 2006-01-31 12:12:15 +00:00
Bernhard Reutner-Fischer
cd98555dfa - fix typo i introduced yesterday. 2006-01-31 08:17:13 +00:00
Eric Andersen
76b24270d4 with 2.4 kernel headers, lo_file_name is char, but with 2.6
headers we get a u8 for lo_file_name, so always cast to (char *)
when treating it as such.
2006-01-30 17:30:22 +00:00
Bernhard Reutner-Fischer
20f4000086 - add some ATTRIBUTE_UNUSED.
- use shorter boilerplate while at it.
2006-01-30 17:17:14 +00:00
Bernhard Reutner-Fischer
0e8727d93b - make linking against libcrypt optional by looking if pw_encrypt() or
correct_password() is configured. Fixes allnoconfig pulling in -lcrypt.
2006-01-30 15:29:55 +00:00
Tim Riker
c1ef7bdd8d just whitespace 2006-01-25 00:08:53 +00:00
Rob Landley
b70ccd9509 Close bug 644: loop incrementing twice, skipping ever other device. 2006-01-22 23:17:18 +00:00
Bernhard Reutner-Fischer
37dec0e9e9 - make CONFIG_MD5SUM_SIZE_VS_SPEED configurable via menuconfig.
- use shorter boilerplate.
2006-01-17 12:07:03 +00:00
Bernhard Reutner-Fischer
7ca61b6f33 - shared libbusybox.
- IMA compilation option (aka IPO, IPA,..)
Please holler if i broke something..
2006-01-15 14:04:57 +00:00
Bernhard Reutner-Fischer
853c44b798 - correct definitions. 2006-01-13 12:03:26 +00:00
Bernhard Reutner-Fischer
dd9dce104d - shrink simple obscure stuff a tiny bit:
text    data     bss     dec     hex filename
    789       0       0     789     315 obscure.o.oorig
    771       0       0     771     303 obscure.o
- replace bzero by memset while at it.
2006-01-12 15:38:12 +00:00
"Vladimir N. Oleynik"
f01e1784e5 removed a warning about an unused pargv in bb_getopt_ulflags. Noticed by Tito 2006-01-09 13:28:31 +00:00
Rob Landley
3d1bbf0a5f Minor cosmetic fix from Tito. 2006-01-09 01:07:24 +00:00
Rob Landley
84cb76733f patch from tito: consolidate delay functions as bb_do_delay() 2006-01-06 20:59:09 +00:00
Rob Landley
9085467970 Trying to losetup a device as a regular user shouldn't result in an endless
loop, and the error messages should display correctly now.
2005-12-21 16:53:57 +00:00
Rob Landley
e422af6bcb Flush input when prompting for a password (bug 373). 2005-12-12 07:02:15 +00:00
"Vladimir N. Oleynik"
bf968f71f1 reduce signedness warning 2005-12-02 10:10:28 +00:00
Rob Landley
1d589b2e2d Fix losetup so that it A) actually works again, B) has much better error
messages, C) can show the current association (if any) when called
with only one argument.  Update the documentation a lot too.

Remind me to add a test suite for this thing.  I think I've figured out
how to handle root-only testsuites...
2005-11-29 23:47:10 +00:00
"Vladimir N. Oleynik"
cc34344d91 change the interface of libbb/compare_string_array (unsigned short to int), usaging for e2fsprogs/fsck 2005-11-26 10:45:26 +00:00
"Vladimir N. Oleynik"
61ff4b3973 more use const for interface of libbb/compare_string_array, example usage for e2fsprogs/fsck 2005-11-26 10:33:55 +00:00
"Vladimir N. Oleynik"
4eb2fd6826 more use libbb/bb_msg_read_error 2005-11-25 11:36:36 +00:00
Rob Landley
b4c823211d Move interface.c to networking directory since it's only used by ifconfig. 2005-11-22 07:52:54 +00:00
Rob Landley
9033453c18 My last change to this file broke tar x. Sigh. (Trying to make sure we work
on file sizes between 2 and 4 gigs on 32 bit machines.  For supporting >4 gigs,
just use a 64 bit machine already...)
2005-11-12 11:04:11 +00:00
Rob Landley
3fc4ad1478 Fix bug 424: doing full_read breaks things like cat which should return a
chunk of data when they get it and not block until they've buffered 4k.

The use case was cat /proc/psaux, but you can also reproduce this by
running non-busybox cat by itself and typing things at the command line.
Then run busybox cat.  Notice how cat is _supposed_ to echo each line back
to us as we hit enter?
2005-11-04 01:54:15 +00:00
Rob Landley
21ccbb6c0e When cp ran out of space it didn't return a nonzero error code. Fixes bug 493. 2005-11-04 01:20:46 +00:00
Rob Landley
2f30932eca Fix cp /dev/null filename, and a few in-passing cleanups. 2005-11-01 21:55:14 +00:00
Rob Landley
2454ebd85d Somebody suggested this, but I've forgotten who. 2005-10-27 22:50:04 +00:00
Rob Landley
3c6bfe3e33 Shaun Jackman noted that limits.h defines path_max and isn't included from
find_root_device.c.  (We #include it in busybox.h but not libbb.h, it seems.
Someday, someone's going to have to clarify for me the difference between
those two...)
2005-10-25 02:22:13 +00:00
"Vladimir N. Oleynik"
0fa9deda17 more const 2005-10-20 09:48:28 +00:00
Bernhard Reutner-Fischer
7547a6e2f6 - don't update copyright years. He might release it, but apparently will have
to update the year himself.
2005-10-15 20:56:31 +00:00
Bernhard Reutner-Fischer
94c3331d47 - an empty middle term in ?: violates ISO C
- use shorter boilerplate and use C89 style comments
2005-10-15 14:13:09 +00:00
"Vladimir N. Oleynik"
6f347ef9dc common BUFSIZ BSS buffer, small reduce code, data and bss 2005-10-15 10:23:55 +00:00
"Vladimir N. Oleynik"
f704b27b5b - new bb_opt_complementally syntax, use [-:?] only - 'free' chars
- new bb_getopt_ulflags features: check max and min args, convert first argv to options special for ar and tar applets
- use bb_default_error_retval for env applet
2005-10-14 09:56:52 +00:00
"Vladimir N. Oleynik"
6c35c7c976 usage bb_dev_null 2005-10-12 15:34:25 +00:00
"Vladimir N. Oleynik"
86a1073e0b bb_dev_null 2005-10-12 15:21:32 +00:00
"Vladimir N. Oleynik"
064f04e7e2 - use complementally '!' to '?' - 'ask' is best 'free' char for this.
- more long opt compatibility, can set flag for long opt struct now
- more logic: check opt-depend requires and global requires, special for 'id' and 'start-stop-daemon' applets.
2005-10-11 14:38:01 +00:00
Rob Landley
ff567f7943 The check for EROFS was wrong. For example, if you try to mount a filesystem
appended to an executable that's being run (yes, I'm doing this) you get
EPERM, but mounting readonly fixes it.  Doing the fallback all the time
shouldn't hurt, and is one less test.
2005-10-11 07:26:15 +00:00
"Vladimir N. Oleynik"
083d3f49c2 bb_mkdep: Rewroted. removed problem "include name must uniq", speed up * 3.
e2fsprogs: remove confuse bb_mkdep. Use internal e2fsprogs includes only.
other: remove confuse bb_mkdep.
2005-10-10 11:35:17 +00:00
Bernhard Reutner-Fischer
ab52db8d5e - size reduction of pidof
- fix typo in reverse_pidlist
2005-10-07 15:44:37 +00:00
Bernhard Reutner-Fischer
cf95e0b2d5 - add llist_free_one() and llist_free() to libbb 2005-10-06 12:12:51 +00:00
Bernhard Reutner-Fischer
56b217117a - add llist_free_one() and llist_free() to libbb; Add a bit of documentation.
- change llist_add_to_end as proposed by vodz in http://busybox.net/lists/busybox/2005-September/016411.html
- remove unneeded includes, add short boilerplate and copyright to llist.c
- move COMM_LEN from find_pid_by_name to libbb.h and use it in procps_status_t
- add reverse_pidlist() to find_pid_by_name. Will be needed for pidof.
2005-10-06 12:10:48 +00:00
"Vladimir N. Oleynik"
4a5ce08688 another more correction for getopt_ulflags() documentation (examples) 2005-10-05 13:58:40 +00:00
"Vladimir N. Oleynik"
d1b6078e5d more correction for getopt_ulflags() documentation by author of this fuck logic 2005-10-05 12:44:52 +00:00
Bernhard Reutner-Fischer
120513c29f - add proper separators. sorry for the noise.. 2005-10-05 12:28:55 +00:00
Bernhard Reutner-Fischer
43fb3fcb2f - add a bit more documentation to vodz' recent additions. 2005-10-05 12:23:13 +00:00
"Vladimir N. Oleynik"
35939d9378 update bb_getopt_ulflags special for 'ps' applet, usaging '-' as first group char from bb_opt_complementally is new feature: set argv is options;
use new bb_getopt_ulflags for ps
# define terminal_width 80->79 for unwide
use stdout file descriptor for get_terminal_width_height. (its must)
2005-10-05 10:52:47 +00:00
"Vladimir N. Oleynik"
be0ed3d0b9 use updated bb_getopt_ulflags() for ps applet 2005-10-04 16:48:26 +00:00
"Vladimir N. Oleynik"
39a841cecf change interface to bb_xasprintf() - more perfect for me.
ln.c: error_msg(str)->error_msg(%s, str) - remove standart "feature" for hackers
reduce 100 bytes don't care in sum
2005-09-29 16:18:57 +00:00
Bernhard Reutner-Fischer
bee9eb1a9d - rename llist_add_to.c to llist.c
- move llist_add_to_end() from ifupdown.c to libbb/llist.c
2005-09-29 12:55:10 +00:00
"Vladimir N. Oleynik"
5f46010ab7 spwd bulid now, (typo) 2005-09-26 12:58:24 +00:00
Rob Landley
5246063a7b Patch from Amir Shalem to make busybox compile on a uClibc that has no shadow
password support.
2005-09-25 23:36:12 +00:00
Mike Frysinger
62f18e1f20 use the shorter license header 2005-09-24 07:16:29 +00:00
Mike Frysinger
0d4ee68be5 use brief license line 2005-09-24 06:01:57 +00:00
Bernhard Reutner-Fischer
c5280e8885 - consolidated password helpers 2005-09-20 21:09:31 +00:00
Bernhard Reutner-Fischer
f56b8e4b00 - consolidated password helpers into bb_pwd.c 2005-09-20 21:08:10 +00:00
Bernhard Reutner-Fischer
d5bd137a24 - rename libbb's password helpers as suggested in libbb.h
my_getpwnam -> bb_xgetpwnam  /* dies on error */
  my_getgrnam -> bb_xgetgrnam  /* dies on error */
  my_getgrgid -> bb_getgrgid
  my_getpwuid -> bb_getpwuid
  my_getug    -> bb_getug
2005-09-20 21:06:17 +00:00
"Vladimir N. Oleynik"
f246dc7f57 ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE->CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE 2005-09-16 12:55:29 +00:00
"Vladimir N. Oleynik"
23f62fc6f3 split libbb: moved xregcomp separatelly for speed up recompile 2005-09-14 16:59:11 +00:00
"Vladimir N. Oleynik"
1e07f852e0 FEATURE->ENABLE_FEATURE loses one for 'top' applet 2005-09-14 16:08:06 +00:00
Rob Landley
90ca6b2878 This code exists to compensate for ancient broken build environments which,
as far as I can tell, are no longer relevant.  Modern busybox refuses to
build under libc5 (there's a specific test and #error for that), and
I'm not sure building against 2.1 kernel headers on Alpha was ever relevant.

I'm happy to put any of this back if anybody can point to a real need for it,
but if so we need to specifically document what environment is being
compensated for.  (And we should quarrantine the build environment code
into one place, anyway.  Maybe "quirks.h" for known compiler and
libc quirks?)
2005-09-07 06:39:02 +00:00
Mike Frysinger
99f61719cb Amir Shalem writes:
this patch fix syscall names mix-up in libb/syscalls.c
2005-09-06 21:53:21 +00:00
"Vladimir N. Oleynik"
45a8ed89c6 - sync traceroute with Slackware-10.1
(support -FIl -g gw -i if -z pt now).
- libbb/getopt_ulflags.c support bb_opt_complementally="x-x" as trigger now
2005-09-06 16:08:33 +00:00
Rob Landley
9955c45907 get_terminal_width_height.c was in there twice. 2005-09-05 18:42:18 +00:00
"Vladimir N. Oleynik"
27421a1878 1) bb_opt_complementaly -> bb_opt_complementally
2) better support long options
3) new flag '!' for bb_opt_complementally: produce bb_show_usage() if BB_GETOPT_ERROR internally
2005-09-05 14:46:07 +00:00
Rob Landley
cc1669bcde Actually returning ret might be good. 2005-09-05 05:36:15 +00:00
Rob Landley
828548ab56 According to bug #63, crond is unhappy with crontab lines that don't end in a
newline, or lines that have trailing spaces.
2005-09-01 10:23:57 +00:00
Rob Landley
e0537f6194 Bernhard Fischer suggested that get_terminal_width_height() should return
the result of the ioctl so callers can tell if we have a tty.  (0 means
we have a tty, nonzero means the ioctl couldn't find size info and we
fake 80x24.  Really we should fake 80x25, but oh well...)
2005-09-01 02:57:45 +00:00
Mike Frysinger
ddddb94f05 make sure __NF_sysfs exists before trying to use it 2005-08-27 18:19:01 +00:00
Rob Landley
6417564eeb Two FEATURE_CLEAN_UP patches from Shaun Jackman, closing filehandles. 2005-08-22 15:57:50 +00:00
Mike Frysinger
6ebbc7414e the () around isspace actually matters 2005-08-16 05:39:07 +00:00
Mike Frysinger
71224980e1 Bernhard Fischer says: fix comment typo 2005-08-16 05:27:51 +00:00
Rob Landley
6a6798b8e4 Major rewrite of mount, umount, losetup. Untangled lots of code, shrunk
things down a bit, fixed a number of funky corner cases, added support for
several new features (things like mount --move, mount --bind, lazy unounts,
automatic detection of loop mounts, and so on).  Probably broke several
other things, but it's fixable.  (Bang on it, tell me what doesn't work for
you...)

Note: you no longer need to say "-o loop".  It does that for you when
necessary.

Still need to add "user mount" support, which involves making mount suid.  Not
too hard to do under the new infrastructure, just haven't done it yet...

The previous code had the following notes, that belong in the version
control comments:

- * 3/21/1999   Charles P. Wright <cpwright@cpwright.com>
- *             searches through fstab when -a is passed
- *             will try mounting stuff with all fses when passed -t auto
- *
- * 1999-04-17  Dave Cinege...Rewrote -t auto. Fixed ro mtab.
- *
- * 1999-10-07  Erik Andersen <andersen@codepoet.org>.
- *              Rewrite of a lot of code. Removed mtab usage (I plan on
- *              putting it back as a compile-time option some time),
- *              major adjustments to option parsing, and some serious
- *              dieting all around.
- *
- * 1999-11-06  mtab support is back - andersee
- *
- * 2000-01-12   Ben Collins <bcollins@debian.org>, Borrowed utils-linux's
- *              mount to add loop support.
- *
- * 2000-04-30  Dave Cinege <dcinege@psychosis.com>
- *             Rewrote fstab while loop and lower mount section. Can now do
- *             single mounts from fstab. Can override fstab options for single
- *             mount. Common mount_one call for single mounts and 'all'. Fixed
- *             mtab updating and stale entries. Removed 'remount' default.
- *
2005-08-10 20:35:54 +00:00
Paul Fox
0b62158475 implemented a builtin echo command in ash. moved the guts of the
echo applet into libbb, and now call bb_echo() from both echo.c
and ash.c
2005-08-09 19:38:05 +00:00
Mike Frysinger
b953134bba apgo in Bug 322 writes: kill off CONFIG_FEATURE_MTAB_FILENAME 2005-07-30 08:48:10 +00:00
Paul Fox
e5ba382b99 move the ifdef to after libbb.h include, so it can do some good. 2005-07-27 14:20:52 +00:00
Mike Frysinger
4d00896d05 use toplevel ARFLAGS and update default ARFLAGS to be quiet 2005-07-27 01:09:24 +00:00
Mike Frysinger
6fafa5aa9f 2005-04-05 Shaun Jackman <sjackman@gmail.com>
* libbb/printf.c: Check for __NEWLIB_H__ before __GLIBC__.
2005-07-26 23:05:03 +00:00
Mike Frysinger
6e05312ba9 no longer used as reported by apgo in Bug 348 2005-07-26 22:51:57 +00:00
Paul Fox
1429017968 ifdef all of loop.c with CONFIG_FEATURE_MOUNT_LOOP. won't
compile due to CONFIG_FEATURE_MOUNT_LOOP_MAX otherwise.  reported
by Stephane Billiart.
2005-07-22 19:58:32 +00:00
Paul Fox
c337d29550 applying fix for:
0000117: Remove linefeed after overwrite prompt using cp -i
	  User input not on the same line as the prompt when about to
	  overwrite a file.
2005-07-19 21:31:05 +00:00
Paul Fox
3f6f3174e9 applying fix from:
0000068: mount limited to max 8 loop devices (patch provided)  

(made minor wording change for config help message)
2005-07-19 20:55:37 +00:00
Paul Fox
0a92bbf349 applying fix from:
0000067: cp -p produces misleading error message
2005-07-19 20:47:33 +00:00
Mike Frysinger
348e84c202 change the hardcoded error constant (0x80000000UL) to a nice flexible define (BB_GETOPT_ERROR) 2005-05-11 00:39:03 +00:00
Mike Frysinger
fb6d22c96c now that mjn3 explained it to me, add documentation for the 3rd field in long opts 2005-05-11 00:02:39 +00:00
Mike Frysinger
e5d0bde697 add documentation for long options and touch up the current docs now that i actually understand how to use the function myself :) 2005-05-10 23:48:35 +00:00
Mike Frysinger
9dc93ac561 syntax/whitespace touchup 2005-05-09 21:51:15 +00:00
Rob Landley
93983040c5 Shaun Jackman said:
This patch adds a CONFIG_FEATURE_CLEAN_UP stanza, and also adds an
ifdef around the SIOCGIFMAP call.
2005-05-03 21:30:26 +00:00
Rob Landley
60158cb93e A patch from Takeharu KATO to update/fix SE-Linux support. 2005-05-03 06:25:50 +00:00
Rob Landley
e3752e56a4 Revert Tito's patch to zcip. My bad, David Brownell had objected and I missed
it...
2005-05-03 03:28:55 +00:00
Rob Landley
8445a9ff99 On Tuesday 19 April 2005 21:10, Tito wrote and today added:
> Hi,
> this is a first attempt of size optimization for zcip taking into account all
> the hints given so far on the list.
> I've applied just the more obvious busyboxifications so maybe it could be
> optimized more.
BTW: I've ripped out  a lot of debug code and changed c++ // comments to /* */
as both were rather confusing for a newbie like me. ;-) 
Sorry to the author for that.
I know that this makes mantaining the code easier, but I'm simple minded....
2005-05-01 00:22:03 +00:00
Eric Andersen
fef32b570b Correct errors preventing busybox tar from working properly,
fixing bug http://bugs.uclibc.org/view.php?id=231
2005-04-27 10:51:38 +00:00
Mike Frysinger
2bf88a891f In Bug 5, Tito writes:
This is a first attempt to improve the comments of getopt_ulflags.c.
Maybe under some aspects the text could be refined, but so
far it is already usable and should help people who "avoided getopt_ulflags as the pest" to understand how it works.

This patch was created with the help of
Vodz, the author of the code, who explained me patiently
how getopt_ulflags works
and with the help of
Paul Fox, who corrected my broken english.

So thanks and merits should go to them also.
2005-04-18 22:42:58 +00:00
Eric Andersen
14f5c8d764 Patch from Bernhard Fischer to make a bunch of symbols static
which were otherwise cluttering the global namespace.
2005-04-16 19:39:00 +00:00
Eric Andersen
451c0d2828 Rework to fix http://bugs.uclibc.org/view.php?id=107 2005-04-16 07:46:53 +00:00
Eric Andersen
3cd1986195 Add bb_msg_read_error 2005-04-16 07:42:35 +00:00
Mike Frysinger
2ed05ab146 fake out support for POSIX -H and -L options since busybox cp dereferences everything by default 2005-04-14 02:52:50 +00:00
Mike Frysinger
a36ac0db67 Shaun Jackman writes: Fix typo. Use __NR_umount2 instead of __NR_pivot_root. 2005-03-04 01:34:23 +00:00
Mike Frysinger
9b9e5479e8 add some more comments 2005-03-04 01:27:18 +00:00
Mike Frysinger
3b05b80cd7 newlib fixe from Shaun Jackman 2005-03-04 01:10:56 +00:00
Rob Landley
c0dedd05e8 Sort rewrite to be SUSv3 compliant. New config option, updated help, and
a couple of infrastructure bits.
2005-01-24 07:00:02 +00:00
Eric Andersen
1e4dc96d61 Dear andersen:
Is the change on libbb/loop.c which you commited in 2005/1/3 effective
really?

The __GLIBC__ macro and __UCLIBC__ macro are defined in
feature.h in glibc source, so the change may not be effective.
If you want to check this with __GLIBC__, feature.h header is needed.

Some architectures(e.g. PPC series) need to include linux/posix_types.h
in stead of asm/posix_types.h, so the patch which is attached with
this mail include <linux/posix_types.h>.
2005-01-04 20:37:55 +00:00
Eric Andersen
1271dbb860 perhaps a better fix 2005-01-03 05:50:01 +00:00
Rob Landley
861f0145d3 Workaround for uClibc-specific header problem described here:
http://www.busybox.net/lists/busybox/2004-December/013276.html

Rob
2004-12-09 23:12:00 +00:00
Eric Andersen
0e020d1025 Make certain clients of bb_make_directory default to honoring
the user's umask
2004-10-13 06:25:52 +00:00
Eric Andersen
a62665b72f Patch from Claus Klein to increase, and make more apparent
the hard coded limit on the number of mounts
2004-10-08 08:57:35 +00:00
Eric Andersen
94d628c76a Tito writes:
Hi to all,
This patch contains just some fixes for some misleading
comments in my_getpwuid.c and my_getug.c.
The code is untouched so this patch will not
cause troubles.

Please apply.

Thanks in advance and Ciao,
Tito
2004-10-08 08:07:40 +00:00
Eric Andersen
7daa076d3e egor duda writes:
Hi!

I've created a patch to busybox' build system to allow building it in
separate tree in a manner similar to kbuild from kernel version 2.6.

That is, one runs command like
'make O=/build/some/where/for/specific/target/and/options'
and everything is built in this exact directory, provided that it exists.

I understand that applyingc such invasive changes during 'release
candidates' stage of development is at best unwise. So, i'm currently
asking for comments about this patch, starting from whether such thing
is needed at all to whether it coded properly.

'make check' should work now, and one make creates Makefile in build
directory, so one can run 'make' in build directory after that.

One possible caveat is that if we build in some directory other than
source one, the source directory should be 'distclean'ed first.

egor
2004-10-08 07:46:08 +00:00
Eric Andersen
2842659cc0 Patch from Michael Tokarev:
Scenario:

  touch x -- creates plain file name `x'
  mkdir x -- exits successefully

libbb/make_directory.c, bb_make_directory(), contains
the following code:

        if (mkdir(path, 0777) < 0) {
            /* If we failed for any other reason than the directory
             * already exists, output a diagnostic and return -1.*/
            if (errno != EEXIST) {
                fail_msg = "create";
                umask(mask);
                break;
            }
            /* Since the directory exists, don't attempt to change
             * permissions if it was the full target.  Note that
             * this is not an error conditon. */
            if (!c) {
                umask(mask);
                return 0;
            }
        }

The assumption that EEXIST error is due to that the *directory*
already exists is wrong: any file type with that name will cause
this error to be returned.  Proper way IMHO will be is to stat()
the path and check whenever this is really a directory.  Below
(attached) is a patch to fix this issue.
2004-10-08 07:21:58 +00:00
Glenn L McGrath
29de86314a Remove this error message at Vodz request, it was misleading. 2004-09-24 02:36:44 +00:00
Glenn L McGrath
f15dfc5570 Tito writes,
"This patch fixes all the bugs in id previously spotted by vodz and me.
The binary size increased a bit,  but now it should work as expected."
2004-09-15 03:04:08 +00:00
Eric Andersen
7b08cdd98c No longer needed 2004-09-02 23:11:53 +00:00
Eric Andersen
7eb79fff10 Tito writes:
Hi Erik,
Hi to all,
This is part five of the my_get*id story.
I've tweaked a bit this two functions to make them more flexible,
but this changes will not affect existing code.
Now they work so:
1) my_getpwuid( char *user, uid_t uid, int bufsize)

   if bufsize is > 0 char *user cannot be set to NULL
                     on success username is written on static allocated buffer
                     on failure uid as string is written to buffer and NULL is returned
   if bufsize is = 0 char *user can be set to NULL
                     on success username is returned
                     on failure NULL is returned
   if bufsize is < 0 char *user can be set to NULL
                     on success username is returned
                     on failure an error message is printed and the program exits

  2) 1) my_getgrgid( char *group, uid_t uid, int bufsize)

   if bufsize is > 0 char *group cannot be set to NULL
                     on success groupname is written on static allocated buffer
                     on failure gid as string is written to buffer and NULL is returned
   if bufsize is = 0 char *group can be set to NULL
                     on success groupname is returned
                     on failure NULL is returned
   if bufsize is < 0 char *group can be set to nULL
                     on success groupname is returned
                     on failure an error message is printed and the program exits

This changes were needed mainly for my new id applet.
It is somewhat bigger then the previous but matches the behaviour of GNU id
and is capable to handle usernames of whatever length.
BTW: at a first look it seems to me that it will integrate well (with just a few changes)
with the pending patch  in patches/id_groups_alias.patch.
The increase in size is balanced by the removal of my_getpwnamegid.c
from libbb as this was used only in previous id applet and by size optimizations
made possible in whoami.c and in passwd.c.
I know that we are in feature freeze but I think that i've tested it enough
(at least I hope so.......).
2004-09-02 22:21:41 +00:00
Eric Andersen
52499cb9ae Tito writes:
Hi,
I've spent the half night staring at the devilish  my_getpwuid and my_getgrgid functions
trying to find out a way to avoid actual and future potential buffer overflow problems
without breaking existing code.
Finally I've  found a not intrusive way to do this that surely doesn't break existing code
and fixes a couple of problems too.
The attached patch:
1) changes the behaviour of my_getpwuid and my_getgrgid to avoid potetntial buffer overflows
2) fixes all occurences of this function calls in tar.c , id.c , ls.c, whoami.c, logger.c, libbb.h.
3) The behaviour of tar, ls and  logger is unchanged.
4) The behavior of ps with somewhat longer usernames messing up output is fixed.
5) The only bigger change was the increasing of size of the buffers in id.c to avoid
     false negatives (unknown user: xxxxxx) with usernames longer than 8 chars.
     The value i used ( 32 chars ) was taken from the tar header ( see gname and uname).
     Maybe this buffers can be reduced a bit  ( to 16 or whatever ), this is up to you.
6) The increase of size of the binary is not so dramatic:
     size busybox
       text    data     bss     dec     hex filename
     239568    2300   36816  278684   4409c busybox
    size busybox_fixed
       text    data     bss     dec     hex filename
     239616    2300   36816  278732   440cc busybox
7) The behaviour of whoami changed:
    actually it  prints out an username cut down to the size of the buffer.
    This could be fixed by increasing the size of the buffer as in id.c or
    avoid the use of my_getpwuid and use getpwuid directly instead.
    Maybe this colud be also remain unchanged......

Please apply if you think it is ok to do so.
The diff applies on today's cvs tarball (2004-08-25).
Thanks in advance,
Ciao,
Tito
2004-08-26 22:18:59 +00:00
Eric Andersen
6fea7328ee Felipe Kellermann writes:
Unfortunatelly I've not followed the last two or three weeks commits (new
semester started and so now I rarely have time to fix my personal bridge)
but tonight I synched my tree and immediately noticed a rather nasty bug!

[Using libbb/interface.c:1.24]
# grep eth0 /proc/net/dev | xargs
eth0:311708397 237346 1670 0 1789 1670 0 0 22580308 120297 0 0 0 102 0 0

# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:20:AF:7C:EA:B7
          inet addr:10.0.0.1  Bcast:10.0.0.127  Mask:255.255.255.128
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:5 Base address:0x320


All values `ifconfig' is showing are `zeroed' -- I quickly looked at the
last commits I missed and noticed that there were a commit relating to
ifconfig, libbb/interface.c:1.23->1.24 (PatchSet 4338).

I've reversed the patch and now everything is working again.  I compared
the get_name's return values from the 1.23 and 1.24 and quickly noticed
that the new revision is leaving `p' right on the sep while the rev 1.23
was leaving it right on the starting of the values...

1-line, 1/3-minute patch attached  :-)
2004-08-26 21:45:21 +00:00
Eric Andersen
0722513497 Use __kernel_old_dev_t for 2.6.x kernels 2004-08-16 08:36:28 +00:00
Eric Andersen
cf6ef05711 Aurelien Jacobs writes:
with a quick conversion you will see that 132608 == 0x20600
so noticed that the elif will never be matched !
Apparently there was already a try to modify this in CVS which
was reverted (it was plain wrong).

I don't know when __kernel_old_dev_t is needed, but with a 2.6.7
or a 2.6.8 this is __kernel_dev_t wich is needed.

I corrected this with the following patch but maybe older 2.6
still need __kernel_old_dev_t ?

I think this should be corrected before 1.0.

Thanks
Aurel
2004-08-16 08:29:44 +00:00
Eric Andersen
9940e081c9 Patch from solar to fix problems with get_name() 2004-08-12 16:52:00 +00:00
Glenn L McGrath
18bbd9bf3b Patch from Tito to fix memory leak upon error. 2004-08-11 03:50:30 +00:00
Eric Andersen
93d7fba892 Tito, farmatito at tiscali dot it writes:
Hi to all,
This patch is useful for:
1) remove an unused var from extern char *find_real_root_device_name(const char* name)
    changing it to extern char *find_real_root_device_name(void).
2) fixes include/libbb.h, coreutils/df.c, util-linux/mount.c and  util-linux/umount.c accordingly.
3) fixes a bug, really a false positive,  in find_real_root_device_name() that happens if
    in the /dev directory exists a link named root (/dev/root) that should be skipped but
    is not. This affects applets like df that display wrong results
2004-08-03 00:14:02 +00:00
Manuel Novoa III
413db4d583 Clean up hex escape support. 2004-07-29 23:15:16 +00:00
Eric Andersen
ccfc44806d Felipe Kellermann noticed a missing `break'. 2004-07-27 16:45:46 +00:00
Eric Andersen
b2a300590d bother. unrevert my fix. 2004-07-26 12:11:32 +00:00
Eric Andersen
53f5c0d5bf Allow hex escape sequences 2004-07-26 12:06:19 +00:00
Eric Andersen
380919905c Allow hex escape sequences 2004-07-26 11:28:47 +00:00
Glenn L McGrath
2e99d43846 Fix for a bug identied by Harald Kuthe, when using many interfaces (29
in this case) the order was incorrect and there were duplicate entries.
2004-07-23 01:49:46 +00:00
Glenn L McGrath
eeb06bf230 Patch from Felipe Kellermann, "There is a call to printf using `*pr-cchar'
referencing a string and using a single char, when *p <= 0x1f."
2004-07-23 01:35:41 +00:00
Glenn L McGrath
774e6cc29c Revert my previous commit 2004-06-25 09:01:09 +00:00
Glenn L McGrath
d9670461c4 Fix compile error under 2.6, check for newer versions first or all the
checks wont be considered.
2004-06-25 07:47:03 +00:00
Eric Andersen
36adca81f5 Patch from Bastian Blank:
On Sat, Jun 19, 2004 at 10:57:37PM +0200, Bastian Blank wrote:
> The following patch changes klogd to use openlog/syslog themself
> instead of calling syslog_msg which always calls the triple
> openlog/syslog/closelog.

Updated patch: get rid of syslog_msg entirely. Request from Erik Andersen.

Bastian
2004-06-22 10:07:17 +00:00
Glenn L McGrath
ff5309ac99 Add part of a patch from Vernon Sauder that i missed a while back 2004-05-02 08:38:53 +00:00
Eric Andersen
6f9a7783ce Do not use getpass(3) 2004-05-01 01:27:30 +00:00
Glenn L McGrath
1219879422 Dont try and preserve hard links to directories.
The linux kernel doesnt allow hard links to directories, SUS says its
implementation specific.
cramfs gives empty directories and 0 length files the same node it
makies it difficult to distinguish from hard links.
2004-04-19 12:28:02 +00:00
Eric Andersen
2c2256cb8b remove a warning 2004-04-14 17:57:11 +00:00
Eric Andersen
aff114c33d Larry Doolittle writes:
This is a bulk spelling fix patch against busybox-1.00-pre10.
If anyone gets a corrupted copy (and cares), let me know and
I will make alternate arrangements.

Erik - please apply.

Authors - please check that I didn't corrupt any meaning.

Package importers - see if any of these changes should be
passed to the upstream authors.

I glossed over lots of sloppy capitalizations, missing apostrophes,
mixed American/British spellings, and German-style compound words.

What is "pretect redefined for test" in cmdedit.c?

Good luck on the 1.00 release!

      - Larry
2004-04-14 17:51:38 +00:00
Eric Andersen
66a56aa028 Vladimir N. Oleynik writes:
Hi.

Last changes (rev 1.12) to recursive_actions() by Christian Grigis
have problem.
Test for demonstrate:

$ mkdir aaa bbb ccc
$ su
# chown root bbb
# chmod 700 bbb
# exit
$ busybox chmod 777 -R .
./bbb: Permision denied

But "./ccc" mode not changed. Previous variant works fine,
errors skiped and continued recursion.


--w
vodz
2004-04-07 17:59:04 +00:00
Eric Andersen
3f47c453da Christian Grigis, christian.grigis at smartdata dot ch writes:
Hello everyone,

Busybox's insmod fails to locate a module when that module is the only one
existing in the /lib/modules directory (with a unique name).

Example:

# find /lib/modules/ -type f
/lib/modules/kernel/drivers/char/bios.o
# insmod bios
insmod: bios.o: no module by that name found
# touch /lib/modules/dummy
# find /lib/modules/ -type f
/lib/modules/kernel/drivers/char/bios.o
/lib/modules/dummy
# insmod bios
Using /lib/modules/kernel/drivers/char/bios.o

As long as there is another file in the /lib/modules directory, insmod
finds it OK.

I tracked the problem down to 'check_module_name_match()' in insmod.c:

It returns TRUE when a match is found, and FALSE otherwise. In the case
where there is only one module in the /lib/modules directory (or more that
one module, but all with the same name), 'recursive_action()' will return
TRUE and we end up on line 4196 in 'insmod.c' which returns an error.
[The reason it works with more than one module with different
names is that in this case there will always be one not matching,
'recursive_action()' will return FALSE and we end up in line 4189.]

Now, from the implementation of 'recursive_action()' and from other
usages of it (tar.c, etc.), it seems to me that FALSE should be returned
to indicate that we want to stop the recursion, so TRUE and FALSE should
be inverted in 'check_module_name_match()'.

At the same time, 'recursive_action()' continues to recurse even after
the recursive call has returned FALSE; again in my understanding and
other usages of it, we can safely stop recursing at this point.


Here is my patch against 1.00-pre8:
2004-04-06 11:56:26 +00:00