Compare commits

...
5710 Commits
Author SHA1 Message Date
Denis Vlasenko 993c6aa077 release 1.4.2 2007-03-18 18:01:32 +00:00
Denis Vlasenko d60a279c34 wget: fix access-to-ro memory 2007-03-18 18:00:51 +00:00
Denis Vlasenko 5483a19fc3 tftp: fix wrong check for port numbers 2007-03-18 18:00:12 +00:00
Denis Vlasenko 6745766347 tar: fix tar option parsing 2007-03-18 17:58:36 +00:00
Denis Vlasenko a631e71642 ip: fix misnumbered command names 2007-03-18 17:57:36 +00:00
Denis Vlasenko e3d83aafb4 fix erroneous lowercasing by bb_hexdigits_upcase[i] | 0x10 2007-03-18 17:56:43 +00:00
Bernhard Reutner-Fischer bbbb7e02fc - pull r17757 from trunk: fix stty's fix_param(). Closes #1193 2007-02-04 11:16:21 +00:00
Bernhard Reutner-Fischer 1ca74185c4 - pull r17554 and r17555 from trunk:
- fix testsuite and add test for sum
2007-01-27 22:47:08 +00:00
Bernhard Reutner-Fischer a626a99ca5 - readahead depends on LFS 2007-01-26 09:07:26 +00:00
Denis Vlasenko e338dd95b4 accumulated post-1.4.0 fixes 2007-01-24 22:03:46 +00:00
Denis Vlasenko 8942c12782 releasing busybox 1.4.0 2007-01-20 19:57:57 +00:00
Denis Vlasenko 316355524f fixing bugs revealed by randomconfig runs 2007-01-20 16:54:19 +00:00
Denis Vlasenko 91f20ab510 fixes for amd64 compilation 2007-01-20 01:47:44 +00:00
Denis Vlasenko e055443412 ls: stop doing time() for each file in "ls -l"
ls: use fully-buffered stdout (can it be problematic
on VERY slow/hanging NFS mounts?)
2007-01-19 22:03:06 +00:00
Denis Vlasenko 4ebaf10742 strdup -> xstrdup
sed: de-obfuscate piece of code
2007-01-19 21:33:19 +00:00
Denis Vlasenko 2405ad659e ls: use get_cached_username/groupname 2007-01-19 21:24:17 +00:00
Denis Vlasenko 9af7c9d6b6 openvt,getty,vfork_daemon_rexec,mount: tighten up fd cleanup code
(will close all fd's > 2 on daemonization now)
getty: fix "getty -" support, and also do not try to chown/chmod "-"
telnetd: fix "lost ctty" bug
Yet another attempt on saner function names:
bb_sanitize_server_stdio(0/1) -> bb_sanitize_stdio() + bb_daemonize();
2007-01-19 21:19:35 +00:00
Denis Vlasenko f8c11aa65d fsck: dead code removal; also disable progress indicator code
(doesn't look good to me)
2007-01-19 02:04:09 +00:00
Denis Vlasenko e18a293a52 fsck: stop using strtok 2007-01-19 02:03:14 +00:00
Denis Vlasenko 1abf91aa25 fsck: move functions around so that related ones are nearby
no actual code changes
2007-01-19 02:02:33 +00:00
Denis Vlasenko a0e701d137 fsck: small optimization 2007-01-19 02:01:19 +00:00
Denis Vlasenko 74c9d2365a fix potentially misaligned 32-bit accesses 2007-01-18 15:42:00 +00:00
Bernhard Reutner-Fischer c966ba46a9 - move the smallint that is platform dependant to it's proper place 2007-01-18 10:32:09 +00:00
Peter Kjellerstedt f8384fa50c Use char for smallint on CRIS as well. 2007-01-18 10:26:07 +00:00
Bernhard Reutner-Fischer 1a250d9f32 - reinstate paranoia check in wrapf(). 2007-01-18 08:41:22 +00:00
Denis Vlasenko 7f0d7ae4f5 fix subtle bug inherited from dash 2007-01-18 01:12:57 +00:00
Denis Vlasenko 41aaefce71 stop using global variable needlessly 2007-01-18 00:53:35 +00:00
Denis Vlasenko cbbc043d1b smallint can be a char for amd64 too 2007-01-18 00:16:06 +00:00
Denis Vlasenko ef44d9d9f2 sed,get_line_from_file: improve comments 2007-01-17 23:16:16 +00:00
Bernhard Reutner-Fischer ae114c235e - stty's visible() function and catv's guts are identical. Merge them into
an appropriate libbb function.
2007-01-17 19:51:00 +00:00
Bernhard Reutner-Fischer 79cc55975f - remove superfluous define that expanded to "!strcmp"
- remove some dead code
2007-01-17 19:46:46 +00:00
Bernhard Reutner-Fischer 8eb0549e5d - reuse return code of vsnprintf to avoid pulling in strlen 2007-01-17 19:46:33 +00:00
Bernhard Reutner-Fischer 94feb1c807 - merge display_changed() and display_all()
This one is a bit risky but did work for me in cursory testing..
2007-01-17 19:46:12 +00:00
Bernhard Reutner-Fischer d4a745c3d4 - peruse get_terminal_width_height and remove legacy code for ancient
slowaris versions.
2007-01-17 19:45:36 +00:00
Bernhard Reutner-Fischer a6e31ad834 - rewrite find_param to use index_in_str_array 2007-01-17 19:45:14 +00:00
Bernhard Reutner-Fischer 4950f010f3 - manually inline tty_value_to_baud and remove string_to_baud_or_die
(cleanup)
2007-01-17 19:44:59 +00:00
Bernhard Reutner-Fischer 21fc740023 - constify some read-only members and remove superfluous casts
(cleanup)
2007-01-17 19:44:24 +00:00
Bernhard Reutner-Fischer 4fa566d4ad - reuse option_mask32 for state-handling in main
- improve check for errors from fcntl
2007-01-17 19:42:30 +00:00
Bernhard Reutner-Fischer 9e8df9354a - replace some occurances of "kernel" with busybox 2007-01-17 19:36:01 +00:00
Denis Vlasenko b64eed6030 httpd: use fd#1 in inetd mode
inetd: micro style fix
2007-01-14 17:06:11 +00:00
Denis Vlasenko d1a6e8d320 inetd: preparatory patch, no code changes 2007-01-14 14:46:18 +00:00
Denis Vlasenko d97c9244b1 Rename bb_sanitize_stdio -> bb_sanitize_server_stdio
(name is still bad - it doesn't hint that function
may do daemonization trick for you if asked to).
Small fixes to fakeidentd.
2007-01-14 13:12:06 +00:00
Denis Vlasenko b8b81a6f8f small size optimization 2007-01-14 12:47:27 +00:00
Denis Vlasenko 844ff096ec isrv.h: add copyright info 2007-01-14 12:34:48 +00:00
Denis Vlasenko fdf7aec532 I forgot "svn add" AGAIN! :( 2007-01-14 12:32:30 +00:00
Denis Vlasenko c14c95ec89 fakeidentd: avoid extra fcntl calls 2007-01-14 12:31:26 +00:00
Denis Vlasenko 19250813a8 fakeidentd: fix daemon mode (was thinking that it is in
inetd-wait mode and dying after timeout). Minor fixes,
comments are improved in places.
2007-01-14 12:07:25 +00:00
Denis Vlasenko ffcef2d1f7 inetd: open log after daemonization 2007-01-14 02:03:28 +00:00
Denis Vlasenko 7a431b3715 By popular request reinstate fakeidentd's standalone mode.
Since this is also needed for other applets like telnetd,
introduce generic driver for such things.
It even supports inetd-wait ('linger') mode, when inetd
hands out listen socket to child and waits to it to die,
instead of handing out accepted socket and continuing
listening itself (nowait mode).
Code growth ~200 bytes.
NB: our inetd doesn't support wait mode yet (or mabe it is buggy).
2007-01-14 01:29:06 +00:00
Denis Vlasenko 150f402b36 whitespace fixes (leading spaces to tab) 2007-01-13 21:06:21 +00:00
Denis Vlasenko 2418288cac small fixes to ipv6 infrastructure 2007-01-13 21:05:38 +00:00
Denis Vlasenko 3a34d0c08a random small size optimizations 2007-01-12 22:10:34 +00:00
Denis Vlasenko 21b080daa8 stty: fix bug reported by Paul Albrecht <albrecht@rdi1.com> -
stty -echo didn't work. Introduced by me :(
2007-01-12 21:03:07 +00:00
Denis Vlasenko f8abc100cc stty: rearrange functions, avoiding the need in forward declarations.
No other code chages.
2007-01-12 21:02:04 +00:00
Denis Vlasenko 4df8135cf6 undo RESERVE_CONFIG_BUFFER change. aldot, small on-stack char[N] objects
are perfectly okay, don't convert them to RESERVE_CONFIG_BUFFERs.
2007-01-12 21:01:05 +00:00
Denis Vlasenko 5d68724d5b next part of ipv6-ization. mostly netcat. 2007-01-12 20:59:31 +00:00
Denis Vlasenko 2c91652bbc next part of ipv6-ization. dnsd code is "interesting"... 2007-01-12 14:57:37 +00:00
Denis Vlasenko 6536a9b583 next part of ipv6-ization is here: wget & httpd 2007-01-12 10:35:23 +00:00
Denis Vlasenko f8138d1f91 fakeinetd: attempted ipv6-ization (and it's done)
but entire applet can be orders of magnitude smaller
if written as an inetd service.
So did that (#ifdef'ed out entire old version).
inetd version is less than 10% of old one!
function                                             old     new   delta
packed_usage                                       22083   22105     +22
nobodystr                                              4       -      -4
bind_ip_address                                        4       -      -4
ident_substr                                          20       -     -20
chmatch                                               22       -     -22
movefd                                                25       -     -25
skipchars                                             49       -     -49
handlexitsigs                                         51       -     -51
replyError                                            70       -     -70
.rodata                                           158120  158024     -96
deleteConn                                           102       -    -102
G                                                    524     388    -136
conns                                                560       -    -560
fakeidentd_main                                     1457     143   -1314
------------------------------------------------------------------------------
(add/remove: 0/10 grow/shrink: 1/3 up/down: 22/-2453)       Total: -2431 bytes
2007-01-11 23:26:13 +00:00
Denis Vlasenko 4fa5e8b455 fix my own breakage 2007-01-11 22:39:25 +00:00
Denis Vlasenko f7996f3b70 Trailing whitespace removal over entire tree 2007-01-11 17:20:00 +00:00
Denis Vlasenko 3821fb13ea fix verbose output; remove commented-out includes. 2007-01-11 16:51:21 +00:00
Denis Vlasenko 8e9ccba371 ipv6-ization efforts continue. Few bugs are found,
unknown number likely introduced...
2007-01-11 16:50:23 +00:00
Denis Vlasenko 085231fbba code shrinkage by Bernhard Fischer <rep.nop@aon.at> 2007-01-10 22:35:54 +00:00
Denis Vlasenko 1a8bf7f5d3 missed a few #undefs (no real impact I think) 2007-01-10 20:57:03 +00:00
Denis Vlasenko 7573541f74 fix bug 1146 (gunzip breakage introduced by me --vda) 2007-01-10 20:50:04 +00:00
Denis Vlasenko bbe514683a a bit more IPv6-ization work
syslogd: converted to use it (in -R host:port)
2007-01-10 20:19:56 +00:00
Denis Vlasenko 9de420c27c Improve generic ipv4+ipv6 support in libbb.
Convert telnet to it. Now this works:
telnetd -b [::1]:1234 - bind to IPv6 non-standard port
telnet [::1]:1234 - connect to IPv6 non-standard port
telnet ::1 1234 - same
This does not require ANY ipv6-specific code in applets
(no struct sockaddr_in6. In fact, no sockaddr_in, too).
2007-01-10 09:28:01 +00:00
Denis Vlasenko 62a6983a81 execute "safe applets" exev if not standalone shell
(patch by "Eric Spakman" <E.Spakman@inter.nl.net>)
2007-01-10 00:24:50 +00:00
Denis Vlasenko 886bb0df66 Fix typo in usage text by shortening it 2007-01-09 23:48:46 +00:00
Denis Vlasenko 1c962f23e0 Yet another small size reduction by Bernhard Fischer <rep.nop@aon.at> 2007-01-09 23:44:57 +00:00
Denis Vlasenko 59f2c34037 small size reduction by Bernhard Fischer <rep.nop@aon.at> 2007-01-09 23:43:28 +00:00
Denis Vlasenko bae7948a5a small size reduction by Bernhard Fischer <rep.nop@aon.at> 2007-01-09 23:42:43 +00:00
Denis Vlasenko db1edde6d8 compilation fix by Bernhard Fischer <rep.nop@aon.at> 2007-01-09 23:39:48 +00:00
Bernhard Reutner-Fischer d1e54e4f56 - missing hunk to go with r17206 2007-01-09 17:41:54 +00:00
Bernhard Reutner-Fischer 0f48663f83 - shrink by 26 bytes or so 2007-01-09 17:37:32 +00:00
Bernhard Reutner-Fischer e86bd6cde5 - vapier wants LD to point to CC, revert my previous change 2007-01-09 17:36:26 +00:00
Bernhard Reutner-Fischer 8fc4011992 - shrink klogd a tiny bit.
Compile tested only, would have sent it to the list for review but they don't show up in the ML archives :-/
   text    data     bss     dec     hex filename
    533       0       0     533     215 sysklogd/klogd.o.orig
    530       0       0     530     212 sysklogd/klogd.o
2007-01-09 15:46:36 +00:00
Bernhard Reutner-Fischer f07fe62d89 vda, we once had a get_chomped_line_from_file or the like. Where is that nowadays? FIXME: use it here instead of the fgets()
- shrink by ~9%: use common_buf, reuse are_you_root, adopt to global option_mask32
2007-01-09 10:06:19 +00:00
Denis Vlasenko 44c2eb23dd ping6: fix sequence numbers (missed ntoh) and ttl display.
(apparently some, eh, clever libc guy decided that
*CHANGING* IPV6_HOPLIMIT value in libc header is a nifty idea...)
2007-01-08 23:55:33 +00:00
Bernhard Reutner-Fischer d6c23aeefb - guess we need dl too 2007-01-08 16:38:33 +00:00
Bernhard Reutner-Fischer c1feac6e9f - set LD to ld
- simplify the cmd_busybox__ a bit and pass the LDFLAGS via -Wl down to CC
2007-01-08 16:29:15 +00:00
Denis Vlasenko 681f183b94 Previous "fix" wasn't good enough.
Now *this* is the correct fix (I think).
2007-01-07 22:23:38 +00:00
Denis Vlasenko 91c06e0a3c arp: small fixes for user-supplied device name case 2007-01-07 22:20:33 +00:00
Bernhard Reutner-Fischer 42646c5585 - style fixes and shrink by another 4 bytes while at it. 2007-01-07 22:12:35 +00:00
Denis Vlasenko 6998142998 httpd: stop adding our own "Content-type:" to CGI output 2007-01-07 21:25:12 +00:00
Denis Vlasenko db6a5c3f9e gzip cleanup part #13 - the last for today I think 2007-01-07 19:45:51 +00:00
Denis Vlasenko 3ae6f34135 gzip cleanup part #12 2007-01-07 19:44:57 +00:00
Denis Vlasenko 2f6df7fa0a gzip cleanup part #11 2007-01-07 19:44:35 +00:00
Denis Vlasenko 56c83eaaf5 gzip cleanup part #10 2007-01-07 19:40:50 +00:00
Denis Vlasenko 89af56b3e5 gzip cleanup part #9 2007-01-07 19:40:34 +00:00
Denis Vlasenko 52933d47bd gzip cleanup part #8 2007-01-07 19:40:13 +00:00
Denis Vlasenko ef87d46b8c gzip cleanup part #7 2007-01-07 19:39:54 +00:00
Denis Vlasenko 1a03c21adf gzip cleanup part #6 2007-01-07 19:39:34 +00:00
Denis Vlasenko da31fbc1b1 gzip cleanup part #5 2007-01-07 19:39:02 +00:00
Denis Vlasenko f824136f6b gzip cleanup part #4 2007-01-07 19:38:42 +00:00
Denis Vlasenko ed0f6db35e gzip cleanup part #3 2007-01-07 19:38:26 +00:00
Denis Vlasenko 30551fd6da gzip cleanup part #2 2007-01-07 19:38:06 +00:00
Denis Vlasenko ad403413c7 a ton of gzip changes, split up in compiled and
run-tested pieces. Code was rather messy.
It's not a bug fix, more like code cleanup.

This is the first part.
2007-01-07 19:37:42 +00:00
Denis Vlasenko 88e2b1cb62 I *always* forgotting svn add 2007-01-07 19:35:11 +00:00
Bernhard Reutner-Fischer 7ae93f0fe7 - FIXME: someone broke diff -r
- minor shrinkage i had lying around
   text	   data	    bss	    dec	    hex	filename
   7002	      8	     88	   7098	   1bba	diff.o.orig
   6936	      8	     81	   7025	   1b71	diff.o
2007-01-07 15:56:09 +00:00
Bernhard Reutner-Fischer 5568b722d4 - a few minor tweaks 2007-01-07 15:53:18 +00:00
Bernhard Reutner-Fischer 70722ec4ce - pull taskset.tests from the busybox_scratch branch 2007-01-07 15:19:34 +00:00
Bernhard Reutner-Fischer f0b71c19ae - add arp to defconfig 2007-01-07 12:18:59 +00:00
Denis Vlasenko fa85b86f38 add arp applet - thanks to
"Eric Spakman" <E.Spakman@inter.nl.net>
2007-01-07 01:24:12 +00:00
Denis Vlasenko b05955e0a5 work around gcc's false warning 2007-01-07 00:24:49 +00:00
Denis Vlasenko 8336f080cb diff: small optimizations; do not try to diff non-seekable stream
(currently we don't support that)
sort: fixes. testsuites fixed:
sort with non-default leading delim 1
sort with non-default leading delim 2
sort key doesn't strip leading blanks, disables fallback global sort
2007-01-07 00:21:41 +00:00
Denis Vlasenko 8a820b2732 syslogs: a bit better wording in explanation how buffering
is allocated
2007-01-06 22:08:53 +00:00
Bernhard Reutner-Fischer ea9e35f5dd - minor shrinkage: -25 bytes or so. 2007-01-06 21:47:09 +00:00
Denis Vlasenko 3697a829de "kernel" => "busybox" 2007-01-06 10:31:45 +00:00
Denis Vlasenko da98165ad6 kill unused variable 2007-01-06 01:27:24 +00:00
Denis Vlasenko c7a4aa5c99 move [g]zip decompressor state into malloc'ed buffer. size:
text    data     bss     dec     hex
5256       0     108    5364    14f4 - old
4915       0       0    4915    1333 - new
2007-01-06 00:03:11 +00:00
Denis Vlasenko d1a19affeb split inflate_xx_setup() subroutines from inflate_xx() 2007-01-05 23:58:45 +00:00
Denis Vlasenko cd42cb8df0 do not expose internal state of [g]zip unpacker.
fix memory leak in inflate_gunzip.
2007-01-05 23:56:53 +00:00
Denis Vlasenko 447b543eaf Stopped doing assignments inside expressions.
Who wrote this gem, I wonder?

n -= (e = (e = gunzip_wsize - ((d &= gunzip_wsize - 1) > w ? d : w)) > n ? n : e);
2007-01-05 19:49:02 +00:00
Denis Vlasenko cc33ef12d2 decompress_unzip: preparatory patch 2007-01-05 19:46:04 +00:00
Denis Vlasenko 3376298b59 Stop tracking buffer size - it is a constant.
Stop ignoring write errors.
Fix bugs in this line:
rc->buffer_size = read(rc->fd, RC_BUFFER, rc->buffer_size);
(a) should use safe_read()
(b) just ONE short read (e.g. 4 bytes) will make ALL future reads short!
2007-01-05 14:04:47 +00:00
Denis Vlasenko 98b8e9487d simplify access to buffer, making code a bit smaller 2007-01-05 13:59:05 +00:00
Bernhard Reutner-Fischer 89d49a4236 - remove duplicate includes 2007-01-04 22:13:25 +00:00
Denis Vlasenko a0e2a0a192 syslogd: start using bb_common_bufsiz1 instead of stack/malloc
logger: optimize, also use bb_common_bufsiz1 (~40 bytes)
tested to eat arbitrarily-sized input at high speed - ok
2007-01-04 21:22:11 +00:00
Denis Vlasenko b893497151 syslogd: stop doing open/fstat/lseek/close on _every_ write
(still doing it if more than a second passed in between).
Costs ~40 bytes.
2007-01-04 18:02:32 +00:00
Denis Vlasenko a9b60e93ee new libbb func: xmalloc_realpath (+ use it where makes sense)
syslogd, logread: add debugging code (disabled)
syslogs: drastically smaller bss; fix "-C n" behaviour
2007-01-04 17:59:59 +00:00
Denis Vlasenko ceab8700df syslogd: almost rewritten. Had several obvious bugs... 2007-01-04 17:57:54 +00:00
Bernhard Reutner-Fischer bfe1950c63 - spelling fix 2007-01-04 15:44:49 +00:00
Denis Vlasenko e428e9d43b klogd: small optimizations
(btw, I looked into syslogd... that's frightening!)
2007-01-04 03:07:57 +00:00
Denis Vlasenko b8429fb1f4 fix allnoconfig build. the most useful fix of the month. ;)
[spotted by Bernhard Fischer <rep.nop@aon.at>]
2007-01-03 23:23:58 +00:00
Denis Vlasenko a773af3b1d httpd: read cgi output with full_read, not safe_read
(avoids mangling of HTTP headers)
2007-01-03 23:02:18 +00:00
Denis Vlasenko a8951cbc34 wget: always print port# in 'Host' header (smaller code) 2007-01-03 22:29:01 +00:00
Denis Vlasenko 919c10dd88 ping[6]: don't do htons(a++), it can be a macro 2007-01-03 22:14:18 +00:00
Denis Vlasenko b36b370fbe wget: print port# in 'Host' header, if different from 80 2007-01-03 22:09:26 +00:00
Denis Vlasenko 562dc249e0 ftpgetput: fix PASV mode, fix xatou0induced breakage,
improve error message, guard against garbage from remote server
being printed. ~20 bytes code growth
2007-01-03 21:55:50 +00:00
Denis Vlasenko 6eebed561a chown: fix handling of "user.group" notation 2007-01-03 20:07:06 +00:00
Denis Vlasenko c9d34da375 find: fix misplaced #else (fix by Harald Kuthe <trhoudini@hotmail.com>) 2007-01-03 03:15:58 +00:00
Denis Vlasenko d54708399d fdisk: remove 8k buffer from bss - OSF labels
are not THAT common anyway
2007-01-03 02:58:54 +00:00
Denis Vlasenko 9b1381fd2f convert calloc to xzalloc
fix sleep-on-die option
2007-01-03 02:56:00 +00:00
Denis Vlasenko bb3d0fab3b extern variable declaration in a .c file is heresy - fixing it 2007-01-03 01:57:25 +00:00
Denis Vlasenko 75fa4eb155 fsck_minix: tiny optimization 2007-01-03 01:36:42 +00:00
Denis Vlasenko 87033fb5fa forgot to svn add util-linux/minix.h :( 2007-01-03 00:47:47 +00:00
Denis Vlasenko 73464ce53d fbset: move variable from data to bss
fsck_minix: fix fallout
2007-01-03 00:45:05 +00:00
Denis Vlasenko aa95959cb8 factor out minix structures/constants into minix.h
fsck_minix: optimizations
2007-01-03 00:43:19 +00:00
Denis Vlasenko 6dd392a252 fsck_minix: optimizations. ~130 bytes 2007-01-03 00:41:53 +00:00
Denis Vlasenko 24cfe8fe0c introduce small[u]int
fsck_minix: use it for flag variables. 140 bytes saved
2007-01-03 00:39:15 +00:00
Denis Vlasenko 2a85676fa5 silly style fixes 2007-01-02 16:45:05 +00:00
Denis Vlasenko ace35eeb88 Remove networking/libiproute/linux/pkt_sched.h
(and networking/libiproute/linux/ since it become empty).
Style fixes.
2007-01-02 16:32:16 +00:00
Mike Frysinger a71199e0f0 str2u() is only used when FEATURE_SORT_BIG is enabled 2007-01-02 05:43:30 +00:00
Mike Frysinger e5c095345e convert usage compressed command into the new cmd style 2007-01-02 05:42:35 +00:00
Denis Vlasenko e1d3e034a9 awk: style fixes 2007-01-01 23:53:52 +00:00
Denis Vlasenko 6dc6ebbf44 awk: undo locale setting for numbers - or else parsing
can act quite mysteriously
date: add if(ENABLE_LOCALE_SUPPORT)
2007-01-01 23:53:12 +00:00
Denis Vlasenko f782f52c8c awk: style cleanup. A lot of rw data moved to ro
(still has quite a lot of statics etc...).
getopt32-ification.
2007-01-01 23:51:30 +00:00
Denis Vlasenko b2abef3e54 stty: fix width of a field for ppc32
sort: fix -u to match coreutils 6.3
msh: compile fix (my fault)
2007-01-01 18:18:04 +00:00
Denis Vlasenko e27f15615f msh: double "static char line[LINELIM]" etc deleted.
massive amounts of assignments-in-ifs deleted
(some of which were VERY nasty)
2007-01-01 06:00:38 +00:00
Denis Vlasenko d1a302b52f rt_names: stop allocating 5k in rwdata
objsizes: don't show build machinery's object modules
2006-12-31 20:40:20 +00:00
Denis Vlasenko 50ddabc859 less: fix <tab><backspace> buglet 2006-12-31 19:36:01 +00:00
Denis Vlasenko 95b307103a less: interpret backspace.
less is officially declared PAGER-capable! ;)
(this includes viewing of manpages)
2006-12-31 19:23:31 +00:00
Denis Vlasenko c519320000 iproute: remove double get_hz optimization 2006-12-31 19:07:23 +00:00
Denis Vlasenko 13463af29f remove commented out #includes etc
move get_hz to the only caller
2006-12-31 18:58:32 +00:00
Denis Vlasenko 98ee06d3d4 stop using __u32 etc. uint32_t is there for a reason 2006-12-31 18:57:37 +00:00
Denis Vlasenko 806116b234 fixes from Yann E. MORIN <yann.morin.1998@anciens.enib.fr> 2006-12-31 12:14:16 +00:00
Mike Frysinger d514ba226b convert include/autoconf.h split and include/bbconfigopts.h commands into the new cmd style 2006-12-31 11:46:19 +00:00
Mike Frysinger 5dd76862ef Yann E. MORIN. writes: i pity the fool who doesnt use the z length modifier with size_t types 2006-12-31 11:34:17 +00:00
Denis Vlasenko 4a64c33443 about.html: update maintainer name
libbb/Kbuild: less needs xregcomp.o
2006-12-30 22:03:02 +00:00
Denis Vlasenko cb04ff5c68 fixdep.c: avoit doing memcmp in most cases
uidgid_get.c: add forgotten copyright notice
pwd/grp/shadow: avoid collisions with libc names
2006-12-30 21:11:57 +00:00
Denis Vlasenko 80602a98bc saw commit of vapier@busybox.net (thanks!),
decided to stop doing FOUR memcmp's per each input character.
I should have fixed this much earlier...
2006-12-30 19:52:28 +00:00
Mike Frysinger 1b3e8179a2 kill off AUTOCONF_INCLUDED (again) since it tends to get into cat fights with the kernel headers 2006-12-30 19:46:38 +00:00
Mike Frysinger 68ffb9a85d make sure AUTOCONF_TIMESTAMP is filled up properly ... if user has a timezone of Factory for example, strftime() will overflow the string and leave us without a trailing "\n and all hell breaks loose when we compile 2006-12-30 19:43:35 +00:00
Mike Frysinger 40ae9b5617 prevent buffer underflows with empty lines 2006-12-30 19:30:20 +00:00
Mike Frysinger c255f8b492 prevent accessing memory that we dont own 2006-12-30 19:21:48 +00:00
Denis Vlasenko 6a5dc5d75a next bunch of fixes for bugs found by randconfig 2006-12-30 18:42:29 +00:00
Denis Vlasenko 3bba545a54 done a dozen of randconfig test. guess what? ALL failed...
these are resulting fixes
2006-12-30 17:57:03 +00:00
Denis Vlasenko b5a122b6f9 fix for uclibc-without-shadow.h compilation 2006-12-30 14:46:51 +00:00
Mike Frysinger d9e4ddc38b we need to use the compiler driver to invoke LD as LDFLAGS is in the form the compiler driver understands, not the form the linker itself understands, so trying to invoke ld directly and passing it LDFLAGS while invoking the compiler driver in other places and passing it LDFLAGS does not work 2006-12-29 23:27:22 +00:00
Denis Vlasenko c1a339983f Add link to post-1.3.1 patches to website 2006-12-28 21:44:43 +00:00
Mike Frysinger 57ec574af7 * precision requires the argument be an integer, not size_t 2006-12-28 21:41:09 +00:00
Denis Vlasenko 7fa0fcafca fix build without shadow support 2006-12-28 21:33:30 +00:00
Denis Vlasenko 9a44c4f91c bb_xget[pw/gr]nam were horribly misnamed - fixed.
uidgid_get -> get_uidgid, add additional param
(numeric_ok). Make chown use it.
chown: fix "chown user: ...."
install: fix incorrect use of bb_xget[pw/gr]nam
2006-12-28 05:44:47 +00:00
Denis Vlasenko ba092336f0 news.html: Fix bad English 2006-12-27 09:47:53 +00:00
Denis Vlasenko 9cd7a249f1 fix typo 2006-12-27 07:57:29 +00:00
Denis Vlasenko f959bee0f4 Announce 1.3.1 2006-12-27 05:06:27 +00:00
Denis Vlasenko 8f27c34c28 ash: is_safe_applet mustn't affect disabled applets 2006-12-26 21:31:11 +00:00
Denis Vlasenko 666da5e2c6 merge post-1.3.0 fixes 2006-12-26 18:17:42 +00:00
Denis Vlasenko 270c17c0e6 properly export externs thru *.h files 2006-12-26 17:40:33 +00:00
Denis Vlasenko 3ef70d43ad adduser: trivial code movement 2006-12-26 17:37:38 +00:00
Denis Vlasenko bf0a201008 style fixes
last xcalloc replaced by xzalloc
2006-12-26 10:42:51 +00:00
Denis Vlasenko 5dd7ef0f37 chattr: bugfixes and size reduction 2006-12-26 03:36:28 +00:00
Denis Vlasenko 407b8c0b70 trivial size reduction 2006-12-26 03:02:25 +00:00
Denis Vlasenko 0de9375ee6 leftover of e2fsck surgery 2006-12-26 02:51:29 +00:00
Denis Vlasenko c4f623ef2a put small subset of e2fsprogs back in the tree:
lsattr, chattr, fsck. Old e2fsprogs tree is in
e2fsprogs/old_e2fsprogs/*.
2006-12-26 01:30:59 +00:00
Denis Vlasenko 64c5402584 remove e2fsprogs. Nobody volunteered to clean up that mess 2006-12-26 01:25:48 +00:00
Denis Vlasenko d63c3a032a Fix irregular capitalization in usage texts 2006-12-25 15:10:32 +00:00
Denis Vlasenko b6488c1780 trim help texts a bit more 2006-12-25 14:25:14 +00:00
Denis Vlasenko 5a4f0994b0 less: fix regexp search '/' on large files 2006-12-25 01:23:02 +00:00
Denis Vlasenko 7a50a64986 more usage message cleanups 2006-12-24 17:40:16 +00:00
Denis Vlasenko 765996aaea Cleanup usage messages (-200 bytes).
Remove busybox_main from applet table since
it is called via separate check
2006-12-24 16:59:27 +00:00
Denis Vlasenko 0ee3999d13 random tiny size savings 2006-12-24 15:23:28 +00:00
Denis Vlasenko 7cea262273 small stupid changes. no code changes 2006-12-24 07:30:09 +00:00
Denis Vlasenko a5b3e76c38 missing piece of prev commit: ndelay_off 2006-12-24 07:15:50 +00:00
Denis Vlasenko f4dff77355 less: implement waiting for input using select(). Rather tricky business.
But we do not read entire input anymore up-front.
2006-12-24 07:14:17 +00:00
Denis Vlasenko 9ac9e55e3c sum: 40% size reduction (-300 bytes)
find: one_char -> LONE_CHAR
2006-12-23 15:58:11 +00:00
Denis Vlasenko e13a537795 su: fix typo: "argv -= optind" should be += 2006-12-23 02:59:06 +00:00
Denis Vlasenko 1dc1b37b33 use xbind, xconnect where appropriate.
small edits to arping
2006-12-23 02:48:44 +00:00
Denis Vlasenko 7e46cf748e #define FEATURE_GETUSERNAME_AND_HOMEDIR should be always #defined 2006-12-23 01:21:55 +00:00
Denis Vlasenko 2a813e20e2 fix recognitions of -SIGname signals
(fix by Jacques LUDER <jacques.luder@thalesgroup.com>)
2006-12-23 01:06:21 +00:00
Denis Vlasenko 8f6c79240d find: fix spurious -exec error messages
(bug reported by Bernhard Fischer <rep.nop@aon.at>)
2006-12-23 00:49:10 +00:00
Denis Vlasenko 4cccc03768 remove useless casts (type*) xzalloc(...) 2006-12-22 18:37:07 +00:00
Denis Vlasenko a6df5907d2 dpkg: getopt32-ification etc, -100 bytes 2006-12-22 18:32:40 +00:00
Denis Vlasenko e31f721e14 tail: -50 text bytes 2006-12-22 16:06:16 +00:00
Denis Vlasenko f4c52b32db rpm: reformat. was really hard to read 2006-12-22 15:03:50 +00:00
Denis Vlasenko 0849207ce0 convert "negaite" config option into reversed (INCLUDE_SUSv2) 2006-12-22 13:56:36 +00:00
Denis Vlasenko c5cb38f4d9 time: -200 bytes of text 2006-12-22 13:43:19 +00:00
Denis Vlasenko f93ab47c45 time: fix option parsing bug, size optimizations 2006-12-22 12:36:13 +00:00
Denis Vlasenko 1d14e6f48c Always use /usr/share/udhcpc/default.script ([/usr] was depending on CONFIG_xx) 2006-12-22 11:47:19 +00:00
Denis Vlasenko afc9ff99fd removal of commented-out cruft 2006-12-22 00:45:27 +00:00
Denis Vlasenko 714701c890 tar et al: die if bb_copyfd_size copies less than asked for.
(we have bb_copyfd_exact_size now for that kind of usage)
2006-12-22 00:21:07 +00:00
Denis Vlasenko 0a8a774179 cmdedit: reformat code a bit, no algorithm changes 2006-12-21 22:27:10 +00:00
Denis Vlasenko d56b47f9a6 fix type character mixup in command completion 2006-12-21 22:24:46 +00:00
Denis Vlasenko f1282a8792 less: a few fixes for cases where we overflow status line 2006-12-21 17:03:20 +00:00
Denis Vlasenko f65d1338dc less: restore TAB display (was showing as inverse I after prev changes :) 2006-12-21 15:23:45 +00:00
Denis Vlasenko d51d14e36f less: "(null)" is a bit strange. "standard input" is better :) 2006-12-21 13:57:37 +00:00
Denis Vlasenko e147a72173 less: how many different kinds of status line we need, three?!
small fixes. [prev commit also added control char filtering
on input (e.g. regexp input, filename input for 'E' etc)]
2006-12-21 13:26:54 +00:00
Denis Vlasenko e865e81d34 less: stop dying on bad regexps, quietly pipe data w/o
user interaction if stdout is not a tty.
size optimizations
2006-12-21 13:24:58 +00:00
Denis Vlasenko bf66fbc8e2 introduce LONE_CHAR (optimized strcmp with one-char string) 2006-12-21 13:23:14 +00:00
Denis Vlasenko 6910741067 tail: fix tail +N 2006-12-21 00:43:06 +00:00
Denis Vlasenko 3f3190e34c less: total cleanup and bugfix.
Doesn't die horribly on binary files anymore.
In fact, they _100%_ work now. Control chars
are in reverse video, including DEL and that idiocy of VT-10x,
Meta-ESC [inventor of which should be prohibited from reproducing].
Regex search is fixed also. When you specify search ('/' key),
control chars turn into dots (unhighlighted),
and found occurrences highlighted instead. This is reversible.
Memory management fixed (was leaky as hell) and optimized.
Linewrapping fixed and thoroughly tested.
Max buffer size made configurable.
~ 600 bytes saved.
2006-12-21 00:22:03 +00:00
Denis Vlasenko 9a7cef930f less: somewhat buggy applet, but nice. Muchly reduced
xstrdup'ing and memory consumption. Made linewrap saner.
regex matching code was awful - still buggy, but not as
leaky as before. Made buffer size configurable. Killed
several static and on-stack buffers. Hopefully eliminated
staircase effect on Ctrl-C (unable to reproduce).
2006-12-20 02:46:48 +00:00
Denis Vlasenko b95636c52f remove casts from xmalloc() 2006-12-19 23:36:04 +00:00
Denis Vlasenko 2375d75f32 ifupdown: do not print and/or execute empty commands (""). 2006-12-19 23:15:46 +00:00
Denis Vlasenko 8cd1a288fa ifupdown: parse() returning NULL and returning "" is not the same,
it turned out! wow... okay, fixing my buglet...
2006-12-19 23:01:33 +00:00
Denis Vlasenko 28703015ab u_short, ulong exterminated
fdiskXXX: add a bit of sanity (not enough by far)
2006-12-19 20:32:02 +00:00
Denis Vlasenko f58906b646 cmdedit: fix my bug, improve code a bit 2006-12-19 19:30:37 +00:00
Bernhard Reutner-Fischer 28fbd69bf8 - use xlisten/xsocket some more. Saves .25 kB 2006-12-19 16:31:09 +00:00
Bernhard Reutner-Fischer 359d7ca0e7 - rename SU_SYSLOG to FEATURE_SU_SYSLOG 2006-12-19 08:55:38 +00:00
Denis Vlasenko 7f1dc21a5d cmdedit: use qsort for sorting command completion results; style fixes 2006-12-19 01:10:25 +00:00
Denis Vlasenko 8eb3b391ad passwd: add option to check passwords for weakness 2006-12-19 00:33:53 +00:00
Denis Vlasenko 249fabf1a3 Add option to disable command execution from vi & awk 2006-12-19 00:29:22 +00:00
Denis Vlasenko 15b213ef5a su: make /etc/shells check configurable
ash: missing ';'
2006-12-19 00:20:20 +00:00
Denis Vlasenko 908d6b7054 mount: add getmntent_r stub for dietlibc 2006-12-18 23:07:42 +00:00
Denis Vlasenko 7cfecc4b36 xfuncs.c: dietlibc actually HAS fdprintf!
platform.h: define strchrnul for dietlibc
ash: stop using few non-standard functions
2006-12-18 22:32:45 +00:00
Denis Vlasenko c8e6e35ba4 nc: add missing cast
xfuncs: add dprintf for dietlibc
2006-12-18 22:10:24 +00:00
Denis Vlasenko 83e5d6f772 A bunch of defined(__GLIBC__) added. static-linking warning expanded 2006-12-18 21:49:06 +00:00
Denis Vlasenko f42ff90453 du: dietlibc compat fix, style fixes. Thanks to sampo@symlabs.com. 2006-12-18 21:22:16 +00:00
Denis Vlasenko fcfe834d50 ifupdown: strlen(NULL) is a no-no, fixed. Also few micro-optimizations 2006-12-18 21:02:00 +00:00
Denis Vlasenko 6dca70a049 ps: fix buglet, add microoptimization 2006-12-18 14:20:01 +00:00
Denis Vlasenko db50647d1f httpd: we don't have FEATURE_HTTPD_WITHOUT_INETD anymore,
remove it from Config.in
2006-12-17 20:18:05 +00:00
Denis Vlasenko b8c77b5b25 start_stop_daemon: make code a bit more readable 2006-12-17 19:43:10 +00:00
Denis Vlasenko 0f5905e617 od: remove bug-for-bug compat (because the bug was fixed in coreuitls) 2006-12-17 19:21:13 +00:00
Denis Vlasenko c88894602d tar: report error if child dies while writing out the end of tarball
(e.g. out of disk space).
2006-12-17 19:08:20 +00:00
Denis Vlasenko b131b271a0 start_stop_daemon: fix bug where any program name was "matching"
processes for which readlink(/proc/N/exe) fails
2006-12-17 17:30:01 +00:00
Denis Vlasenko 7cdc54ff59 fix/shorten some usage strings 2006-12-17 17:27:56 +00:00
Denis Vlasenko 10f7dd1ea1 tftp: corrupted input packets were killing retransmits - fixed 2006-12-17 01:14:08 +00:00
Denis Vlasenko 0a10da29a7 diff: comment - explain what happens when hunk fails to apply 2006-12-17 00:49:56 +00:00
Denis Vlasenko f7583d89b0 patch: fix double-free (bug 1120) 2006-12-17 00:33:29 +00:00
Denis Vlasenko 9f739445cd inline strcmp(s, "-") [actually macro-ize it for now - gcc is too stupid] 2006-12-16 23:49:13 +00:00
Denis Vlasenko a597aaddfa s/extern inline/static ATTRIBUTE_ALWAYS_INLINE/g
xstrtou: disallow leading '+'
2006-12-16 23:48:13 +00:00
Denis Vlasenko 3469c185e5 wget: smallish optimization 2006-12-16 22:19:47 +00:00
Denis Vlasenko 6a1d661036 diff: fix -q exit code
last_char_is: sacrifice 9 bytes but avoid double-scan
2006-12-16 22:18:44 +00:00
Denis Vlasenko 79e77cdbed site: add link to directory with patches 2006-12-15 22:10:07 +00:00
Denis Vlasenko cda6c636ca re-applying first post-1.3.x change
version change to 1.4.0.svn
2006-12-15 00:59:35 +00:00
Denis Vlasenko 44b2ea786e back out last change - need to make busybox-1_3-stable branch first 2006-12-15 00:02:30 +00:00
Bernhard Reutner-Fischer 728534b3cb - table support for ip route 2006-12-14 15:41:29 +00:00
Bernhard Reutner-Fischer 56b956952e - minor shrinkage 2006-12-14 11:27:58 +00:00
Denis Vlasenko f7b0d4a3e5 Update busybox.net webpage with 1.3.0 announcement 2006-12-14 00:22:51 +00:00
Denis Vlasenko a883fa4cee exterminate last bzero's
version bump to 1.3.0
2006-12-13 23:52:32 +00:00
Bernhard Reutner-Fischer 9729e65706 - honor CONFIG_DEBUG 2006-12-13 17:44:24 +00:00
Bernhard Reutner-Fischer 5b6f776fe9 - remove warning about unused depth parameter in add_to_dirlist()
- make one variable static and add comment about why the other variables there are not static.
2006-12-13 16:50:15 +00:00
Denis Vlasenko 35a4bbe74f date: -R shouldn't use locale 2006-12-13 00:35:21 +00:00
Denis Vlasenko 5e2db5e8ee build system: small fix for "release" target to work 2006-12-12 23:46:31 +00:00
Denis Vlasenko 5fa7148761 build system: add "release" target
find: support -size N (needed for above)
2006-12-12 22:31:15 +00:00
Denis Vlasenko 16c2c700fd passwd: fix indentation 2006-12-12 18:11:58 +00:00
Denis Vlasenko db2b52425d passwd: added comment 2006-12-12 17:14:56 +00:00
Denis Vlasenko 900406c359 passwd: shrink by ~10 bytes, use PRNG instead of usleep. 2006-12-12 14:38:03 +00:00
Bernhard Reutner-Fischer 6f0540e7ec - remove functions marked as LEGACY in SUSv3 and use their modern counterparts. 2006-12-12 11:50:44 +00:00
Bernhard Reutner-Fischer 32f3ebf08f - add an anchor to let me point people to FAQ.html#standalone_shell
easily.
2006-12-10 13:40:16 +00:00
Denis Vlasenko 2ea630f9a5 bb_makedev: fix for glibc 2.3.2
sed: fix C++ style declaration
2006-12-10 02:52:19 +00:00
Denis Vlasenko 2f8f71b20d sed: style fixes 2006-12-10 02:09:12 +00:00
Denis Vlasenko b15b7f7a4a more: fix for case when _FILE_OFFSET_BITS is not #defined.
samll size improvement.
2006-12-10 01:57:29 +00:00
Bernhard Reutner-Fischer 57d83ff5f9 - Proposed fix to make aliases work (with uClibc-current).
See comment in the patch about the change introduced in r16342.
2006-12-07 12:25:17 +00:00
Bernhard Reutner-Fischer 1819eee436 - Improve wording in error message. 2006-12-07 12:18:36 +00:00
Bernhard Reutner-Fischer 95da177b09 - s/:\t\t/\t/ for two helptexts. 2006-12-07 12:16:17 +00:00
Bernhard Reutner-Fischer b7c50c9896 - remove a warning that was not ment to be checked in. 2006-12-06 23:14:31 +00:00
Bernhard Reutner-Fischer feea1b972c - better distinction between CFLAGS and CPPFLAGS. 2006-12-06 21:51:59 +00:00
Bernhard Reutner-Fischer bc95f57932 - adjust to kernel's build infrastructure. 2006-12-06 15:29:00 +00:00
Bernhard Reutner-Fischer 882e60c442 - shrink less.
01a: svn version
01b: merge past_eof and inp_stdin into flags.
01c: merge match_backwards into flags.
01d: add handling of <HOME> and <END> keys, remove set_tty_raw, use fflush_stdout_and_exit
01e: rewrite special-key handling to be smaller.
01f: changing the format saves 4 bytes (alot of places would benefit from this)
   text    data     bss     dec     hex filename
   9034       8     648    9690    25da less.o.01a
   9023       8     640    9671    25c7 less.o.01b
   9027       8     636    9671    25c7 less.o.01c
   9068       8     636    9712    25f0 less.o.01d
   8990       8     636    9634    25a2 less.o.01e
   8986       8     636    9630    259e less.o.01f
2006-12-04 16:04:50 +00:00
Bernhard Reutner-Fischer bbda98f14c - cosmetic change to avoid warnings about eventual padding/packing. 2006-12-04 15:58:27 +00:00
Bernhard Reutner-Fischer bb59f02218 - make sure we pickup the correct defines. Guards against 2.6.19 kernel-headers. 2006-12-04 15:57:17 +00:00
Bernhard Reutner-Fischer 91d4a2dac3 - commentary typo 2006-12-02 20:47:36 +00:00
Denis Vlasenko 1375bc7b67 sed: fix handling of files not ending in '\n' 2006-12-02 20:12:12 +00:00
Denis Vlasenko 8b22b07bc5 sed: improve handling of NULs 2006-12-02 17:58:10 +00:00
Denis Vlasenko becd8c538c passwd: made smaller by ~130 bytes. size can go negative
if current trend will continue ;)
2006-12-01 21:34:20 +00:00
Bernhard Reutner-Fischer 732268fe69 - provide central knob to turn off RPC related options. 2006-12-01 16:56:12 +00:00
Denis Vlasenko 4c87d4f242 passwd: micro-optimization 2006-11-30 23:13:59 +00:00
Denis Vlasenko eb98be02ac "kernel config" -> "busybox config"
suggested by Roberto A. Foglietta <roberto.foglietta@gmail.com>
2006-11-30 22:40:32 +00:00
Denis Vlasenko 93f6aa6bca "make bigdata" biggest offender dealt with:
xmalloc 16Kb buffer instead of keeping it in bss
2006-11-30 21:11:01 +00:00
Denis Vlasenko 610c4aa197 ed: convert style to bbox's. No code changes. 2006-11-30 20:57:50 +00:00
Denis Vlasenko 002526481e passwd: small size optimization. salt generation improved
(really generated different salts even if called back-to-back).
2006-11-30 20:41:28 +00:00
Denis Vlasenko ab24e18c7a passwd: rework:
* do not make backup copy by copying (just retain old file)
* correctly fall back to /etc/passwd if user is not in shadow
* fix bug with overlong passwd entries
* be permissive on some kinds of failures
* reduce stack usage
* code size: -500 bytes
2006-11-30 16:41:15 +00:00
Bernhard Reutner-Fischer b8bb27c7ea - save 4 bytes
text    data     bss     dec     hex filename
    764       0      80     844     34c vlock.o.oorig
    760       0      80     840     348 vlock.o
2006-11-30 14:53:51 +00:00
Denis Vlasenko 28bb84bd4e Well, I am not 100.00% usre that uint16 will suffice there.
We don't lose anything by using 'unsigned' instead.
2006-11-29 23:15:04 +00:00
Denis Vlasenko 016a82e279 another -90 bytes. That #define is **evil** 2006-11-29 22:47:42 +00:00
Denis Vlasenko 66b86c6902 mkfs.minix: more cleanups, -~300 bytes of code.
Added debugging support.
2006-11-29 22:33:47 +00:00
Denis Vlasenko c6ce8733dd cut 0.5k off mkfs.minix
assorted strtoul fixes (that's what brought me into minix)...
2006-11-29 18:15:52 +00:00
Denis Vlasenko a35c9e91ba httpd: fix decode of '/' when called via -d 2006-11-29 15:58:50 +00:00
Denis Vlasenko 2425bdce34 od: fix buglet in --traditional, microoptimization,
document coreutils bug
bloat-o-meter: account for objects in rodata too
2006-11-29 14:32:01 +00:00
Denis Vlasenko 834410a5a5 getopt32-ification of fdisk 2006-11-29 12:00:28 +00:00
Denis Vlasenko c61852a02b fix support for globally disabling --long-options.
(disabling them saves ~4K on fully configured bbox)
2006-11-29 11:09:43 +00:00
Denis Vlasenko 601ae1378b od: sometime ago I landed BIG od implementation
from coreutils. My fault. This commit contains
cleanups and size reductions.
2006-11-28 23:37:46 +00:00
Denis Vlasenko df38188367 fix bug in new str -> num convertors 2006-11-28 10:54:16 +00:00
Denis Vlasenko 7df69b887a usage: fix few help texts, fix breakage: '\<tab>'
sequence utterly confused cpp :)
2006-11-28 00:46:49 +00:00
Denis Vlasenko c2f5b02293 udhcpc: fix my breakage 2006-11-28 00:21:46 +00:00
Denis Vlasenko 1fffe38e01 fix udhcpc help message, take steps to make usage.h less messy 2006-11-28 00:06:39 +00:00
Denis Vlasenko 229b3d2072 do not overflow ifr_name. maybe it was safe in some places,
but not everywhere. err to the safe side.
2006-11-27 23:44:57 +00:00
Denis Vlasenko e2d3ded354 udhcpc: convert to getopt32 2006-11-27 23:43:28 +00:00
Denis Vlasenko 30d7a346e6 tar: fix misplaced --exclude long option definition 2006-11-27 20:24:40 +00:00
Denis Vlasenko 5e90e10647 Closing bug 1040:
The "quiet" option is quietly (hah) ignored. It should be passed through
to the mount() syscall in the comma separated list of options.
I found the problem with the vfat/msdos filesystems, which uses
a quiet option to override some complaints and errors.
2006-11-27 19:50:16 +00:00
Denis Vlasenko f1a6c6b362 erase_mtab: do not limit ourself to 40 mtab entries 2006-11-27 17:29:09 +00:00
Denis Vlasenko 097c324f59 fix remaining survivors of the return(a) cleanup 2006-11-27 16:59:15 +00:00
Denis Vlasenko d9e15f2068 style cleanup: return(a) -> return a, part 2 2006-11-27 16:49:55 +00:00
Denis Vlasenko 079f8afa0a style cleanup: return(a) -> return a, part 1 2006-11-27 16:49:31 +00:00
Denis Vlasenko 10d0d4eec7 byteswap ops had extra mask ops - removed 2006-11-27 16:48:17 +00:00
Denis Vlasenko 3ece72dc3f svn add bb_strtonum.c :( 2006-11-27 15:12:16 +00:00
Denis Vlasenko 459903bd4e Provide our own isdigit macro. saves more than 400 bytes. 2006-11-27 14:44:18 +00:00
Denis Vlasenko d686a045c8 safe_strtoXX interface proved to be a bit unconvenient.
Remove it, introduce saner bb_strtoXX.
Saved ~350 bytes.
2006-11-27 14:43:21 +00:00
Bernhard Reutner-Fischer 8a0a83d503 - minor shrinkage
text    data     bss     dec     hex filename
    773       0      80     853     355 vlock.o.orig
    766       0      80     846     34e vlock.o
2006-11-27 13:58:18 +00:00
Denis Vlasenko 2813ce2aad ifconfig: do not try to continue on errors. not much sence in doing that
IMHO, but requires extra code.
2006-11-27 10:03:21 +00:00
Denis Vlasenko a7b2c41e03 deluser: the same code, but a bit less obfuscated. 2006-11-27 01:04:23 +00:00
Denis Vlasenko c9bb67787a deluser: size reduction by 60 bytes.
patch from Tito <farmatito@tiscali.it>
2006-11-27 00:54:59 +00:00
Denis Vlasenko bf11e8942d added gcc flag which is needed for ULLONG_MAX to appear
on Tito's box
2006-11-26 22:17:46 +00:00
Denis Vlasenko e5667c1cfe Closing bug 730. libbb run_parts is using scandir (a GNUism),
and it is used only by run_parts applet, so move it there.
Also saved ~30 bytes (prolly gcc autoinlining...).
2006-11-26 20:13:39 +00:00
Denis Vlasenko ec0c920a78 added small doc about tar 'pax header' format 2006-11-26 17:07:38 +00:00
Denis Vlasenko 664733f1a3 sort: two small optimizations 2006-11-26 15:48:54 +00:00
Denis Vlasenko 0d42ddff70 sort: reformat entire file wrt style.
fix single obvious bug: right hand was 0 here:
 flags & (FLAG_b&FLAG_d&FLAG_f&FLAG_i&FLAG_bb)
fixed to use |
2006-11-26 15:48:03 +00:00
Denis Vlasenko cf749bc10c small fixes:
fix xstrdup to not grossly overallocate memory
use xopen instean of xopen3 in several places
etc.
2006-11-26 15:45:17 +00:00
Denis Vlasenko c1660fea6d tar: refuse to untar files with "/../" components 2006-11-26 15:42:03 +00:00
Denis Vlasenko b596335868 tar: correctly skip (and warn about) pax headers.
plug memory leak. save 50 bytes.
Wooohooo! we finally can unpack kernel tarballs!
2006-11-26 01:46:59 +00:00
Denis Vlasenko 7725d0ff5c tar: add support for FEATURE_TAR_GNU_EXTENSIONS so than we can save
long names now. We were able to read such tars, but not create.
+275 bytes. Without FEATURE_TAR_GNU_EXTENSIONS: -25 bytes.

We still cannot unpack Linux kernels, but not for long ;)
2006-11-25 23:56:50 +00:00
Denis Vlasenko 2d27e4ccbb tee: fix bug: argv[-1] is a no-no!
bb_full_fd_action: optimize
die_if_ferror: "<applet>: filename" isn't a good err msg, add "..I/O error"
2006-11-25 23:50:28 +00:00
Denis Vlasenko 87cd4a87e3 tar: small fix and small optimization 2006-11-25 23:47:32 +00:00
Denis Vlasenko 43bddf31e9 small improvements in str -> num convertors 2006-11-25 14:49:04 +00:00
Denis Vlasenko f2408e6c3f tar: abort if tarring up file larger that 64Gb
(otherwise we will produce garbled tarfile)
2006-11-25 14:48:09 +00:00
Denis Vlasenko 5dd27b1ee0 dd: support >2gb values for seek, skip, count 2006-11-25 14:46:21 +00:00
Denis Vlasenko ed836cdc30 regularize str -> num convertors 2006-11-25 14:44:13 +00:00
Denis Vlasenko 809a6e3104 small optimization 2006-11-24 22:42:44 +00:00
Denis Vlasenko 3feb2fc535 tar: fix multiple -t and/or -v options handling.
do not process list of files to tar up in reverse order.
2006-11-24 21:55:55 +00:00
Denis Vlasenko d031ffa623 tar: sanitize option handling 2006-11-24 21:54:44 +00:00
Denis Vlasenko b833ca9d2d tar: buglet fix 2006-11-24 18:53:13 +00:00
Denis Vlasenko d6772501db tar: fix and sanitize handling of long filenames/linknames
(GNU extensions 'K' and 'L').
We correctly handle them when untarring now, but unfortunately
we still don't use them when tarring! That stupid 100 char limit
is still there!
The biggest problem is that we don't support 'pax' tar format.
Linux kernel tarballs are in this format... shame
2006-11-24 17:21:44 +00:00
Denis Vlasenko d398ecab9d hunt down improper include <>, make mkswap output 4Gb+ friendly 2006-11-24 15:38:03 +00:00
Denis Vlasenko 8023d7df78 svn add makedev.c. Forgot as usual... :( 2006-11-24 15:06:28 +00:00
Denis Vlasenko b8a8e601df tar: small fixes:
* size-optimize mapping code
* kill double close
2006-11-24 14:59:45 +00:00
Denis Vlasenko c50f370f98 tar: cache [ug]id->username/groupname mappings. Cuts down amount
of open/read/close of /etc/passwd and /etc/group
dramatically (we were rereading those for each untarred file!!!)
2006-11-24 14:57:31 +00:00
Denis Vlasenko 4fbb584a0e tar: cry murder and bail out if file shrinks under us while we tar it up 2006-11-24 14:55:23 +00:00
Denis Vlasenko 0b35470d9b glibc makedev() is a large inline. Save 700+ bytes by wrapping it
into a function.
2006-11-24 14:54:27 +00:00
Denis Vlasenko cf30cc82a3 header_verbose_list: stop truncating file size in listing 2006-11-24 14:53:18 +00:00
Denis Vlasenko 376ce1e775 tar:
* unpack: handle tar header fields which are not NUL terminated
* pack: handle 4+GB files correctly
* pack: refuse to store 101+ softlinks (was truncating link
  target name)
* pack: mask mode with 07777
2006-11-24 14:51:01 +00:00
Denis Vlasenko 14621929a1 md5sum: make -c grok formats like "68b329da9893e34099c7d8ad5cb9c940 *foo".
Also eradicate 95 bytes of bloat.
2006-11-23 15:59:12 +00:00
Denis Vlasenko a741b778fe ifupdown:
ifconfig said to set iface up before it processes hw %hwaddress%,
which then of course fails. Thus we run two separate ifconfig
2006-11-23 15:08:37 +00:00
Denis Vlasenko 93ad1c2385 ifupdown: save some 100+ bytes of code in addstr() 2006-11-23 15:07:38 +00:00
Denis Vlasenko 4e4662cc73 wget: -O - still outputs progressbar (to stderr)
Noticed dead code. -100 bytes.
2006-11-23 13:10:23 +00:00
Denis Vlasenko c90c3f30a8 add "wpad" DHCP option. Spotted some optimization opportunities: -80 bytes 2006-11-23 12:57:49 +00:00
Denis Vlasenko 48237b0c88 introduce setsockopt_reuseaddr(int fd), setsockopt_broadcast(int fd),
use them where appropriate. 200 bytes saved
2006-11-22 23:22:06 +00:00
Bernhard Reutner-Fischer b40bdb383a - add FIXME to brokenness in the installer.. 2006-11-22 18:40:06 +00:00
Bernhard Reutner-Fischer 7627cc1454 - fix typo 2006-11-22 18:21:08 +00:00
Denis Vlasenko 81e264d4af fix double merge 2006-11-22 17:42:06 +00:00
Bernhard Reutner-Fischer be2f9f7fe0 - update TODOs 2006-11-22 16:48:29 +00:00
Bernhard Reutner-Fischer 32eddffa30 - revert r15563 (pull current version of taskset off the busybox_scratch branch) 2006-11-22 16:39:48 +00:00
Denis Vlasenko c8717cd857 telnetd: move generic stuff into libbb. It will make it easy
to make other server applets IPv6-aware too.
2006-11-22 16:10:39 +00:00
Denis Vlasenko 0801ef28ca telnetd: if FEATURE_IPV6 is on, telnet will NOT work on IPv4
which is kind of stupid
2006-11-22 15:57:52 +00:00
Denis Vlasenko 75f8d080a2 telnetd: we were having telnetd with is ONLY inetd or ONLY standalone.
What if I need to have both?? This patch introduces
CONFIG_FEATURE_TELNETD_STANDALONE: y - both, n - only inetd.
2006-11-22 15:54:52 +00:00
Bernhard Reutner-Fischer d6bbf99a8b - reinstate "make checkhelp" 2006-11-22 09:39:48 +00:00
Denis Vlasenko aad4999eea #if HAVE_AFINET6 -> #ifdef HAVE_AFINET6 2006-11-22 02:12:07 +00:00
Denis Vlasenko 428f7ae6e2 httpd: comment on QUERY_STRING 2006-11-21 21:35:14 +00:00
Denis Vlasenko 8b45837b4c httpd: add link to docs 2006-11-21 21:23:21 +00:00
Denis Vlasenko 5e618ff439 xgethostbyname: more readable 2006-11-21 20:35:22 +00:00
Denis Vlasenko 7ca3921e5e bb_INET_default[] is really just a const "default",
nothing INET-specific
2006-11-21 20:34:21 +00:00
Denis Vlasenko 5096246ffb ifconfig: looks like char host[128] is not really needed. 2006-11-21 20:32:38 +00:00
Denis Vlasenko f8c8bb1160 wget: yet another contortion for proftpd's PASV response. 2006-11-21 19:10:26 +00:00
Bernhard Reutner-Fischer 921f5df25f - add 'ip rule' support. First take..
text    data     bss     dec     hex filename
   2999       0       0    2999     bb7 networking/libiproute/iprule.o
2006-11-21 15:36:08 +00:00
Denis Vlasenko 04b30ba3b8 ifconfig: preparatory patch, no code changes 2006-11-21 14:26:37 +00:00
Denis Vlasenko 3aa2d51cd6 insmod: set STRVERSIONLEN = 64, convert #ifdef CONFIG to #if ENABLE,
stop using CONFIG_ prefix for non-config-system variables
2006-11-21 14:12:53 +00:00
Denis Vlasenko 9229794ab3 insmod_ng_main: -80 bytes. Stopp mmapping, use xmalloc_open_read_close(). 2006-11-21 11:58:14 +00:00
Bernhard Reutner-Fischer a8381948da - style fixes 2006-11-21 11:23:11 +00:00
Denis Vlasenko 1288722f3e wget: add TODO 2006-11-21 11:15:58 +00:00
Denis Vlasenko 40f62a8c3d wget: fix ftp PASV mode ("numeric" check was too strict) 2006-11-21 11:04:31 +00:00
Bernhard Reutner-Fischer 3e7ef7ead4 - update defconfig 2006-11-21 10:53:05 +00:00
Denis Vlasenko 9cade08917 wget: reduce likelihood of ETA overflow (especially with !LFS) 2006-11-21 10:43:02 +00:00
Denis Vlasenko 04291bc5ae httpd: slight reduction of #ifdef forest
few other applets: #ifdef CONFIG_ -> #if ENABLE_
traceroute: fix exposed bugs
defconfig: update
2006-11-21 10:15:25 +00:00
Denis Vlasenko 3eb91c2e35 cpio: (allegedly) fix bug 0001095:
"cpio hardlink support and possible memory leak fix"
2006-11-21 00:55:46 +00:00
Denis Vlasenko 5d148e2646 httpd: fix cgi-bin/index.cgi support, add example of it,
stat: fix end-of-line if format is specified (wasn't printing it),
      fix %z (time) format to match coreutils 6.3
2006-11-21 00:12:09 +00:00
Denis Vlasenko fcdb00f735 httpd: LC_TIME locale _must_ be POSIX to httpd! We speak over the net! 2006-11-21 00:09:37 +00:00
Denis Vlasenko 6c85ddc850 httpd: add support for directory indexer (cgi-bin/index.cgi) 2006-11-21 00:08:39 +00:00
Denis Vlasenko a3ee69fa6c httpd: get rid of big, useless blocks (deindent,
bring code under 80 columns)
2006-11-21 00:07:31 +00:00
Denis Vlasenko 0bb993f39b httpd: More robust Content-length: parsing,
code reorganization (less indented)
2006-11-21 00:06:28 +00:00
Denis Vlasenko 736230e209 dhcprelay: new applet 2006-11-20 19:40:36 +00:00
Denis Vlasenko c9cdeaa3fe add compile-time check for correct DHCP packet size 2006-11-20 01:13:09 +00:00
Denis Vlasenko 4a5cf16a36 login: use %s - we know that string is not too long there
ping[6]: use getopt32: smaller (-50 bytes) and handles -c6 correctly
(was requiring '-c 6' with mandatory space)
2006-11-20 00:48:22 +00:00
Denis Vlasenko 6a353c8158 mount: if FILE* is NULL, it's not wise to use it. 2006-11-19 17:34:57 +00:00
Denis Vlasenko 83edaf3fd6 svlogd: log full lines to stderr too, and also stop using stdio for that 2006-11-19 17:33:54 +00:00
Denis Vlasenko 22dcd04f8f mkdir: style fix 2006-11-19 13:53:50 +00:00
Denis Vlasenko 89f0b3486d rodata cleanup. "unable to" == "cannot". -300 bytes 2006-11-18 22:04:09 +00:00
Denis Vlasenko 61126ab30a small fixes: using fd-based io instead of FILE*-based,
missed O_TRUNC, etc
2006-11-18 22:03:26 +00:00
Denis Vlasenko 5a3395bc01 udhcp: fix indentation and style.
Eliminate (group) a lot of smallish *.h files
Remove lots of unneeded #includes
2006-11-18 19:51:32 +00:00
Denis Vlasenko abfc4cf6d8 Add names of people historically linked to bbox project 2006-11-18 16:30:04 +00:00
Denis Vlasenko f7eaccde13 nc: fix --help text 2006-11-18 02:17:37 +00:00
Denis Vlasenko a7189f01a4 add -Wundef, fix uncovered bugs 2006-11-17 20:29:00 +00:00
Denis Vlasenko 04c6386c45 forgot about avn add... :( 2006-11-17 18:58:49 +00:00
Denis Vlasenko 8a00f44bf4 runit: add runsv, runsvdir and sv. Oh yes.
It even seems to work. +11K. :(
2006-11-17 18:58:16 +00:00
Denis Vlasenko a5342b4541 httpd: make Bernhard happier 2006-11-17 18:26:57 +00:00
Bernhard Reutner-Fischer 8bfd215fb2 - Set INSTALL_OPTS according to the config. 2006-11-17 13:54:29 +00:00
Bernhard Reutner-Fischer 193bcf381e - fix generation of the busybox.links install script inputfile 2006-11-17 13:17:04 +00:00
Bernhard Reutner-Fischer 68532b3578 - typo fix 2006-11-17 12:47:50 +00:00
Bernhard Reutner-Fischer e766715032 - end may be used uninitialized.
- TODO: should eventually use skip_whitespace there
2006-11-17 11:28:00 +00:00
Denis Vlasenko b3a071543d httpd: reduce ifdef forest. comment out redundant PATH setting 2006-11-16 18:04:43 +00:00
Denis Vlasenko d4f3d1a4bd httpd:
fix union aliasing bug
symptom: wget of non-existent file gets redirected to /text/html/something
on second and subsequend wget attempts
fix double-free bug
symptom: glibc caught double-free (we didn't NULL config->xxx ptrs after free)
2006-11-16 16:20:12 +00:00
Denis Vlasenko 0871bc89fb httpd: add -i (inetd) and -f (foreground) otions.
-i makes possible to run httpd in both inetd and standalone mode
without recompile (or need to have two different binaries)
2006-11-16 16:17:02 +00:00
Denis Vlasenko e867b7ce86 httpd: stop being silly with setenv 2006-11-16 16:12:09 +00:00
Denis Vlasenko 83ea643d8d svlogd: new applet. +9k. Still too big, but it was 12k yesterday. 2006-11-16 02:27:24 +00:00
Mike Frysinger 3672fe9e91 remove duplicate flag decls 2006-11-15 21:52:10 +00:00
Denis Vlasenko 1119972f91 umount: umount -a shouldn't stop on first failure 2006-11-12 17:23:45 +00:00
Denis Vlasenko 6c5e5a0e85 httpd: cosmetic fixes (the bug which was being hunted down
turned out to be nonexistent :)
2006-11-10 23:28:57 +00:00
Denis Vlasenko 067e3f031a wget: fix error message.
Bad:
wget http://127.0.0.1:81/fgdg/Makefile
Connecting to 127.0.0.1[127.0.0.1]:81
: HTTP/1.0 404 Not Foundror 404 Not Found
Good:
wget http://127.0.0.1:81/fgdg/Makefile
Connecting to 127.0.0.1[127.0.0.1]:81
get: server returned error: HTTP/1.0 404 Not Found

nslookup: fix my mistake
applets: make Bernhard Fischer <rep.nop@aon.at> happy :)
2006-11-10 23:25:53 +00:00
Denis Vlasenko 07159f0f0e add && !defined(__UCLIBC__) to static link warning check 2006-11-09 00:00:12 +00:00
Denis Vlasenko 8528151658 small ipv6 doc changes; nslookup a tiny bit smaller 2006-11-07 19:05:43 +00:00
Denis Vlasenko 6476cc1089 getty: remove ancient termio support (was using termois anyway) 2006-11-07 01:52:10 +00:00
Denis Vlasenko 9f60929cc4 httpd: sendCgi() forked child needs to close opened
server socket and accepted socket
2006-11-05 19:47:33 +00:00
Denis Vlasenko 5af906e7c8 rename: compare_string_array -> index_in_str_array
introduce index_in_substr_array and use it in
iproute2
2006-11-05 18:05:09 +00:00
Denis Vlasenko 402151671b ps: add documentation on POSIX ps 2006-11-05 00:47:38 +00:00
Denis Vlasenko 77a1a53a98 usage.h: stop using ancient USAGE_xxx (we have USE_xx now) 2006-11-05 00:46:35 +00:00
Denis Vlasenko 9494919ea5 ps: implement POSIX-like options, most notably -o
(activated by CONFIG_DESKTOP)
2006-11-05 00:45:47 +00:00
Denis Vlasenko aae0311356 smart_ulltoa5: make available in libbb 2006-11-05 00:44:39 +00:00
Denis Vlasenko 459e4d6cf7 replace /proc scanning code by more versatile one.
Use it where appropriate.
Stop scanning /etc/passwd *for every process*!!! (uid->username)
top: reduce memory usage - we won't save unneeded fields
from /proc info anymore. Downside: ~+250 bytes of code
2006-11-05 00:43:51 +00:00
Denis Vlasenko fa07680091 top: improve CPU% calculation
style fixes
2006-11-05 00:38:51 +00:00
Denis Vlasenko 9d4533ede1 Fix kbuild bugs noticed by Bernhard Fischer <rep.nop@aon.at> 2006-11-02 22:09:37 +00:00
Denis Vlasenko dd539f7687 Unneeded code removed, usused field "unsigned pscpu" removed 2006-11-01 20:20:37 +00:00
Denis Vlasenko 9225854144 mostly style fixes 2006-11-01 10:25:35 +00:00
Denis Vlasenko 048c93cc55 pidof: reduce #ifdef forest 2006-11-01 09:17:47 +00:00
Denis Vlasenko 35fb512728 PID should be stored in pid_t, not int or long.
find_pid_by_name() was returning 0 or -1 in last array element,
but -1 was never checked. We can use just 0 intead.
2006-11-01 09:16:49 +00:00
Denis Vlasenko d3ada32285 ps: reduce #ifdef forest 2006-11-01 09:14:52 +00:00
Denis Vlasenko 966ec7c067 #if CONFIG_xxx -> #if ENABLE_xxx 2006-11-01 09:13:26 +00:00
Denis Vlasenko 31c65f2456 find: -type T was actually meaning ! -type T!
With this fix, "make mrproper" works correctly
2006-10-31 23:39:37 +00:00
Denis Vlasenko 14aa9f7415 build system: Makefiles are in source dir, add $(srctree) 2006-10-31 23:03:09 +00:00
Denis Vlasenko b141b9b512 reads: fix bug 1078 2006-10-31 22:46:08 +00:00
Denis Vlasenko 4126b1f5c6 add usefun info on SIGINT handling peculiarities 2006-10-31 18:41:29 +00:00
Denis Vlasenko 8c76487f06 login: add big fat comment about SIGINT - prevent
adding/deleting that code again and again
2006-10-31 18:30:56 +00:00
Denis Vlasenko 6ae8079e2d login: re-enable Ctrl-^C before execing shell. 2006-10-31 17:34:44 +00:00
Denis Vlasenko 3b8ff68ec8 dd: fix bugs: always assumed conv=sync, died on write errors
w/o perror and statictics. Several small improvements
2006-10-31 15:55:56 +00:00
Denis Vlasenko 5f18e7ca33 find: implement -prune. "make clean" now works! :) 2006-10-31 03:21:02 +00:00
Denis Vlasenko a3b4fed8b3 find: fix implicit -print (sometime differed from standard) 2006-10-31 03:20:13 +00:00
Denis Vlasenko 6191a7a007 find: implement ( ) 2006-10-30 02:10:47 +00:00
Denis Vlasenko afea46b4e4 "#warning: http://...." doesn't work (gcc thinks that it's a comment!) 2006-10-29 19:37:13 +00:00
Denis Vlasenko 41be5b863d website: fix link 2006-10-29 19:34:49 +00:00
Denis Vlasenko 8d463072df website: announce 1.2.2.1 2006-10-29 19:30:55 +00:00
Denis Vlasenko 5d499e1600 find: a lot more compliant to 'standard' find
(we were not respecting order of actions!).
Add -o and -a handling.
2006-10-29 19:07:01 +00:00
Denis Vlasenko e2fb719ba3 find: small improvement 2006-10-29 19:03:56 +00:00
Denis Vlasenko df0553bbd2 find: fix -exec to work like stock find does. 2006-10-29 00:21:47 +00:00
Denis Vlasenko 656f746e74 ls: silly comment fixes 2006-10-28 13:02:55 +00:00
Denis Vlasenko 8c0c119130 chmod: typo in comments 2006-10-28 12:42:40 +00:00
Denis Vlasenko 94cf69fe3e ls: cleanup part 2. ifdef forest is much less scary now :) 2006-10-28 12:37:51 +00:00
Denis Vlasenko 5c7596058d ls: cleanup part 1 2006-10-28 12:37:16 +00:00
Denis Vlasenko 8c35d65c43 recursive_action: add depth param
chmod: match coreutils versus following links
2006-10-27 23:42:25 +00:00
Denis Vlasenko e80e2a3660 chgrp: just call chown! :) 2006-10-27 23:28:38 +00:00
Denis Vlasenko 3b8fc1c582 recursive_action: preparatory changes. will introduce "int level". 2006-10-27 17:59:14 +00:00
Denis Vlasenko 51b4c92f80 chown: add -vcf support if CONFIG_DESKTOP
chmod: stop following symlinks
2006-10-27 16:07:20 +00:00
Denis Vlasenko fefb279ace chmod: support -vcf if CONFIG_DESKTOP 2006-10-27 15:13:54 +00:00
Denis Vlasenko cf70433173 modprobe: reformat to match bbox style 2006-10-27 15:12:50 +00:00
Denis Vlasenko 82f9e28513 OFF_T_FMT -> OFF_FMT 2006-10-27 13:00:07 +00:00
Denis Vlasenko 25d8062128 top: batch mode should output all processes 2006-10-27 09:34:22 +00:00
Denis Vlasenko b54b208d90 Fix largefile breakage; advance version to 1.2.2 2006-10-27 09:05:40 +00:00
Denis Vlasenko dca0b707c0 reshuffle libbb.h contents so that order of decls makes sense
Found bad typo in largefile support :)
2006-10-27 09:05:02 +00:00
Denis Vlasenko 621204bbf6 get_terminal_width_height: do not pass insanely large values 2006-10-27 09:03:24 +00:00
Denis Vlasenko d3d004dd35 last nail into error_msg() (de)capitalization 2006-10-27 09:02:31 +00:00
Denis Vlasenko 1340ca8c87 As usual, I forgot "svn del"... 2006-10-27 07:17:36 +00:00
Denis Vlasenko 2fe7b73d99 ...and yet another small fix. Ouch... 2006-10-26 23:39:04 +00:00
Denis Vlasenko 1de0830e62 Fix minor breakage in previous commit 2006-10-26 23:32:43 +00:00
Denis Vlasenko ddec5af6b0 rename functions to more understandable names 2006-10-26 23:25:17 +00:00
Denis Vlasenko f0ed376eda remove bb_printf and the like 2006-10-26 23:21:47 +00:00
Denis Vlasenko 670a6626ca add ipv6 developer doc 2006-10-26 17:21:13 +00:00
Denis Vlasenko ebe578ab2f nslookup: make it more IPv6 friendly 2006-10-26 17:17:59 +00:00
Denis Vlasenko 68f2187265 mount: use switch (compare_string_array(..))
where appropriate, saves >100 bytes.
2006-10-26 01:47:34 +00:00
Denis Vlasenko 1457915afc xconnect is non-conforming to "xfunc like libc" rule. Fixing 2006-10-26 01:09:46 +00:00
Denis Vlasenko 940b2e4b73 ip: "ip addr del" and "ip addr delete" both should work 2006-10-26 00:38:22 +00:00
Denis Vlasenko c6f188def8 silly size savings and capitalization fixes 2006-10-26 00:37:00 +00:00
Bernhard Reutner-Fischer e63a0dee9e - revert r16191; re-add resize() applet.
text	   data	    bss	    dec	    hex	filename
    288	      0	      0	    288	    120	console-tools/_resize.o.gcc-2.95
    258	      0	      0	    258	    102	console-tools/_resize.o.gcc-3.3
    252	      0	      0	    252	     fc	console-tools/_resize.o.gcc-3.4
2006-10-25 15:07:56 +00:00
Denis Vlasenko 8077850330 sed: mostly style fixes, very small changes in actual code 2006-10-25 12:46:46 +00:00
Denis Vlasenko d18a3a20db use skip_whitespace where appropriate 2006-10-25 12:46:03 +00:00
Denis Vlasenko c8400a2162 wget: wget $'-\207' ... should not be allowed to work. ever. :)
So fix wget & getopt32. Also fix multiple --header options
order: add and use rev_llist.
2006-10-25 00:33:44 +00:00
Rob Landley 44c7917cab Put up BusyBox 1.2.2 and get out of Denis' way. Also minor tweak to
autodocifier.pl so USAGE_ macros that haven't been converted to USE_ yet 
get correctly stripped out when generating BusyBox.html.
2006-10-24 21:46:19 +00:00
Bernhard Reutner-Fischer d35d540217 - add nmeter and raidautorun to defconfig. 2006-10-24 20:07:29 +00:00
Bernhard Reutner-Fischer a481d87ff7 - we take exactly one argument. 2006-10-24 20:06:55 +00:00
Denis Vlasenko 7534e0834f wget: -100 bytes, reduce stack usage, remove --header length limit 2006-10-23 23:21:58 +00:00
Denis Vlasenko 703aa13ff5 watch: fix warning
getty: fix breakage; fix excessive stack usage
2006-10-23 22:43:02 +00:00
Denis Vlasenko 4e70bf4359 getty: conditionally disable handling of all-caps terminals. 2006-10-23 10:17:34 +00:00
Denis Vlasenko 50e77e1cc1 getty: cleanup part 2 2006-10-23 02:11:22 +00:00
Denis Vlasenko dce3fde414 getty: cleanup part 1 2006-10-23 02:10:45 +00:00
Denis Vlasenko 7c4503d223 __GLIBC__ -> defined(__GLIBC__) 2006-10-23 00:42:24 +00:00
Denis Vlasenko 2295b49169 grep: "grep -h pattern file1 file2" ignored -h
(precluded kernel's "make modules")
2006-10-22 11:42:51 +00:00
Denis Vlasenko 9b44db5d9d cp: update help text 2006-10-22 10:05:01 +00:00
Denis Vlasenko f24e1f40e0 cp: add support for -s, -l. Fix free(nonmalloc) bug.
Add doc on POSIX's rules on -i and -f (insane!).
ln: make "ln dangling_symlink new_link" work.
2006-10-21 23:40:20 +00:00
Denis Vlasenko 8d73c35916 watch: execute command thru shell, not fork/exec. Other fixes 2006-10-20 23:48:30 +00:00
Denis Vlasenko 9bff26cccb chpst: add overlooked copyright statement 2006-10-20 19:40:44 +00:00
Denis Vlasenko c108ed5497 raidautorun: new applet, by:
Thomas Jarosch (email?) and
Bernhard Fischer <rep.nop@aon.at>
2006-10-20 19:39:48 +00:00
Denis Vlasenko 456fa6c0b1 readlink: do not emit errors if file doesnt not exist / not a link
getopt32: add =N support
2006-10-20 18:36:55 +00:00
Denis Vlasenko df51892690 Added compile-time warning for STATIC+GLIBC build 2006-10-20 13:42:57 +00:00
Denis Vlasenko e1a0d486e4 message string changes, mostly for consistency, also -32 bytes in .rodata 2006-10-20 13:28:22 +00:00
Bernhard Reutner-Fischer dd2982882b - remove duplicate flags (-funsigned-char -fno-builtin-strlen) 2006-10-20 12:21:17 +00:00
Denis Vlasenko b79b87a30f build system: (try to) get rid of bb_config.h hack 2006-10-19 22:17:44 +00:00
Denis Vlasenko 9fa9950784 build system: check for ENABLE_, USE_ and SKIP_ (not only for CONFIG_) 2006-10-19 22:14:58 +00:00
Denis Vlasenko b560577cb2 move usage_compressed.h generation into applets/ 2006-10-19 22:12:47 +00:00
Denis Vlasenko 52b5eba715 applets/applets.o must be rebuilt if usage.h is modified. 2006-10-19 22:11:06 +00:00
Denis Vlasenko fdc101782a scripts/usage.c: de-uglify #includes 2006-10-19 22:10:07 +00:00
Eric Andersen 534d88e34e console-tools/resize.c is apparently leftover from a reverted patch.
Since it is a 0 length file, it gets nuked by 'make distclean' so
I suppose might as well kill it off properly.
2006-10-19 22:02:29 +00:00
Denis Vlasenko 13c5a6832f mount: support user mounts if CONFIG_DESKTOP 2006-10-16 22:39:51 +00:00
Denis Vlasenko f46be09106 mdev: reduce excessive indentation 2006-10-16 19:39:37 +00:00
Denis Vlasenko 4e33e07f60 strip -> $(STRIP); fix "unused variable" warning
(patch by Diekema, Jon (AGRE) <Jon.Diekema@smiths-aerospace.com>)
2006-10-16 18:24:57 +00:00
Denis Vlasenko 5f03158f66 ash: fix segfault in ash.
patch by walter harms <wharms@bfs.de>
2006-10-16 01:33:16 +00:00
Denis Vlasenko d0e70af9d1 nc: fix 2 my own buglets, and few someone else's too. 2006-10-16 01:10:28 +00:00
Denis Vlasenko bf39216cc4 grep: -r didn't close files, producing "Too many open files" 2006-10-15 18:38:01 +00:00
Denis Vlasenko c6ec8c9680 telnetd: check ptsname() for NULL 2006-10-15 18:22:05 +00:00
Denis Vlasenko 023b57d935 wget: xatoi's were oversealous ("200 OK" isn't a number) 2006-10-15 17:05:55 +00:00
Denis Vlasenko efeed5ed28 fdisk: compilation fix 2006-10-14 16:16:03 +00:00
Denis Vlasenko 3544ae6004 grep: fix combination of -r and -h 2006-10-14 14:51:59 +00:00
Denis Vlasenko 3a6755f56f grep: add support for -r 2006-10-14 14:24:30 +00:00
Denis Vlasenko c345d8e945 sulogin: add support for $SUSHELL & $sushell 2006-10-14 11:47:02 +00:00
Denis Vlasenko 997aa1179e modprobe: fix for 2.4 kernels - by
Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
2006-10-14 11:12:20 +00:00
Denis Vlasenko ea62077b85 add open_read_close() and similar stuff 2006-10-14 02:23:43 +00:00
Denis Vlasenko 88ca067690 xread/write can use full_read/write (smaller code) 2006-10-12 22:44:13 +00:00
Denis Vlasenko 2d5ca60bfb bb_get_[chomped]line_from_file wasn't descriptive enough.
Renaming...
2006-10-12 22:43:20 +00:00
Denis Vlasenko 372686bde7 cut, mount: small improvements 2006-10-12 22:42:33 +00:00
Denis Vlasenko 9c267b851e style fixes 2006-10-12 20:06:18 +00:00
Denis Vlasenko 98ae2160b6 fdisk: separate sun/aix/etc code into #included files 2006-10-12 19:30:44 +00:00
Denis Vlasenko a6dbb08a48 small style fixes 2006-10-12 19:29:44 +00:00
Denis Vlasenko 12f5676cce execable: no need to check getenv for NULL, it works anyway. 2006-10-12 06:15:13 +00:00
Denis Vlasenko 5cb46485dd execable.c: forgot to do "svn add" again... 2006-10-12 06:12:11 +00:00
Denis Vlasenko f6f43df60b ifupdown: stop emitting annoying/misleading error messages.
Patch by Gabriel Somlo <somlo at cmu.edu>
2006-10-11 22:16:56 +00:00
Denis Vlasenko 8de82bf84f hush.c: stop using __FILE__ (bad in out-of-tree builds) 2006-10-11 21:38:33 +00:00
Denis Vlasenko 665b02cb60 build system: fix build in separate obj tree 2006-10-11 21:24:42 +00:00
Denis Vlasenko 1db39b2f51 nmeter: new applet. ~4k
Fix build proble on x86_64
2006-10-11 20:59:02 +00:00
Denis Vlasenko 1114de7219 od: provide full-blown od from coreutils if CONFIG_DESKTOP 2006-10-10 23:26:05 +00:00
Denis Vlasenko cba9ef5523 fixes from Vladimir Dronnikov <dronnikov@gmail.ru> 2006-10-10 21:00:47 +00:00
Bernhard Reutner-Fischer 1ac42bf66e - add option -t
mkinitrd and mkinitramfs both require -t.
2006-10-10 15:28:41 +00:00
Denis Vlasenko da8f43fd34 build system: fix for non-i386 builds 2006-10-09 19:47:38 +00:00
Denis Vlasenko ca3c981c07 start_stop_daemon: add -N <nice> compat
[re]nice: add support for -nNNN w/o spaces, -NNN (nice only),
          simplified code
2006-10-08 23:36:17 +00:00
Denis Vlasenko 7039a66b58 correct largefile support, add comments about it. 2006-10-08 17:54:47 +00:00
Denis Vlasenko 1385899416 attempt to regularize atoi mess. 2006-10-08 12:49:22 +00:00
Denis Vlasenko 5625415085 dd: make it recognize not only 'k' but 'K' too;
make it (partially) CONFIG_LFS-aware
2006-10-07 16:24:46 +00:00
Denis Vlasenko 890ac9deb2 awk: && -> & in "n->info && OPCLSMASK" - fixes bug 1067 2006-10-07 15:16:19 +00:00
Denis Vlasenko f7a57848c2 eject: remove unmounting. It is buggy for many non-trivial
mounts, and can be done as shell script.
2006-10-07 15:00:29 +00:00
Denis Vlasenko 96e9d3c968 wget: don't be careless with xstrdup'ing 2006-10-07 14:28:55 +00:00
Denis Vlasenko a655152b00 wget: fix download of URLs like:
http://busybox.net?var=a/b
http://busybox.net?login=john@doe
http://busybox.net#test/test
2006-10-07 14:28:28 +00:00
Denis Vlasenko bede7d0ebe build system: do not generate include/linux 2006-10-06 16:14:12 +00:00
Denis Vlasenko 4fa499a17b build system: remove loeftover (two empty dirs) 2006-10-06 13:51:04 +00:00
Denis Vlasenko c12f53090b dnsd fix; option_mask32 added. dnsd needs more love. 2006-10-06 09:49:47 +00:00
Denis Vlasenko 4e6ceb4455 chpst: fix vda's silly mistakes
Patch by Vladimir Dronnikov <dronnikov@gmail.ru>
2006-10-06 08:54:49 +00:00
Denis Vlasenko 000b9ba91f eject: -T fix 2006-10-05 23:12:49 +00:00
Denis Vlasenko de59c0f58f httpd: add -u user[:grp] support 2006-10-05 22:50:22 +00:00
Denis Vlasenko 01c27fc5ac which: -84 bytes 2006-10-05 21:10:53 +00:00
Denis Vlasenko a3310527db make defconfig now works 2006-10-05 18:26:35 +00:00
Denis Vlasenko 8bf7bb8541 yet another fixlet: make clean/distclean/mrproper 2006-10-05 17:42:55 +00:00
Denis Vlasenko 1868409c86 fixing build system overhaul fallout... 2006-10-05 17:11:08 +00:00
Denis Vlasenko 5d2f1736d9 build system: small optimization 2006-10-05 10:26:05 +00:00
Denis Vlasenko 7d219aab70 build system overhaul 2006-10-05 10:17:08 +00:00
Denis Vlasenko 8f8f268cfd bb_applet_name -> applet_name 2006-10-03 21:00:43 +00:00
Denis Vlasenko 67b23e6043 getopt_ulflags -> getopt32.
It is impossible to formulate sane ABI based on
size of ulong because it can be 32-bit or 64-bit.
Basically it means that you cannot portably use
more that 32 option chars in one call anyway...
Make it explicit.
2006-10-03 21:00:06 +00:00
Denis Vlasenko 40920825d5 rename bb_default_error_retval -> xfunc_error_retval 2006-10-03 20:28:06 +00:00
Denis Vlasenko b6332248ca fdformat: remove redundant check 2006-10-03 19:57:50 +00:00
Denis Vlasenko 9275814a9e lots of silly indent fixes 2006-10-03 19:56:34 +00:00
Denis Vlasenko cf94446af7 random style fixes 2006-10-03 19:02:20 +00:00
Denis Vlasenko 6edaddec02 traceroute: fix compilation if netinet/protocols.h is missing 2006-10-03 18:19:02 +00:00
Denis Vlasenko f0a97fb43a Yeah, yeah... I forgot about 'svn add'... fixing that 2006-10-03 17:52:24 +00:00
Denis Vlasenko fe54458e46 runit/chpst: "change process state" utility
It's "nice" on steroids - can set uid/gid, mem/cpu limits etc. +3.5k
2006-10-03 15:57:40 +00:00
Denis Vlasenko 7c1ed2e922 traceroute: do not look up icmp protocol# in /etc, it is well-known :) 2006-10-03 10:47:35 +00:00
Denis Vlasenko 1c3577f91d ifupdown: Debian users contributed improvement to it 2006-10-02 20:57:10 +00:00
Denis Vlasenko 2e864cd219 eject: -T (implements single button open/close) 2006-10-02 20:49:25 +00:00
Denis Vlasenko 546cd1881a mount: accept and ignore -s (sloppy) option.
needed for compatibility with Linux automounter.
2006-10-02 18:52:49 +00:00
Denis Vlasenko e2016e145b sed: -e options were handled in reverse order. fix that. 2006-10-01 21:37:40 +00:00
Denis Vlasenko b97c9842a5 sed: unbreak multiple -e, -f option handling (my fault) 2006-10-01 21:05:12 +00:00
Denis Vlasenko bb119d059a gzip: add a bit of comment. The code itself
is too bloated to work on it...
2006-10-01 16:44:04 +00:00
Denis Vlasenko 97a8dd3857 g[un]zip: add support for -v (verbose).
Add CONFIG_DESKTOP, almost all bloat from this change
is hidden under that.
2006-10-01 15:55:11 +00:00
Denis Vlasenko f8aa109a9f wget: make progress bar and ETA work correctly with -c 2006-10-01 10:58:54 +00:00
Denis Vlasenko aecabffb8b dpkg: fix use-after-free (bug 939) 2006-09-30 21:05:25 +00:00
Denis Vlasenko 55a994055f lsmod: repair indentation
httpd: ifdef CONFIG -> if ENABLE (shorted, catched typos)
2006-09-30 20:41:44 +00:00
Denis Vlasenko 3038ac9c19 vconfig: fix bug 701 (I be damned if I understand it) 2006-09-30 19:37:25 +00:00
Denis Vlasenko 02be0f5350 syslogd: do not retry udp sends (can stall syslogd for extended periods
of time), resolve remote logging host before daemonization
2006-09-30 19:21:24 +00:00
Denis Vlasenko 14c1940255 syslogd: getopt_ulflags'ification (save ~50 bytes) 2006-09-30 19:20:00 +00:00
Denis Vlasenko 1decd0e529 syslogd: add option to suppress logging of messages lower than level N (-n N) 2006-09-30 19:17:40 +00:00
Denis Vlasenko 39d551fd15 fbset: store short string in the structure itself instead of the pointer
(small size saving)
2006-09-30 16:28:30 +00:00
Denis Vlasenko 274b8c0639 fbset: add support for -a (bug 1017) 2006-09-30 16:22:59 +00:00
Denis Vlasenko 7e3eb5171b no-op (just for svn commit run. 2.6.18 oopses on that, need to reproduce) 2006-09-30 08:32:41 +00:00
Denis Vlasenko 7935a5a992 libiproute/ll_map.c: fix bug 279
("On-demand net module loading fails with CONFIG_FEATURE_IFUPDOWN_IP")
2006-09-30 00:18:16 +00:00
Denis Vlasenko 70210168fc wc: optionally support very large files in wc 2006-09-29 23:41:59 +00:00
Denis Vlasenko 3ed001ff26 wc: reduce source cruft, make it so that "wc -c" (one option, no filenames)
will not print leading blanks.
2006-09-29 23:41:04 +00:00
Rob Landley 530c3ef818 Mention the new gpl@busybox.net address. 2006-09-29 22:43:12 +00:00
Denis Vlasenko 0b193a7871 losetup: use /dev/loopN or /dev/loop/N according to CONFIG_FEATURE_DEVFS=n/y 2006-09-29 21:47:11 +00:00
Denis Vlasenko a959588b80 Yet another silly little byte saving. couldn't -> cannot 2006-09-29 21:30:43 +00:00
Denis Vlasenko 6c30db8bd3 grep: add help text; fix style 2006-09-29 21:04:12 +00:00
Denis Vlasenko 51937534fb grep: implement -o option. Patch by Jac Goudsmit. 2006-09-29 20:58:53 +00:00
Denis Vlasenko 266bc17690 top: add support for -b, -n <iterations> 2006-09-29 17:16:39 +00:00
Denis Vlasenko b1726785f9 mount: fix bug 946 (mount -f should update mtab) 2006-09-29 14:43:20 +00:00
Denis Vlasenko f0d6cc8ca9 getopt_ulflags: fix indentation in comment (needs to be 8 _spaces_
in order to look correct to both 4 tab and 8 tab population).
Add comment about :: (which indicates optional argument).
2006-09-29 13:56:58 +00:00
Denis Vlasenko b02ef82c99 getopt_ulflags: formatting fixes 2006-09-29 08:23:42 +00:00
Denis Vlasenko 6248a734e2 xargs: simplify option parsing 2006-09-29 08:20:30 +00:00
Denis Vlasenko 981b24db5e rt_names.c: move few strings into rodata 2006-09-28 22:36:23 +00:00
Denis Vlasenko 5492884311 dpkg: style fixes; short -> int (generated code is smaller) 2006-09-28 22:35:42 +00:00
Denis Vlasenko 57308afb5b dpkg: reduce bss usage by ~130 kbytes (yes, kilobytes!)
at the cost of ~100 bytes of text.
Improves friendliness to nommu systems.
(Dunno whether nommu people ever use dpkg, though...)
2006-09-28 22:34:46 +00:00
Denis Vlasenko 06b543b217 ifupdown: make dhcp start/stop scripts user configurable
in /etc/network/interfaces. Patch author is Gabriel L. Somlo <somlo@cmu.edu>
2006-09-28 22:31:51 +00:00
Denis Vlasenko 524176680d Tried to find sha1_crypt - nope... ok, save few bytes in md5_sha1_sum.c
(time to sleep, 02:28 in the morning)...
2006-09-28 00:29:00 +00:00
Denis Vlasenko de9ec92958 usage.h: fix compile-time bugs exposed by previous change 2006-09-27 23:31:59 +00:00
Denis Vlasenko ce97960a6e usage.h: remove ugly tricks. We have USE_FEATURE_xxx now.
Few bugs are now exposed...
2006-09-27 23:31:08 +00:00
Denis Vlasenko c16bd212e3 silly switch style fix 2006-09-27 19:51:06 +00:00
Denis Vlasenko 94d5d82bd8 crontab: we indent using tabs 2006-09-27 19:48:56 +00:00
Denis Vlasenko 956a569360 losetup: with no arguments lists all /dev/loopN. Corrected help text.
(patch by Vladimir Dronnikov <dronnikov@gmail.ru>)
2006-09-27 14:51:27 +00:00
Denis Vlasenko 0bb628f4f3 kill: implement killall5. OpenWRT folks will be happy.
However their code was unusably different from sysvinit original.
Run tested.
2006-09-27 14:25:33 +00:00
Denis Vlasenko a77947f5bb kill: fix bugs (kill -l output was horrible), fix style, constify data 2006-09-27 14:19:16 +00:00
Denis Vlasenko be905d550c process utilities related style cleanup 2006-09-27 14:17:31 +00:00
Denis Vlasenko 2f4399c6cc ifupdown: fix for standalone shell; removed hardcoded PATH 2006-09-27 14:14:51 +00:00
Denis Vlasenko 0534125ccc ifupdown: style cleanup, no code changes 2006-09-26 20:35:30 +00:00
Denis Vlasenko e175ff252f several fixes from openWRT project 2006-09-26 17:41:00 +00:00
Denis Vlasenko 22f6dcb47c login: fix getopt_ulflags fallout (wasn't taking username supplied by getty) 2006-09-26 16:31:01 +00:00
Denis Vlasenko 8b8c75e6ab httpd: sanitize indentation 2006-09-26 10:07:41 +00:00
Denis Vlasenko a552eeb498 wget: add (configurable) large file support. Run tested. 2006-09-26 09:22:12 +00:00
Eric Andersen 3312c989e6 fix 'grep -C' which requires an argument 2006-09-25 22:18:56 +00:00
Denis Vlasenko d9867320b4 vlock: make message shorter 2006-09-24 02:10:03 +00:00
Denis Vlasenko da3cec9c85 mount: fix breakage from recent changes (spurious -ro mounts) 2006-09-24 01:01:01 +00:00
Rob Landley 29d94b907f Another attempt at untangling the logic so the compiler can follow it and not
generate pointless warnings.
2006-09-23 19:56:21 +00:00
Denis Vlasenko a94554d010 wget: fix bug where wget creates null file if there is no remote one.
add O_LARGEFILE support (not run tested :).
2006-09-23 17:49:09 +00:00
Denis Vlasenko 01a74f9649 applets.c: fix indentation 2006-09-23 16:34:39 +00:00
Denis Vlasenko c290563319 remove unneeded #includes, fix indentation 2006-09-23 16:01:09 +00:00
Denis Vlasenko c1876d7364 inetd: deindent main loop, other readability enhancements 2006-09-23 15:58:01 +00:00
Denis Vlasenko 4c196a80fc hexdump: fixlet for my breakage 2006-09-23 15:53:01 +00:00
Denis Vlasenko ec17d437ab inetd: reformat with tabs for indentation 2006-09-23 15:18:38 +00:00
Denis Vlasenko 2dbeaa95ca hexdump: deindent, almost fits into 80 columns now 2006-09-23 13:31:46 +00:00
Denis Vlasenko a36a676923 correct_password: undo whitespace damage.
vlock + correct_password: fix incorrect line breaks in messages.
2006-09-23 13:11:49 +00:00
Denis Vlasenko 7f1f5b001f ifupdown: getopt_ulflags'ification. 2006-09-23 12:49:01 +00:00
Denis Vlasenko a65a17700a arping: fix bug (getopt_ulflags and optarg don't mix),
remove unreachable error path.
2006-09-23 12:46:30 +00:00
Denis Vlasenko fe76cd5a5c insmod: getopt_ulflags'isation 2006-09-23 12:32:58 +00:00
Denis Vlasenko d78b433414 passwd: getopt_ulflags'isation 2006-09-23 12:30:03 +00:00
Denis Vlasenko 6429aabbf1 bb_askpass: shorten static password buffer. 256 is way too large.
simplify code a bit.
2006-09-23 12:22:11 +00:00
Rob Landley b97f07f5a1 Follow-up to 16172: this also doesn't produce a warning for me on gcc 4.1,
without having to feed the compiler nonsense.
2006-09-22 19:11:59 +00:00
Rob Landley 0372197385 "I'll think about it" != "apply it now". It means I need to think about it. 2006-09-22 18:47:45 +00:00
Denis Vlasenko 754a88f7aa netstat: getopt_ulflags'isation 2006-09-22 16:02:40 +00:00
Denis Vlasenko 01e88f0339 gzip: getopt_ulflags'isation 2006-09-22 15:13:38 +00:00
Denis Vlasenko 27ee7ba95e losetup: getopt_ulflags'ification + small fix for perror_nomsg 2006-09-22 14:53:41 +00:00
Denis Vlasenko 099efbf99e awk: getopt_ulflags'isation 2006-09-22 09:02:30 +00:00
Denis Vlasenko 750fc6d7bb sed: getopt_ulflags'isation 2006-09-22 08:56:03 +00:00
Denis Vlasenko 8514fc5681 hostname: getopt_ulflags'isation 2006-09-22 08:53:14 +00:00
Denis Vlasenko 0e87d347e8 telnetd: getopt_ulflags'isation 2006-09-22 08:50:29 +00:00
Denis Vlasenko 109d21fe74 adjtimex: getopt_ulflags'isation 2006-09-22 08:47:54 +00:00
Denis Vlasenko cb1ba86507 logger: getopt_ulflags'isation 2006-09-22 08:44:58 +00:00
Denis Vlasenko f47ff100cc getopt: fix whitespace damage 2006-09-22 08:42:06 +00:00
Denis Vlasenko cad36681d2 readprofile: getopt_ulflags'isation 2006-09-22 08:39:49 +00:00
Denis Vlasenko 7869c018b5 ipcs: fix my recent breakage 2006-09-22 08:30:52 +00:00
Bernhard Reutner-Fischer ae843e9cc8 - add new applet resize.
text    data     bss     dec     hex filename
    185       0       0     185      b9 console-tools/resize.o
    255       0       0     255      ff console-tools/resize.o.print
2006-09-22 08:18:41 +00:00
Rob Landley e9a7a6212b Change license statements (and clean up headers) on some of the files that
Erik or I are primary copyright holders on.
2006-09-22 02:52:41 +00:00
Bernhard Reutner-Fischer 05592ac00c - update and expand TODO a little bit 2006-09-21 22:58:38 +00:00
Bernhard Reutner-Fischer 3503ff72c6 - pull r15578 from busybox_scratch branch:
- fix bug where it would behave wrong if ./nohup.out was not writable.
  - debloat and make it readable while at it.
$ size coreutils/nohup.o*
   text    data     bss     dec     hex filename
    362       0       0     362     16a coreutils/nohup.o.trunk
    344       0       0     344     158 coreutils/nohup.o
$ make bloatcheck
function                                             old     new   delta
nohup_main                                           324     310     -14
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-14)             Total: -14 bytes
2006-09-21 22:10:24 +00:00
Bernhard Reutner-Fischer 42f67026a1 - silence gcc warning about a funcptr possibly being used uninitialized.
This is a perfect example on where we should NOT care if the functor is not
  initialized since the result will not be what the user may expect.
  Safe bet would be to init to NULL, but let's try normal uu for good measure.
- fix commentary typo while at it.
2006-09-21 20:40:56 +00:00
Denis Vlasenko ce32f65a1b mount: nfs mount should enable bb_error-to-syslog support 2006-09-21 12:30:16 +00:00
Bernhard Reutner-Fischer a528643330 - gcc-2.95 doesn't support -static-libgcc
- remove Winline
2006-09-21 11:54:51 +00:00
Denis Vlasenko 116080a13a mount: make Rob happy by reinstating #defines 2006-09-21 11:13:08 +00:00
Rob Landley fbdf121b7d Teach get_terminal_width_height to fall back to $LINES and $COLUMNS when
used via things like a serial console.
2006-09-20 22:06:01 +00:00
Rob Landley 4ef6f647a3 The version checked into the tree is a snapshot of an unifinished applet, and
you just made lots of ">>>>>>> mine" lines show up in my working copy of this.

Please don't do that again.
2006-09-20 21:57:36 +00:00
Rob Landley eb84a42fdd The Software Freedom Law Center wants us to add a copyright notice to the
generated binaries, to make copyright enforcement easier.  Our liason with
them (Bradley Kuhn) suggested the following text:

> Copyright (C) YEAR-2006  Erik Andersen, Rob Landley, and others.
> Licensed under GPLv2.  See source distribution for full notice.

And the busybox help message seems the least offensive place to put it.  (At
some point in the future, I need to strip 128 bytes from the binary to feel
good about this, though. :)

Minor header file cleanup while I was there, since libbb.h already #includes
most of that stuff...
2006-09-20 21:41:13 +00:00
Rob Landley 94b383d419 License clarification. 2006-09-20 20:01:29 +00:00
Bernhard Reutner-Fischer d1f939eaf3 - fix documentation for the command-line options of ipcs. Closes #1036 2006-09-20 15:56:53 +00:00
Bernhard Reutner-Fischer a6585774f9 - fix embarrassing typo of mine. Closes bug #1038 2006-09-20 15:29:13 +00:00
Denis Vlasenko 3ccc100670 ipcs: fix output (misaligned columns) 2006-09-19 17:43:56 +00:00
Denis Vlasenko c7b9bad519 ipcs: getopt_ulflag'ification, -170 bytes 2006-09-19 17:40:31 +00:00
Denis Vlasenko 79deb66c35 stty: fix few bugs found in testing 2006-09-19 15:12:12 +00:00
Denis Vlasenko 2969c772c2 getty: oops... removing duplicate #include <syslog.h> 2006-09-19 14:47:54 +00:00
Denis Vlasenko debaf2fe02 stty: reorder code, reducing need in forward declarations.
added few missed bits of error checking for parameters.
2006-09-19 14:31:44 +00:00
Denis Vlasenko 20b253d2d8 stty: convert "enum mode_type" into unnamed enum
(reduces code obfuscation); deindent set_mode;
add _or_die suffixes to few functions
2006-09-19 14:24:23 +00:00
Denis Vlasenko 8971cdaeca stty: reduce #ifdef forest 2006-09-19 14:20:22 +00:00
Denis Vlasenko e40c04b826 stty: simplify linewrapping code a bit 2006-09-19 14:19:42 +00:00
Denis Vlasenko 9efb070dcb stty: style fixes 2006-09-19 14:17:10 +00:00
Denis Vlasenko 7eab79acc5 stty: fix a longstanding FIXME (was able to die half-way setting term params) 2006-09-19 14:16:28 +00:00
Denis Vlasenko 85f9e32f7f mount: fstabname needs to be const char* 2006-09-19 14:14:12 +00:00
Denis Vlasenko 23514fe251 mount: fix warning (printf field width of * wants int, not size_t) 2006-09-19 14:07:52 +00:00
Denis Vlasenko f70265290c getty: #include <syslog.h> 2006-09-19 13:50:55 +00:00
Denis Vlasenko 0b5fd45ef7 change char *string = "foo" -> char string[] = "foo"
function                                             old     new   delta
xsetenv                                               45      44      -1
iproute_list_or_flush                               1834    1833      -1
ipaddr_modify                                       1915    1914      -1
ipaddr_list_or_flush                                1861    1860      -1
invarg                                                39      38      -1
do_set                                              1259    1258      -1
bb_verror_msg                                        268     267      -1
create_icmp_socket                                   142     140      -2
create_icmp6_socket                                  142     140      -2
bb_full_fd_action                                    324     322      -2
bb_path_mtab_file                                     10       -     -10
.rodata                                           214796  214720     -76
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/11 up/down: 0/-99)            Total: -99 bytes
2006-09-19 09:55:09 +00:00
Denis Vlasenko 9213a9e0f2 whitespace cleanup 2006-09-17 16:28:10 +00:00
Denis Vlasenko a6127aacef mount: style fixlet 2006-09-17 15:51:52 +00:00
Denis Vlasenko 6231e870ec style fixes 2006-09-17 15:45:48 +00:00
Denis Vlasenko 029c469934 mount: revert mount --bind to using "bind" as fstype. 2006-09-17 15:39:22 +00:00
Denis Vlasenko a52145a927 mount: mount_it_now() - char *dir is not really needed. 2006-09-17 15:09:48 +00:00
Denis Vlasenko c889d2b786 mount: fix "duplicate mount options in mtab" bug 2006-09-17 15:08:12 +00:00
Denis Vlasenko c0975199be mount: nfs_strerror's static buffer was bigger than needed. 2006-09-17 15:06:34 +00:00
Denis Vlasenko 9c99b62b9e mount: getopt_ulflag'ification 2006-09-17 15:05:31 +00:00
Denis Vlasenko 13b4924ce0 mount: style fixes 2006-09-17 15:04:35 +00:00
Denis Vlasenko 3bc59aa2a4 mount: fix bugs: free(mp->mnt_fsname) of non-malloced ptr;
check for "more than 2 arguments" was actually checking for -2.
2006-09-17 15:04:01 +00:00
Denis Vlasenko fc56dd2e21 mount: use bb_simplify_path as appropriate 2006-09-17 15:01:53 +00:00
Denis Vlasenko 8d474b5009 mount: style fixes 2006-09-17 15:00:58 +00:00
Denis Vlasenko 66fabdb631 login: apply fixes + getopt_ulflag'ification by Bernhard 2006-09-17 14:45:09 +00:00
Bernhard Reutner-Fischer 4d0f54af94 - Steven Scholz pointed out that ssd's make-pid doesn't take an argument. 2006-09-15 19:25:18 +00:00
Denis Vlasenko 30a64cdc95 mount: reorder things, fix NFS-less mount. 2006-09-15 15:12:00 +00:00
Rob Landley 215c61d3c2 Unbreak allbareconfig. 2006-09-15 04:10:05 +00:00
Rob Landley f5fc1384e9 So, in the cornucopia of superfulous warning directives I didn't add to the
tree, we have the warning about failed inlines (which with our inline
limit set to zero means any usage of the "inline" keyword at all).  Note
that setting the inline limit to zero, and using -Werror, both predated
adding the warning about inlines to the tree.  So whatever checkin added
that did nothing but break the tree.  But oh well.

The second category of superfluous warnings is warning about functions with
no previous declaration.  Apparently, if you add ALWAYS_INLINE to an empty
function definition, it considers the sucker undeclared as far as the
warning is concerned.  (I.E. it's a buggy warning.  I try not to ask the
compiler to generate warnings it can't competently generate.)

This is why I removed "inline" (unbreak allbareconfig), and couldn't replace it
with "ALWAYS_INLINE" (still broke allbareconfig).
2006-09-15 04:08:25 +00:00
Rob Landley 69115c656d Unbreak allbareconfig.
We've had -Werror in the tree for quite a while, so adding #warning
somewhat counterproductve way to make comments on the code that belong on the
mailing list anyway.
2006-09-15 04:01:03 +00:00
Rob Landley da9d1d079e Strangely, using // in the comments I added was not a persistent accident. 2006-09-14 19:52:07 +00:00
Denis Vlasenko 7ccf5cc064 login: eliminate forward decls and #ifdefs 2006-09-14 17:03:18 +00:00
Denis Vlasenko af9854b81a umount: do not try to close FILE* which is NULL. 2006-09-14 16:40:46 +00:00
Denis Vlasenko be507170eb mount: -o remount should not add lines to /etc/mtab 2006-09-14 16:09:27 +00:00
Denis Vlasenko 25098f7fd5 mount: move code from nfsmount.c into mount.c 2006-09-14 15:46:33 +00:00
Bernhard Reutner-Fischer 6eb2f8edce - make sure that the 'build' dir exists even if we are about to build just one applet. 2006-09-14 15:07:48 +00:00
Bernhard Reutner-Fischer 1d6fb6d448 - do away with silly comment and do the Right Thing wrt building the archives.
You have to provide the absolute path to the objdir/target.ext you want to build, as can be seen in the respective makefiles..
2006-09-14 15:04:31 +00:00
Denis Vlasenko 727ef94447 mount: fix mtab support (but it is still rather buggy) 2006-09-14 13:19:19 +00:00
Rob Landley 85c6de71bf svn 15355 replaced "BusyBox is licensed under the GNU General Public Public
License" with "BusyBox is licensed under the GNU General Public
License version 2 or later... (This is the same license the Linux kernel
is under...)"  Except that the Linux kernel isn't under GPLv2 or later,
it's just under GPLv2.

Now they match again.
2006-09-14 05:59:32 +00:00
Rob Landley cc9962d7fb More code from kernel developers, and therefore licensed under GPLv2 only.
Clarify the license boilerplate.

On an unrelated note, this could use busyboxification.  check_mount() looks
reusable and ask() is generic...
2006-09-14 05:27:28 +00:00
Rob Landley 73810e8d42 Add Larry Doolittle's ntpclient, plus some formatting tweaks. 2006-09-13 19:54:36 +00:00
Bernhard Reutner-Fischer 7fee0c4357 - fix copy'n paste errors that got introduced when switching to the shorter boilerplate.
No object code changes.
2006-09-13 16:39:19 +00:00
Bernhard Reutner-Fischer 92582f2e11 - r16075 broke for de-selected FEATURE_UTMP; Partial fix that wants some more cleanup (see FIXME in the patch). 2006-09-13 15:42:47 +00:00
Rob Landley 577905f1e4 Revert duplicate patch.
I don't know why patch decided to apply this even though it was already in
the tree.  I thought the other hunks failed because they were totally
unrelated leakage from Bernhard's tree (which they are; was the a reason
for bundling them in with this fix?  Do they have something to do with
the GCC 2.95 fix?  I suspect they prevent me from backporting this
patch to 1.2.2 because the header consolidation into libbb.h hadn't
been done yet, and no I'm not fixing it up: if that's the case then
this patch won't be in 1.2.2 due to extraneous changes bundled with it that
prevent a clean backport without rolling a new patch).
2006-09-12 22:42:03 +00:00
Rob Landley 20cc6d567f Remove pointless "const". Bloatcheck says 0 bytes difference. 2006-09-12 21:42:17 +00:00
Rob Landley 1b2b5cfba8 Fix from Bernhard for somebody trying to limp along with gcc 2.95.4. 2006-09-12 20:29:22 +00:00
Rob Landley 16bbb20089 Random cleanup hanging around my tree. 2006-09-12 20:28:34 +00:00
Bernhard Reutner-Fischer b5f50ea344 - small trivia to be gentle to gcc-2.95.x which had no va_copy but only __va_copy. 2006-09-12 13:27:55 +00:00
Bernhard Reutner-Fischer 428a5cd0d3 - fix warning about discarding qualifiers in initialization 2006-09-12 13:25:16 +00:00
Denis Vlasenko 00d7d6cef6 nfsmount: sanitize it. It had a rather peculiar idea of implementing "bg"
option - it was going to return a special flag back to caller and
expecting caller to call it again with special parameter! Also
caller was charged with calling mount() syscall...

mount: mtab support was non-functional. Enabling it revealed serious bug
which is not fixed yet.
2006-09-11 17:42:44 +00:00
Bernhard Reutner-Fischer 64d7e93081 - convert a few xopen3(,,0) into xopen(,). Also peruse the fact that xopen defaults to 0777 on it's own, so we don't need to xopen3(,,0777).
Saves a few bytes:
$ size busybox.old busybox                                text    data     bss     dec     hex filename
 839676    8780  243592 1092048  10a9d0 busybox.old
 839660    8780  243592 1092032  10a9c0 busybox
$ make CC=gcc-4.2-HEAD bloatcheck
function                                             old     new   delta
static.vconfig_main                                  281     279      -2
static.rx_main                                      1076    1074      -2
static.mt_main                                       294     292      -2
static.gzip_main                                     753     751      -2
static.mkfs_minix_main                              4034    4030      -4
static.unzip_main                                   1771    1766      -5
static.crontab_main                                 1513    1507      -6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/7 up/down: 0/-23)             Total: -23 bytes
2006-09-11 16:01:40 +00:00
Bernhard Reutner-Fischer 57b56674a3 - merge xstat.c into xfuncs.c 2006-09-11 09:18:09 +00:00
Bernhard Reutner-Fischer dea6e3d3cf - Tito pointed out that Rob forgot to add e2fsprogs/blkid/list.c 2006-09-11 09:16:12 +00:00
Rob Landley 49ea46667f Build fixes for gcc 4.0 with -Werror, from Tito. 2006-09-11 01:34:21 +00:00
Rob Landley 69674941dd Error reporting fix for sulogin, plus remove help entries for options we never
implemented.  (Plus a bit more of bbsh leaking in from my tree, but it
shouldn't hurt anything and I'm lazy...)
2006-09-11 00:34:01 +00:00
Denis Vlasenko 3077294615 nfsmount: remove some really old code (for kernels 1.x!) + small cleanups. 2006-09-10 18:48:16 +00:00
Denis Vlasenko d2b13eab98 nfsmount: delete nfsmount.h 2006-09-10 18:40:18 +00:00
Denis Vlasenko 39e93cc951 nfsmount: nfsmount.h merged into nfsmount.c 2006-09-10 18:38:17 +00:00
Denis Vlasenko 2244a21a8e nfsmount: style fix 2006-09-10 18:28:23 +00:00
Denis Vlasenko 5983914c1b ipcs: silly trick with strings. saves ~200 bytes. 2006-09-10 18:26:51 +00:00
Rob Landley 1bfca7bac7 Cleanup headers and replace the zero padding with an even smaller version.
One of the pads turned out to be unnecessary: sizeof(struct TarHeader) is
TAR_BLOCK_SIZE, the padding's in the struct.  The others could be done inline
with bb_common_bufsiz1.

This is a cleanup I did to Denis' patch long ago, but got sidetracked by
what turned into svn 15660.
2006-09-10 03:20:37 +00:00
Denis Vlasenko 9852d5a1e6 sulogin: minor cleanup. 2006-09-09 14:00:58 +00:00
Denis Vlasenko 8fafacd7ec setkeycodes: something horrible happened here
to indentation... fixed now
2006-09-09 13:23:04 +00:00
Denis Vlasenko 42dfcd2612 top: fixed wrong comment, made error message more clear 2006-09-09 12:55:02 +00:00
Denis Vlasenko 0c45bb23d2 tar: fix "xopen with O_CREAT" warning, improve zero padding write
(was doing zillions of 1-byte write syscalls)
2006-09-09 12:49:03 +00:00
Denis Vlasenko d5d614c5f4 xopen3(O_RDONLY) -> xopen(O_RDONLY). 2006-09-09 12:25:20 +00:00
Denis Vlasenko 9cac521f07 using [xa]sprintf for string concatenation is neat and saves
~100 bytes according to bloatcheck. Also this fixes bug in rpm
2006-09-09 12:24:19 +00:00
Denis Vlasenko 3526a1320a wget: wrap one atrociously long line (around 200 chars long!). 2006-09-09 12:20:57 +00:00
Denis Vlasenko d797fcd726 udhcp: FEATURE_UDHCP_SYSLOG should be selected only if
udhcp[cd] really are going to use it.
2006-09-09 12:18:46 +00:00
Denis Vlasenko 2f50aa42c5 login: use some ideas from util-linux's login.
O_NONBLOCKing output on login timeout.
fchmod instead of chmod (latter is racy).
is_my_tty() is not needed anymore after race is fixed
(is_my_tty() was racy too anyway...).
2006-09-08 17:56:52 +00:00
Denis Vlasenko bd8f43dbab few random readability enhansements. No code changes 2006-09-08 17:31:55 +00:00
Denis Vlasenko 9a9edf200b login: make it saner and smaller by ~0.5k. 2006-09-08 17:29:53 +00:00
Denis Vlasenko 6bbd174593 login: small fixes like \n removal, bb_error_msg'ification, etc. 2006-09-08 17:26:20 +00:00
Denis Vlasenko 942e4291fe login: previous commit comment was wrong :)
That commit added login script support.
Now _this commit_ is a style fix. Sorry....
2006-09-08 17:25:04 +00:00
Denis Vlasenko 2e502914b0 login: style fixes 2006-09-08 17:22:45 +00:00
Rob Landley dd93abeaff Shrinkage/cleanup from Tito. 2006-09-08 17:22:05 +00:00
Rob Landley ef08184d9e Fix warnings. 2006-09-08 17:21:19 +00:00
Rob Landley 3476ad651d Second drop. More infrastructure in place, especially for parsing pipelines.
The minimal version got a couple hundred bytes bigger, partly because it's
broken into more functions but mostly because it now dynamically reallocates
and frees everything with no hard-coded limits.  (I thought about making
that optional, but there's a limit to what I can debug and maintain.  It
should still be reasonably NOMMU friendly, the allocations are small and
short lived, and shouldn't contribute noticeably to long-term memory
fragmentation.)
2006-09-08 16:59:08 +00:00
Rob Landley c27f4f5445 A quick cleanup pass of some low-hanging mess. 2006-09-08 00:41:48 +00:00
Rob Landley d35c0efddb Bugfix for: echo '123456789' | sed 's/./|&/5' 2006-09-08 00:01:02 +00:00
Denis Vlasenko 239369b368 Fix (hopefully) bug 976. Need more thorough audit.
Restore erroneously removed FEATURE_UDHCP_SYSLOG.
2006-09-07 17:05:44 +00:00
Denis Vlasenko a9801658ee getty, sulogin: convert to using bb_msg for syslog output 2006-09-07 16:20:03 +00:00
Denis Vlasenko b750dec40a fix if (ENABLE_FEATURE_SYSLOG & (...)) - should be && 2006-09-07 16:03:45 +00:00
Denis Vlasenko 049d6b8c08 Add CONFIG_FEATURE_SYSLOG which controls whether
bb_xx_msg will ever try to send output to syslog.
Add "select CONFIG_FEATURE_SYSLOG" to relevant applets.
This allows to omit syslog code if we do not have
any syslog-capable applets in the build.
2006-09-07 06:02:39 +00:00
Denis Vlasenko b7d8dd9ab1 CONFIG_FEATURE_COMPRESS_USAGE was impossible to turn on
if !CONFIG_NITPICK
2006-09-07 05:43:38 +00:00
Denis Vlasenko 3da6aa878a adding files missed in prev updates (forgot about svn add) 2006-09-07 05:09:22 +00:00
Rob Landley f522d1231c Denis Vlasenko has started to put stuff on his BusyBox home page, so index it. 2006-09-06 22:56:38 +00:00
Denis Vlasenko 6d655be5df removed a lot of trailing \n in bb_msg() calls. It is added
automatically by function itself.
2006-09-06 19:02:46 +00:00
Denis Vlasenko 3538b9a882 Implement optional syslog logging using ordinary
bb_xx_msg calls, and convert networking/* to it.
The rest of bbox will be converted gradually.
2006-09-06 18:36:50 +00:00
Bernhard Reutner-Fischer 5d725462d4 - strip 399424 off the bss by making decompress_uncompress buffers config buffers.
Compile tested (too lazy to look for a small .Z on the net).
$ size busybox.old busybox
   text    data     bss     dec     hex filename
 859555   10232  645732 1515519  171fff busybox.old
 859683   10232  246308 1116223  11083f busybox
$ make bloatcheck
function                                             old     new   delta
uncompress                                          1036    1160    +124
inbuf                                               2116       4   -2112
outbuf                                              4100       4   -4096
htab                                              131072       - -131072
codetab                                           262144       - -262144
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 1/2 up/down: 124/-399424)   Total: -399300 bytes
2006-09-06 15:28:32 +00:00
Bernhard Reutner-Fischer e614eaf40d - mdev and grep use xregcomp. Closes bug #1021 2006-09-06 13:24:39 +00:00
Rob Landley 4cb035dd23 Vladimir Dronnikov (ybrnj80 at yandex dot ru) pointed out that my cleanup of
his code introduced a bug (an extra backslash in the CIFS mount string).
2006-09-05 14:00:21 +00:00
Rob Landley 02496aa69e The bb_ prefixes were removed from xasprintf() and xopen() a month ago (in
svn 15767).
2006-09-05 13:48:21 +00:00
Denis Vlasenko 797b4d210d run_shell.c: style fix 2006-09-05 09:45:30 +00:00
Denis Vlasenko d25a2645f5 xfunc: fix: && -> &. Also nuked two double semicolons... 2006-09-05 09:36:19 +00:00
Rob Landley 02add9e53a Might as well commit this to have the history. It's not linked in to the
applet list yet (and won't be until it can replace lash, I'm not having five
shells in menuconfig at once), but you can build it with scripts/individual
and mostly this is checked in so I can bloatcheck future versions against it
easily....

This is about as small as a shell can get and still be a shell.
2006-09-05 03:22:19 +00:00
Rob Landley 4d609cb5a3 Thinko. 2006-09-04 19:43:26 +00:00
Rob Landley 8cedabaee0 Patch from Natanael Copa to make start-stop-daemon just use readlink and
strcmp to check if a program is already running.
2006-09-04 18:59:39 +00:00
Denis Vlasenko adff40e80d sulogin: fix bug: -tNNN didn't work 2006-09-03 17:11:34 +00:00
Denis Vlasenko 1da6a21666 dpkg: fix buffer overflow (bug 983) 2006-09-03 16:33:58 +00:00
Denis Vlasenko 21afc7dc29 uuencode: common implementation for wget and uuencode (closing bug 694) 2006-09-03 15:49:40 +00:00
Denis Vlasenko 22dca23d52 archival: added O_TRUNC so that when we overwrite files on unpack,
we truncate them. Also spotted & fixed hard to trigger bug
          with extension handling.
2006-09-03 14:23:29 +00:00
Denis Vlasenko 314908da9e tar: revert older fix (non-portable), added new one.
testsuite tar-extracts-all-subdirs now passes.
2006-09-03 14:04:33 +00:00
Denis Vlasenko 65113e8d97 zcip: bb_error_msg had stray newlines; small optimization in opt parsing 2006-09-03 12:31:59 +00:00
Denis Vlasenko af906a3b6c zcip: minor fixes 2006-09-03 12:29:53 +00:00
Denis Vlasenko a9abecd85e zcip: fix stdout/err versus syslog output.
Incomplete: xfunc() would not respect this. TODO.
2006-09-03 12:28:32 +00:00
Denis Vlasenko 65dbd8752b zcip: getopt -> bb_getopt_ulflags 2006-09-03 12:27:25 +00:00
Denis Vlasenko 60e3dd6016 zcip: convert lots of zero-initialized locals
in zcip_main() to statics in bss.
2006-09-03 12:26:06 +00:00
Denis Vlasenko 035aae5841 zcip: use xfunc() where appropriate 2006-09-03 12:23:56 +00:00
Denis Vlasenko 27af5a0dd3 replacing func() with xfunc() where appropriate 2006-09-03 12:21:59 +00:00
Denis Vlasenko 87d80dcc3e zcip: apply patch from
http://bugs.busybox.net/view.php?id=1005
      zcip does not claim another IP after defending
2006-09-03 12:20:36 +00:00
Denis Vlasenko 06ab5fb6b9 tar: tar xf foo.tar dir/dir did not extract all subdirs.
Added testsuite entry for this
2006-09-02 18:40:10 +00:00
Denis Vlasenko bcf4908e71 ping: bind -> xbind 2006-09-02 17:53:16 +00:00
Denis Vlasenko e0b7f71d26 ping(6): use htons instead of SWAP_BE. 2006-09-02 16:57:59 +00:00
Denis Vlasenko 2cbe6e6eb2 ping: implement -I option 2006-09-02 16:17:30 +00:00
Denis Vlasenko db7f2e5881 ping6: resolve interface name to number early.
gcc is more efficient at truncating int to int16
via cast, use that instead of &.
2006-09-02 16:16:23 +00:00
Denis Vlasenko cb6874cc66 Sync ping and ping6 a bit, fix style and indentation. 2006-09-02 16:13:36 +00:00
Denis Vlasenko d53dd3e627 Fix endianness issue in ping6 2006-09-02 16:11:44 +00:00
Bernhard Reutner-Fischer bfbc4ebf40 - patch from Csaba Henk to make the "User-Agent" header field configurable. 2006-09-02 15:30:26 +00:00
Rob Landley 686298d6fb Walter Harms contributed a section on scripting languages. (I trimmed it
a bit.)
2006-09-01 17:38:23 +00:00
Rob Landley 89d9d4d5f7 Vladimir Dronnikov also submitted a CIFS support patch to mount, which I
heavily reworked here and probably broke.  Tomorrow I need to set up a
copy of samba to test against.  (This compiles, I make no promises beyond that.)
2006-09-01 08:10:44 +00:00
Rob Landley f5bbc692a0 Bernhard Fischer complained about moving --sort-common. 2006-08-30 16:50:00 +00:00
Rob Landley 1fdd83f897 There's some strange bug in glibc that triggers if you combine the
--gc-sections linker flag with static linking.  If this happens, then
the "stdout" variable (used by printf() and such) will only work if stdout
is _not_ redirected.  I.E "./busybox" prints stuff, but "./busybox | cat"
does not produce any output.  (But even when redirected, "write(1,"blah",4);"
continues to work just fine.)

This is clearly a glibc bug, but to avoid triggering it I've moved the
--gc-sections flag so it only gets added when we're not statically linking.
If somebody would like to go poke Ulrich Drepper, you can trivially reproduce
this with a "hello world" program, ala:

  gcc -static -Wl,--gc-sections hello.c &&  (./a.out | cat)
2006-08-29 21:46:10 +00:00
Bernhard Reutner-Fischer 31e2c00ec3 - set version back to 1.2.0 like it was before. Add at least -svn to the Extraversion to be able to distinguish it from the now old 1.2.0 release 2006-08-29 20:21:33 +00:00
Rob Landley 88621d7398 Svn 16007 broke the build under gcc 4.0.3. This fixes up some of the damage
(the e2fsprogs directory is too twisty and evil to easily fix, but I plan
to rewrite it anyway so I'll just bump that up in priority a bit).
2006-08-29 19:41:06 +00:00
Bernhard Reutner-Fischer 8c1eda528a - it's a mistake to remove lib-specific prefixes from libraries; still the removal should be complete. 2006-08-28 23:39:36 +00:00
Bernhard Reutner-Fischer 73561cc75a - pull from busybox_scratch: r15829:15850
Various fixes, cleanups and shrinkage:
saves 952 Bytes:
   text    data     bss     dec     hex filename
1087742   15853  790632 1894227  1ce753 ../busybox/busybox.old
1086790   15853  790632 1893275  1ce39b busybox
via:
# scripts/bloat-o-meter ../busybox/busybox_unstripped.old busybox_unstripped 
function                                             old     new   delta
ipcrm_main                                           756     822     +66
getval                                                 -      61     +61
maybe_set_utc                                          -      40     +40
udhcpc_main                                         2896    2912     +16
md5_hash_block                                       428     437      +9
opt                                                    8      16      +8
qgravechar                                           106     110      +4
make_bitmap                                          292     295      +3
inflate_unzip                                       2056    2059      +3
add_partition                                       1412    1414      +2
__parsespent                                         156     158      +2
qrealloc                                              41      42      +1
format                                                 -       1      +1
catv_main                                            313     314      +1
watch_main                                           293     292      -1
varunset                                              81      80      -1
part                                                   1       -      -1
check_if_skip                                        837     836      -1
start_stop_daemon_main                               840     837      -3
create_lost_and_found                                175     172      -3
supress_non_delimited_lines                            4       -      -4
static.l                                               4       -      -4
static.c                                               5       1      -4
bsd_sum_file                                         237     233      -4
eval2                                                338     332      -6
arithmetic_common                                    166     158      -8
cmpfunc                                               22       5     -17
cksum_main                                           294     275     -19
cmp_main                                             465     439     -26
dd_main                                             1535    1508     -27
rmmod_main                                           376     333     -43
cut_file                                             727     644     -83
ipcs_main                                           3809    3721     -88
cut_main                                             722     614    -108
date_main                                           1443    1263    -180
remove_ids                                           222       -    -222
------------------------------------------------------------------------------
(add/remove: 3/4 grow/shrink: 11/18 up/down: 217/-853)       Total: -636 bytes
2006-08-28 23:31:54 +00:00
Mike Frysinger 6ce8dae1d5 need libsepol in addtion to libselinux 2006-08-28 23:24:38 +00:00
Bernhard Reutner-Fischer 99b706858b - do maintainers duty by bumping version to 1.3.0-pre0;
pullup r15828 from busybox_scratch
2006-08-28 21:21:25 +00:00
Rob Landley 8479063667 Bugfix from Jason Schoon: send the right signal with -s. 2006-08-28 20:30:27 +00:00
Rob Landley 028ba280be More allbareconfig fixes. 2006-08-28 20:16:42 +00:00
Rob Landley b8cea6dcb3 Jordan Crouse submitted a patch to only include xregcomp.c when we actually
use it, thus fixing building against uClibc with regex support disabled.
2006-08-28 20:04:46 +00:00
Rob Landley abfe107f78 No real need for my_query_module() and this eliminates some type-punned
pointer warning on certain gcc versions (and saves 38 bytes).
2006-08-28 19:40:08 +00:00
Bernhard Reutner-Fischer 82ac9ecfe5 - pgf(?) found and fixed that missing dependency (usage: .config, IIRC), so remove the now unneeded NOTPARALLEL clause 2006-08-28 13:29:41 +00:00
Rob Landley 099ed50f91 Unbreak allbareconfig a bit. (The telnetd.c fix is a perfect example of why
applets which are a forest of #ifdefs are unmaintainable.)
2006-08-28 09:41:49 +00:00
Rob Landley f78ab5396d Antti Seppala (with dots over the last two a's) wants our getty to initialize
the terminal the way mingetty does instead of the way agetty does.  It's
a bit ugly for somebody else to be writing to a console sitting at a
login: prompt, but it's uglier when newline doesn't work as expected if
they do.
2006-08-24 20:00:44 +00:00
Rob Landley 4b5827a69b Patch from Yann Morin so modprobe won't return failure if the module gets
loaded while it's running (ala multi-device hotplug).
2006-08-22 23:50:11 +00:00
Rob Landley ecb29573e9 "Jordan Crouse" <jordan.crouse@amd.com> says:
The following patch makes coreutils/test.c act fail gracefully if getgroups() 
returns a -1.  This fixes a problem on the One Laptop Per Child ROM image
whereby we were getting odd Memory exhausted messages for '[' and 'test'.

Found by Mitch Bradley <wmb@firmworks.com>
(Tweaked by Rob: no need to initialize a static to NULL, or realloc something
that's only allocated when it's NULL.)
2006-08-22 23:40:28 +00:00
Rob Landley 98a915713d Michael Opdenacker spotted that makefile should use () instead of {}. 2006-08-21 17:42:03 +00:00
Rob Landley 1ffe1ede54 Oops, Michael pointed out that my cleanup left some dead code in there. 2006-08-21 16:03:38 +00:00
Rob Landley 43ee36c6da Yann E. Morin spotted a broken check_ld macro. 2006-08-20 23:13:33 +00:00
Rob Landley 0e4690d4ef Michael Opdenacker contributed a readahead applet. 2006-08-20 22:12:18 +00:00
Bernhard Reutner-Fischer 289e86a0a5 - typo s/ENABLE_WGET_LONG_OPTIONS/ENABLE_FEATURE_WGET_LONG_OPTIONS/g 2006-08-20 20:01:24 +00:00
Bernhard Reutner-Fischer d591a360d3 - merge -r15463:15564 from busybox_scratch branch through these changesets:
------------------------------------------------------------------------
r15465 | aldot | 2006-06-21 20:48:06 +0200 (Wed, 21 Jun 2006) | 3 lines

- use CONFIG_BUSYBOX_EXEC_PATH as before it one was broken by a recent revert.
- use xchdir() since all is invain if it fails there anyways, supposedly

------------------------------------------------------------------------
r15466 | aldot | 2006-06-21 20:55:16 +0200 (Wed, 21 Jun 2006) | 2 lines

- adjust docs to take CONFIG_BUSYBOX_EXEC_PATH into account.

------------------------------------------------------------------------
r15467 | aldot | 2006-06-21 21:31:24 +0200 (Wed, 21 Jun 2006) | 18 lines

- partial fallout of my TREE_USED touchup against gcc-4.2: rip unused vars, save
s 144 bytes
   text    data     bss     dec     hex filename
 862434   10156  645924 1518514  172bb2 busybox.old
 862322   10156  645892 1518370  172b22 busybox
function                                             old     new   delta
z_len                                                  4       -      -4
textend                                                4       -      -4
part_nb                                                4       -      -4
insize                                                 4       -      -4
ifile_size                                             4       -      -4
do_link                                                4       -      -4
new_text                                              70      60     -10
ipaddr_list_link                                      33      23     -10
gzip_main                                            898     822     -76
------------------------------------------------------------------------------
(add/remove: 0/6 grow/shrink: 0/3 up/down: 0/-120)           Total: -120 bytes


------------------------------------------------------------------------
r15468 | aldot | 2006-06-21 21:43:05 +0200 (Wed, 21 Jun 2006) | 19 lines

- remove useless global exports
function                                             old     new   delta
rpm_main                                             940    1601    +661
rpm_getstring                                        107     112      +5
rpm_getint                                           148     153      +5
loop_through_files                                   103     106      +3
fileaction_dobackup                                  115     113      -2
fileaction_list                                        5       -      -5
rpm_getcount                                          42       -     -42
extract_cpio_gz                                      161       -    -161
rpm_gettags                                          504       -    -504
------------------------------------------------------------------------------
(add/remove: 0/4 grow/shrink: 4/1 up/down: 674/-714)          Total: -40 bytes

   text    data     bss     dec     hex filename
 862322   10156  645892 1518370  172b22 busybox.old
 862290   10156  645892 1518338  172b02 busybox


------------------------------------------------------------------------
r15555 | aldot | 2006-06-30 14:10:11 +0200 (Fri, 30 Jun 2006) | 22 lines

- shrink syslog a little bit, move a big buffer (for 'line') off the bss, fold s
emaphore stuff into single caller manually.
  stats:
function                                             old     new   delta
logMessage                                           395     427     +32
message                                             1245    1257     +12
opts                                                   -       4      +4
small                                                  1       -      -1
local_logging                                          4       -      -4
doRemoteLog                                            4       -      -4
circular_logging                                       4       -      -4
syslogd_main                                        1299    1285     -14
static.res                                            36      16     -20
.rodata                                           186650  186586     -64
static.line                                         1025       -   -1025
------------------------------------------------------------------------------
(add/remove: 1/5 grow/shrink: 2/3 up/down: 48/-1136)        Total: -1088 bytes
cow@s37:~/src/busybox_scratch$ size sysklogd/syslogd.o{.orig,}
   text    data     bss     dec     hex filename
   3723     348    5242    9313    2461 sysklogd/syslogd.o.orig
   3697     348    4188    8233    2029 sysklogd/syslogd.o

==============================================================================
Overall bloatcheck for the changeset mentioned above:
function                                             old     new   delta
rpm_main                                             953    1608    +655
logMessage                                           395     427     +32
message                                             1245    1257     +12
opts                                                   -       4      +4
rpm_getstring                                        107     110      +3
rpm_getint                                           148     151      +3
loop_through_files                                   103     104      +1
small                                                  1       -      -1
fileaction_dobackup                                  115     113      -2
z_len                                                  4       -      -4
textend                                                4       -      -4
part_nb                                                4       -      -4
local_logging                                          4       -      -4
insize                                                 4       -      -4
ifile_size                                             4       -      -4
do_link                                                4       -      -4
doRemoteLog                                            4       -      -4
circular_logging                                       4       -      -4
fileaction_list                                        5       -      -5
new_text                                              70      60     -10
ipaddr_list_link                                      33      23     -10
clear_bufs                                            31      21     -10
syslogd_main                                        1287    1273     -14
builtin_help                                         190     176     -14
static.res                                            36      16     -20
builtin_source                                       229     199     -30
rpm_getcount                                          42       -     -42
gzip_main                                            842     786     -56
.rodata                                           227176  227112     -64
lash_main                                            609     527     -82
busy_loop                                           3883    3739    -144
extract_cpio_gz                                      155       -    -155
rpm_gettags                                          501       -    -501
static.line                                         1025       -   -1025
------------------------------------------------------------------------------
(add/remove: 1/15 grow/shrink: 6/12 up/down: 710/-2221)     Total: -1511 bytes
2006-08-20 17:35:13 +00:00
Bernhard Reutner-Fischer 13068a4fdb - typo: s/optarg/nprobes_str; fixes segfault as reported by Raphael HUCK 2006-08-18 18:29:40 +00:00
Bernhard Reutner-Fischer 71193a853d - remove CRIS specific CFLAG from generic flags-checking. 2006-08-18 17:44:52 +00:00
Bernhard Reutner-Fischer 5bd2a4b6ce - remove last reminiscents of IN_BUSYBOX 2006-08-18 17:22:23 +00:00
Rob Landley 4470b74e29 The kernel can't handle umount /dev/hdc, we have to do it through mtab,
except that we still have to work when there is no mtab.

Oh, and while we're at it, take advantage of the fact that modern processors
avoid branches via conditional assignment where possible.  ("x = a ? b : c;"
turns into "x = c; if (a) x = b;" because that way there's no branch to
potentially mispredict and thus never a bubble in the pipeline.  The if(a)
turns into an assembly test followed by a conditional assignment (rather
than a conditional jump).)  So since the compiler is going to do that _anyway_,
we might as well take advantage of it to produce a slightly smaller binary.

So there.
2006-08-17 19:07:20 +00:00
Rob Landley eb28ce4644 Timo Scheffler pointed out that OpenWRT isn't listed. 2006-08-17 04:45:24 +00:00
Rob Landley fac4ebea3d Add link to BusyBox Weekly News. (Yeah, another timesink.) 2006-08-16 22:25:43 +00:00
Rob Landley 95718b3091 New entry about backporting fixes. 2006-08-16 22:13:56 +00:00
Rob Landley b90a371a4c Update the tinyutils page to mention microperl, LUA, buildroot,
gentoo embedded...
2006-08-16 21:10:27 +00:00
Rob Landley 4640b05afd Bernhard Fischer pointed out some leftover debris needing cleanup. 2006-08-15 21:37:55 +00:00
Rob Landley a299efb7b0 Make a warning go away when standalone shell is disabled. 2006-08-10 21:46:43 +00:00
Rob Landley 10b36f94bb Patch from Chris Steel to fix mdev deleting device nodes. 2006-08-10 01:09:37 +00:00
Rob Landley b988462d3e Ok, features.h already defines _OPEN_SOURCE (and complains if it's already
defined), yet it's not doing it for scripts/individual for some reason.
(I hate fighting with header files.)
2006-08-10 01:08:41 +00:00
Rob Landley 519d7df930 Another whack at scripts/individual. Now builds 212 applets. 2006-08-09 20:56:23 +00:00
Rob Landley e55a73c7a8 Update usage to talk about the new shared subtree stuff in mount. 2006-08-09 20:55:35 +00:00
Rob Landley 3ba7bd143e Vladimir Dronnikov convinced me to twiddle the semantics of the new shared
subtree stuff to look more like http://lwn.net/Articles/159077/ thinks
they should.
2006-08-09 19:51:13 +00:00
Rob Landley 721b46e0e6 Fix a typo (|| instead of |) and remove two comments about a problem fixed
in the previous patch.
2006-08-08 12:54:02 +00:00
Rob Landley e3781b7312 Add shared subtree support, suggested by Vladimir Dronnikov. Also break out a
few new (unfinished) config options, which I intend to make hidden (but
enabled) when CONFIG_NITPICK is disabled.  Getting the .config infrastructure
to do that is non-obvious, it seems...
2006-08-08 01:39:49 +00:00
Rob Landley 47b16a6fe9 Using lstat() instead of stat() means that attempting to loopback mount
a symlink doesn't work.
2006-08-08 00:47:17 +00:00
Rob Landley 7250915d78 Make a warning go away on 64-bit systems. 2006-08-06 20:41:11 +00:00
Rob Landley 236c6755d2 Teach md5sum and sha1sum to work the way other applets do so I don't have to
teach scripts/individual new tricks.  And while I'm at it, teach
scripts/individual other new tricks.  Now builds 198 applets, some of which
I should teach it to hardlink together because they're really the same app...
2006-08-06 02:13:36 +00:00
Rob Landley affb7a61a6 scripts/individual now builds 171 applets. Some of them may even work. :) 2006-08-05 00:41:39 +00:00
Rob Landley 59fe8b9089 There are a number of reasons for reinventing printf(). Writing status to
stdout is not one of them.
2006-08-04 22:02:55 +00:00
Rob Landley f4e50b0bcd We haven't got a CONFIG_APT_GET. 2006-08-04 21:12:14 +00:00
Rob Landley cb376eebf0 Digging up my old "make standalone" stuff from a year ago:
http://busybox.net/lists/busybox/2005-September/015766.html

I renamed it "individual" to not confuse it with the standalone shell.  (Which
it isn't compatible with for obvious reasons.)  Configure busybox (I did
make defconfig), then run scripts/individual and it'll build an individual
version of each applet in the "build" subdirectory.

Currently it builds 146 and fails to build 104 applets out of "make defconfig".
I haven't taught it about multi-file applets yet (like tar), or the ones where
two applets get built from the same source (for example, zcat is a trivial
variant of gunzip so there is no zcat.c).  But here's a start.
2006-08-04 21:05:33 +00:00
Rob Landley e6a3fef08c Add busybox_old to distclean. 2006-08-04 20:39:56 +00:00
Rob Landley 23b61be0df Add comments to all the functions in this file documenting what they're for. 2006-08-04 20:20:03 +00:00
Rob Landley 74bb70cf54 Ok, that's not a typo, that's just me not thinking. 2006-08-04 20:19:01 +00:00
Rob Landley 3629d95a24 Typo. 2006-08-04 20:15:18 +00:00
Rob Landley 27d07c9ce2 Now that we have xopen3(), it's just plain unclean to have xopen() with
O_CREAT.  Two users are still doing it (and thus getting permissions 777),
I'm not sure what permissions they should be using but here they are
changed to xopen3().  This costs us a dozen or so bytes, but removing the
777 from xopen() should get some of that back.
2006-08-04 19:16:31 +00:00
Rob Landley daf58ef61a Use xopen3() instead of an after-the-fact chown. 2006-08-04 17:26:58 +00:00
Rob Landley 2c55fcac08 Thinko spotted by Vladimir Dronnikov. 2006-08-04 05:24:58 +00:00
Rob Landley 6ced427a6d Try to make a "type-punned pointer" warning go away for somebody on the
buildroot list.
2006-08-03 20:39:59 +00:00
Rob Landley 403777ffae Patch from tito to improve options parsing. 2006-08-03 20:22:37 +00:00
Rob Landley 081e38483e Remove xcalloc() and convert its callers to xzalloc(). About half of them
were using "1" as one of the arguments anyway, and as for the rest a multiply
and a push isn't noticeably bigger than pushing two arguments on the stack.
2006-08-03 20:07:35 +00:00
Rob Landley 86b4d64aa3 These should have been part of 15767 too. 2006-08-03 17:58:17 +00:00
Rob Landley 7478804b78 Fix umount so loop device disassociation hopefully doesn't screw up errno on
a failed mount.  And while I'm at it, legacy mdev removal was only being done
in the _failure_ case?  That can't be right.  Plus minor header cleanups
and an option parsing tweak.
2006-08-03 17:54:45 +00:00
Rob Landley 280a264fb8 Attempt to fixup httpd.c to match svn 15767. 2006-08-03 17:49:15 +00:00
Rob Landley d921b2ecc0 Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only
had one user), clean up lots of #includes...  General cleanup pass.  What I've
been doing for the last couple days.

And it conflicts!  I've removed httpd.c from this checkin due to somebody else
touching that file.  It builds for me.  I have to catch a bus.  (Now you know
why I'm looking forward to Mercurial.)
2006-08-03 15:41:12 +00:00
"Robert P. J. Day" 6dce0b6fa7 Remove apparent typo in "bool" line. 2006-08-03 11:28:36 +00:00
"Robert P. J. Day" 581d4f36b3 Move declaration to be compatible with older gcc's. 2006-08-03 10:50:39 +00:00
Rob Landley cae61e7ca4 Make a gcc 4.1 warning go away. 2006-08-01 00:30:26 +00:00
Rob Landley 2aced7ea04 Announce 1.2.1 2006-07-31 23:56:26 +00:00
Rob Landley 533320c659 1) ifeq is make syntax, #ifeq is a make comment.
2) The check_cc macros should probably all have the same number of arguments.
3) Move the -Werror into the gcc 4.0 on i386 test, because gcc 4.1 is broken
and produces warnings for things that provably aren't incorrect.

In other news it would be nice if our check_ld macro actually did something,
and why does or makefile do all the check_cc calls, then call itself as if
it's building out of tree, then do all the check_cc calls again?
2006-07-31 22:56:17 +00:00
Rob Landley 565bc33332 Remove code that can't be reached. 2006-07-31 22:50:12 +00:00
Rob Landley c052576821 Tito said that strings is a complete rewrite. 2006-07-31 16:37:57 +00:00
Rob Landley 91dc086d63 Switch off CONFIG_NITPICK in defconfig. (Kind of the point of CONFIG_NITPICK.) 2006-07-30 18:56:29 +00:00
Rob Landley 446129adae Add back in non-ifdef version of FEATURE_PRETTY_PRINT, and get the attribution
right this time.
2006-07-27 16:40:55 +00:00
Rob Landley 52c7d7ebf3 And now, with a for loop, so it can handle the nested USE() case. 2006-07-27 15:12:21 +00:00
Rob Landley fc367f9824 There's no excuse for adding new #ifdefs to the code like that. None at all. 2006-07-27 15:02:58 +00:00
Rob Landley 277eb6bb44 I touched perl. I feel dirty.
Make autodocifier suck less.  It still doesn't handle nested USE( USE() ) case
(the inner USE() winds up in the output), but making it recursive involves
getting perl to accept a "for" loop and it's telling me that "break" is an
unrecognized bareword and I hate perl.  This is at least an improvement.
2006-07-27 14:59:36 +00:00
Mike Frysinger eac0c06938 allow people to display dmesg output without syslog levels 2006-07-27 11:18:36 +00:00
Mike Frysinger 0b7dfb5ae7 eat gremlins 2006-07-27 03:42:30 +00:00
Mike Frysinger a7881119cc de-cuddle if( to if ( 2006-07-27 03:00:49 +00:00
Rob Landley 4795e4e011 Rich Filker spotted that sed -e 's/xxx/[/' didn't work right. Did a smaller
fix than his, and shrank the code a bit on top of that so the net size is
smaller, and added a test to the test suite for this case.  Plus I cleaned up
the #includes and removed unnecessary "const"s while I was there.
2006-07-26 17:25:08 +00:00
Rob Landley 7cc6b69bb0 Patch from Shaun Jackman, set optind by hand if we don't call getopt. 2006-07-26 16:10:39 +00:00
Rob Landley e1a0f5372f Unbreak allbareconfig. (Todo item: rewrite dependency checker. Yeah, I
already have that one, but it moves up the list...)
2006-07-26 15:38:46 +00:00
Rob Landley 5ebeb3ec56 Somebody on the buildroot list hit:
insmod.c:515:10: extra tokens at end of #ident directive
2006-07-25 20:37:45 +00:00
Mike Frysinger 91a339002a get rid of udhcp submenu 2006-07-24 07:35:52 +00:00
Mike Frysinger 8840759c61 move lchown/chown define out of specific files and into platform.h where it belongs 2006-07-20 19:31:07 +00:00
"Robert P. J. Day" eea561871b "formated" -> "formatted" throughout the code base. 2006-07-20 19:02:24 +00:00
Rob Landley bf30c69a38 Patch from Yann Morin to fix bug 941, underscores in module aliases. 2006-07-20 17:36:18 +00:00
Rob Landley f86a5ba510 Remove unnecessary consts. 2006-07-19 21:45:30 +00:00
Rob Landley 53702e53ba Replace the previous checkin with the correct fix. 2006-07-19 21:43:53 +00:00
Rob Landley 3b0cfb40a5 Patch from Yann Morin to look for modules.conf in the right place on 2.6.
Fixes http://bugs.busybox.net/view.php?id=942
2006-07-19 21:33:42 +00:00
"Robert P. J. Day" 3e4da920bd For now, get around the error that "child" might be uninitialized. 2006-07-18 12:05:43 +00:00
"Robert P. J. Day" fc2aea1a76 Rearrange order of type qualifiers. 2006-07-18 11:33:44 +00:00
Rob Landley f0623a2c98 Patch from Thaddeus Ternes, adding chuid to start-stop-daemon. 2006-07-17 00:35:07 +00:00
Rob Landley 62103757ef Bugfix from Tito to make sure /etc/group gets updated. 2006-07-16 18:58:18 +00:00
Rob Landley d893b120ba New mkswap. Small and simple. Might even work. :) 2006-07-16 08:17:03 +00:00
Rob Landley 534374755d Cleaup read() and write() variants, plus a couple of new functions like
xlseek and fdlength() for the new mkswap.
2006-07-16 08:14:35 +00:00
Rob Landley afb94ecf2b Convert setuid/setgid users to xsetuid/xsetgid. 2006-07-16 08:06:34 +00:00
Rob Landley 25c194fd19 Add -Werror. 2006-07-16 08:03:29 +00:00
Rob Landley df822f2606 We need xsetuid() and xsetgid() because per-user process resource limits can
prevent a process from switching to a user that has too many processes, and
when that happens WE'RE STILL ROOT.  See http://lwn.net/Articles/190331/
2006-07-15 23:00:46 +00:00
Rob Landley 1870737480 Comment tweak from tito. 2006-07-15 19:46:46 +00:00
Mike Frysinger 83169c607b Tito writes: If the gecos field of an user is empty, obscure reports a false "similar to gecos" error. 2006-07-15 03:59:00 +00:00
Rob Landley 91ed1a4a41 Patch from Suresh Rajashekara moving comments and #includes and such around. 2006-07-14 17:59:36 +00:00
Eric Andersen a4622324dd mention osuosl 2006-07-13 00:52:29 +00:00
Rob Landley 3a9cceb092 Add the two busybox developers' home pages that have busybox related stuff
on them.
2006-07-13 00:10:33 +00:00
Rob Landley 1f9145c5c3 More minor tweaks. 2006-07-12 21:31:16 +00:00
Mike Frysinger 58dda84ecc decuddle () from for/if/while 2006-07-12 20:04:00 +00:00
Rob Landley c9c1a41c58 A couple things that got tangled up in my tree, easier to check in both than
untangle them:

Rewrite u_signal_names() into get_signum() and get_signame(), plus trim the
signal list to that required by posix (they can specify the numbers for
the rest if they really need them).  (This is preparatory cleanup for adding
a timeout applet like Roberto Foglietta wants.)

Export the itoa (added due to Denis Vlasenko, although it's not quite his
preferred implementation) from xfuncs.c so it's actually used, and remove
several other redundant implementations of itoa and utoa() in the tree.
2006-07-12 19:17:55 +00:00
"Robert P. J. Day" 801ab14013 Add one-line GPL boilerplate to numerous (but not all yet) source files. 2006-07-12 07:56:04 +00:00
Rob Landley ab7d9be17c Patch from Tito to remove pwd_to_spwd (which we don't actually need), with
some #ifdef removal from me.
2006-07-11 16:19:17 +00:00
"Robert P. J. Day" 2819f757ca Add one-line GPL boilerplate to these source files. 2006-07-11 11:32:31 +00:00
Rob Landley 22d3958d76 Denis Vlasenko spotted the lack of bounds checking in my first attempt at
itoa/utoa.
2006-07-11 00:44:36 +00:00
Rob Landley 1cca9484db Upgrade netcat a lot. Make -e able to take the rest of the command line as
what to exec.  Add -f mode and a brief explanation of how to use it to replace
minicom.  Add -l -l mode so you can turn any command into a server.  And group
all of netcat's command line options under two CONFIG entries, so if you
disable both it doesn't use getopt at all.
2006-07-10 19:45:20 +00:00
"Robert P. J. Day" 5d8843e451 Replace current verbose GPL stuff in libbb/*.c with one-line GPL boilerplate. 2006-07-10 11:41:19 +00:00
Rob Landley 5b88a38157 Add itoa and utoa to see what Denis Vlasenko thinks. 2006-07-10 07:41:34 +00:00
Rob Landley 3bfcf3cccc Patch from Tito to make syslog configurable and remove #ifdefs. Further
cleanups by me.
2006-07-10 03:05:46 +00:00
Rob Landley cba1b96735 Patch from Shaun Jackman to set environment variable RUNLEVEL equal to
init's argv[1], so if you append "single" to your kernel command line and
the kernel doesn't parse it, RUNLELEL=single.

Plus a few unrelated header cleanups while I was in the area...
2006-07-09 17:28:17 +00:00
Rob Landley acf448d4f6 Bugfix from Shaun Jackman (check that argv[optind] isn't null before
dereferencing it) plus a bunch of tweaks from me.
2006-07-09 17:03:07 +00:00
Rob Landley 1df45cf8e7 Point at fixes.patch for 1.2.1. 2006-07-08 18:11:00 +00:00
Rob Landley ff6e21c2ce Fix tar so it can extract git-generated tarballs, based on a suggestion
from Erik Frederiksen.
2006-07-06 20:30:19 +00:00
Rob Landley 9ebd1bd468 Attempt to address Shaun Jackman's problem adding "busybox: busybox.bflt" to
.config.mak.
2006-07-06 20:02:47 +00:00
Paul Fox e3324502a5 fix dependencies so that compressed usage gets rebuilt if
a) include/usage.h is changed, and 
    b) after "make clean".
2006-07-06 20:00:43 +00:00
Rob Landley 4ae905a31c Minor build tweaks that save 1100 bytes building busybox on Ubuntu 6.06. 2006-07-06 17:22:54 +00:00
Rob Landley aa516a61b9 Fix three embarassing thinkos in the new dmesg.c:
1) the c argument shouldn't have had a : after that, dunno how that got there.
2) the xgetlarg for level was using size
3) because xgetlarg's error message _SUCKS_ (it does a show_usage() rather than giving any specific info about the range that was violated) I dropped the range down to 2 bytes.  (Which works fine, I dunno why we were nit-picking about that...)
2006-07-06 16:41:56 +00:00
Rob Landley f296f0b77d Bug fix from Vladimir Oleynic via Paul Fox for:
echo "+bond0" > /sys/class/net/bonding_masters
while true; do
  echo hello
done
2006-07-06 01:09:21 +00:00
Mike Frysinger 434ccd9739 fixes from ldoolitt@recycle.lbl.gov to use proper tab escaping and fix a typo 2006-07-05 22:19:21 +00:00
"Robert P. J. Day" cf5b80ba32 This file doesn't appear to be used anywhere. 2006-07-05 12:47:26 +00:00
Bernhard Reutner-Fischer 273430aa8d - Pull r15593:
Rename to CROSS_COMPILE and move its configuration to .config.mak. (Shaun Jackman)
2006-07-04 08:26:55 +00:00
"Robert P. J. Day" c773ac8a79 Delete unused version.c file and corresponding function prototypes
from blkid.h.  If this file needs to be resurrected, it can be
based on ext2fs/version.c.
2006-07-03 18:11:39 +00:00
Mike Frysinger 259472e741 remove duplicate CONFIG_TASKSET option 2006-07-03 05:22:36 +00:00
Mike Frysinger 441bfbf143 make the -0 xargs option a little more clear 2006-07-03 05:19:44 +00:00
"Robert P. J. Day" 4eddb42bbc Remove the silly redundancy from that header file include. 2006-07-03 00:46:47 +00:00
"Robert P. J. Day" c9f423a93d Correct the comment to match the code. 2006-07-02 19:52:52 +00:00
"Robert P. J. Day" 63fc1a9e08 Standardize on the vi editing directives being on the first line. 2006-07-02 19:47:05 +00:00
"Robert P. J. Day" 087b9d640e Allow a user-configurable minimum password length. 2006-07-02 18:35:39 +00:00
Bernhard Reutner-Fischer e02706fe45 - note that get_hz potentially needs cleanup. 2006-07-02 10:33:10 +00:00
Rob Landley 7a8e491dff Patch from Shaun Jackman moving the var=value logic to here it can do some good. 2006-07-01 17:19:02 +00:00
"Robert P. J. Day" 7ccb65f3a4 Yet more "#if 0" content removed. 2006-07-01 15:09:17 +00:00
"Robert P. J. Day" d35ef0f666 More removal of "#if 0" content. 2006-07-01 14:59:54 +00:00
"Robert P. J. Day" edd9ca5743 More removal of "#if 0" content. 2006-07-01 14:52:12 +00:00
"Robert P. J. Day" 53f21e34a7 Remove "#if 0" content. 2006-07-01 14:34:33 +00:00
"Robert P. J. Day" 177c9f3128 Get rid of all "#if 0" content. 2006-07-01 14:30:28 +00:00
"Robert P. J. Day" 68229837ff Remove all usage of the "register" storage class specifier. 2006-07-01 13:08:46 +00:00
"Robert P. J. Day" f350160963 Remove "#if 1" directives. 2006-07-01 12:19:39 +00:00
Rob Landley 01772aea33 Annoint 1.2.0. 2006-06-30 22:40:13 +00:00
Rob Landley 12d9419273 Revert taskset for 1.2.0. It emits a warning, breaks building under RH9,
and nobody seemed interested in fixing it despite repeated complaints.
I'll worry about it in the 1.3 timeframe...
2006-06-30 22:20:43 +00:00
Ned Ludd 5df6d9f777 - Give Rob Landley things TODO like depmod 2006-06-30 21:48:38 +00:00
Rob Landley a526c30cc5 Make another warning go away. 2006-06-30 20:30:10 +00:00
Rob Landley ab58d5cf8a Make warnings go away. 2006-06-30 19:04:09 +00:00
Rob Landley 9c0e4f03d9 More random todo items... 2006-06-30 16:38:09 +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 cd545287c5 Fix bug 744 by moving the flushing logic into the exhausted read buffer test.
(Also some other minor cleanups while I was there, shouldn't affect the
resulting binary.)
2006-06-30 16:35:40 +00:00
Rob Landley 00c051e42d Bug http://bugs.busybox.net/view.php?id=723 - initialize tv1 the first time
through the loop.
2006-06-30 14:05:19 +00:00
Mike Frysinger c340ea191a fix from Kolbjørn Barmen for building for m68k targets 2006-06-30 02:53:56 +00:00
Rob Landley 7077ea30f5 Some old kernel headers don't #include BLKSSZGET in sys/mount.h. 2006-06-29 19:00:12 +00:00
Rob Landley c5e4ab7fe6 Minor update on init not working. 2006-06-29 04:59:11 +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 db1ab1aeb3 Top was catching sigterm (and fumbling sigint) so it could reset the terminal
type on the way out, but the signal handler didn't exit.  Plus it did
unnecessary things with sigaction.  This code is overgrown and needs a serious
weed-whacking...
2006-06-28 14:11:25 +00:00
Rob Landley ea7c18514b Fix http://bugs.busybox.net/view.php?id=826 in which "(echo; echo) | sed x"
crashes because the empty state of the hold space is NULL but the empty
state of the pattern space is "".
2006-06-28 13:50:59 +00:00
Mike Frysinger cc826d74e4 cleanup patch usage 2006-06-28 00:22:32 +00:00
Rob Landley 1979d3ccbc More website cleanup. 2006-06-27 22:33:22 +00:00
Rob Landley d879ffb79e Move 2005 and earlier to oldnews. 2006-06-27 21:29:56 +00:00
Rob Landley ed9aec908b Redo the license section completely, and update the header to group the tabs. 2006-06-27 20:47:08 +00:00
Rob Landley cddba6c61f Move documentation links into the index so they're more visible. 2006-06-27 18:59:57 +00:00
Rob Landley af12cb39d1 Patch from Geoff Baker to fix bug http://bugs.busybox.net/view.php?id=905 by
changing wget's ftp code not to chdir but to use the complete path each time.
2006-06-27 18:41:03 +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
"Robert P. J. Day" 21302c2b78 Properly print the output for a sit (IPv6-in-IPv4) interface. 2006-06-26 22:03:43 +00:00
"Robert P. J. Day" 4137dd783b Aesthetic fix to use newer structure initialization format. 2006-06-26 21:54:57 +00:00
Mike Frysinger cd68a2e1a8 fix watchdog on no-mmu systems by adding -F option for rexec 2006-06-26 21:31:17 +00:00
Mike Frysinger 42705abc28 dont setpgrp() for now as it breaks system() and that is more important than ctrl+c handling of background processes 2006-06-26 20:42:36 +00:00
Rob Landley ef10d52745 Upgrade mdev to allow commands to be run on create/delete.
Both Jason Schoon and Giuseppe Ciotta deserve credit for this, I used elements
of both.  It's been upgraded so that you can specify that a given command
should run at create, at delete, or at both using different special characters
(@, $, and * respectively).  It uses the system() method of running command
lines which means you can use environment variables on the command line (it
sets $MDEV to the name of the current device being created/deleted, which is
useful if you matched it via regex), and the documentation warns that you need
a /bin/sh to make that work, so you probably want to pick a default shell.
2006-06-26 14:11:33 +00:00
Rob Landley cf7577d417 Missed one. Based on suggestions from Erik Hovland. 2006-06-25 22:59:31 +00:00
Rob Landley 11c7a7bed6 Various cleanups I made while going through Erik Hovland's patch submissions,
some of which are even from him. :)
2006-06-25 22:39:24 +00:00
Bernhard Reutner-Fischer f087798e8b - convert old-style parameter declarations (K&R) to modern style. 2006-06-25 22:08:53 +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 768945b762 A few patches from Erik Hovland, turning strncpy() into safe_strncpy() and
removing some unnecessary code.
2006-06-25 00:34:52 +00:00
Rob Landley 641c3537c0 Add a test from Glenn. 2006-06-24 22:55:13 +00:00
Rob Landley e1ee482684 Document mount's new error return conventions. 2006-06-24 22:39:19 +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 5d9c42aadc Slowly pulling more common headers into libbb.h. Andre pointed out that
older uClibc didn't include sys/socket.h from netinet/in.h, so add an
explicit #include for that too...
2006-06-24 17:55:02 +00:00
Rob Landley 53433b3ca1 Clean up. 2006-06-22 22:28:29 +00:00
Rob Landley 1fa4a9448b Patch from Shaun Jackman to replace CFLAGS_EXTRA with .config.mak 2006-06-22 22:05:00 +00:00
Rob Landley 67d4943393 CONFIG_DHCP -> CONFIG_APP_DHCP. 2006-06-22 18:48:34 +00:00
Mike Frysinger 135cee3741 Jean Wolter writes: modprobe checks, whether a module is already loaded. The function used for this currently always returns 0. 2006-06-21 23:03:37 +00:00
Bernhard Reutner-Fischer 35492137f8 - add note about strict ordering 2006-06-21 18:19:53 +00:00
Mike Frysinger c2ad4f5d27 Jean Wolter writes: ash uses bsearch to search in the list of built-in commands, therefore the list of built-in commands has to be ordered. Revision 15077 introduced the source built-in and destroyed this order. And now ash doesn't find the shift command anymore. 2006-06-21 18:04:49 +00:00
Rob Landley 0cc2c2c289 Patch from Paul Fox to improve mount's error handling behavior, which I beat
on a bit.
2006-06-21 03:53:33 +00:00
Rob Landley dbfb5a3cb7 Andre (armcc2200@yahoo) patched a bug where successful mounts could sometimes
produce an error, due to a missing rc assignment.
2006-06-21 02:39:57 +00:00
Rob Landley 399d45f1c6 Aurelien Jacobs pointed out inline functions that could be removed. Doing so
shrank the code a bit.
2006-06-21 01:49:17 +00:00
Rob Landley e5e1a10cd3 Remove pointless "inline" wrapper around get_terminal_width_height(). 2006-06-21 01:15:36 +00:00
Rob Landley 2d6af16035 Zubicaray reported a bug in vi that causes it to eat 100% cpu when you close
an xterm it's running in.  The vi signal behavior would catch and restarts lots
of signals, like SIGHUP, that should just kill the thing.  (Leftover behavior
from when it would segfault all the time.)  Filtered out the more obviously
bad ones.  If it segfaults, we should find and fix the problem.
2006-06-21 00:52:31 +00:00
Mike Frysinger b049c0ec19 only enable count_bit functions when actually needed to fix warning reported by Bernhard Fischer 2006-06-20 23:03:27 +00:00
Rob Landley b13fee4cbb Since rangecoder is just a bunch of C functions, move it into the one user
(decompress_unlzma.c).  Also a slight #include cleanup, and I've been meaning
to put #include <unistd.h> into libbb.h since it's so darn common...
2006-06-20 22:38:00 +00:00
Rob Landley 5483de1cb7 Cleanup patch from Shaun Jackman converting %m to perror. 2006-06-20 21:35:26 +00:00
Rob Landley 9fe801e0d2 Patch by Robert P. Day to remove obsolete alias code that the 2.4 and 2.6
Linux kernels don't do anymore.
2006-06-20 21:13:29 +00:00
Mike Frysinger 14ff19b28a assign default debug level to the MSHDEBUG define 2006-06-20 20:37:01 +00:00
Rob Landley 2b8a05a775 I broke allbareconfig with half-finished cleanups I'd forgotten weren't done.
Got both to a decent stopping point.  (There's a lot more cleanup to do on ls.c
but now is not the time...)
2006-06-20 17:43:01 +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 2818b292fb Patch by Robert P. Day to make structs use c99 initializers. 2006-06-20 15:52:52 +00:00
Rob Landley 2a613d7360 Patch from Robert P. J. Day cleaning up some unnecessary preprocessor
directives.
2006-06-20 14:57:00 +00:00
Rob Landley 352e117c6b Amrein-Marie Christophe pointed out that Mandrake changed its name. 2006-06-20 14:09:20 +00:00
Rob Landley 7a260f01ce Make some 64 bit warnings go away on x86-64. 2006-06-19 03:20:03 +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
Rob Landley 14d7065ef1 Make this slightly more readable, and expose the hypocrasy of a comment that
says "our implementation makes it impossible to use blocksizes smaller than
22 octets" right above a check for blocksize < 8.
2006-06-18 15:23:13 +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 fe3d844bb1 Make it so Erik has to forward me less email. 2006-06-16 22:29:03 +00:00
Bernhard Reutner-Fischer fa61ca7591 - add cross-reference generation target.
Experimental.
2006-06-16 17:19:39 +00:00
Bernhard Reutner-Fischer 6d82f94681 - do away with the fwd-decls of functions. Should not contain any code changes
AFAICT.
2006-06-16 16:37:07 +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 1449a2014a This directory was fallout from the great feature freeze of 2003, which led
up to the 1.00 release.  I just moved what was left of it to
http://busybox.net/~landley/pending because it does _not_ belong in the
tree anymore.
2006-06-16 15:08:59 +00:00
Bernhard Reutner-Fischer 747041955e - hide CONFIG_GETOPT_LONG for the 1.2.0 release. Turned on per default.
I will revisit this and make sure that run-parts and ifupdown are fixed; hdparm needs treatment too..
2006-06-16 14:03:23 +00:00
Bernhard Reutner-Fischer f5efa7bfeb - add patch to provide a target 'html' to build a cross-reference of the source 2006-06-16 12:45:29 +00:00
Bernhard Reutner-Fischer fd4b61d5f3 - add needed includes and include busybox.h needed for the ATTRIBUTE define. 2006-06-16 12:28:39 +00:00
Rob Landley bc8c50351f Remove warnings caused by #include <sys/mount.h> in platform.h. Apparently
we redefine a lot of stuff from standard header files...
2006-06-16 04:25:19 +00:00
Rob Landley 9947a244d4 Patch from Rich Felker:
- duplicated format bit 14 forced LIST_EXEC always-on
- -p option was behaving just like -F (SUSv3 says -p only shows / for
  dirs, not other special symbols)
- tests for LIST_EXEC in color functions were nonsense (constant
  tests). i assume they were supposed to be (all_fmt & LIST_EXEC)
  however having coloring of executable files depend on -F seems
  undesirable.
2006-06-15 22:11:10 +00:00
Bernhard Reutner-Fischer 1761b9dabe - use shorter boilerplate, more accurate header guard
- don't use multi-line string literals
2006-06-15 21:56:28 +00:00
Bernhard Reutner-Fischer 7011dd0e06 - drats. 2006-06-15 21:39:34 +00:00
Bernhard Reutner-Fischer 42f091a761 - let the scripts be prerequisites of the files the generate
- make sure that bbconfig isn't too stupid
2006-06-15 21:35:35 +00:00
Rob Landley 39218932b1 Fix bug found by Joey Hess and forwarded by Bastian Bunk. Add Joey Hess's
test case to the testsuite, plus another one that would have been broken by
the first attempt at a fix.
2006-06-15 20:50:38 +00:00
Rob Landley cd82c3c041 Don't do workarounds for broken shells. Busybox is about to grow a shell that
we can run our own testsuite under, and I want it to handle the full range of
strange and peverted behavior you can find in real world shell scripts.
In the meantime, I'll just say #!/bin/bash in places that may care.
2006-06-15 20:07:57 +00:00
Rob Landley 04b7ef967b Jens Michaelsen pointed out that Linksys' firmware download side moved. 2006-06-15 17:34:57 +00:00
Rob Landley 148734df99 We came up with our own names for ATTRIBUTE_*, so why check if they're already
#defined?  Also remove a check for a gcc version older than RH9 (if non-linux
needs that #define they can put it in their section.)
2006-06-15 16:00:42 +00:00
Rob Landley 22d26fc6ae Patch from Yann Morin to put BLKGETSIZE64 in platform.h had rather a lot of
fallout due to the #include <sys/mount.h>.  Removed that #include from various
applets and fixed up those that were unhappy when that #include was made
because they'd block copied stuff out of it.  (Sigh.)
2006-06-15 15:49:36 +00:00
Rob Landley d6e5083d16 Help text update for libbb, talking about make standalone. 2006-06-15 15:04:53 +00:00
Bernhard Reutner-Fischer e2c7d34051 - there is no "CONFIG_STANDALONE" in the repository. Also iff there was a
CONFIG_STANDALONE, we'd need to toggle this on per default.
2006-06-14 17:33:57 +00:00
Bernhard Reutner-Fischer 597e70e9e4 - rename CONFIG_FEATURE_TFTP_DEBUG to CONFIG_DEBUG_TFTP 2006-06-14 17:32:11 +00:00
Bernhard Reutner-Fischer 32bf1f9d42 - rename CONFIG_FEATURE_TFTP_DEBUG to CONFIG_DEBUG_TFTP so it's off in defconfig
- expand the cmd_get/cmd_put macros
- Jason Schoon writes: unlink only if non-stdio
2006-06-14 17:29:10 +00:00
Bernhard Reutner-Fischer f1bd42a305 - correct typo 2006-06-14 16:51:50 +00:00
Bernhard Reutner-Fischer df798b7f58 - minor size tweak
text    data     bss     dec     hex filename
    613       0       0     613     265 loginutils/su.o.orig
    605       0       0     605     25d loginutils/su.o
2006-06-14 16:36:45 +00:00
Bernhard Reutner-Fischer 66e3a222cd - minor shrinkage 2006-06-14 16:17:50 +00:00
Rob Landley d760560c52 Attempt at fixing bug 836, vaguely based on patch from somebody named
clausmuus, forwarded to me by Yann E. Morin.
2006-06-14 01:51:16 +00:00
Rob Landley a34b48abe5 Upgrade the standalone shell code to use CONFIG_BUSYBOX_EXEC_PATH. 2006-06-14 01:27:01 +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 575c8bacda Don't break allbareconfig. 2006-06-13 21:30:09 +00:00
Rob Landley 68286770b6 Patch from Shaun Jackman to detect "name=value" variable assignments. Random
cleanup at the end by me to make some unrelated #ifdefs go away...
2006-06-13 19:01:30 +00:00
Rob Landley f946379599 Make lash smaller. (Use llist_t for file closing, and different allocation
functions.)
2006-06-13 18:50:20 +00:00
Rob Landley 7c7b0d7437 Rewrite of dmesg, smaller and simpler. 2006-06-13 18:31:04 +00:00
Rob Landley 18958e9309 Random cleanup of platform.h. 2006-06-13 18:28:33 +00:00
Rob Landley 0960ca7383 Work around a persistent uClibc bug, since 0.9.29 still hasn't shipped.
Poked to do this by Jason Schoon.
2006-06-13 18:27:16 +00:00
Rob Landley 19a3940f15 Patch from Denis Vlasenko:
* Rename a var: statbytes -> transferred
* cursize == transferred, always. Nuke cursize.
* Make progressmeter() a nop if !CONFIG_FEATURE_WGET_STATUSBAR
  (reduces #ifdef forest)
* double elapsed -> int elapsed
* Do not sprintf to buf first and then write(STDERR) it,
  just fprintf directly to stderr
* Progress bar printing code made smaller
* Style fixes
2006-06-13 17:10:26 +00:00
Rob Landley 76ef08c5e3 Whitespace cleanup from Denis Vlasenko. 2006-06-13 16:44:26 +00:00
Rob Landley 7900b7b9b9 Use -ffunction-sections -fdata-sections --gc-sections if the compiler supports
it.  If nothing else, this gives us better granularity in bloatcheck.
2006-06-13 16:17:16 +00:00
Rob Landley c4b673994e Use xstat() instead of if(stat()) die() 2006-06-13 16:09:16 +00:00
Rob Landley fd8409f8c5 Patch from Denis Vlasenko, tweak error messages. 2006-06-13 15:31:39 +00:00
Rob Landley 9a1a9de49f Minor size shrinkage. 2006-06-13 15:12:14 +00:00
Rob Landley 9a202c9daa Patch from Denis Vlasenko: unlzma was make files with mode 777. Tweak
everything to do stat() and use xopen3().
2006-06-13 14:54:42 +00:00
Rob Landley 1dea55d577 Fix from Paul Fox to make compressed help text notice config changes. 2006-06-13 14:37:14 +00:00
Bernhard Reutner-Fischer 7b8ff22685 - make VERBOSE= and V= work equally; use BUILD_VERBOSE internally.
- move the link flags to cmd_link* so they are printed when requesting verbose output
2006-06-13 14:20:17 +00:00
Bernhard Reutner-Fischer 2f6a317944 - fix stupid typo from last checkin 2006-06-12 14:34:01 +00:00
Bernhard Reutner-Fischer f81ac42689 - remove superfluous CONFIG_BEGIN and CONFIG_END 2006-06-11 18:04:23 +00:00
Bernhard Reutner-Fischer a926f8e50a - add fancy mode to start-stop-daemon to support --oknodo and --verbose 2006-06-11 17:24:01 +00:00
Bernhard Reutner-Fischer 081b1ac6b4 - invert logic for nocheck_targets to exclude the empty default target. 2006-06-11 16:41:10 +00:00
Bernhard Reutner-Fischer e5de38497a - don't check for toolchain-setting for make targets that don't need them
- we already depend on sed, so do away with tr. Avoids pulling in yet another
  dependency.
2006-06-10 14:58:33 +00:00
Bernhard Reutner-Fischer 62f9856f54 - revert incorrect select change 2006-06-10 14:32:56 +00:00
Bernhard Reutner-Fischer b25f98a417 - fix two segfaults (reported by Horst Kronstorfer)
- remove dangling file if get fails (spotted and fixed by Jason Schoon)
- shrink it (Bernhard Fischer)
Thanks, all!
   text	   data	    bss	    dec	    hex	filename
   2684	      0	      0	   2684	    a7c	networking/tftp.o.orig
   2748	      0	      0	   2748	    abc	networking/tftp.o.allfixed
   2666	      0	      0	   2666	    a6a	networking/tftp.o.+shrink
2006-06-10 14:15:03 +00:00
Bernhard Reutner-Fischer 3b1936dcf9 - use bb_xbind
Thanks Erik Hovland
2006-06-10 11:39:09 +00:00
Bernhard Reutner-Fischer 44e216f264 - use bb_xchdir instead of ignoring eventual errors of chdir
Thanks to Erik Hovland
2006-06-10 11:29:44 +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 6ba8bbe88a add ordering warning on enum Location 2006-06-09 12:25:10 +00:00
Bernhard Reutner-Fischer 1e23b6fdb5 - make sure that we see string_insert only if we need it. 2006-06-09 07:12:27 +00:00
Paul Fox 7ba12c6957 remove leading "Enable" from the config option text. not only is it
redundant, but it made the menuconfig shortcut mechanism mostly
useless, since so many of the entries started with 'E'.
2006-06-08 21:48:47 +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
Rob Landley 176f2df69b Patch from Erik Hovland, via Tito. 2006-06-08 14:19:48 +00:00
Rob Landley 9c6f9552ec Some day, maybe gcc will be able to optimize out static functions that are
never used so we don't have to #ifdef them.  Wouldn't that be nice?
2006-06-08 14:11:36 +00:00
Mike Frysinger 2e7dfc179c need prototype for new vfork_daemon() 2006-06-07 21:58:57 +00:00
Mike Frysinger 9be7435203 initial support for no-mmu systems 2006-06-07 21:48:43 +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 2fc534f3f1 hint at where the Magic comes from 2006-06-07 21:37:49 +00:00
Bernhard Reutner-Fischer f915a77386 - do away with the comment that noted that the current implementation
unly supports linux.
2006-06-07 21:26:09 +00:00
Rob Landley 6d8ce170b0 Fix from Tito to read from stdin only when it's not a tty. 2006-06-07 21:22:42 +00:00
Bernhard Reutner-Fischer 5929edc1fa - spelling 2006-06-07 20:30:01 +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
Rob Landley 4c5ad2fc90 Consolidate devfs garbage and mark it as obsolete. 2006-06-07 20:11:53 +00:00
Mike Frysinger 830d258dee use bb_xbind/bb_xlisten 2006-06-07 20:06:24 +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
Mike Frysinger e3fdf2431a add a --noclobber flag 2006-06-07 18:12:27 +00:00
Mike Frysinger 81514ecca3 add support for cleaning out previous busybox install 2006-06-07 18:08:25 +00:00
Mike Frysinger 74b29a107f dont install emtpy libdirs 2006-06-07 17:27:46 +00:00
Mike Frysinger 55b12105b5 dont mix tabs and spaces, kthx 2006-06-07 17:24:29 +00:00
Mike Frysinger bc6584977a remove cvs $Id tag 2006-06-07 16:31:05 +00:00
Bernhard Reutner-Fischer 16d3e4e0af - add applet taskset to set/retrieve the CPU affinity of a process
text    data     bss     dec     hex filename
    584       0       0     584     248 taskset.o.gcc-2.95
    509       0       0     509     1fd taskset.o.gcc-3.3
    505       0       0     505     1f9 taskset.o.gcc-3.4
    506       0       0     506     1fa taskset.o.gcc-4.0
    498       0       0     498     1f2 taskset.o.gcc-4.1
    495       0       0     495     1ef taskset.o.gcc-4.2-HEAD
2006-06-07 15:44:59 +00:00
Mike Frysinger ea93f8a397 Tito writes: this patch fixes two potential bugs with the -i -I flags that could be reset during option parsing 2006-06-07 14:25:22 +00:00
Bernhard Reutner-Fischer e0387a6ee8 - fix the build if we have ftpput without ftpget (speeling reeoe)
Thanks to Stephane Billiart
2006-06-07 13:31:59 +00:00
Rob Landley 0753f4a15e Callers to identify() converted the endianness of the buffer. So did
identify().  This meant big endian systems had a NUXI problem.  Removed
the redundant conversion from the callers, and made some in-passing cleanups
while I was there.
2006-06-07 00:27:25 +00:00
Rob Landley eb29d6ce6a Remove a config entry that leaked in from my tree before I decided to
implement cat -v as a separate applet.
2006-06-06 22:59:37 +00:00
Rob Landley c44ab02f15 Whack the one last warning in make allbareconfig... 2006-06-06 19:50:16 +00:00
Mike Frysinger 280dae74b0 import support for microblaze relocations from uClinux-dist 2006-06-06 06:30:32 +00:00
Mike Frysinger 2a13175440 make the default prompt suck less when using fancy prompts 2006-06-06 06:26:12 +00:00
Mike Frysinger 75c6b7962d fix from uClinux-dist for proper exit status if reading /proc/modules failed 2006-06-06 06:19:19 +00:00
Mike Frysinger b306cb767f merge blackfin/microblaze from uClinux-dist 2006-06-06 06:15:52 +00:00
Mike Frysinger 8e640a1043 use vfork() instead of vork() since the only thing we do is execve() an app after fork (allows time to work on no-mmu) 2006-06-06 06:08:34 +00:00
Mike Frysinger b16b5bb08f only check __GNU_LIBRARY__ if it is actually defined 2006-06-06 06:00:20 +00:00
Rob Landley 362dc2bf33 Header cleanup on two more networking files (move libbb.h to the top and
remove #includes that libbb.h already does), plus a minor cleanup of
libbb.h to move #includes towards the top of the file where we can see 'em.
2006-06-05 17:35:24 +00:00
Rob Landley 12d87550a3 Confirming it's not needed. 2006-06-05 17:32:44 +00:00
Bernhard Reutner-Fischer bc291dc731 - add note about need to unify the 4 itoa() implementations. 2006-06-05 16:00:12 +00:00
Bernhard Reutner-Fischer 1e34731a6a - add testcase for grep bug (http://busybox.net/bugs/view.php?id=887)
The patch for bug #887 seems to work for me..
2006-06-04 18:40:48 +00:00
Bernhard Reutner-Fischer 213cc00445 - add note about ingroup and is_a_group_member 2006-06-04 17:58:19 +00:00
Bernhard Reutner-Fischer 863073da08 - add note about removing superfluous fmt specifiers 2006-06-04 16:05:02 +00:00
Bernhard Reutner-Fischer 395010b1f0 - note to cleanup fprintf(2,...) -> bb_error_msg(...) and
perror("bar") -> bb_perror_msg("bar");
2006-06-04 15:37:59 +00:00
Bernhard Reutner-Fischer 1b9d7c9aa9 - use bb_msg_{read,write}_error where appropriate.
text	   data	    bss	    dec	    hex	filename
 825015	   9100	 645216	1479331	 1692a3	busybox.old
 824919	   9100	 645216	1479235	 169243	busybox
2006-06-03 22:45:37 +00:00
Bernhard Reutner-Fischer a3d4bf38b0 - use bb functions instead of handrolling stuff.
- add XXX question about supposedly superfluous else clause
   text	   data	    bss	    dec	    hex	filename
   5918	      0	      0	   5918	   171e	editors/sed.o.orig
   5901	      0	      0	   5901	   170d	editors/sed.o
2006-06-03 21:40:11 +00:00
Rob Landley e84f4343b2 Remove #ifdeffed out code, both KEEP_UNUSED and #if 0. 2006-06-03 21:23:20 +00:00
Bernhard Reutner-Fischer 5084c78cbe - remove superfluous call of stack_machine(0) upon exit. 2006-06-03 21:19:09 +00:00
Bernhard Reutner-Fischer 5f6d67b7d6 - no need to have timer_duration in the data section.
- cleanup a little bit while at it.
2006-06-03 20:53:18 +00:00
Bernhard Reutner-Fischer b1312c9125 - use bb_msg_write_error in 3 places
- whitespace
2006-06-03 20:09:02 +00:00
Bernhard Reutner-Fischer c89982dcd7 - move #include busybox.h to the very top so we pull in the config
and eventual platform specific includes in early.
2006-06-03 19:49:21 +00:00
Bernhard Reutner-Fischer deda6a5c0d - move #include busybox.h to the very top so we pull in the config
and eventual platform specific includes in early.
- remove two supposedly superfluous newlines from ...error_msg() in modprobe
  and use shorter boilerplate while at it.
2006-06-03 19:35:15 +00:00
Bernhard Reutner-Fischer 2c351a8f98 - patch from Yann E. Morin: makes modprobe understand shell patterns
(especially '*') in module aliases, such as:
  "alias usb:v0582p0075d*dc*dsc*dp*ic*isc*ip* snd_usb_audio"

Fixes bug #889

 842162	  10244	 645924	1498330	 16dcda	busybox.old-4.1.20060603-1948
 842178	  10244	 645924	1498346	 16dcea	busybox.new-4.1.20060603-1948
2006-06-03 19:08:49 +00:00
Bernhard Reutner-Fischer 62558765b9 2006-06-02 Shaun Jackman <sjackman@gmail.com>
* shell/lash.c (pseudo_exec) [_NEWLIB_VERSION]: Remove the
	__getopt_initialized hackery.
2006-06-03 10:28:25 +00:00
Bernhard Reutner-Fischer 5c0ae06ef1 - No options should set the current system time.
Shaun Jackman writes:
A bug introduced in svn 11946 broke rdate. It no longer sets the
current system time when no options are specified. The options have
the opposite sense from what one might think, and, oddly enough, -ps
is intentionally a no-op.

Quoth rdate(8) from the BSD System Manager's Manual:

    -p      Do not set, just print the remote time
    -s      Do not print the time.
2006-06-03 10:24:20 +00:00
Rob Landley 9a990aaba8 Patch from Atsushi Nemoto:
This patch make depmod.pl more robust in cross environment.  If native
nm did not recognize target's object, you can override it with NM
environment variable.
2006-06-02 21:30:40 +00:00
Bernhard Reutner-Fischer e15d7573a1 - move #include busybox.h to the very top so we pull in the config
and eventual platform specific includes in early.
2006-06-02 20:56:16 +00:00
Rob Landley ecae66ac16 Header cleanup: don't #include headers that libbb.h already includes. 2006-06-02 20:53:38 +00:00
Rob Landley ff97ee9abd #ifdef reduction. 2006-06-02 19:03:01 +00:00
Bernhard Reutner-Fischer cf1f2ace39 - fix CONFIG_DEBUG_INIT compile failure 2006-06-02 10:43:17 +00:00
Mike Frysinger 3132e9d830 use xmalloc() 2006-06-02 06:30:30 +00:00
Paul Fox f0327f8e98 fix fdflish typo (reported by erik hovland) 2006-06-02 03:37:16 +00:00
Bernhard Reutner-Fischer b5353a20f3 - look at bb_applet_name. Should close bugs #892 and #893
also restructure code a bit so the fix only adds 1 byte..
2006-06-01 18:30:42 +00:00
Bernhard Reutner-Fischer d04e9b8130 - shrink logread a bit.
text    data     bss     dec     hex filename
    862      26     188    1076     434 logread.o.orig
    825      26     188    1039     40f logread.o
2006-06-01 14:36:14 +00:00
Paul Fox d112f8fa5e make halt and poweroff messages more accurate (i.e., claim "we're about to",
rather than "it's done", and combine with reboot handler to save space.
2006-06-01 13:17:49 +00:00
Rob Landley 8fc32d9326 Shaun Jackman pointed out that KERNEL_VERSION() is used without guards, so
defining it in a guard is silly.
2006-06-01 00:52:30 +00:00
Rob Landley 317a45cb62 The common case APPLET() macro only needs three arguments. 2006-06-01 00:51:38 +00:00
Rob Landley 9b1857f79f Bugfix from Shaun Jackman: don't attempt to write 64 bytes and then fail if
the write wasn't 192 bytes long.
2006-05-31 23:54:50 +00:00
Rob Landley d5b9b60fa5 Add CONFIG_NITPICK. (And tweak a couple other help entries while I'm there.)
Nothing's actually using it yet, but we need it.
2006-05-31 23:23:42 +00:00
Rob Landley 0620841758 Patch from Tito to remove long options from hdparm. 2006-05-31 22:52:57 +00:00
Rob Landley c8b360ebb7 Use BB endianness macro. 2006-05-31 22:24:33 +00:00
Rob Landley b623a542df Header file cleanup. platform.h apparently needs to be included early on so it
can figure out what header files to include, and override stuff that comes
later.  But applets shouldn't include platform.h directly, they should include
busybox.h or libbb.h.  Since busybox.h already includes libbb.h, move libbb.h
to the top of busybox.h and platform.h near the top of libbb.h (right after
bbconfig.h, which is something platform.h also needs access to).

While we're at it, move some stuff from busybox.h to libbb.h so we have one
big file to audit/clean up/try to make sense of instead of many.
2006-05-31 22:09:03 +00:00
Rob Landley 8abbee474c Add catv (separate applet instead of cat -v). Also cleanup cat.c comments,
the following of which (from cat.c) belongs in svn history instead of the
source code:

/* Mar 16, 2003      Manuel Novoa III   (mjn3@codepoet.org)
 *
 * This is a new implementation of 'cat' which aims to be SUSv3 compliant.
 *
 * Changes from the previous implementation include:
 * 1) Multiple '-' args are accepted as required by SUSv3.  The previous
 *    implementation would close stdin and segfault on a subsequent '-'.
 * 2) The '-u' options is required by SUSv3.  Note that the specified
 *    behavior for '-u' is done by default, so all we need do is accept
 *    the option.
 */
2006-05-31 19:36:04 +00:00
Bernhard Reutner-Fischer 9a5686b605 - fix IMA compile error i introduced when adding this untested snippet. 2006-05-31 18:57:56 +00:00
Bernhard Reutner-Fischer dac033e98c ha! a scratch-buffer! ;)
put the isdigit hack into it to help landley out..
2006-05-31 15:36:20 +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 8d3a6f7aaf - add CONFIG_FEATURE_WGET_LONG_OPTIONS 2006-05-31 14:11:38 +00:00
Bernhard Reutner-Fischer f3ac9ebc8e - convert xcalloc(1,x) to xzalloc 2006-05-31 13:31:16 +00:00
Bernhard Reutner-Fischer 595159f38c - shrink klogd a bit
text    data     bss     dec     hex filename
    569       0       0     569     239 sysklogd/klogd.o.orig
    537       0       0     537     219 sysklogd/klogd.o
2006-05-31 12:22:13 +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
Bernhard Reutner-Fischer 507cd755a4 - conditionally define BB_NOMMU 2006-05-31 10:04:03 +00:00
Rob Landley 3252b625b7 Since we have less than 100k of usage.h data anyway, using bzip -9 is silly.
That says use 900k chunks when compressing, which needs about 4 megs of data
structures to undo the Burrows-Wheeler transform.  Switching it down to
bzip -1 (100k chunks) should have no impact on the compression (since it
still all fits in one chunk) but should reduce runtime decompression memory
requirements to something like 500k.  Still larger than gunzip, but not
egregiously so.
2006-05-30 19:19:45 +00:00
Rob Landley b2d42fa6d1 Test to see if I can rename a file without blanking its history... 2006-05-30 18:49:05 +00:00
Rob Landley 4b146e65ad Note about BB_NOMMU. 2006-05-30 18:31:37 +00:00
Bernhard Reutner-Fischer 7ae1553980 - consolidate "Sending SIG%s to all processes"; untested..
text    data     bss     dec     hex filename
   5379      32       8    5419    152b init/init.o.oorig
   5358      32       8    5398    1516 init/init.o
2006-05-30 18:17:21 +00:00
Bernhard Reutner-Fischer a8622e049d - this could use a brother which deals with glibc based systems.. 2006-05-30 15:49:10 +00:00
Bernhard Reutner-Fischer c58dbf28e0 - remove useless variable "status" from init_main.
http://www.opengroup.org/onlinepubs/009695399/functions/waitpid.html suggests
that we need not specify a status if we don't want, and we don't.
"If wait() or waitpid() return because the status of a child process is available, these functions shall return a value equal to the process ID of the child process. In this case, if the value of the argument stat_loc is not a null pointer, information shall be stored in the location pointed to by stat_loc.  "
   text    data     bss     dec     hex filename
   5391      32       8    5431    1537 init/init.o.06
   5379      32       8    5419    152b init/init.o
2006-05-30 12:16:54 +00:00
Bernhard Reutner-Fischer 3ab3080bc2 - use config_buffer for message()
- add second argument to waitfor(*action,pid); if action==NULL then use pid tor
  wait for. If an action was given, we wait for the action to finish just as
  before. In run() remove second and third occurance of the same functionality
  the waitfor() call now provides.
  Adjust the former only caller of waitfor accordingly.

PS: Not using waitfor but creating a second function used a few bytes more than
simply extending and reusing waitfor.
   text    data     bss     dec     hex filename
   5426      32       8    5466    155a init/init.o.orig
   5391      32       8    5431    1537 init/init.o
2006-05-30 12:10:29 +00:00
Rob Landley 752f0a6001 Put parentheses around some of the SWAP() macros, as pointed out by Peter
Kjellerstedt.
2006-05-30 06:28:03 +00:00
Rob Landley f14f7fc5ca Teach bloatometer about .rodata, and tweak the display into something that
has a better chance of getting merged.
2006-05-29 20:56:27 +00:00
Bernhard Reutner-Fischer 077368194c - cleanup conftest temporary files. 2006-05-29 20:01:52 +00:00
Bernhard Reutner-Fischer 35e1a077d6 - DEBUG_INIT -> config CONFIG_DEBUG_INIT 2006-05-29 13:08:35 +00:00
Bernhard Reutner-Fischer 76bb97c995 - landley, remove this? 2006-05-29 13:01:37 +00:00
Bernhard Reutner-Fischer 49e60b9788 - set_term() doesn't need an argument. (Like r15220 this is just compile-tested)
text    data     bss     dec     hex filename
   5432      32       8    5472    1560 init/init.o.r15220
   5426      32       8    5466    155a init/init.o
2006-05-29 12:57:52 +00:00
Bernhard Reutner-Fischer 0da069d382 - move common code into new open_new_terminal() function;
text    data     bss     dec     hex filename
 864434   10244  645892 1520570  1733ba busybox_old
 864386   10244  645892 1520522  17338a busybox_unstripped

add/remove: 1/0 grow/shrink: 0/2 up/down: 92/-143 (-51)
function                                     old     new   delta
open_new_terminal                              -      92     +92
exec_signal                                  345     276     -69
run                                         1527    1453     -74
Again, 48 != 51 so let's trust the former..
2006-05-29 12:54:16 +00:00
Bernhard Reutner-Fischer bbc225e13d - just whitespace 2006-05-29 12:12:45 +00:00
Bernhard Reutner-Fischer d2c306e862 - ls: remove unused variable
- dpkg.c, diff: use xstat
   text    data     bss     dec     hex filename
 848823    9100  645216 1503139  16efa3 busybox_old
 848679    9100  645216 1502995  16ef13 busybox_unstripped
bloatcheck is completely useless as it sees -79 for this, which is bogus.
2006-05-29 12:10:23 +00:00
Rob Landley 1ec5b29054 More size shrinkage. 2006-05-29 07:42:02 +00:00
Rob Landley a6e131dab3 Size reductions, mostly switching things to use libbb functions. 2006-05-29 06:43:55 +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 9755197448 This is not C++. 2006-05-29 05:21:29 +00:00
Rob Landley 0582ee0826 A few new todo items from email with Bernhard. 2006-05-29 05:06:06 +00:00
Rob Landley 15d20a03d6 Remove _() and N_() from platform.h. #define them as NOP macros in the two
files still using them.  I didn't remove them from e2fsck.c to avoid stomping
pending cleanup patches from Garrett, and I didn't bother to remove them from
fdisk.c because that entire file needs to be rewritten from scratch.
2006-05-29 05:00:44 +00:00
Rob Landley 8394729ddf Remove _(). 2006-05-29 04:49:55 +00:00
Rob Landley 4e3aff3425 Remove _(). 2006-05-29 04:37:28 +00:00
Rob Landley 267a0ed9e6 I changed last10 to last25, and just bumped it up to 50 so I renamed it
"recent.html".  There's a symlink from each of the old names for the moment,
I'll zap those eventually...
2006-05-28 02:10:21 +00:00
Rob Landley 81dab2cf83 Fix hdparm to use PRIu64 instead of typecasting to long long (which is 128 bits
on 64 bit platforms), and move #include <inttypes.h> to libbb.h.
2006-05-28 01:56:08 +00:00
Rob Landley 0fbe7ddbdd Put the ending quote on the help entry... 2006-05-28 01:40:26 +00:00
Rob Landley c44bc986b7 Fix some warnings in allbareconfig. 2006-05-28 01:19:06 +00:00
Rob Landley 3f78561d63 My first bout of untangling udhcp. Make lots of gratuitous #defines go
away, substitutie BB_VER for an external VERSION, use busybox CONFIG symbols
rather than checking for them then defining others, etc.  Lots more cleanup
to do...
2006-05-28 01:06:36 +00:00
Rob Landley 8fba99f35e Move portability stuff to platform.h, and clean up adjtimex.c a bit while
I'm in the area.
2006-05-27 22:08:01 +00:00
Rob Landley 299a6b4d7b Consolidate #include <sys/time.h> so libbb.h does it. 2006-05-27 21:42:58 +00:00
Rob Landley d244bc1a57 Update FAQ to mention make baseline when talking about make bloatcheck. 2006-05-27 21:30:34 +00:00
Rob Landley d9872aa0d7 Consolidate the .PHONY targets and add "make baseline" for bloatcheck. 2006-05-27 21:24:16 +00:00
Bernhard Reutner-Fischer 95a040fac8 - use the defines CURRENT_TTY and VC_1; also shrink xargs a tiny bit:
add/remove: 0/0 grow/shrink: 2/6 up/down: 5/-37 (-32)
function                                     old     new   delta
static.add_interface                         271     274      +3
static.glob3                                  36      38      +2
static.renice_main                           409     408      -1
static.readcmd                              1083    1081      -2
static.changepath                            176     174      -2
static.parse_opts                             56      51      -5
static.rx_main                              1095    1088      -7
static.xargs_main                            759     739     -20
----------------------------------------------------------------
Result                                                :-)    -32
2006-05-27 09:36:43 +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 d765ee5d0f - provide fallback defines for non-linux 2006-05-26 20:34:02 +00:00
Bernhard Reutner-Fischer b21d23bd46 - provide fallback defines for non-linux 2006-05-26 20:33:12 +00:00
Bernhard Reutner-Fischer 01d23ade57 - add central knob to turn off getopt_long everywhere. EXPERIMENTAL!
Adds "Enable getopt long" under "General options", default y.
  Send patches to fix getopt_ulflags and run_parts.c if you turn this off..
  See http://busybox.net/lists/busybox/2006-May/021828.html for a start to run-parts
2006-05-26 20:19:22 +00:00
Bernhard Reutner-Fischer d29337580e - use strtol instead of strtoll if the latter does not exist
- add and use wrapper for attribute
- add and use replacement for vasprintf if it is unavailable
2006-05-26 19:58:58 +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 b180e5a766 - use portability wrapper define bb_setpgrp. 2006-05-26 14:24:56 +00:00
Bernhard Reutner-Fischer 08421e1d0c - work around bug in gcc-3.4.x on ARM 2006-05-26 14:05:48 +00:00
Bernhard Reutner-Fischer 8379053b11 - move llist to top of file so we can potentially use it in all prototypes easily 2006-05-26 13:54:07 +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
Bernhard Reutner-Fischer 4ed1f1d99d - add workaround for tar being broken since it uses a non-portable constant. 2006-05-26 13:34:25 +00:00
Bernhard Reutner-Fischer 7fca7e3378 - use the SED given by the user
- use the portable `` instead of $(). There is no bbsh, so this is needed.
2006-05-26 13:28:39 +00:00
Bernhard Reutner-Fischer e28d1d6fdc - add target hosttools (see make help)
- rename check_gcc to check_cc and pass the CC to use as arg#1; peruse check_cc for HOSTCFLAGS
- add and use check_strip
- add checks for {,no-}whole-archive and {start,end}-group LD flags
2006-05-26 13:22:57 +00:00
Bernhard Reutner-Fischer 6d0dbeb550 - use ATTRIBUTE_ALWAYS_INLINE if requested
- use shorter boilerplate while at it
2006-05-26 13:13:11 +00:00
Bernhard Reutner-Fischer e00fc16aaa - move libc checks from busybox.h to platform.h
- add ATTRIBUTE_ALWAYS_INLINE, endian handling for DEC UNIX, some more
  compiler dependent defines to platform.h
- add conditional bb_setpgrp define to platform.h
- remove superfluous specifying args from "#define fdprintf dprintf"
2006-05-26 13:10:10 +00:00
Bernhard Reutner-Fischer 7fd9983c56 - patch from Tito to pretty print the overall delta 2006-05-26 10:29:40 +00:00
Mike Frysinger 314c739b07 Yann E. MORIN. writes:
hdparm has a uint64_t passed to printf with a %llu format (which is ok, because
it's the same size), but without first being casted(?) to unsigned long long int.
Which is kinda funny because it's done OK on a few lines above...
2006-05-26 02:05:19 +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
Mike Frysinger fa6c4844b2 fix spelling mistakes 2006-05-26 01:48:17 +00:00
Mike Frysinger 9c03cb920a check for queueing dependancy dependancies typos 2006-05-26 01:41:04 +00:00
Mike Frysinger 3354487393 queuing is spelled correctly 2006-05-26 01:38:19 +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 69d863b6c6 And fix the error I just introduced. :) 2006-05-25 21:13:30 +00:00
Rob Landley 5a2997de72 Remove pointless #define. 2006-05-25 21:12:40 +00:00
Rob Landley ade7f95bd1 Patch from Tito:
Remove -v verbose -V version -q quiet flags
Remove parse_opt_v2();
Rename parse_opt_v3() to parse_xfermode()
Remove if_strcat()
Rearrange code in  dump_identity() to reduce size
Modify some strings so that they could be optimized by the compiler
Minor code clean up
Remove unneeded #define <shm.h>

#if BB_BIG_ENDIAN && !defined(__USE_XOPEN)
# define __USE_XOPEN
#endif    
Must be before #include <unistd.h> and #include "busybox.h"
(noticed by Bernhard Fischer <rep.nop@aon.at>)

Remove duplicate code in do_time()
2006-05-25 18:53:06 +00:00
Rob Landley 6cd2250953 Remove a pointless #define. 2006-05-25 18:31:11 +00:00
Bernhard Reutner-Fischer 89a22ea5d9 make the testsuite a little less brittle:
- 'function fn_name\n{' breaks on older FreeBSD default shells, so use the more
  widely supported 'fn_name () {'. This needs more fixing..
- test for integers ought to use the proper operators
- test for strings ought to use quoting of the strings to be fair to strange
  implementations of test(1)
- make sure not to ignore return-codes != 0 from commands; Some shells exit
  immediately on this (much like explicitely requesting set -e in e.g. bash)

TODO:
*) Some older shells do not allow a space after the test-condition in an "if"
statement. This doesn't work:
if [ $status -ne 0 ] ; then
as opposed to this:
if [ $status -ne 0 ]; then
or this
if [ $status -ne 0 ]
then

*) strict spacing between commands. In some shells you have to say:
foo ; bar ; baz
The affected shells barf on stuff like ommitting the space, so this doesn't
work:
foo; bar   ;baz

*) $() vs. ``
The former isn't really portable as opposed to the latter.

*) fix frong assumption that the testsuite is run from the source-dir.
This is a complete misconception and renders the testsuite completely useless.


That said, i note that IMO a test-harness ought to do it's best to work in
a wide variety of environments, everything else defeats it's purpose.
2006-05-25 13:24:02 +00:00
Rob Landley 027ea1aeac Two more issues pointed out by Bernhard. 2006-05-24 17:58:00 +00:00
Rob Landley 5fc467e758 Yann Morin spotted some leftover flotsam from halfway through the recent
llist.c interface change that accidentally got checked in.  My bad.
2006-05-24 17:45:47 +00:00
Rob Landley fa6b5e62c2 It takes _talent_ to implement a version of nohup that does everything except
the actual blocking of HUP.
2006-05-23 00:28:06 +00:00
Bernhard Reutner-Fischer a81cec9192 - set x bit 2006-05-21 22:06:59 +00:00
Rob Landley 5cd1ccd995 Convert to a global struct, the way sed was. Now I have two, I can work out
the infrastructure to merge global structs into a union...
2006-05-21 18:33:27 +00:00
Rob Landley 9ffd42317b Minor cleanups: Convert a few calloc() calls to xzalloc, remove unnecessary
memset, collate variable declarations...
2006-05-21 18:30:35 +00:00
Rob Landley c020f5f518 New version of nohup that's much smaller, less paranoid, consistent,
vaguely portable, and licensed GPLv2 "or later".
2006-05-21 18:28:13 +00:00
Bernhard Reutner-Fischer 4148afe049 - fix wrong path to scripts/usage; It is in the builddir and not in the srcdir.
- flag .depend as .NOTPARALLEL to workaround bug in make-3.80 and make-3.81
Some more details on the second workaround (i.e. kludge):
make-3.80 silently fails, while make-3.81 is at least self-conscious enough to
admit:
include/usage_compressed.h: .config scripts/usage
#  Implicit rule search has not been done.
#  File does not exist.
#  File has not been updated.
#  Dependencies commands running (THIS IS A BUG).
#  commands to execute (from `/home/cow/src/bb2/Makefile', line 430):
        $(Q)$(SHELL) $(top_srcdir)/scripts/usage_compressed "$(top_builddir)/scripts" > $@

I'm giving up on trying to run the rest of the prerequisites of .depend in
parallel and just (try to) indicate that the prerequisites of .depend are
not to be run in parallel.

While this makes `make distclean defconfig;make -j´ work for me, it is not a
real -- longterm -- solution; FIXME
2006-05-21 15:05:49 +00:00
Bernhard Reutner-Fischer a1e130f122 - check for existing usage binary, so it get's more obvious that the toplevel
Makefile uses the wrong path to the binary (it's in top_builddir and not in top_srcdir)
2006-05-21 10:45:01 +00:00
Bernhard Reutner-Fischer 3c8c0690fd - there is no _usage.h anymore, so don't rm it in distclean. 2006-05-21 10:04:46 +00:00
Bernhard Reutner-Fischer 30ead9a9b9 - do not create usage_compressed.h if CONFIG_FEATURE_COMPRESS_USAGE is not set 2006-05-21 09:02:12 +00:00
Bernhard Reutner-Fischer 1a5eb46820 - there is no "sh". Use $(SHELL) 2006-05-21 08:25:45 +00:00
Bernhard Reutner-Fischer ef21629a6b - silence warning about no return in function returning non-void
- put CONFIG_DEBUG_CROND_OPTION into config
no changes in size when debugging is disabled.
2006-05-20 14:14:05 +00:00
Rob Landley 9b5a99ad21 Patch from Robert P. Day to remove #ifdefed out SLIP support code that we
have no CONFIG option to enable, and which existing SLIP users don't seem
to miss.
2006-05-19 22:54:42 +00:00
Rob Landley 206f75784b Remove unused function parameter, from Garrett. 2006-05-19 22:42:23 +00:00
Rob Landley 19d42df206 Add diffutils and dhcp to list of packages we provide replacements for. 2006-05-19 22:14:19 +00:00
Bernhard Reutner-Fischer 35017fb4fc - backout erroneously checked in snippet.. 2006-05-19 20:48:22 +00:00
Rob Landley df4cdaf341 First quick stab at organizing TODO under whose TODO item it is. 2006-05-19 20:47:55 +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 d8e87a09d1 - forgot to make busybox_unstripped depend on the applets in IMA mode. 2006-05-19 18:37:34 +00:00
Bernhard Reutner-Fischer c7801c4634 - use shorter boilerplate. 2006-05-19 18:35:03 +00:00
Bernhard Reutner-Fischer 351c832d75 - redirect stdout of scripts/config/conf to /nil for
allyesconfig, allnoconfig, defconfig, allbareconfig
- fix invalid call to "make"; use $(MAKE) instead.
2006-05-19 18:33:34 +00:00
Bernhard Reutner-Fischer a254065e63 - remove SIGIOT as suggested by landley. 2006-05-19 17:54:05 +00:00
Rob Landley 4ae2f511cf Patch from tito to replace shared memory usage with mlock(), slightly tweaked
by me.
2006-05-19 17:24:26 +00:00
Mike Frysinger cf89c37d08 fix indenting in help output for ifconfig 2006-05-19 16:14:31 +00:00
Bernhard Reutner-Fischer 14b1d2930a - typo s/allbaseconfig/allbareconfig/
I thought Robert Day pointed this out, but i cannot find the mail in the archives..
2006-05-19 14:02:51 +00:00
Bernhard Reutner-Fischer 0a8812bdc5 - replace _PATH_DEVNULL with bb_dev_null 2006-05-19 13:12:21 +00:00
Bernhard Reutner-Fischer 14aa06f29c - do not use non-standard u_int.
- do not use _PATH_DEVNULL gnuism but bb_dev_null.
Thanks to Rich Felker.
2006-05-19 13:02:27 +00:00
Bernhard Reutner-Fischer e2922e42a0 - make it C89 compatible; Declarations in the middle of a function is of course
fine in C99, but it really serves no purpose other than breaking compilation
  on C89 compilers.
  Thanks to Rich Felker for pointing this out.
2006-05-19 12:48:56 +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 4009ed91f7 - Rich Felker writes:
SIGIOT is not defined in any standard i can find and it seems to be
useless (alias for SIGABRT) on linux. i put it in #ifdef but it's
probably best just to remove it and cut down the size a bit.
2006-05-19 12:41:13 +00:00
Bernhard Reutner-Fischer d9ed35c8b9 - remove superfluous legacy includes.
This applet should be converted to use llist; __NEED_DLLIST
2006-05-19 12:38:30 +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 a85a63f6ee - fix invalid mode 2006-05-19 12:22:11 +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
Bernhard Reutner-Fischer e3c150bc67 - cleanup memory if opening aliases failed and cleanup was requested. 2006-05-19 11:24:28 +00:00
Rob Landley 42c4259f68 Fluff out info on morris accounts. 2006-05-18 21:53:51 +00:00
Rob Landley 3afb070e6d Avoid a memory leak pointed out by Lucas C. Villa Real. 2006-05-18 20:41:43 +00:00
Rob Landley d2ccc2ba26 Typo fix. 2006-05-17 21:04:53 +00:00
Rob Landley 7723019c6b Patch from Bernhard Fischer to remove some useless bits. 2006-05-17 20:24:53 +00:00
Rob Landley c27c04c16e Announce 1.1.3. 2006-05-17 19:59:24 +00:00
Rob Landley 81369a8b2f Typo that hits big endian systems. 2006-05-17 19:47:58 +00:00
Rob Landley 5371a953ca The gnu extension to have realpath() malloc its buffer when handed a NULL
isn't implemented in uClibc, so we can't use it.
2006-05-17 04:09:14 +00:00
Rob Landley 2686d3bc38 Rob Sullivan cleaned up the longstanding patch from Hideki IWAMOTO to add
ibs and obs support to dd, and made it configurable.  I cleaned it up a bit
further and moved conv= into the same config option.
2006-05-16 16:52:12 +00:00
Rob Landley adde79883f Largeish cleanup patch from Tito, mostly if statement therapy. 2006-05-16 15:32:30 +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
Rob Landley d272dc7cb3 Remove some out of date bits. 2006-05-15 21:02:36 +00:00
Rob Landley 282a26b8ba The one line fix to Bernhard Fischer's "profoundly". 2006-05-15 18:38:11 +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 d9b6b844e5 pull Rules.mak from top_srcdir as pointed out by Robert P. J. Day on the mailing list 2006-05-13 02:33:41 +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
Mike Frysinger 2f4d91da75 fix whitespace 2006-05-13 02:27:52 +00:00
Rob Landley 47b1838957 Patch from Lucas C. Villa Real adding "source" as a synonym for the "." command. 2006-05-12 20:44:16 +00:00
Paul Fox d7384296f6 implement -print0 for find 2006-05-12 14:47:20 +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 525d74badb Busybox is licensed under GPLv2 or later. Shipping another license with the
project would confuse the issue.

Some of these files are available elsewhere under other license terms,
but that's not directly relevant to busybox.
2006-05-11 21:19:22 +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 0690d1591f Tabs weren't lining up in the help text. 2006-05-11 17:33:10 +00:00
Rob Landley ac4c92da3b More about configuring busybox. 2006-05-11 17:21:13 +00:00
Rob Landley 9b70093714 Rename the devfs device names option so it doesn't bite people so often. 2006-05-11 16:39:52 +00:00
Rob Landley 2ad1e7ce44 Patch from Vladamir Oleynik, reducing memory consumption. 2006-05-11 15:23:23 +00:00
Rob Landley 983d751bc0 Remove reference to programming.html, update description of FAQ. 2006-05-11 15:02:32 +00:00
Rob Landley b73d2bf4bf Reorganize FAQ, update a few entries, and consolidate with programming.html. 2006-05-11 15:00:32 +00:00
Mike Frysinger 8d2cb8be3b back out default implicit %.o rule for now 2006-05-11 05:33:31 +00:00
Mike Frysinger d148a94a2a move the dir related rules to the end so the E2FSPROGS_AR rule is the default 2006-05-11 04:39:09 +00:00
Mike Frysinger be7c539b7a dont use tabs people 2006-05-11 04:37:25 +00:00
Mike Frysinger e135a5d746 fix no previous prototype warning 2006-05-11 02:36:51 +00:00
Mike Frysinger b5547fb0b3 fix no previous prototype warning 2006-05-11 02:35:55 +00:00
Mike Frysinger e92923862e typecast bbig to kill format warnings 2006-05-11 02:31:45 +00:00
Mike Frysinger 49f6afc0a0 rename 2006-05-11 02:10:13 +00:00
Mike Frysinger e3412d8331 remove files not related to busybox 2006-05-11 02:09:39 +00:00
Mike Frysinger 6143c0719b add implicit rule for %.a to help debugging in subdirs 2006-05-10 18:12:16 +00:00
Rob Landley 094b9f7e1d Shut up the warning "implicit declaration of strlen". 2006-05-10 17:41:21 +00:00
Mike Frysinger 06b00e8ba7 accept() takes a socklen_t, not an int 2006-05-10 17:18:11 +00:00
Mike Frysinger d2c8fd6360 fix whitespace in comment example 2006-05-10 17:17:09 +00:00
Mike Frysinger 772a3467ba some more useful debug info from Jason Holden 2006-05-10 17:14:32 +00:00
Mike Frysinger 673c9443ba add a default .o rule for easier debug 2006-05-10 17:12:12 +00:00
Bernhard Reutner-Fischer 72c4d64d20 - add helptext for --retries 2006-05-10 16:11:02 +00:00
Mike Frysinger 62ec21d0cf touchup whitespace/english a bit more 2006-05-10 15:59:07 +00:00
Mike Frysinger 731f81cbed whitespace between if and ( 2006-05-10 15:23:12 +00:00
Bernhard Reutner-Fischer eba32f429b - typo in error-message: s/algotithm/algorithm
- whitespace cleanup
2006-05-10 07:59:32 +00:00
Mike Frysinger 59e46117b1 clean more files 2006-05-10 05:19:27 +00:00
Rob Landley f893250a3b Replace isnan() and isinf() with inline tests so uClibc doesn't want us to
link sort against libm.  This adds 22 bytes for glibc but is a win for uClibc,
and since glibc is bigger than all of busybox it seems kind of silly to worry
about it.
2006-05-09 23:14:39 +00:00
Rob Landley c503df5bdd Split CONFIG_DEBUG from CONFIG_DEBUG_PESSIMIZE, and consolidate some Rules.mak
stuff along the way.
2006-05-09 22:08:56 +00:00
Bernhard Reutner-Fischer 2431830018 - fix bug in make help introduced by landley in r15022:
Development:
  bloatcheck             - show size difference between busybox_unstripped
  /bin/sh: -c: line 0: unexpected EOF while looking for matching `''
  /bin/sh: -c: line 1: syntax error: unexpected end of file
  make[1]: *** [help] Error 2
  make: *** [help] Error 2
2006-05-09 11:29:56 +00:00
Rob Landley e3f5a3fd82 Convert sed's static variables to a single global structure. 2006-05-09 03:53:55 +00:00
Rob Landley 0b65628395 Move sed over to the generic llist_t for append. Saves about 90 bytes. 2006-05-08 22:17:23 +00:00
Rob Landley 92d8b35594 Make bloatcheck work when building out of tree. 2006-05-08 20:48:12 +00:00
Bernhard Reutner-Fischer 45d545890f - fix build 2006-05-08 20:20:32 +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 712ba85b30 Tweak suggested by Matt Mackall when I submitted the bloat-o-meter changes
back to linux-kernel...
2006-05-08 18:30:33 +00:00
Rob Landley d61b8d8f9b The changes svn 14960 made to Rules.mak broke building out of tree
(with O=directory), and reverting them fixes building out of tree.  I'd be
happy to fix them up instead of reverting them if I had the foggiest idea
what they were trying to do, but I don't, and this at least gets building
out of tree working again...
2006-05-08 18:18:02 +00:00
Rob Landley 19802563ed The if() is cheaper than the extra function parameter. According to make
bloatcheck, this saves 112 bytes on x86...
2006-05-08 15:35:46 +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
Mike Frysinger 1b4e1dae71 re-enable udhcp in a few more places 2006-05-08 03:24:36 +00:00
Mike Frysinger 7031f62d9b add back in udhcp support 2006-05-08 03:20:50 +00:00
Rob Landley 15fe2e11d7 Shrink the code about 50 bytes, allocate less run-time memory, and add a
comment that null terminating the string we sscanf() shouldn't be required
since the kernel adds \n to the end of it and sscanf will stop there.
2006-05-08 02:53:23 +00:00
Rob Landley 17507fa4c5 More busting on legacy mtab support in the help text. 2006-05-08 02:22:24 +00:00
Rob Landley 20deab0537 Cleanup patch from tito. 2006-05-07 23:34:15 +00:00
Rob Landley 63e4c637cb The udhcp was deleted from busybox in 14634. Bolting an external project to
the side of the tree doesn't _COUNT_, and I will not ship it.

Udhcp was deleted shortly after I posted my philosophy for what should and
shouldn't go into busybox:

http://www.busybox.net/lists/busybox/2006-March/019484.html

I complained about the change t the time.  I've complained repeatedly since.
But nobody felt like fixing it.  External dependencies are something to be
minimized.  I don't care about the ability for packages to build outside
busybox: something is either part of busybox, or it isn't.  If I convert any
part of the external udhcp repository to use libbb, I've broken the external
package.  Any random cleanups that touch that directory suddenly have to worry
about external dependencies that are NOT OUR PROBLEM.  Therefore, that
directory is not and cannot be part of busybox.  Wishful thinking isn't going
to change that.  I will not ship something I can't maintain.

I'll try to get a new dhcp client and server in before the ship window closes,
but I have a half-dozen other projects pending.  I'm sorry this happened, but
I'm not the one who removed it, and I'm not the one who ignored the project
maintainer's repeated complaints about the situation for the next month and a
half.
2006-05-07 23:19:20 +00:00
Rob Landley baa89b398d Patch to fix bug 868, and some related cleanup while I was in the area.
A tab is now taken as the end of filename if it's there, but if it isn't
(because the timestamp isn't there) we continue with the existing untruncated
line as the filename.
2006-05-07 21:10:06 +00:00
Rob Landley a336e7cc25 Script to easily get an assembly dump of a single function. 2006-05-07 20:58:55 +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 f8a8084267 Add "make bloatcheck" to run Matt Mackall's bloat-o-meter. Copy an old
busybox_unstripped to busybox_old, build a new version, and "make bloatcheck"
to see a detailed breakdown of the size difference.
2006-05-07 19:26:53 +00:00
Rob Landley 9fb272a222 Dennis Vlasenko pointed out that run_applet_by_name sets bb_applet_name already. 2006-05-07 01:44:23 +00:00
Mike Frysinger 89ede3f586 fix udhcp again 2006-05-06 05:30:46 +00:00
Mike Frysinger 96087332e7 make sure script is executable 2006-05-06 05:27:19 +00:00
Rob Landley 42bd987e22 Add an "optional" line for FEATURE_READLINK_FOLLOW. 2006-05-05 22:22:30 +00:00
Rob Landley c008c7440d New test from Natanael Copa. 2006-05-05 21:07:41 +00:00
Mike Frysinger 1781188a9d didnt mean to commit debug enable 2006-05-05 20:33:07 +00:00
Mike Frysinger 02d8fa48ad use %p when printing pointers, not %x 2006-05-05 20:32:31 +00:00
Mike Frysinger 4e512f1062 fix Bug 659 as reported by Robin Getz 2006-05-05 18:38:07 +00:00
Rob Landley 3958e0a151 Busybox's udhcp was deleted a while ago. Bolting an external project onto the
tree doesn't change that.
2006-05-05 18:20:42 +00:00
Rob Landley d8f6601502 Another patch from Garrett: remove bad block bitmap checking code. Everything
produced in the list ten years has some variant of internal error correction
(disks, cdrom, flash), so if it has user-visible bad blocks on it the
hardware has exhausted its remapping reserve and is dying, and you need to get
your data off pronto.  (The one exception I can think of is floppies, and I
don't care.)
2006-05-05 17:29:09 +00:00
Rob Landley 2c39eee805 Migrate endianness macros. 2006-05-05 16:54:40 +00:00
Rob Landley 39cf645ce0 Patch from Dennis Vlasenko resetting values that get reused. 2006-05-05 16:52:28 +00:00
Rob Landley 2381f702c9 Patch from Dennis Vlasenko simplifying the APPLET macros. 2006-05-05 15:55:06 +00:00
Rob Landley 49159c7f94 Patch from Jason Schoon to make mount -a not abort on the first failure. 2006-05-05 15:01:38 +00:00
Bernhard Reutner-Fischer 0e413e53e9 - ignore missing helptext for options which are not selectable. 2006-05-05 14:05:21 +00:00
Bernhard Reutner-Fischer 4f7953cc3c - add helptext for CONFIG_UNIX2DOS 2006-05-05 11:55:53 +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 3b89039c25 It was sitting there, in the patches directory, for years. It was delete it
or apply it.  It's small, simple, evil, part of SUSv3, and we can switch it
off.
2006-05-04 20:56:43 +00:00
Rob Landley 846fe0c045 There aren't any bzip2 based RPMs. If people want to experiment with new
packaging formats, there's ipkg and such...
2006-05-04 19:57:34 +00:00
Rob Landley b1c3fbc677 CONFIG->ENABLE migration. 2006-05-04 19:52:28 +00:00
Rob Landley 0c43046fde Fix allbareconfig. 2006-05-04 19:51:22 +00:00
Bernhard Reutner-Fischer 3916b2a560 - add script to check for missing help entries of config options
Currently we have these errors:

./modutils/Config.in: No helptext for 'CONFIG_FEATURE_QUERY_MODULE_INTERFACE'
./networking/Config.in: No helptext for 'CONFIG_IPADDR'
./networking/Config.in: No helptext for 'CONFIG_IPLINK'
./networking/Config.in: No helptext for 'CONFIG_IPROUTE'
./networking/Config.in: No helptext for 'CONFIG_IPTUNNEL'
./coreutils/Config.in: No helptext for 'CONFIG_UNIX2DOS'
2006-05-04 11:38:33 +00:00
Rob Landley 7c94bed234 Big dead code elimination pass from Garrett. 2006-05-03 21:58:45 +00:00
Rob Landley db2ab89b7c Build break fix from Bernhard fischer, fixing fallout from svn 14974. (My bad.) 2006-05-03 21:39:28 +00:00
Rob Landley f76cd964ec Whitespace and documentation cleanup from Dennis Vlasenko. 2006-05-03 21:23:15 +00:00
Rob Landley 425e7584a4 Patch from Rich Felker to make ls use libc's qsort. 2006-05-03 20:22:03 +00:00
Rob Landley 1801e9cde7 Rich Felker writes:
mistake in a macro caused statement before declaration.
2006-05-03 20:19:14 +00:00
Rob Landley 035ef5659e Patch from Garrett Kajmowicz to move a lot of #defines into the
header file.
2006-05-03 20:05:18 +00:00
Rob Landley 2584e9b39f Remove HDIO_GETGEO_BIG which is dead (removed from 2.6) and was pointless back
in 2.4 (it fetched the same hd_geometry struct only with uint cylinders instead
of ushort cylinders: nothing that big has ever accurately reported gemoetry,
it's all LBA.

Also stop declaring the hd_geometry struct static: it's two chars, a short, and
a long for a grand total of 8 bytes.  That can go on the stack.
2006-05-03 20:00:00 +00:00
Rob Landley 0f0b645f73 Use ATTRIBUTE_NORETURN as suggested by tito, plus a few in-passing cleanups. 2006-05-03 18:28:06 +00:00
Rob Landley c5598177bc Patch from Jason Schoon to add optional SIGUSR1 support to dd. 2006-05-02 22:44:04 +00:00
Rob Landley 67d5b8b5b1 Minor tweaks: remove traces of old $COMMAND environment variable. 2006-05-02 21:39:04 +00:00
Rob Landley 2631486f1b Patch from Shaun Jackman:
ls has an ugly bug. ls uses an array of pointers, the elements of
which are all in a linked list. To free the elements, instead of
freeing all the elements in the array, array[0..nelements], it frees
by iterating the linked list starting at array[0], which it assumes is
the head of the list. Unfortunately, ls also sorts the array! So,
array[0] is no longer the head, but somewhere in the middle of the
linked list. This patch fixes this bug, and also adds an
ENABLE_FEATURE_CLEAN_UP stanza.
2006-05-02 19:46:52 +00:00
Rob Landley 6389ff1115 Patch from tito removing obsolete code. 2006-05-01 19:28:53 +00:00
Rob Landley c488f87953 Notes on portability, and on when #include <linux/blah> is appropriate. 2006-05-01 05:26:01 +00:00
Rob Landley 73f54702bc Fixup a build break if ENABLE_SHOW_USAGE switched off. (Fallout from the
compressed usage messages patch).
2006-05-01 00:53:40 +00:00
Rob Landley 3ea66a805d Patches from Denis Vlasenko to rework "current_name" handling and remove
print_current_name().
2006-04-29 20:08:40 +00:00
Rob Landley 8a6254994c Patch from Denis Vlasenko:
* Do not initialize globals to 0, it is done automatically
* unsigned short -> uint16_t,  unsigned int -> uint32_t
  where appropriate (did it ever work on Alphas?)
* triple sync() is silly - removed
* check_zone_nr uses check_zone_nr2 now
* remove trailing periods from messages, uppercase first letter
2006-04-29 20:05:17 +00:00
Rob Landley 9950cab8e0 Patch from Denis Vlasenko:
ix bug (inode_map and zone_map are char* pointers,
sizeof() on them gives 4 or 8)
2006-04-29 20:03:54 +00:00
Rob Landley 5bc3f05a23 Remove some unused code pointed out by Tito, plus a slightly more graceful
way of handling endianness.
2006-04-29 19:11:24 +00:00
Rob Landley a3e4f38f7b Style fixes from Denis Vlasenko. 2006-04-29 16:06:31 +00:00
Rob Landley 5f8b5ecda2 Another patch from Denis Vlasenko:
Make hdparm smaller:
* Make bb_ioctl return the status
* Replace ioctl with bb_ioctl in a few places
* Add bb_ioctl_alt, use where appropriate (four places)
* unsigned char args1[4+512] = {WIN_IDENTIFY,0,0,1,};
  ate 0.5k of rodata, fix that
2006-04-29 16:03:40 +00:00
Rob Landley e5b281f89e From Dennis Vlasenko, Make hdparm smaller:
* Use combined no_scsi_no_xt()
 * Have common unsigned char args[4] = {WIN_SETFEATURES,0,0,0};
2006-04-29 15:49:18 +00:00
Rob Landley 2e2d752d49 Cleanup to hdparm by tito. 2006-04-29 15:23:33 +00:00
Mike Frysinger 2514042661 termios.h is already included so dont include sys/termios.h as well 2006-04-29 04:45:22 +00:00
Mike Frysinger 02fe81033f detect more obsolete headers 2006-04-29 04:44:08 +00:00
Mike Frysinger 59c6baedf7 just include fcntl.h not sys/fcntl.h 2006-04-29 04:43:50 +00:00
Mike Frysinger 706f8f6de5 just include fcntl.h not sys/fcntl.h 2006-04-29 04:43:31 +00:00
Mike Frysinger f054be12de Rob Sullivan writes: rewrite the regex handling to improve stability 2006-04-29 04:21:10 +00:00
Mike Frysinger 12ef09b818 compile.h is incorrect; create a new do_link.h and use that for bb_mkdep and usage 2006-04-29 04:19:10 +00:00
Mike Frysinger fe6bb3853c use pretty output for scripts/bb_mkdep and scripts/usage 2006-04-29 04:12:36 +00:00
Bernhard Reutner-Fischer 3737c03630 - rerun gcse pass after reload, enable whole-program iff we are not building
the lib (due to bug in gcc; see comment.)
I would have run the testsuite to check if everything is still behaving, but
unfortunately i cannot run the testsuite anymore: it just sits there and does
nothing even with a pristine checkout and an old gcc.
srcdir=/tmp/busybox/testsuite /tmp/busybox/testsuite/runtest 
PASS: Applet order
FAIL: Common typos
PASS: Obsolete function usage
PASS: Obsolete function usage
<spins, ^C>
make[1]: *** [check] Interrupt
make: *** [check] Interrupt

I've just corrected that wrong double-printing.

Anyway. with gcc-4.1-HEAD from earlier today, we now have for
defconfig+ COMPILE_AT_ONCE:


880 -rwxr-xr-x  1 433 433 893476 Apr 28 21:41 busybox.oorig-4.0
860 -rwxr-xr-x  1 433 433 874560 Apr 28 21:36 busybox.oorig
844 -rwxr-xr-x  1 433 433 858752 Apr 28 21:49 busybox

   text    data     bss     dec     hex filename
 879920   11568 1039148 1930636  1d758c busybox.oorig-4.0
 862802   10192 1038796 1911790  1d2bee busybox.oorig
 848066    9100 1037536 1894702  1ce92e busybox

values for 4.0.2 just added for reference..
2006-04-28 20:02:29 +00:00
Bernhard Reutner-Fischer 15545b1db9 - print "Obsolet headers" instead of "Obsolete function usage" when checking
for obsolet includes.
2006-04-28 19:53:48 +00:00
Rob Landley a2d9a1752c More usage.h cleanups, with collateral changes to httpd. Specifically,
most of our CONFIG entries switch stuff on instead of off when enabled, so fix
the gratuitously reversed INETD thing.
2006-04-28 19:38:04 +00:00
Rob Landley 0e6a3e14e4 Patch from tito to update output of hdparm. 2006-04-28 01:33:30 +00:00
Rob Landley 7e21d5f6b1 Patch from Dennis Vlasenko to add the option to compress help text. 2006-04-27 23:34:46 +00:00
Rob Landley d5b9428bb6 Re-wordwrap the new tests, and fix seq.c to pass them. 2006-04-27 22:36:32 +00:00
Bernhard Reutner-Fischer a345dc855f - add two regression tests for seq.
"seq two arguments equal, arbitrary negative step" fails but should pass..
2006-04-27 13:46:56 +00:00
Bernhard Reutner-Fischer fc477f4bc6 - add note about crond 2006-04-26 19:40:15 +00:00
Bernhard Reutner-Fischer 06a81d368e - patch from Denis Vlasenko to make sizes PHONY and to add objsizes which prints
the sizes of the individual object files.
2006-04-26 10:10:25 +00:00
Rob Landley 5fe8d5b9c5 Convert a chunk of usage.h to USE_ and SKIP_ (more to do there), and fix a
DEFALT typo in du while I was there.
2006-04-25 22:40:53 +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 997650b972 From Denis Vlasenko:
* CPU% = process[i].ticks/sum(process[i].ticks) * busy_cpu_ticks/total_cpu_ticks
* got rid of empty line under "Load average" line
  and used last line - +2 visible processes
* do not do float conversion of loadavg, just read it as string from /proc
* fix display on small screens
* dropped unused .stime, .utime fields
* a few variables were renamed
* style fixes
2006-04-24 23:13:46 +00:00
Bernhard Reutner-Fischer 56fbd21fa7 - return ret so we return something meaningful. 2006-04-24 17:41:29 +00:00
Mike Frysinger 70cbb6e026 Jason Schoon writes: Attached is a patch to display the usage message if fuser is called with no arguments, rather than doing no work and failing silently. 2006-04-21 22:04:05 +00:00
Mike Frysinger 10f55b1dae Jason Schoon writes: This makes the case where LFS is not defined, but fdisk is configured with large disk support use the pretty build rules. 2006-04-21 21:59:22 +00:00
Mike Frysinger 586ea61284 2006-04-20 Shaun Jackman <sjackman@gmail.com>
* Makefile: Build a bFLT binary.
        * Rules.mak: Ditto.
2006-04-21 01:18:07 +00:00
Ned Ludd 791976490b - passwd doesnt use salt with md5 passwords; bug #604 thanks taviso 2006-04-21 00:40:35 +00:00
Mike Frysinger f162183527 kill signed warnings 2006-04-20 04:00:11 +00:00
Rob Landley 998dbee6d9 Patch from Jean Wolter:
it looks like the introduced support for character classes and
equivalence classes is not correct. The attached patch tries to fix
some symptoms and tries to make tr behave like gnu tr for the added
test cases. The patch

 - removes if clauses with side effects
 - fixes handling of buffer pointer (strcat added characters to the
   buffer without increasing the buffer pointer)
 - re-arranges character classes to match ASCII order

regards,
Jean
2006-04-19 22:22:06 +00:00
Rob Landley 5076eb4af9 svn 14824 broke -funsigned-char and possibly building out of tree, because
$(srcdir) can't bind early since it's set to a different value in each subdir.
If it binds early, it's blank, hence an empty -I which eats the next option
as a directory to look for #include files in.

So CFLAGS has to bind late, but the check_gcc stuff should only get run once.
I added a "make V=2" mode to show when check_gcc gets run, and turned WARNINGS
into a CFLAGS line since it was always getting added anyway.
2006-04-19 20:32:27 +00:00
Rob Landley 856489b63c New applet cksum, from Rob Sullivan. 2006-04-18 20:57:28 +00:00
Rob Landley bbd50b58ea Remove some #if 0 code. 2006-04-18 20:42:39 +00:00
Rob Landley e4386342b4 Simplify the GPL boilerplate. 2006-04-18 20:41:51 +00:00
Bernhard Reutner-Fischer 18260d5099 - typo: s/derefernce/dereference/g
Thanks to P.J. Day.
2006-04-18 14:17:49 +00:00
Bernhard Reutner-Fischer 0c013f5fc7 - commentary typo and superfluous whitespace removal in weird messages. 2006-04-18 12:46:56 +00:00
Bernhard Reutner-Fischer 38fc692e38 - improve wording in some help texts a little bit. 2006-04-18 11:21:07 +00:00
Bernhard Reutner-Fischer 074fe347b7 - add typo s/deamon/daemon/g 2006-04-18 11:15:19 +00:00
Bernhard Reutner-Fischer ea46f456d4 - patch from P.J. Day to rely on the automatic indenting provided by depends. 2006-04-18 11:11:40 +00:00
Bernhard Reutner-Fischer ba31d27249 - enable dumpleases applet again; bad rob 2006-04-18 10:04:08 +00:00
Bernhard Reutner-Fischer 9b68dbd878 - add grep for typo s/algorithic/algorithmic/g 2006-04-18 08:44:19 +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
Bernhard Reutner-Fischer 2949577981 - simplify config options of the ip applet. 2006-04-18 08:11:37 +00:00
Rob Landley a2e98043d5 From Rob Sullivan: Fix a segfault with searching, plus some cleanups. 2006-04-18 01:53:41 +00:00
Rob Landley 29ba9796be Robert Eggers noticed that nfsmount would sometimes incorrectly return success. 2006-04-17 23:02:57 +00:00
Rob Landley 0edbad1a7c Glenn gave permission for GPLv2 "or later". 2006-04-17 22:49:30 +00:00
Rob Landley 026147a48f Patch from Tito to fix printing null and make output look like hdparm 6.3. 2006-04-17 22:29:13 +00:00
Rob Landley 8b1f11da52 Remove a superfluous quote and more non-generic standalone code. 2006-04-17 21:49:34 +00:00
Rob Landley 559f7d8e92 Elf dynamic linker stuff from Rich Felker. 2006-04-17 21:47:03 +00:00
Mike Frysinger 5c16988910 enable udhcp applets again; bad rob 2006-04-17 02:00:49 +00:00
Mike Frysinger 20c22e0883 just use the stack to kill memleak and return if user didnt give us anything to match 2006-04-16 21:41:00 +00:00
Mike Frysinger bf2d9905ca use xmalloc, dont hardcode length of string, and get rid of pointless call to memset 2006-04-16 21:30:47 +00:00
Mike Frysinger f8346038e9 kill off pointless malloc.h include 2006-04-16 21:17:00 +00:00
Mike Frysinger b66c931fad kill pointless memory.h includes 2006-04-16 21:15:42 +00:00
Mike Frysinger d017d73399 add a check for obsolete headers 2006-04-16 21:14:59 +00:00
Bernhard Reutner-Fischer af07a00082 - fix typo. Thanks to David Moberg for pointing this out. 2006-04-16 20:56:03 +00:00
Mike Frysinger 00d10a94f3 uncuddle if statements 2006-04-16 20:54:19 +00:00
Mike Frysinger f284c767e5 use more boiler plate GPL notices 2006-04-16 20:38:26 +00:00
Mike Frysinger 3a2b103eea uncuddle brackets 2006-04-16 20:34:26 +00:00
Mike Frysinger dbd8c3b295 add some tests for common typos and for obsolete functions 2006-04-16 06:09:46 +00:00
Mike Frysinger 1a54030445 use memmove() instead of bcopy() 2006-04-16 05:58:21 +00:00
Mike Frysinger 4b7b8a58a1 touchup comment 2006-04-16 05:55:15 +00:00
Mike Frysinger 0436b9f482 use strchr() not index() 2006-04-16 05:54:31 +00:00
Mike Frysinger 78bd504947 use memcmp() not bcmp() 2006-04-16 05:51:47 +00:00
Rob Landley b0a2d6c19d Remove code for protocols we don't properly support. (Most of this could
never be selected via menuconfig anyway.)  If somebody wants one of these
protocols, ask on the list for us to support it _properly_.
2006-04-14 20:07:33 +00:00
Rob Landley da0dcd1050 Patch from Robert P Day to remove standalone code from httpd. (Busybox has
its own make standalone planned as a general solution to this for all
applets.)
2006-04-14 19:46:19 +00:00
Rob Landley e66c7efc31 Busybox is under the GPL. 2006-04-14 19:25:01 +00:00
Rob Landley d086b504c3 Hard wiring configuration symbol values into the code defeats the purpose
of _having_ configuration symbol values.

Also, changing #ifdef CONFIG to #if ENABLE isn't nearly as useful as changing
them to if (ENABLE) or USE()/SKIP()...
2006-04-14 02:32:29 +00:00
Rob Landley 346d6d9af2 The link to Bernhard's subversion branch belongs in subversion.html (where
it already is).
2006-04-14 00:55:46 +00:00
Rob Landley 2ec922eed5 Patch from Robert P Day: let menuconfig indent stuff for us, we don't have
to do it in Config.in.
2006-04-13 23:22:16 +00:00
Bernhard Reutner-Fischer 6b4377f333 - remove unneeded include, use shorter boilerplate while at it and also
shrink filter_accept_reject_list() a tiny bit while at it.
   text    data     bss     dec     hex filename
     59       0       0      59      3b filter_accept_reject_list.o
     62       0       0      62      3e filter_accept_reject_list.o.orig
2006-04-13 13:32:16 +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 4f3d2deaa4 - better wording.
Closes bug #656.
2006-04-12 19:14:35 +00:00
Bernhard Reutner-Fischer 34fc71f5a3 - note to think about eventually ditching vdprintf() 2006-04-12 18:50:19 +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 79865bc507 - add verbatim cp of http://www.gnu.org/copyleft/lesser.txt 2006-04-12 17:46:18 +00:00
Bernhard Reutner-Fischer fc5f318896 - use C99 %j format to print intmax.
Closes bugs #802 and #743
2006-04-12 08:03:11 +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
Bernhard Reutner-Fischer d0ea52ee04 - pin the CFLAGS to make sure that we don't have to re-evaluate the
check_gcc over and over again. Makes make -j work for me..
2006-04-11 20:48:24 +00:00
Bernhard Reutner-Fischer a23a6d7819 - include netinet/in.h for struct sockaddr_in.
Closes bug #735
2006-04-11 18:15:17 +00:00
Bernhard Reutner-Fischer e7f8a32929 - httpd in inetd mode: POST from IE (6) ends up in 'cannot display page'
Closes #827
2006-04-11 13:51:50 +00:00
Bernhard Reutner-Fischer cc295fb261 - comment out the check-referer lines. 2006-04-11 08:55:19 +00:00
Bernhard Reutner-Fischer e0e9886c19 - we seem to use h3, so make it consistent. 2006-04-11 08:49:01 +00:00
Bernhard Reutner-Fischer 91f604771b - update screenshot to reflect the busybox-1.1.2 stable release. 2006-04-11 08:42:58 +00:00
Bernhard Reutner-Fischer 9460f66e4e - tweak visibility of label expected_hwif_error as it's only needed for
CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF or CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF
2006-04-11 08:01:29 +00:00
Bernhard Reutner-Fischer 0b257d411d - remove implied closing paragraph
- add (improper but pretty) border='0'
2006-04-11 07:52:20 +00:00
Mike Frysinger f785255a44 Robert P. J. Day writes: even in the header file, make it clear that the routine depends on __uClinux__ 2006-04-11 04:04:40 +00:00
Bernhard Reutner-Fischer 776fe22756 - add note pointing to the stable branch, so users can pickup the current
stable version with fixes via svn.
2006-04-10 20:15:46 +00:00
Rob Landley bb5b2ffbc5 Announce 1.1.2. 2006-04-10 20:04:32 +00:00
Bernhard Reutner-Fischer 905a58a303 - poke bot 2006-04-10 19:47:46 +00:00
Bernhard Reutner-Fischer 8326d5e31b - add a colorful "valid HTML 4.01 Transitional" button to be able to check the referer easily.
Just rip it out if this is not considered generally useful.. TIA.
2006-04-10 19:40:51 +00:00
Bernhard Reutner-Fischer 3515f6e043 - make it resemble html. 2006-04-10 19:16:50 +00:00
Bernhard Reutner-Fischer fdf2b50316 - make it resemble english and fix typo s/interperet/interpret/g; 2006-04-10 18:40:27 +00:00
Rob Landley 81c40b39cb Patch from Tito to unify deluser and delgroup, and generally shrink code. 2006-04-10 18:03:17 +00:00
Bernhard Reutner-Fischer ca7166fe9d - put udhcp back in (Rob, you removed this in r14787 by accident..). 2006-04-10 18:02:12 +00:00
Rob Landley 4a8d9effca Notes about pic, static linking, and debugging dynamic linking. 2006-04-10 17:54:23 +00:00
Rob Landley 0ebecac02e Second verse, same as the first. 2006-04-10 17:34:12 +00:00
Rob Landley ea4c53ca43 Missing dependency spotted by Robert P Day. 2006-04-10 17:32:05 +00:00
Rob Landley 8ad70871b5 I forgot to re-enable shared library build after 1.1.1. (Undo svn 14590.) 2006-04-10 17:28:27 +00:00
Rob Landley c57ec37959 Patch from Rob Sullivan to consolidate crc32 table generation. 2006-04-10 17:07:15 +00:00
Rob Landley 998f449375 We use -funsigned-char now, so having a separate RESERVE_CONFIG_UBUFFER is
a bit silly.  Wean of that where it currently makes no difference...
2006-04-10 16:40:47 +00:00
Rob Landley 72615752db Modprobe update from Ignacio García Pérez, updating support for modprobe.conf. 2006-04-10 16:09:52 +00:00
Bernhard Reutner-Fischer 6554de06fe - fix typo introduced in the last commit. 2006-04-10 12:32:52 +00:00
Bernhard Reutner-Fischer a4acf669f4 - typo: s/biltin/builtin/g 2006-04-10 12:26:47 +00:00
Rob Landley 3e72c5931c Another size reduction patch from Garrett. 2006-04-06 22:49:04 +00:00
Bernhard Reutner-Fischer bc14214018 - patch from Rob Sullivan to add support for -L 2006-04-06 16:07:08 +00:00
Bernhard Reutner-Fischer 5fb0fecc1f - shrink it a little bit and make it buildable with gcc-2.95
text    data     bss     dec     hex filename
   7332       4      92    7428    1d04 diff.o-gcc-4.2-HEAD.orig
   7185       4      92    7281    1c71 diff.o-gcc-4.2-HEAD.new
   7336       4      92    7432    1d08 diff.o-gcc-4.1-HEAD.orig
   7148       4      92    7244    1c4c diff.o-gcc-4.1-HEAD.new
   7485       4      92    7581    1d9d diff.o-gcc-4.0.orig
   7318       4      92    7414    1cf6 diff.o-gcc-4.0.new
   7511       4      92    7607    1db7 diff.o-gcc-3.4.orig
   7252       4      92    7348    1cb4 diff.o-gcc-3.4.new
   8214       4      92    8310    2076 diff.o-gcc-3.3.orig
   7882       4      92    7978    1f2a diff.o-gcc-3.3.new
      -       -       -       -       - diff.o-gcc-2.95.orig
   8238       8      88    8334    208e diff.o-gcc-2.95.new
2006-04-06 11:28:19 +00:00
Bernhard Reutner-Fischer cc4003f778 - remove unused args.
text    data     bss     dec     hex filename
   7353       4      92    7449    1d19 coreutils/diff.o-gcc-4.2.oorig
   7332       4      92    7428    1d04 coreutils/diff.o
2006-04-06 08:23:11 +00:00
Bernhard Reutner-Fischer 693a93608a - move code around to avoid the need for the prototypes. 2006-04-06 08:15:24 +00:00
Bernhard Reutner-Fischer 8f7d389700 - new applet diff. Rob Sullivan writes:
Here's my attempt at a mini diff applet - it's adapted from the code at
http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/diff/, and only supports
unified diffs.

I've busyboxified everything to a reasonable degree, so I think the code is
suitable enough to be included, but there's still a fair bit of cleaning up
to be done.
2006-04-06 08:11:08 +00:00
Bernhard Reutner-Fischer e11a01cc34 - include inttypes.h as pointed out by Jason Schoon.
- use shorter boilerplate and switch to USE_FEATURE_STAT_FORMAT while at it.
2006-04-05 17:19:37 +00:00
Bernhard Reutner-Fischer 886f6afc8a - this applet should peruse USE_FEATURE_TFTP_... 2006-04-05 16:47:02 +00:00
Bernhard Reutner-Fischer 061fd0a353 - make sure that the label expected_hwif_error is visible even when
CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF isn't set.
2006-04-05 16:37:25 +00:00
Bernhard Reutner-Fischer fa939aae81 - include proper headers. 2006-04-05 16:21:37 +00:00
Bernhard Reutner-Fischer 465874f3a3 - use proper macros to print intmax_t.
PRIuMAX and PRIxMAX are defined in inttypes depending on the wordsize.
2006-04-05 14:57:59 +00:00
Paul Fox b7b24d61e0 adjust ifdefs for inclusion of string_insert() routine 2006-04-05 14:17:24 +00:00
Rob Landley 19af279d16 Kumar spotted another bug: if we autodetect nfs and they haven't specified the
fstype, it should be set to nfs.
2006-04-05 01:43:39 +00:00
Rob Landley e104d5fdcb Some tests were always true. We need comm.tests... 2006-04-04 19:26:37 +00:00
Rob Landley 9a2dd51237 Rewrite/shrink by tito. 2006-04-04 19:19:53 +00:00
Rob Landley ab8736064b You'd think there'd be a compiler warning for "pointless if", wouldn't you? 2006-04-04 16:56:04 +00:00
Rob Landley 3b84dfc2a8 Avoid spurious error message. (Technically applet order should be "SKIPPED"
when you move the testsuite directory outside of busybox and run it, but as
long as the test doesn't fail we're ok.)
2006-04-04 15:39:23 +00:00
Bernhard Reutner-Fischer dee811a53d - remove unused ext2fs_find_first_bit_set() and ext2fs_find_next_bit_set() 2006-04-04 12:17:24 +00:00
Bernhard Reutner-Fischer 89aaf4e249 - pull in prototype for e2fsck_main. 2006-04-04 12:10:28 +00:00
Bernhard Reutner-Fischer 2b398bec9c - make sure that we see all lib*/.c in IMA-mode even when not building the .so 2006-04-03 21:16:52 +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
Bernhard Reutner-Fischer 101a470068 - make append_option and multiconvert static. 2006-04-03 15:46:14 +00:00
Bernhard Reutner-Fischer ebd1355828 - coalesce printf calls.
text    data     bss     dec     hex filename
   3474       4      96    3574     df6 networking/arping.o.orig
   3424       4      96    3524     dc4 networking/arping.o
2006-04-03 12:29:12 +00:00
Bernhard Reutner-Fischer a0f75e2bba - use bb_opt_complementally; Saves another 14 bytes. (thanks again, vodz) 2006-04-03 11:52:01 +00:00
Bernhard Reutner-Fischer a38330c366 - do away with useless fwd-decls, redundant bb_printf calls, silence warning
about comparing signed and unsigned and make stuff static.
   text    data     bss     dec     hex filename
   6944       0       0    6944    1b20 util-linux/ipcs.o.oorig
   6509       0       0    6509    196d util-linux/ipcs.o

TODO: bb_getopt_ulflags, and further simplifications
2006-04-03 11:25:48 +00:00
Bernhard Reutner-Fischer 6153629097 - set flags in a more reasonable manner. Thanks, vodz.
text    data     bss     dec     hex filename
   3520       4      96    3620     e24 networking/arping.o.oorig
   3488       4      96    3588     e04 networking/arping.o
2006-04-03 09:46:29 +00:00
Bernhard Reutner-Fischer cfb53dfd5e - include proper prototypes in libunarchive. 2006-04-02 21:50:01 +00:00
Bernhard Reutner-Fischer 7ab5f4d03d - janitorial: huft_build is never used outside of decompress_unzip.c and has no
prototype (which suggests that it's of no general use) so make it static for now.
2006-04-02 21:23:40 +00:00
Bernhard Reutner-Fischer 9a67ca309c - janitorial: include proper prototypes in libiproute. 2006-04-02 21:14:19 +00:00
Bernhard Reutner-Fischer 7f77810633 - switch Warning Of the Week to wrong or missing prototypes.
e.g. archival/uncompress.c wrongly includes libbb.h instead of busybox.h
  decompress_bunzip2.c,open_transformer.c don't include the proper "unarchive.h"
  etc, etc.
2006-04-02 20:41:55 +00:00
Bernhard Reutner-Fischer a1bccc0ba8 - typos: s/compatability/compatibility/g;s/compatable/compatible/g; 2006-04-02 20:17:55 +00:00
Bernhard Reutner-Fischer 9457e70357 - typo: s/compenent/component/g
add a bit of documentation.
2006-04-02 20:12:31 +00:00
Rob Landley a13cca9cf4 New version from Tito. 2006-04-02 18:57:20 +00:00
Mike Frysinger 819b56b64a work outside of the srctree 2006-04-01 20:38:22 +00:00
Rob Landley 03e78e75f3 The build broke for me on gcc 4.0.3 due to an #include having the wrong patch. 2006-04-01 17:36:31 +00:00
Rob Landley 20fef96dd8 Bug spotted by Kumar Gala. Hopefully this fixes it... 2006-04-01 17:32:52 +00:00
Rob Landley 07a637df47 Patch from KRONSTORFER Horst to Fix a size mismatch in ping, such as the 56/84
mismatch inthe following example:
  # ping -c 1 172.16.2.1
  PING 172.16.2.1 (172.16.2.1): 56 data bytes
  84 bytes from 172.16.2.1: icmp_seq=0 ttl=64 time=0.2 ms
2006-04-01 17:28:11 +00:00
Mike Frysinger b0c5445bf5 new test for source code sanity 2006-04-01 01:36:32 +00:00
Mike Frysinger 5dd1236f49 move source code tests out into a sep file rather than just disabling/breaking them 2006-04-01 01:36:13 +00:00
Mike Frysinger 81834531aa remove bogus " 2006-04-01 01:35:52 +00:00
Mike Frysinger 2cf38523a1 silence error if busybox.links doesnt exist and run tests that begin with "all_" 2006-04-01 01:35:33 +00:00
Rob Landley 43ac88849b Ext2fs cleanup from Garrett Kajmowicz. 2006-04-01 00:40:33 +00:00
Bernhard Reutner-Fischer 5cf905a871 - use RESERVE_CONFIG_BUFFER and a bit of whitespace-cleanup. defconfig:
text	   data	    bss	    dec	    hex	filename
   1307	      0	      0	   1307	    51b	util-linux/hwclock.o.oorig
   1255	      0	      0	   1255	    4e7	util-linux/hwclock.o
2006-03-31 22:36:15 +00:00
Bernhard Reutner-Fischer 81901a096c - add option to suppress the terse usage messages. Saves 6.8k for defconfig:
text	   data	    bss	    dec	    hex	filename
 861791	  11264	1039140	1912195	 1d2d83	busybox.have-terse-usage
 854799	  11264	1039140	1905203	 1d1233	busybox.no-terse
2006-03-31 18:43:55 +00:00
Bernhard Reutner-Fischer 2766eedde8 - use RESERVE_CONFIG_BUFFER. For defconfig this gives:
text	   data	    bss	    dec	    hex	filename
   3627	      4	    120	   3751	    ea7	networking/arping.o.oorig
   3548	      4	     96	   3648	    e40	networking/arping.o.r14710
   3520	      4	     96	   3620	    e24	networking/arping.o
2006-03-31 18:13:42 +00:00
Bernhard Reutner-Fischer e47c4cbd4d - update help text.
the interface argument is now a lowercase 'i' to match the big arping
  commandline-syntax.
2006-03-31 18:10:31 +00:00
Bernhard Reutner-Fischer 137669449a - shrink it a bit further.
text	   data	    bss	    dec	    hex	filename
   3627	      4	    120	   3751	    ea7	networking/arping.o.oorig
   3548	      4	     96	   3648	    e40	networking/arping.o
2006-03-31 18:02:46 +00:00
Rob Landley 8ea5205726 Shrink patch from Bernhard Fischer. 2006-03-30 21:50:57 +00:00
Bernhard Reutner-Fischer 1f6dc6d358 - rename clean_up in tune2fs and mke2fs to be prefixed with their applet names.
Purely cosmetic to ease readability.
2006-03-30 13:54:30 +00:00
Bernhard Reutner-Fischer 214744dba1 - fix paste'o which i overlooked when applying dalias' fmt stuff. 2006-03-30 13:38:19 +00:00
Rob Landley a8e2760924 Clarify. 2006-03-30 02:01:48 +00:00
Rob Landley daa4a6dcbd Update ipaddr help to match reality. 2006-03-30 01:59:30 +00:00
Paul Fox ef81ce620c fix from David Daney, on busybox mailing list:
> The problem is that if the zcip protocol times out at about the same 
 > time another ARP packet is being received, the newly calculated timeout 
 > may be set to wait forever.  This prevents the protocol from progressing 
 > through its various states.
 > 
 > The Fix is to set the timeout to zero if it used to be a positive 
 > number, but it has already expired.  This causes the next protocol state 
 > to be entered immediately instead of never.
 > 
 > If OK please commit.
 > 
 > Also note that if you may have to apply the patch on this page:
 > 
 > http://www.science.uva.nl/research/air/wiki/LinkLocalARPMeasurements
 > 
 > To the linux kernel to get proper zcip behavior.
 >
2006-03-29 23:01:33 +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
Bernhard Reutner-Fischer abaef6565e - warn a bit more verbosely about fmt stuff for non-release versions 2006-03-29 22:28:27 +00:00
Bernhard Reutner-Fischer 6018225238 - mark trunk as 1.2.0-pre0 2006-03-29 22:22:37 +00:00
Paul Fox 5139bd98a7 add public-domain release 2006-03-29 19:54:02 +00:00
Bernhard Reutner-Fischer e375e8c732 - we only need obj_gpl_license if ENABLE_FEATURE_CHECK_TAINTED_MODULE is set 2006-03-29 18:57:09 +00:00
Bernhard Reutner-Fischer 56dd0bff06 - shrink mkswap and make v0 support optional. Thanks also to Tito for his ideas.
http://busybox.net/lists/busybox/2006-March/019326.html

   2137	      8	     28	   2173	    87d	util-linux/mkswap.o.orig
   1890	      8	     28	   1926	    786	util-linux/mkswap.o.v0+v1
   1560	      4	     28	   1592	    638	util-linux/mkswap.o.v1
2006-03-29 17:32:24 +00:00
Bernhard Reutner-Fischer b256bd334f - shrink dmesg a bit.
http://busybox.net/lists/busybox/2006-March/019477.html
2006-03-29 17:26:14 +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
Rob Landley 24b0a9568d Documentation from Jan Kiszka 2006-03-29 15:35:23 +00:00
Rob Landley fe908fda28 Kumar Gala tracked down a problem with NFS mounting. This is a different fix
from his, but to the same problem.
2006-03-29 14:30:49 +00:00
Rob Landley dbd91af061 Mike Frysinger pointed out we can go
CFLAGS=-I/usr/some/funky/path/to/selinux \
  LDFLAGS=-L/usr/some/funky/path/to/selinux make
So Jan Kiszka reverted part of the selinux patch.
2006-03-28 19:40:15 +00:00
Rob Landley 92fff34de6 Bernhard Fischer spotted that we shouldn't free fstype if we didn't allocate
it.
2006-03-28 19:19:19 +00:00
Paul Fox f0305b7f75 fix behavior of ZZ, with respect to readonly mode(s). original
patch and report from Alexander Griesser.
2006-03-28 14:18:21 +00:00
Mike Frysinger 6850017a2f remove some more config code rob missed in rev 13701 cleanup as reported by Robert P. J. Day 2006-03-28 06:11:51 +00:00
Mike Frysinger f885513940 just whitespace fixes 2006-03-28 02:35:56 +00:00
Rob Landley 87848d91c7 setlogcons, from Jan Kaszka. 2006-03-27 23:23:43 +00:00
Rob Landley 28ff9668d9 Mention that 1.1.2 should be out Juneish. 2006-03-27 23:22:16 +00:00
Paul Fox 986ab525b8 ensure that corrupted file extraction causes both a message and
a failure exit code.  delay the error exit until all (good) files
have been extracted.

filesystem errors (nodes of wrong type, permission problems, etc)
still cause immediate failure.
2006-03-27 23:09:14 +00:00
Rob Landley b3ede5abe2 More from Jan Kiszka: this is a port of the latest sysv-init SELinux patch.
It makes busybox invoke the libselinux library function to load the binary
policy right at system start-up. It was successfully tested on a mini-SELinux
system.  Note: requires recent libselinux. I'm using 1.28.
2006-03-27 23:09:12 +00:00
Rob Landley d1f8c1c125 From Jan Kiszka: This patch fixes the security labelling of the login terminal
and process... There still remains some stuff to clean up (the whole
set_current_security_context() appears unnecessary complex to me), but this is
now at least working.
2006-03-27 23:04:42 +00:00
Rob Landley 164a5be04e Patch from Jan Kiszka: In case the libselinux development installation is not
located at its default location, this patch allows to override the path via
SELINUX_INC and SELINUX_LIB when invoking make.
2006-03-27 23:00:32 +00:00
Rob Landley 0949d30638 Software Freedom Law Center and the fixes.patch thing. 2006-03-27 22:43:40 +00:00
Paul Fox 9360f42d32 add support for :wn (initial patch from Alexander Griesser) 2006-03-27 21:51:16 +00:00
Paul Fox dbf935dae6 drop obsolete version string in favor of actual BB version (from
Bernhard Fischer)
2006-03-27 20:29:33 +00:00
Rob Landley c370ea89fa Turn #if 0 into a comment. 2006-03-27 17:00:11 +00:00
Paul Fox 8416a2d558 prevent find from ever descending into an xdev'ed directory. 2006-03-27 16:42:33 +00:00
Rob Landley 3570915769 More dead code removal. 2006-03-26 21:49:42 +00:00
Rob Landley 4789694372 Robert P Day removed some commented out code. 2006-03-26 21:42:40 +00:00
Rob Landley 90ece609e6 Define both big endian and little endian macros. 2006-03-25 03:01:59 +00:00
Rob Landley 0bafd47e84 Stephane Billiart found an endianness bug in insmod. 2006-03-25 02:49:28 +00:00
Bernhard Reutner-Fischer 771b186406 - commentary typos 2006-03-24 14:30:05 +00:00
Bernhard Reutner-Fischer 2dd13bd25a - make sure that we see freeramdisk only once 2006-03-24 09:48:18 +00:00
Rob Landley d1968672ef When cross-compiling, the install directory for shared libraries has to come
from gcc (target machine), not uname (host machine).
2006-03-24 02:42:58 +00:00
Mike Frysinger 787140df39 remove in place of external link 2006-03-23 23:44:29 +00:00
Bernhard Reutner-Fischer e0fe937593 - correct typo 2006-03-23 16:52:59 +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
Mike Frysinger dce5809ebc make the makefile a little more flexible so we can store in either location 2006-03-23 03:47:19 +00:00
Rob Landley 5fba2505d4 News entry announcing 1.1.1. 2006-03-23 03:08:09 +00:00
Mike Frysinger 13c8327b79 sync busybox and udhcp trees 2006-03-23 03:05:05 +00:00
Mike Frysinger e1d41b3102 fixup style 2006-03-23 02:07:41 +00:00
Mike Frysinger 948a09d6f2 dont printf arguments given by user for security sanity 2006-03-23 02:07:20 +00:00
Mike Frysinger 64bef2ab9c fix typo 2006-03-23 02:06:29 +00:00
Rob Landley ca8d0b029b We make both busybox and busybox_unstripped all the time now, no need to
specify whether or not to strip the binary.
2006-03-22 21:03:21 +00:00
Rob Landley 2dd4279959 Patch from Rogelio Serrano to defer checking whether the tty exists until
we actually need to spawn something on it.
2006-03-22 17:39:13 +00:00
Rob Landley 2324a7c9e5 Fix "seq 1 1". 2006-03-22 17:11:44 +00:00
Rob Landley a35886c862 Fix from Glenn McGrath. 2006-03-22 16:59:12 +00:00
Rob Landley 786988faf7 Tweak allbareconfig not to pause. 2006-03-22 15:24:24 +00:00
Rob Landley 7328c8fdc1 Annoint 1.1.1. 2006-03-22 14:07:23 +00:00
Rob Landley cebea726e8 Another header suggestion from Shaun Jackman. 2006-03-22 00:46:36 +00:00
Mike Frysinger 06adf5fb47 2006-03-21 Shaun Jackman <sjackman@gmail.com>: Include signal.h instead of sys/signal.h. 2006-03-22 00:25:07 +00:00
Rob Landley 3ea05d3222 Fix missing copyright and license notice. 2006-03-21 18:20:40 +00:00
Rob Landley d049812571 Patch from Stuart Hughes upgrading depmod.pl 2006-03-21 16:35:50 +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
Rob Landley 6a776e9558 Temporarily disable shared library for the 1.1.1 release. 2006-03-21 16:07:39 +00:00
Bernhard Reutner-Fischer d1ba916167 - workaroung pr25795 in gcc-4.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25795
2006-03-21 11:06:43 +00:00
Rob Landley e3f4ab2bc4 Remove unneeded entries. 2006-03-20 18:40:07 +00:00
Rob Landley 8caffaa9a9 Cleanup: remove double quotes that don't seem to be needed. 2006-03-20 18:39:02 +00:00
Eric Andersen 9601a1c8c2 whitespace cleanup 2006-03-20 18:07:50 +00:00
Eric Andersen 19b5b8ff6a Fix some obvious compile problems. Make the -f' fakeIt option actually work. 2006-03-20 18:07:13 +00:00
Eric Andersen a6db0eef59 Willy Tarreau writes:
I encountered a little typo in 'make help' : the prefix was
noted "$prefix" instead of "$(PREFIX)".
2006-03-20 17:50:08 +00:00
Eric Andersen 28a6afe975 Roy Walker writes:
Here is a patch against the current subversion repository, that makes
udhcpc have an adjustable timeout.  Works for both foreground and before
it drops to the background.  This brings it more in-line with ISC dhcpc.

Use like so:
udhcpc --timeout=10 ...
or
udhcpc -T 10 ...

Still shooting for 1.1.1 this month?  Would really be great if you could
get this in that release.

Please give credit to Paul Pacheco - ppacheco@gmail.com.
2006-03-20 17:37:00 +00:00
Rob Landley c30f445b08 Patch from tito, acked by Bernhard Fischer. 2006-03-20 02:20:18 +00:00
Rob Landley e2b428cbb1 Use lstat() instead of stat so /init being a symlink doesn't screw people up.
(And use it consistently, for size reasons.)
2006-03-20 01:43:29 +00:00
Bernhard Reutner-Fischer 99a072d524 - tito writes: this patch fixes some comments in dos2unix that are wrong
or that reports non existent features (that i've ripped out...)
2006-03-18 23:05:37 +00:00
Bernhard Reutner-Fischer 2523da259c - explain what magic numbers we're using here. 2006-03-18 23:02:45 +00:00
Bernhard Reutner-Fischer 66753a3850 - whitespace cleanup (and also check against the const first and only then look
at bb_applet_name[1])
2006-03-18 15:59:29 +00:00
Bernhard Reutner-Fischer 263e75d051 - fix order of includes. 2006-03-18 11:59:55 +00:00
Mike Frysinger 9aa7f2005d declare const id argument const for probe_{ext2,ext3,cramfs} 2006-03-18 04:17:59 +00:00
Mike Frysinger 179f417788 need string.h as well as strings.h 2006-03-18 04:13:32 +00:00
Mike Frysinger 25f67d419d need EXT2FS_OBJS for fsck 2006-03-18 04:11:51 +00:00
Rob Landley 6bc10635f8 Make the new chroot environment creation infrastructure more flexible about
non-absolute paths.
2006-03-18 03:01:57 +00:00
Rob Landley dcb2122e85 My mount testsuite. Not automatically run at the moment, need to figure out
how to (optionally) supply User Mode Linux to runtests.
2006-03-18 03:00:22 +00:00
Rob Landley eaa34ca5b4 More fixes. Type "auto" should mean unspecified from fstab as well as the
command line, initialize singlemount's rc to an error value so it doesn't
think it succeeded when it didn't, use absolute path when associating a
loop device (and the previous FEATURE_CLEAN_UP logic related to that was
freeing the wrong thing), move reading of /proc/filesystems to where we can
re-read it (when it's empty) for every entry on a "mount -a" so that when
/proc is mounted as the first entry, the later filesystems can autodetect
filesystem type.
2006-03-18 02:58:11 +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 5a57821565 Bug fix: umount wasn't detaching loop devices unless mtab support was enabled.
Made some whitespace cleanups while I was there.
2006-03-17 03:30:05 +00:00
Rob Landley 2824ded677 More test updates. 2006-03-16 16:02:06 +00:00
Rob Landley 4bb1b04fd1 Redo test suite to be able to test more than one command at a time. Eliminate
$COMMAND environment variable, instead put full command line (including
command to run) in second argument.  Modify $PATH to have test versions of
commands at start of path.  (Also more infrastructure for testing as root,
work in progress...)
2006-03-16 15:20:45 +00:00
Rob Landley ea9a471acd Random in-passing tweak. 2006-03-16 14:40:27 +00:00
Rob Landley 187e352b7f Update for bug 14. 2006-03-15 17:09:56 +00:00
Rob Landley 330ac853e3 Tito shrank dos2unix. 2006-03-14 21:49:18 +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
Rob Landley d221d2137f Missed one. 2006-03-14 20:06:44 +00:00
Rob Landley dc0955b603 The new, new mount rewrite. (Mount double prime?) Still being debugged, but
the new infrastructure is reentrant so in theory it's capable of handling
mount -a sanely.  It can also re-use existing flags with remount, handle
-t auto, mount -a -t, and several smaller bugfixes.
2006-03-14 18:16:25 +00:00
Rob Landley 0b22c1c962 Tito unified fdflush and freeramdisk. I tweaked the result a bit. 2006-03-14 02:40:51 +00:00
Mike Frysinger 2f135fc6bf update comments as to what caused the defines to change 2006-03-13 23:48:18 +00:00
Bernhard Reutner-Fischer ef7ccac9da - add two comments 2006-03-13 20:32:48 +00:00
Bernhard Reutner-Fischer a25d83b282 - remove superfluous dependency which was fixed in r14527 2006-03-13 19:30:06 +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 965030e35a Update documentation. 2006-03-13 04:38:40 +00:00
Rob Landley 19808fea76 "make help" should not build the configurator first. 2006-03-13 03:19:46 +00:00
Rob Landley 9dc6913896 Fix "rm .config;make menuconfig" to work like "rm .config; make" (I.E. do
defconfig first), and group busybox administrative settings into a sub-menu.
2006-03-13 02:52:23 +00:00
Rob Landley e01d746fe9 Cleanup patch from tito. 2006-03-12 19:26:01 +00:00
Rob Landley 1c60d9762e Size reduction by Tito. 2006-03-11 18:22:35 +00:00
Mike Frysinger 9e094552c8 fix building with glibc-2.4 2006-03-10 23:41:29 +00:00
Mike Frysinger c70240cc1d add a sep option for stripping 2006-03-10 23:20:48 +00:00
Mike Frysinger 72d59dbd76 rearrange the menu a little to split general settings from applet selection 2006-03-10 23:17:17 +00:00
Rob Landley ead19306f5 Cleanup patches from tito. 2006-03-10 23:16:25 +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 dae6aa2859 Fixup to the previous (portability) patch. Linux actually does need
arpa/inet.h rather than netinet/in.h, otherwise we get warnings.
2006-03-09 22:39:08 +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
Rob Landley 3a324754f8 I'm about to introduce tests that need to run as root (like mount.tests),
meaning we want to run them in a chroot environment.  To help with this,
I worked out a utility function that makes it really easy to set up a chroot
environment.
2006-03-09 22:04:33 +00:00
Rob Landley 31e3610c4b Cleanup from Paul Fox. One find piped to xargs is faster/simpler than
lots of finds doing individual -exec rm.
2006-03-09 22:01:05 +00:00
Rob Landley ac664e07df Mention a few web browsers. 2006-03-09 18:20:43 +00:00
Rob Landley d48633fa6f They won't stop asking, but we can point them to the specific entry... 2006-03-09 18:03:21 +00:00
Rob Landley 49a5599ae9 Patch from Denis Vlasenko to make unlzma smaller. 2006-03-09 17:51:25 +00:00
Bernhard Reutner-Fischer 478a188e85 - remove check. Fixes e.g. buildroot 2006-03-09 16:49:46 +00:00
Bernhard Reutner-Fischer 39a9fddb53 - fix typo 2006-03-09 16:49:01 +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
Mike Frysinger 874af85d5e import most of e2fsprogs 1.38 updates 2006-03-08 07:03:27 +00:00
Paul Fox 0f2dd9f4eb vi-mode changes: eliminate warnings from out-of-range-for-type
case labels that are emitted by gcc4.  rearrange macros to
eliminate these extra case labels entirely (since the optimizer
may no longer do it for us).  eliminate static BUFSIZ character
deletion buffer -- malloc it, and make it much much smaller.
2006-03-07 20:26:11 +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
Rob Landley 1f5e25bf3e Walt Wimer noticed that mknod couldn't handle major or minor > 255. Now our
limit checking autodetects what the system supports (at compile time).
2006-03-06 19:31:39 +00:00
Bernhard Reutner-Fischer 2e9cf373a9 - workaround bug in make-3.81beta4:
- has to use
/top/obj/dir/*.o: /top/obj/dir/file.o: /top/src/file.c
instead of the proper
/top/obj/dir/*.o: /top/obj/dir/file.o: /top/src/dir/file.c
2006-03-06 14:20:43 +00:00
Bernhard Reutner-Fischer a59721166a - work around missing features and bugs in make-3.79.1:
- no order-only prerequisites; incomplete workaround (see comment in diff)
- no internal variable MAKEFILE_LIST; workaround
- define bar\nfoo:=<long-list>  doesn't work; workaround
also:
- reinstate clean, distclean as noconfig_target.
- unconditionally clean libbusybox.so*
2006-03-06 14:19:15 +00:00
Mike Frysinger 56ee779074 clean *.osm as pointed out by Robert P. J. Day 2006-03-05 18:04:23 +00:00
Mike Frysinger 33b45a09a1 clean busybox_unstripped as pointed out by Robert P. J. Day 2006-03-05 16:25:19 +00:00
Rob Landley 688ed0d760 Patch from Robert P. Day, moving byte order checks to use platform.h macros. 2006-03-04 22:40:25 +00:00
Bernhard Reutner-Fischer d9969ea175 - correct comment.
Should revisit gcc >= 4.1 with that =1 later on
2006-03-03 20:31:33 +00:00
Rob Landley 06ec8cff83 Typo fixes brought to you by the letters a, l, and Robert P. Day. 2006-03-03 19:02:50 +00:00
Eric Andersen cbd1c85744 Kill off some unused code that was wasting several k, as noticed by
Denis Vlasenko when building with  -ffunction-sections -fdata-sections
2006-03-03 18:37:39 +00:00
Rob Landley c05dda4b2d Denis Vlasenko noticed that falign=0 is meaningless, and that should probably
be falign=1.  Saves a little over 3k on an x86 "make defconfig" build.
2006-03-03 17:57:50 +00:00
Bernhard Reutner-Fischer 7ad83b4e2c - ar cruP doesn't replace ('r') but unconditionally _adds_ all objects.
landley, that one broke your tar-testing (see below).

To see the issue i was talking about in the comment to rev. 14431, remove the
'P' from ARFLAGS in Rules.mak, then recompile.

You will see undefined references to these symbols:
iplink_main
iproute_main
iptunnel_main
login_main
run_parts_main


These are due to the fact that these applets (named e.g. login.o) clash with
libbb/login.o, for example. So ar sees that we're going to add login.o
(the applet!) and does so. Later on, we add libbb/login.o (just the basename
is used, so login.o). and this libbb/login.o *replaces* the login.o (the
applet!).

I therefor want (you) to rename abovementioned files from libbb to have
a prefix bb_ (e.g. svn mv libbb/login.c libbb/bb_login.c) to avoid these
clashed.

ok?
TIA,
2006-03-03 14:19:15 +00:00
Bernhard Reutner-Fischer e3ec99de82 - remove unused lists *-m 2006-03-02 18:23:13 +00:00
Bernhard Reutner-Fischer c8e278f54b - make sure applets.o is rebuilt when the .config changes.
- don't overwrite objects in the archive. Affected applets with name-clash
  mostly vs. libbb:
iplink_main
iproute_main
iptunnel_main
login_main
run_parts_main
2006-03-02 18:13:05 +00:00
Bernhard Reutner-Fischer 9b6b894422 - allow for make /path/to/dir/file.o 2006-03-02 17:38:15 +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 c0bb308389 - silence warning about "'free_and_close_stuff' used but never defined" 2006-03-02 10:06:22 +00:00
Bernhard Reutner-Fischer cfc5d860e6 Denis Vlasenko writes: make sizes was rebuilding busybox - unstripped one! 2006-03-02 09:44:32 +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 12c2429a42 Fixup to make warnings from the last patch go away. 2006-03-01 21:36:18 +00:00
Rob Landley 08abe64d91 Selinux fix from Jan Kiszka. 2006-03-01 20:48:44 +00:00
Bernhard Reutner-Fischer b7f39732f8 - fix compilation of sed.
error: static declaration of 'free_and_close_stuff' follows non-static declaration
  Tiny whitespace cleanup while at it,
  also make sure that we don't use CONFIG_ anymore.

Rob, hope this is ok w/ you..
2006-03-01 20:14:16 +00:00
Rob Landley e7c43b66d7 Cleanup patch from Denis Vlasenko. Mostly variants of removing the if(x)
from before "if(x) free(x)".
2006-03-01 16:39:45 +00:00
Rob Landley 93f2286e6e When gnu fails this one we shouldn't let it _hang_... 2006-03-01 16:32:35 +00:00
Rob Landley e8e7811fb4 Yet more sed tests. Passing these is a to-do item for 1.1.2 or 1.2, not a
1.1.1 issue.
2006-03-01 16:32:01 +00:00
"Vladimir N. Oleynik" 325da7b509 use bb_xstrndup vs strndup. Thanks rfelker. 2006-03-01 05:39:41 +00:00
"Vladimir N. Oleynik" 5c2b238b3a more busybox's style: close bug 745 2006-02-28 10:15:42 +00:00
"Vladimir N. Oleynik" 716bbe96d4 make grep faster (close bug 758), reduce small memory leak in CONFIG_FEATURE_CLEANUP mode 2006-02-28 10:10:19 +00:00
"Vladimir N. Oleynik" 73804d6f7e more security: don't start shell code from argv 2006-02-28 08:23:27 +00:00
Rob Landley 8bbee85214 defconfig shouldn't enable CONFIG_INSTALL_NO_USR, and while we're at it
remove residue of old defconfig and tweak "make with no config" to run
defconfig before bringing up menuconfig.
2006-02-28 05:26:13 +00:00
Rob Landley 2fe4eac4ea Cosmetic cleanup from tito. 2006-02-28 04:45:24 +00:00
Rob Landley e813ddba18 Cleanup from Glenn McGrath. 2006-02-28 03:53:14 +00:00
Bernhard Reutner-Fischer 0817313255 - whitespace cleanup from Tito. 2006-02-27 22:34:41 +00:00
Rob Landley 4217bab02e Patch from Glenn McGrath to remove code that opens a file but does nothing
with it.
2006-02-26 04:42:05 +00:00
Mike Frysinger 5ba2fb2c9d remove duplicate license notice 2006-02-25 07:57:32 +00:00
Mike Frysinger 983e0ca89e strip out unneeded comments 2006-02-25 07:42:02 +00:00
"Vladimir N. Oleynik" 5c06b277ce fdisk unmaintained now :( 2006-02-25 07:20:15 +00:00
Rob Landley 5527b9117e Another clean-up patch from Garrett. 2006-02-25 03:46:10 +00:00
Rob Landley 736e52532e Minor cleanup from Garrett Kajmowicz. 2006-02-25 03:36:00 +00:00
Rob Landley b73451daee Cleanup from Denis Vlasenko. 2006-02-24 16:29:00 +00:00
Rob Landley 75cc0cace3 I was playing around with a dependency generator a couple weeks ago and I found
some #include files that aren't in the tree.  No biggie...
2006-02-24 03:15:34 +00:00
Rob Landley 883e0e83f2 Missed one in the get_line_from_file() update... 2006-02-24 03:12:03 +00:00
Rob Landley 3cb94d2eb3 Move FAQ under docs, add programming.html to docs list. 2006-02-24 02:55:24 +00:00
Rob Landley f6ddadc172 Mention patches directory as a read-only svn alternative. 2006-02-24 02:48:49 +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
Rob Landley 5c22c11de2 Add a test suite for seq. 2006-02-24 01:45:58 +00:00
Mike Frysinger 0612b5fa68 add exception for uncuddling brackets 2006-02-24 01:18:24 +00:00
Rob Landley 6b6edf959d Lots of tests the fix to sed needs to pass... 2006-02-23 23:13:16 +00:00
Rob Landley b21837714a Documentation update: more detail on vfork. 2006-02-23 19:59:34 +00:00
Rob Landley 73a20f3551 "sed 2 -2 10" was very unhappy. Made the thing bigger fixing it,
fiddled a bit to get the size back down as much as I could...
2006-02-23 19:54:48 +00:00
Bernhard Reutner-Fischer ed7bb6278d - put NLS stuff in one central place to avoid redefines.
Fixes warnings about:
fdisk.c:45:1: warning: "_" redefined
nfsmount.c:121:1: warning: "_" redefined
nfsmount.c:122:1: warning: "N_" redefined
interface.c:84:1: warning: "_" redefined
2006-02-23 14:25:15 +00:00
Rob Landley 51be57e4df Convert all the applets from #include to USE(). Had to fix some nonstandard
naming along the way to get USE() macros for everything.
2006-02-23 00:42:25 +00:00
Mike Frysinger 0923063ebb add myself and Bernhard 2006-02-23 00:21:22 +00:00
Mike Frysinger 23ca7253be test to make sure applets are in alphabetical order 2006-02-22 23:38:57 +00:00
Mike Frysinger 73b4710974 fix applet order 2006-02-22 23:33:39 +00:00
Mike Frysinger 992a58c216 document leading + option 2006-02-22 22:56:30 +00:00
Rob Landley c6d09a6276 You don't need an #ifdef around #defines in usage. 2006-02-22 20:33:15 +00:00
Rob Landley 0a7c8ef6e2 Patch from Denis Vlasenko to constify things and fix a few typos. 2006-02-22 17:01:00 +00:00
Rob Landley fb16d5c6aa Tweak my entry. 2006-02-22 15:40:38 +00:00
Rob Landley e8f504e86d Bug 751: file handle leaks can add up until available filehandles for the
process are exhausted.
2006-02-22 02:10:34 +00:00
Rob Landley d6e14d8bee Don't build directory libraries unless we're building an applet that needs it.
Cherry-picked from Devin Bayer's big MacOS X patch.
2006-02-21 19:11:35 +00:00
Rob Landley 6f2a0b2275 Small tweak cherry-picked from Devin Bayer's monster MacOS X patch. 2006-02-21 18:34:54 +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
Rob Landley a7e3d05208 Create /dev/root symlink pointing to real root device, if any. 2006-02-21 06:11:13 +00:00
Rob Landley c5789a6e23 Walter Harms added -D to date, and I did a code cleanup while I was in the
area.  Probably broke something...
2006-02-21 05:06:42 +00:00
Mike Frysinger bf28ed8834 eat extraneous newlines at the end of applet full usage 2006-02-21 04:32:03 +00:00
Mike Frysinger 0a6b0bfa7a add setarch/linux32/linux64 applet 2006-02-21 04:26:52 +00:00
Rob Landley ea6360e393 Missed a file in the last checkin, won't build without this... 2006-02-21 03:12:15 +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
Rob Landley a2841e6d4b Patch from Giuseppe Ciotta to specify retry count. 2006-02-20 23:26:38 +00:00
Rob Landley 0d8766a3b1 Rename UNUSE() to SKIP(). 2006-02-20 23:05:06 +00:00
Rob Landley 06249fee39 Bug 640: a filename of length exactly 100 could bleed into the next field on
display or extract.  (Only shows up when no gnu longname extension, either
because it's disabled or because tarball hasn't got it.)
2006-02-20 19:28:53 +00:00
Mike Frysinger dcbad607fc add s390x to the list 2006-02-20 19:28:34 +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
Rob Landley b4ec339ac2 Update comment. 2006-02-20 14:39:55 +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
Rob Landley eb00afb2d5 The gentoo security guys found another way to segfault busybox's decompression
code: we can do a null dereference if one of our huffman tables has all zero
length codes.  This fixes it.  (Thanks solar.)
2006-02-20 02:18:03 +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
Mike Frysinger da2a7d6b20 rfelker writes in Bug 738: sys/sysmacros.h is needed for makedev 2006-02-19 22:47:51 +00:00
Mike Frysinger dfd902b7ff rfelker writes in Bug 736: stty.c includes unneeded, obsolete header memory.h 2006-02-19 22:43:58 +00:00
Mike Frysinger 4b33f7aa41 rfelker writes in Bug 734: Nothing from err.h is used, but cal.c includes it, breaking compile on systems lacking this function. 2006-02-19 22:41:41 +00:00
Mike Frysinger 611e085c20 kill all .depend files 2006-02-18 20:13:22 +00:00
Mike Frysinger a568ef2343 hide bb_mkdep build 2006-02-18 20:12:39 +00:00
Mike Frysinger ebee0e7705 fix building on ppc64 2006-02-18 06:14:31 +00:00
"Vladimir N. Oleynik" 06776b3650 type typo. Thanks, Devin Bayer 2006-02-17 09:33:22 +00:00
"Vladimir N. Oleynik" b267f13c61 quick copy-paste typo 2006-02-17 09:05:41 +00:00
Rob Landley efae294b15 Fix for an integer overflow bug that could cause a segfault on certain
pathological archives.

(Unlikely to have security implications, the only way to trigger it basically
wound up doing memset(dbuf,x,2^31) and triggering an immediate segfault.  The
test basically gives us a more polite error message.)

Thanks to Ned Ludd and the Gentoo security guys for finding this.
2006-02-17 05:19:40 +00:00
Rob Landley 2c98c40ec8 The tendency of vi to auto-indent can be really annoying at times. 2006-02-17 05:12:03 +00:00
Rob Landley f856eabcde More whitespace than you can possibly imagine... 2006-02-17 03:43:49 +00:00
Rob Landley 27cd85b5be Update Rogues Gallery. 2006-02-17 02:38:00 +00:00
"Vladimir N. Oleynik" eaa3b29a6d forgoten new file for 14080 revison 2006-02-16 15:41:12 +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" cb9b114d35 isolate and show busybox`s changes 2006-02-16 14:28:17 +00:00
Rob Landley 5c1cd5fdd3 Putting together OPTIONFLAGS, sed needs the global flag to handle multiple
options.
2006-02-16 09:25:31 +00:00
Rob Landley 006fa2d45b When setting an environment variable by piping something into grep, backquotes
can be useful.  Also tweak an if case to be more portable.
2006-02-16 09:00:57 +00:00
Rob Landley d1e38c07e6 Rogues gallery. 2006-02-16 03:21:44 +00:00
"Vladimir N. Oleynik" c218a29325 add last terminal line 2006-02-15 17:15:56 +00:00
"Vladimir N. Oleynik" 9a51540b15 demo (UN)USE_FEATURE... usage 2006-02-15 13:27:18 +00:00
"Vladimir N. Oleynik" 6732af2766 full removed config.h, use bb_config.h only 2006-02-15 12:29:37 +00:00
Rob Landley 02794e1516 Fix bug 674: sum's block count should always round up. 2006-02-14 17:47:05 +00:00
Rob Landley 46e351d478 Patch from awk maintainer (Dmitry Zakhrov) to fix bugs 642, 663, and 667. 2006-02-14 16:05:32 +00:00
Bernhard Reutner-Fischer 5ba53c05fc - commentary typos 2006-02-14 10:43:40 +00:00
"Vladimir N. Oleynik" 3afdfecf7e restore change by Denis Vlasenko: file_to_buf must vary fast, best if inline 2006-02-14 10:36:38 +00:00
"Vladimir N. Oleynik" 465300ced9 cleanups after changes by Denis Vlasenko. Size optimization 2006-02-14 10:17:09 +00:00
"Vladimir N. Oleynik" 63ca3bfe9d commentary typos. Thank by aldot 2006-02-14 09:23:25 +00:00
Rob Landley a253e7361f Rob Landley is busybox maintainer now. Eeek. 2006-02-14 08:29:48 +00:00
Rob Landley d05981eaf1 Fix off by one error. (I know I had a reason for doing that, but I have _no_
idea what it was...)
2006-02-14 07:33:45 +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 7bfa88f315 New USE() macros
For each CONFIG_SYMBOL, include/bb_config.h now has both ENABLE_SYMBOL
and USE_SYMBOL(x).  ENABLE_SYMBOL is still always defined (1 or 0) so that
if(ENABLE) should optimize out when it's zero.  The USE_SYMBOL(X) will only
splice in X if the symbol is defined, otherwise it'll be empty.

Thus we can convert this:

#ifdef CONFIG_ARGS
    opt = bb_getopt_ulflags(argc, argv, "ab:c"
#ifdef CONFIG_THINGY
        "d:"
#endif
        , &bvalue
#ifdef CONFIG_THINGY
        , &thingy
#endif
    );
#endif

into this:
    if (ENABLE_ARGS) {
        opt = bb_getopt_ulflags(argc, argv, "ab:c" USE_THINGY("d:"), &bvalue
                USE_THINGY(, &thingy));
    }

And it should produce the same code.

Unlike the old versions in include/_usage.h, the new USE_SYMBOL(x) can handle
commas in its arguments (as shown above).  (The _usage.h file is obsolete and
no longer generated.)

Nobody should need to include config.h directly anymore, bb_config.h should
define all the configuration stuff we need.  Someday, the CONFIG_SYMBOL
versions should go away in favor of ENABLE_SYMBOL and USE_SYMBOL().

Thanks to vodz for the new version of bb_mkdep.c that works with function
macros.
2006-02-13 19:16:41 +00:00
Bernhard Reutner-Fischer f251ec6847 - commentary typos 2006-02-12 11:25:32 +00:00
Rob Landley c29a0f371a More random documentation. 2006-02-12 00:45:39 +00:00
Rob Landley 4926d643ea Missed this in svn 13701. 2006-02-10 21:38:20 +00:00
Rob Landley 4a1d874e1d Another item. 2006-02-10 21:36:53 +00:00
Rob Landley cc6d8d30ec Fix umount so it works if there's no /etc/mtab or /proc/mounts, make
umount -a into a CONFIG_FEATURE (why not?), and zap the now obsolete
defconfig file (which was supposed to be part of the previous checkin).
2006-02-08 20:06:57 +00:00
Rob Landley 1ab4c3dc25 Help text update and tweak to defconfig to remove two more things that
the "maximum sane configuration" shouldn't have.  (Explicit MTAB support in
mount, which you should only need if you have no /proc, and FEATURE_CLEAN_UP,
which exists to humor valgrind and otherwise just bloats the code).
2006-02-08 18:50:17 +00:00
Rob Landley 32251b4825 Convert some help text to english. 2006-02-08 18:34:21 +00:00
Mike Frysinger 271aa40a15 add back in path nulling after calling find_dev() since it is needed for now ... 2006-02-07 06:10:45 +00:00
Mike Frysinger 27a74e8017 Cristian Ionescu-Idbohrn writes:
force enough space padding so that applet names always end up on their own line
2006-02-07 00:58:11 +00:00
Mike Frysinger 0380166916 space out supported applet names so the config list doesnt wrap on an 80col terminal 2006-02-07 00:51:07 +00:00
Mike Frysinger 4fcefb9e90 fixup whitespace in awk help output 2006-02-06 23:38:59 +00:00
Rob Landley 30a6bba65f Bug 677: there are apparently still people using telnet. 2006-02-06 02:49:45 +00:00
Mike Frysinger ba9c4d1f89 get rid of warnings with applets that have no usage and get rid of pointless --- separator between applets 2006-02-06 01:11:34 +00:00
Mike Frysinger f37529d6b6 if the .pl script gets updated, force doc regen 2006-02-05 22:15:39 +00:00
Mike Frysinger b0ed3d7cc0 Rob Sullivan writes: Here's a patch to autogenerate the list of applets in the Busybox documentation 2006-02-05 22:10:40 +00:00
Rob Landley bec26527a1 Save a few bytes in error message. 2006-02-05 03:31:44 +00:00
Mike Frysinger a421ba8203 cleanup style ... just because you use less spaces doesnt mean the resulting code is smaller 2006-02-03 00:25:37 +00:00
Mike Frysinger 248d2220f9 shrink the code a bit 2006-02-03 00:19:42 +00:00
Mike Frysinger 53d57dbe6b gavinl writes in Bug 661:
if read() file return less than 1, we should close the fd and then goto end.
2006-02-03 00:16:53 +00:00
Mike Frysinger 5509228a7b alphabetical order and fix mdev comments about echo>/sys vs echo>/proc/sys 2006-02-02 23:14:57 +00:00
Mike Frysinger 35cf19d741 fix mdev help output 2006-02-02 22:52:59 +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
"Vladimir N. Oleynik" 1f04c9d29c removed anoinig `unused' warnings 2006-02-01 14:47:52 +00:00
"Vladimir N. Oleynik" 73ffd762ca removed anoinig warnings 2006-02-01 12:56:19 +00:00
"Vladimir N. Oleynik" b399a96343 remode warning: const static mix 2006-02-01 12:41:35 +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" 87be316149 more better for me signed<->unsigned and the const keyword usage 2006-01-31 14:25:52 +00:00
"Vladimir N. Oleynik" 4333a09d65 add feature: support for running scripts through an interpreter. Thanks Florian Schirmer <jolt@tuxbox.org> 2006-01-31 13:53:30 +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
"Vladimir N. Oleynik" 57545c810a avoid signed<->unsigned warning 2006-01-31 12:06:57 +00:00
"Vladimir N. Oleynik" 4d57926bd3 removed unneed signed, avoid warning 2006-01-31 11:57:06 +00:00
Bernhard Reutner-Fischer 81b94960a2 - pass -static via CC rather than LD 2006-01-31 11:29:22 +00:00
"Vladimir N. Oleynik" 39e7510664 more destroy potential overflow for x86_64. 2006-01-31 11:19:12 +00:00
"Vladimir N. Oleynik" 77bb33c474 destroy potential overflow for x86_64. Added ATTRIBUTE_UNUSED 2006-01-31 11:16:40 +00:00
Bernhard Reutner-Fischer 9f4a1e1c75 - add and use ATTRIBUTE_ALIGNED(num_bytes)
- remove unused parameter pindex from fdisk.c, xbsd_initlabel()
2006-01-31 09:53:53 +00:00
"Vladimir N. Oleynik" dfe6e74157 changed strange mix signed<->unsigned 2006-01-31 09:44:04 +00:00
"Vladimir N. Oleynik" dd14ca082a protect potential overflow for x86_64 2006-01-31 09:35:45 +00:00
"Vladimir N. Oleynik" 4ccd2b4697 quick analize signed->unsigned: protect overflow of map[char], getchar->EOF. Use ATTRIBUTE_UNUSE. 2006-01-31 09:27:48 +00:00
Bernhard Reutner-Fischer cd98555dfa - fix typo i introduced yesterday. 2006-01-31 08:17:13 +00:00
Rob Landley 9e275e3450 Not on libbusybox.so: it's GPL, no API barrier, no stability promise. 2006-01-31 03:45:26 +00:00
Rob Landley a167ec5e63 Turn defconfig into what make allyesconfig is today. Turn allyesconfig
back into allyesconfig.  (Memo: apparently SELINUX doesn't compile anymore.)

Make defconfig shouldn't switch on libbusybox.so, but allyesconfig does.
2006-01-31 02:42:50 +00:00
Eric Andersen 3496fdc9a5 hopefully the last of the annoying signed/unsigned and mixed type errors 2006-01-30 23:09:20 +00:00
Eric Andersen a68ea1cb93 fix up yet more annoying signed/unsigned and mixed type errors 2006-01-30 22:48:39 +00:00
Eric Andersen 9a58b02ec7 make certain we dereference the pointer as a time_t, esp on x86_64
where it might otherwise not be dereferenced as such by default
2006-01-30 22:33:31 +00:00
Eric Andersen 0cb6f35c33 fix up annoying signed/unsigned and mixed type errors 2006-01-30 22:30:41 +00:00
Eric Andersen 5e678873f9 clean up yet more annoying signed/unsigned mismatches and fixup
yet more incorrect types
2006-01-30 19:48:23 +00:00
Eric Andersen 2cdd4d56ff passing around an int as a void* is a very bad idea 2006-01-30 18:33:12 +00:00
Eric Andersen d78aea8b8e sort out yet more type issues 2006-01-30 18:00:02 +00:00
Bernhard Reutner-Fischer 4bf31272ff - very minor tweak: save 1 byte.
statistics:
   text    data     bss     dec     hex filename
    867       0      12     879     36f fold.o.oorig.gcc-3.3
    843       0      12     855     357 fold.o.oorig.gcc-3.4
    780       0      12     792     318 fold.o.oorig.gcc-4.0
    761       0      12     773     305 fold.o.oorig.gcc-4.1-HEAD
    761       0      12     773     305 fold.o.oorig.gcc-4.2-HEAD
    866       0      12     878     36e fold.o.gcc-3.3
    842       0      12     854     356 fold.o.gcc-3.4
    779       0      12     791     317 fold.o.gcc-4.0
    760       0      12     772     304 fold.o.gcc-4.1-HEAD
    760       0      12     772     304 fold.o.gcc-4.2-HEAD
2006-01-30 17:41:06 +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
Eric Andersen f55289f4b9 fixup a few types to prevent gcc (rightfully) whining about mixing
signed and unsigned, unmatches pointer target types, etc
2006-01-30 17:27:00 +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
"Vladimir N. Oleynik" 2d604581ef removed warning "comparison between signed and unsigned". 2006-01-30 14:02:06 +00:00
"Vladimir N. Oleynik" 51bfa54e46 removed warning "comparison between signed and unsigned". Added ATTRIBUTE_UNUSED. My whitespace 2006-01-30 13:58:34 +00:00
"Vladimir N. Oleynik" 59c4e5cf92 removed warning "comparison between signed and unsigned". Added ATTRIBUTE_UNUSED. My whitespace 2006-01-30 13:51:50 +00:00
"Vladimir N. Oleynik" 676b15e067 removed warning "comparison between signed and unsigned". 2006-01-30 13:47:19 +00:00
"Vladimir N. Oleynik" cd473dd0c1 removed warning "comparison between signed and unsigned". Added ATTRIBUTE_UNUSED. Whitespace 2006-01-30 13:41:53 +00:00
"Vladimir N. Oleynik" cd5c15d287 removed warning "comparison between signed and unsigned". Change very very old code: use int instead short 2006-01-30 13:36:03 +00:00
"Vladimir N. Oleynik" 9b9a920eef removed warning "comparison between signed and unsigned". Reduced size 2006-01-30 12:23:46 +00:00
"Vladimir N. Oleynik" e75b41d990 support GNU suffixes for fancy mode: b(512), k(1024) and m(1024*1024) 2006-01-30 11:15:11 +00:00
"Vladimir N. Oleynik" b1fd52e0b7 remove outdated and do not corected comment. Use bb_xasprintf instead xmalloc+set+set+strcpy. 2006-01-30 10:49:14 +00:00
Rob Landley 646129163a Re-add initrd support, unify halt/reboot/poweroff, add -n and -f options. 2006-01-30 08:31:37 +00:00
Rob Landley 49576c0018 Note on SVN 13424: Don't mix "default y" and select of something earlier
in the menu hierarchy or else make allnoconfig winds up leaving whatever the
select  points to as "y".  (In this case, "make allnoconfig" is leaving 
CONFIG_TEST as "y".)
2006-01-30 06:11:42 +00:00
Rob Landley f8fd4db92f Move SUSv2 obsolete feature disabling to debug menu, invert meaning of
symbol (switched on to remove now: test your apps to make sure they _don't_
do this, because as some point we should just yank it), fixup head/tail/fold.

Also tweak "make allyesconfig" so anything starting with CONFIG_DEBUG gets
left switched off.  Possibly other things we want to put in the debug menu?
2006-01-30 01:30:39 +00:00
Rob Landley dd53c24d41 Remove foo.txt and reenable -funsigned-char now that ash is fixed. 2006-01-30 01:27:08 +00:00
Rob Landley 03628c8f75 Remind me to implement bb_fork_exec()... 2006-01-29 06:45:38 +00:00
Rob Landley b1b3cee831 Add explanations of encrypted passwords, and fork vs vfork. 2006-01-29 06:29:01 +00:00
Bernhard Reutner-Fischer 08a1b5095d - add a macro to check for ld and as flags
Very unreliable as e.g the ld check will see the flags supported by each emulation, not just the active one.
  good enough for now..
  Fix would be to crate one or more dummy .c files and accually try if a flag
  works.
2006-01-27 15:45:56 +00:00
"Vladimir N. Oleynik" 79af7d5deb for change previous log: close bug 186 2006-01-26 10:58:12 +00:00
"Vladimir N. Oleynik" 2e33daaed5 close bug 190 2006-01-26 10:46:14 +00:00
Mike Frysinger 546a99db1d use LC_ALL, not LANG, for forcing C 2006-01-25 22:46:25 +00:00
"Vladimir N. Oleynik" 84005af7ef C99 say: "char" declaration may be signed or unsigned default 2006-01-25 17:53:04 +00:00
"Vladimir N. Oleynik" 5775aa2ef6 added support /prefix for IPV4 form IPV6 code. Close bug 461 2006-01-25 16:17:58 +00:00
Bernhard Reutner-Fischer 08c5a1789b - Simplify the prereq and add more documentation.
- Fix regex for allyesconfig.
2006-01-25 15:58:04 +00:00
"Vladimir N. Oleynik" 2e5ee8ed93 +#include <sys/socket.h>
remove unused 'int i' form main
whitespacing only
2006-01-25 14:40:24 +00:00
"Vladimir N. Oleynik" 7b4aa6ffc6 new applet. Thanks Roberto A. Foglietta 2006-01-25 14:19:11 +00:00
"Vladimir N. Oleynik" 8aa9e57149 support 64 arith. Close bug 136 2006-01-25 13:56:03 +00:00
"Vladimir N. Oleynik" 1e98a0705b close bug 638 2006-01-25 13:21:08 +00:00
"Vladimir N. Oleynik" fdb871c498 Add more bash-like dot-dirs cmdedit feature
Close bug 648.
Restore my whitespace
2006-01-25 11:53:47 +00:00
Tim Riker 7d501a8673 ignore whitespace 2006-01-25 00:25:37 +00:00
Tim Riker 7dd4cbf2bf LANG=C should help 2006-01-25 00:17:47 +00:00
Tim Riker c1ef7bdd8d just whitespace 2006-01-25 00:08:53 +00:00
Bernhard Reutner-Fischer f64ff682a3 - correct flag for gcc-3.x 2006-01-24 18:25:51 +00:00
Bernhard Reutner-Fischer 9ed6ac2bea - Turn off combine for allyesconfig and allbareconfig.
The user ought to explicitely request this.
2006-01-24 18:15:20 +00:00
Bernhard Reutner-Fischer 2aba3953d4 - readd config option for libbusybox and ima-mode which were accidentally
dropped by landley in rev13542.
2006-01-24 16:14:14 +00:00
"Vladimir N. Oleynik" ab90b9f427 close bug 657 2006-01-24 12:02:27 +00:00
Rob Landley 8b6063490d Once more, with fewer inappropriate semicolons. 2006-01-24 02:38:28 +00:00
Rob Landley 391a904f46 Ken McGuire's patch to make mke2fs and e2fsck work on big endian systems like
PPC, with an obligatory couple of swipes from me.
2006-01-23 21:38:06 +00:00
Rob Landley 6130b9b160 Testing CONFIG_SORT_BIG to display the help for the big version of sort isn't
much use when the symbol is CONFIG_FEATURE_SORT_BIG.
2006-01-23 21:10:38 +00:00
"Vladimir N. Oleynik" e0ae702b0e ash with -funsigned-char don`t work! 2006-01-23 13:47:36 +00:00
"Vladimir N. Oleynik" b757699164 Oops, restore tabs 2006-01-23 11:39:05 +00:00
"Vladimir N. Oleynik" 9394b232ef cleanup (dist)clean logic 2006-01-23 11:24:58 +00:00
Rob Landley b70ccd9509 Close bug 644: loop incrementing twice, skipping ever other device. 2006-01-22 23:17:18 +00:00
Rob Landley e927743bb0 There was a missing ! on strcmp (despite the fact it worked in my testing,
I have no idea _how_), and a simpler fix for the extra \n problem.  I tested
this and it worked for me, for what that's worth...
2006-01-22 23:14:16 +00:00
Bernhard Reutner-Fischer 86f5c9906b - add platform.h.
- use shorter boilerplate while at it.
2006-01-22 22:55:11 +00:00
Rob Landley 2edf52643d The whole "init is sometimes pid 3" thing is silly. Init is pid 1, anything
else is a kernel bug.  Both 2.4 and 2.6 should get this right now.  This
should fix the bug IraquiGeek is seeing (although killall still needs to
be fixed.)
2006-01-22 02:41:51 +00:00
Rob Landley aaffef4d33 Start of developer documentation for busybox. 2006-01-22 01:44:29 +00:00
Paul Fox f9d40d6815 compile on 2.96 for a while longer -- no floating declarations. 2006-01-20 21:48:06 +00:00
Rob Landley c1d69906a0 Patch from Aurelien Jacobs to add unlzma. (A new decompression type,
see www.7-zip.org)
2006-01-20 18:28:50 +00:00
Rob Landley 7a43bd07e6 Zap sysdeps directory, moving Config.in and defconfig to top of tree.
(Busybox should not be system dependent enough to have different default
configurations for different platforms.  We're not a kernel.)
2006-01-20 17:47:09 +00:00
Rob Landley c8e41157a2 Update readme and install.sh usage message. 2006-01-19 21:22:37 +00:00
Bernhard Reutner-Fischer 5a620ea220 - Document -m, -c, -s and provide a default shell for standalone build.
- Wrap overlong lines plus a few whitespace fixes.
- add GPL header.
2006-01-19 18:04:15 +00:00
Bernhard Reutner-Fischer a901b40464 - missing bits of patch attached to bug #249 (constify). 2006-01-19 14:51:17 +00:00
Bernhard Reutner-Fischer f771d88443 - need to have config MODULE in order to make tristate work..
Thanks to Robert Schwebel for pointing this out. I must be blind..
2006-01-19 14:45:16 +00:00
Bernhard Reutner-Fischer 96002bba67 - cleanup Config.in. Use "select CONFIG_FOO" and add the corresponding
"depends on CONFIG_BAR" instead of the if !CONFIG_FOO ...default y stanza.
2006-01-19 14:42:23 +00:00
"Vladimir N. Oleynik" cfc8f59649 restore 8-bit syntax works, last debian patch is broken. Noticed by Vladimir Dronnikov 2006-01-19 11:23:34 +00:00
Bernhard Reutner-Fischer b565a12cf8 - bump version to 1.1.1 nonrelease series (let's say -pre0). 2006-01-19 09:22:39 +00:00
Bernhard Reutner-Fischer d9679e3af1 - remove debian/ 2006-01-17 15:56:59 +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
"Vladimir N. Oleynik" 0f9ae1a0d7 setgid and setuid have changes effective id too 2006-01-15 14:55:48 +00:00
"Vladimir N. Oleynik" fb29b46201 sync with dash_0.5.3-1 2006-01-15 14:21:01 +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
"Vladimir N. Oleynik" 8c9daa12dc restore erronyous 'cleanups' by Rob Sullivan and landley 2006-01-15 09:29:41 +00:00
Rob Landley 855f1e1320 Cleanup patch from Rob Sullivan. 2006-01-15 02:20:06 +00:00
Rob Landley 734a779a42 1.1.0 is out. 2006-01-14 07:43:22 +00:00
Paul Fox 72d1a2357d add find's "-mmin" option. configurable. 2006-01-13 21:05:41 +00:00
Bernhard Reutner-Fischer 4a1865ca5e - revert last change for now.. 2006-01-13 18:11:59 +00:00
Bernhard Reutner-Fischer 5a62284972 this applet needlessly big! TODO: bb_getopt_ulflags()
- use atol for the offset, which is always in bytes. Small step in eventually dropping bb_xparse_number().
2006-01-13 17:29:46 +00:00
Bernhard Reutner-Fischer 26ea0b7f16 - turn off "nc gaping hole" and devfsd in allbareconfig, the latter doesn't
use the FEATURE notation and noone will update it to use it.
2006-01-13 16:25:03 +00:00
Bernhard Reutner-Fischer 853c44b798 - correct definitions. 2006-01-13 12:03:26 +00:00
Bernhard Reutner-Fischer 2677cf1b0a - Mention code-cleanup possibilities in TODO. 2006-01-13 08:46:39 +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
Bernhard Reutner-Fischer eedd1be730 - remove warning about redeclaration of __constant_htons
- remove warning about format '%ld' expects type 'long int *', but argument #num
  has type 'long unsigned int *'
2006-01-12 13:15:49 +00:00
Bernhard Reutner-Fischer d1d23a6e67 - mark argument who of print_route as unused. 2006-01-12 12:08:46 +00:00
Rob Landley 29e08ffcdf Frank Sorenson added hotplug support to mdev. (I tweaked it a bit. Need
to come up with a test suite for all the stuff that requires root access.
Something involving User Mode Linux or QEMU, probably...)
2006-01-12 06:13:50 +00:00
Rob Landley 1c19deed17 The major:minor read from dev ends with \n, need to trim that. 2006-01-12 03:07:49 +00:00
Rob Landley bbf4e167f2 Ok, ping needs a rewrite from the ground up. (This is not a busybox app.)
Fix bug 309, where ping -s 1 localhost would give an elapsed time 9 digits
long due to a stack overflow.  Apparently, iputils also does this.
2006-01-11 03:44:11 +00:00
Rob Landley 009765d2ca And lo, we hath reached Release Candidate 1. 1.1.0 should happen this week. 2006-01-10 19:48:53 +00:00
"Vladimir N. Oleynik" 24f819fd74 can use TMPDIR if user's HOMEDIR do not found. Noticed by Bernhard 2006-01-10 12:35:43 +00:00
Rob Landley bc059bc7fa The brain-dead FTP servers on Solaris don't support the size command. 2006-01-10 06:36:00 +00:00
Rob Landley 9e4100bf95 Don't return 0 when there's an error. 2006-01-10 06:19:56 +00:00
Rob Landley 71d6ccd801 With -a, the jump to mount_it_now can skip the initialization of f, and
if we don't zero it after closing it we re-close a filehandle that isn't
open, and since this is a file _pointer_ it segfaults on a double free.

Yeah, subtle bug.  I need to break this out into separate functions if I can
figure out how to avoid making the code larger while doing so.  Part of
the general -a and -o remount work I need to do, but that's after 1.1.0...
2006-01-10 05:30:28 +00:00
Rob Landley 8b0efdb1a1 Both atime and diratime should switch _off_ the corresponding no* flag. 2006-01-10 02:37:20 +00:00
Mike Frysinger bd67e8074a upgrade ZyXEL from hall of shame to hall of [product] fame 2006-01-10 01:43:40 +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 5184336647 Bug 112, return value of awk should be /256. In reality, we should probably
be using WEXITSTATUS(), but until I can figure out why the heck that would
want to do (*(int *) &(status)) on the value, I'm happy just fixing the bug we
actually see.
2006-01-09 05:26:58 +00:00
Rob Landley fb8c4983a6 Fix bug 603: "chown :root thingy" should work now. 2006-01-09 03:45:43 +00:00
Rob Landley e569553aa0 Bug 547: writing out the tar file header before we confirm we can actually
open and read from the file isn't something we can recover from after the
fact.  Resequence things to check first, write second.
2006-01-09 03:07:44 +00:00
Rob Landley 3d1bbf0a5f Minor cosmetic fix from Tito. 2006-01-09 01:07:24 +00:00
Rob Landley 8bcc6e964b Why we didn't take a watchdog.c suggestion this time 'round, in case anybody
comes up with a fix...
2006-01-09 00:54:46 +00:00
Mike Frysinger e87ae0bd4f declare const for fun 2006-01-08 11:15:53 +00:00
Mike Frysinger e885d5300a Tito writes:
Somehow while applying the bb_do_delay patch a change slipped
in libbb.h that broke compilation.

libbb.h Line 355 
  extern char bb_path_mtab_file[];

This conflicts with mtab_file.c
#if defined(CONFIG_FEATURE_MTAB_SUPPORT)
const char bb_path_mtab_file[] = "/etc/mtab";
#else
const char bb_path_mtab_file[] = "/proc/mounts";
#endif
2006-01-08 11:15:34 +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 251161f75c Bug 624 wants quoted char support for printf, so you can do something like:
printf '%d\n' '"x"'
and have it print out 120.  This is the smallest implementation I can think
of at the moment.
2006-01-06 20:28:05 +00:00
Rob Landley f8ec1b51f3 No, we _want_ the suid and sgid bits reverted by chown, for security reasons.
They mean something different when the user they're switching to is different,
so if you still want suid you reset it afterwards.  This is a safety feature.
2006-01-06 18:22:05 +00:00
Bernhard Reutner-Fischer c00411a16a - better wording 2006-01-04 13:35:09 +00:00
Mike Frysinger 5990efb795 use MAP_PRIVATE instead of MAP_SHARED for uClinux systems (see Bug 550) 2006-01-04 07:31:19 +00:00
Mike Frysinger b92405552f Jason Schoon writes:
Here is a patch for kill that I posted long ago, but forgot about
until today.  This allows kill to specify a negative process/group
(such as -1).  The shell already had this fix applied by Vodz some
time ago.
2006-01-04 00:13:22 +00:00
Mike Frysinger f982d86ba7 import nios2 support from microtronix 2006-01-04 00:11:26 +00:00
Mike Frysinger 29ed59ee11 make mount usage a bit more terse 2006-01-04 00:04:08 +00:00
Mike Frysinger 705fad2964 just use bb_xfopen() 2006-01-03 23:59:17 +00:00
Mike Frysinger bb12d6f728 fix comment documentation 2006-01-03 23:59:01 +00:00
Bernhard Reutner-Fischer 823f80f5ad - silence warning about unused param
needs revisit later on like many others to use ATTRIBUTE_UNUSED from platform.h
2005-12-29 21:17:05 +00:00
Bernhard Reutner-Fischer f00680eb59 - use HOSTCC instead of a hardcoded cc 2005-12-29 16:53:47 +00:00
"Vladimir N. Oleynik" 0bf67e849a remove buffer overflow by Erik and decodeString problem by Glenn, add error check of decodeString as Apache 2005-12-26 17:26:59 +00:00
Rob Landley ce88793698 When you went "losetup -d /dev/loop0 /dev/loop1" the error message was strange. 2005-12-21 17:00:25 +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 beb665a376 Second attempt to simplify the login menu. Shadow password stuff at the top,
with no dependencies (since depending on 9 of the 13 apps in the menu gets
a bit silly).  And fix my attempt to make internal shadow password support
automatically depend on internal password support plus shadow password
support.
2005-12-21 16:33:41 +00:00
Bernhard Reutner-Fischer 17329745fc - fix check for group and user, remove some whitespace while at it. 2005-12-21 15:07:30 +00:00
Rob Landley 5d84c2398e Fix chroot, leave console alone if -c not specified, and yank debug code.
(I still haven't set up a test environment to confirm this works...)
2005-12-20 17:25:51 +00:00
Rob Landley 7b363fd3c9 Some minor cleanups/bugfixes split off from the big remount work:
Shorten GPL boilerplate.
  Enabling FEATURE_CLEAN_UP broke things in two places.
  Move the NFS with uClibc check to nfsmount.c
2005-12-20 17:18:01 +00:00
Rob Landley b9620414c1 Shadow password support went beyond the dependency event horizon, just make
it an independent menu.  And make internal shadow password support a subset
of the other internal password function support.
2005-12-20 15:25:25 +00:00
Rob Landley 6a24976ceb Actually, static buffers look like _this_... 2005-12-20 15:23:20 +00:00
"Vladimir N. Oleynik" 6b903a2d8a remove debug feature for production 2005-12-20 11:02:54 +00:00
Rob Landley 9a1e25d994 Make a few warnings go away. 2005-12-19 16:30:33 +00:00
Rob Landley c90c8b50e4 Do an svn log -v, the information in this changelog is stunningly
obsolete.
2005-12-19 16:29:19 +00:00
Rob Landley b3f05a467a Shadow password support involves vlock too. 2005-12-19 02:52:48 +00:00
Rob Landley 68eb9dd371 Patch from Tito to make vlock much smaller. 2005-12-19 02:50:10 +00:00
Rob Landley 553d83d427 strncmp isn't automatically superior to strcmp. Especially when it isn't
used right.
2005-12-18 20:34:41 +00:00
Rob Landley 9bdd742dd2 Sigh. Left the debug path in. Fixed. 2005-12-17 10:54:17 +00:00
Rob Landley b56c285da5 Added /etc/mdev.conf support. Adds about 1.9k to mdev. 2005-12-17 10:52:30 +00:00
Rob Landley 1a78103306 Bug 601: When we fork an archiver and feed stuff to it through a pipe, if
we don't close the pipe the child process won't exit, and we'll hang in
waitpid().
2005-12-16 21:33:10 +00:00
Rob Landley ef1f7b5058 Ahem. Vladimir checked in a different fix bug didn't close out the bug.
Reverting...
2005-12-16 08:03:34 +00:00
Rob Landley 4b91b88fcb Less would segfault if it had no tty. (Bug 600.) 2005-12-16 08:02:11 +00:00
Rob Landley 199501f2a0 I screwed up the last commit: if dt is null when ENABLE_MULTIPLE_OPTIONS is
off, we'd dereference the null.  Oops.
2005-12-16 06:18:06 +00:00
Rob Landley a930bd3332 Stephane Billiart said:
the attached patch makes applet list in busybox.links
correctly include tr and watchdog.
Currently, they don't appear because they are prefixed
with ENABLE_ in include/applets.h
2005-12-16 06:12:46 +00:00
"Vladimir N. Oleynik" ddc280ec43 sync license from mainstream 2005-12-15 12:01:49 +00:00
"Vladimir N. Oleynik" 8315cd527f fopen(TTY...) to bb_xfopen(), close bug 600 2005-12-15 11:53:22 +00:00
Bernhard Reutner-Fischer 9a14bd04f8 - Stephane Billiart writes:
Fix the compilation of head and tail.

  thanks!
2005-12-15 11:47:16 +00:00
Bernhard Reutner-Fischer 73bffd4d96 - remove duplicate entry for switch_root 2005-12-15 11:44:31 +00:00
Rob Landley 42eddbafe7 Add a fflush(stdout). 2005-12-15 08:04:17 +00:00
Rob Landley ae50c6d8ee Better use of the ENABLE guards. 2005-12-15 07:42:13 +00:00
Rob Landley e0c418e13b The rest of Yann E. Morin's install revamp. 2005-12-15 07:25:54 +00:00
Rob Landley 164c5c80ba Eliminate unnecessary allocation from md5sum that was leaked without ever being used. 2005-12-15 06:51:52 +00:00
Rob Landley 5aabf4e415 Fix -g and -p options. Patch from Traceman. (I don't know who that is,
it's the darn bug generator again.)
2005-12-15 05:42:55 +00:00
Rob Landley 483027f166 Patch from dlively (whoever that is, see bug 591) to fix
"ip link set <dev> addr".
2005-12-15 05:29:48 +00:00
Bernhard Reutner-Fischer d42ef28b98 - several functions depend on IPv4 or IPv6 od IPX support.
removes warning about unused code for allbareconfig.
2005-12-14 14:13:15 +00:00
Bernhard Reutner-Fischer 17d355cb3c - remove warning (thanks Yann E. MORIN) and switch to ENABLE_
- typo: s/begining/beginning/g
2005-12-14 08:32:44 +00:00
"Vladimir N. Oleynik" e6d88ea2a1 remove sigsetmask, noticed by Bernhard 2005-12-13 13:24:23 +00:00
Bernhard Reutner-Fischer e0b8778506 - check if CC supports -funsigned-char
- add CC_MAJOR and CC_MINOR variables. (gcc centric for now)
2005-12-13 11:52:46 +00:00
Bernhard Reutner-Fischer 5816ccb190 - wrap label GET_COUNT in #if ENABLE_FEATURE_FANCY_applet to avoid warning
about unused label.
2005-12-13 10:48:45 +00:00
Bernhard Reutner-Fischer ec351c32e3 - do away with superfluous keyword. 2005-12-13 10:28:25 +00:00
"Vladimir N. Oleynik" 4a9d6d1fe9 remove strange bloat dup2() usage, sync this code with mainstream login-utils, size reduce 2005-12-13 08:44:41 +00:00
Rob Landley 70f7ef7be3 Nothing to see here. Move along.
Not buying it, eh?

I know I said new features before 1.1, but, well...  (I was weak!)

The config file and hotplug modes aren't implemented yet.  Might take a stab at
those tomorrow.  (I _should_ go back to focusing on the bug triage list.)
2005-12-13 08:21:33 +00:00
Rob Landley 3858bf18d5 Minor fix: if(CONFIG) breaks the build when that CONFIG is disabled, it has
to be if(ENABLE).  (Make allbareconfig is a good testing thing.)
2005-12-13 04:06:22 +00:00
Rob Landley e919096271 Patch from Yann E. Morin, something to do with bugs 276 and 272. 2005-12-12 19:38:44 +00:00
Bernhard Reutner-Fischer 126da9ec2d - typo: s/sucess/success/g
What's up with loginutils/su.c line 42: "SYSLOG_SUCESS" ? Please have a look..
2005-12-12 11:20:39 +00:00
Bernhard Reutner-Fischer b7d5342003 - fix zcip for IMA compile mode.
rename usage() to zcip_usage, make struct arp_packet static. This applet is
  not ISO C89 compatible due to the use of C99-style comments ("c++ comments).
2005-12-12 10:21:35 +00:00
Rob Landley 10fb2b71f3 Flush output to log promptly (bug 389). 2005-12-12 07:04:59 +00:00
Rob Landley e422af6bcb Flush input when prompting for a password (bug 373). 2005-12-12 07:02:15 +00:00
Rob Landley a75c180e53 Bug 310: be consistent about stat/lstat and chown/lchown to avoid accidentally
modifying permissions or ownership when twiddling symlinks.
2005-12-12 06:58:53 +00:00
Rob Landley 032e2cbf20 Uninitialized variable causing intermittent syntax errors (bug 449). 2005-12-12 06:52:45 +00:00
Rob Landley cdbae77823 printf() arguments shouldn't be passed straight from user supplied data.
(Security thingy.)
2005-12-12 06:49:33 +00:00
Rob Landley 37310ea057 Change CONFIG_MODPROBE_MULTIPOLE_OPTIONS to
CONFIG_FEATURE_MODPROBE_MULTIPLE_OPTIONS.
2005-12-12 04:28:17 +00:00
Rob Landley 762bb626c7 Patch from Yann E. Morin to reorganize module config options. 2005-12-11 20:20:05 +00:00
Rob Landley 999af20d3e Make insmod quiet by default (patch from Yann E. Morin). 2005-12-11 20:14:12 +00:00
Rob Landley 9c32a15220 Yann E. Morin's update to modprobe usage. 2005-12-11 20:12:24 +00:00
Rob Landley 82327f4be4 Patch from Yann E. Morin to make rmmod report failure properly. 2005-12-11 19:46:50 +00:00
Glenn L McGrath 0bd0257fe0 Add build options to control SuS compatability, allows numeric
option handling to be disabled.
Defaults to enabled, so no changes in default behaviour
2005-12-11 03:09:05 +00:00
Bernhard Reutner-Fischer d77b781c1f - remove unused variable have_read_stdin
- use FLAG_WIDTH
2005-12-10 20:13:54 +00:00
Paul Fox 377bdaff3b avoid mixed declarations, to support older compilers just a little longer. 2005-12-08 18:48:20 +00:00
Rob Landley cc59aae65f Macro was wrong, name(void) vs name(x), and apparently gcc 2.95 cares about
matching up macro arguments even when the macro substitutes to nothing...
2005-12-07 23:17:28 +00:00
Rob Landley 07fffc5add uClibc can't handle anonymous MAP_SHARED. Since we're treating it as
read only data anyway, MAP_PRIVATE shouldn't make a major difference.
2005-12-07 22:45:28 +00:00
Rob Landley 02bab6869e Tito is using broken kernel headers that pollute the namespace with every
CONFIG_ symbol in the kernel, and this clashes with busybox's CONFIG_TR
and CONFIG_WATCHDOG, causing applets.h to barf if they're not switched
on (since the broken headers don't affect kconfig or the makefiles).

Since such broken kernel headers are common enough to crop up every few
months, a simple work around is to move TR and WATCHDOG from CONFIG_
to ENABLE_ early.
2005-12-06 22:48:29 +00:00
"Vladimir N. Oleynik" a62b0e7459 reduce 3 warning if compile with -W 2005-12-06 12:20:57 +00:00
"Vladimir N. Oleynik" 2f0a5f947a restore compare_string_array new interface (make broken by landley) 2005-12-06 12:00:39 +00:00
Rob Landley d4f15e95d6 Install links patch from Yann E. Morin. (Another thing hanging around in my
tree forever.  Tweaked the docs a bit.)
2005-12-02 18:27:39 +00:00
Rob Landley d1569c215c If we really _need_ an #ifdef like this, then we should be using the libbb
getopt infrastructure instead.
2005-12-02 17:57:23 +00:00
Rob Landley 746cfc8bf0 Another cleanup patch that's been in my tree for a while. Again I think it's
originally from Bernhard Fischer...
2005-12-02 17:55:45 +00:00
Rob Landley b5ca9e0c4e A cleanup patch I've had lying around in my tree for a while, I think it
was from Bernhard Fischer?
2005-12-02 17:54:01 +00:00
"Vladimir N. Oleynik" bf968f71f1 reduce signedness warning 2005-12-02 10:10:28 +00:00
"Vladimir N. Oleynik" a972c870a8 reduce signedness warning 2005-12-02 10:06:04 +00:00
"Vladimir N. Oleynik" 27d42a08c8 remove warnings if compile with -W, use ENABLE_FEATURE vs CONFIG_FEATURE 2005-12-02 09:46:04 +00:00
Rob Landley 4a070d1460 Make char default to "unsigned" on all platforms so we have a consistent base
to deal with all the new gcc 4.0.2 warnings from.
2005-12-01 17:01:43 +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" 70678bc5b6 getopt -> getopt_ulflags. noticed by Rob Sullivan 2005-11-29 12:32:33 +00:00
Mike Frysinger 5a5d0fa044 update license 2005-11-29 02:53:52 +00:00
Mike Frysinger 004ad11337 ShaneAnderson writes in Bug 565:
need to include .config file before setting CROSS otherwise
TARGET_ARCH isnt set properly
2005-11-29 02:52:25 +00:00
Paul Fox 969af89797 add "-C" format to hexdump
fixes bug #113 and satisfies a personal need at the same time.

output compares identically to util-linux version.  (with
exception of whitespace differences on last lines of output with
non-uniform length, which are neither fixed nor worsened by this
change.)
2005-11-28 21:06:00 +00:00
Paul Fox d957b9537e fix bug #474:
0000474: vi crashes often

problem was that the buffer used for "." command ("last_modifying_cmd")
wasn't being maintined correctly -- the recording code was walking back
over the front of that buffer when a repeatable insert command
included backspacing (e.g. "i\b\b\bfoo").  the fix is to simply
record the backspaces along with the rest of the command.
    
also, cleaned up start_new_cmd_q() slightly.
2005-11-28 18:07:53 +00:00
Paul Fox 5a16a89427 eliminate mixed declaration, to support older compilers a little longer. 2005-11-28 16:29:45 +00:00
"Vladimir N. Oleynik" 8c44f0179d use libbb/get_kernel_revision(), reduce stack usage, add loses -w -f option for getopt, convert to bb_getopt_ulflags(), reduce memory usage - xmalloc to bb_common_bufsiz1, size reduce over 200 bytes 2005-11-28 15:54:22 +00:00
Rob Landley 52219874fe Patch from Cristian Ionescu-Idbohrn to deal with _ vs - better. 2005-11-27 19:01:53 +00:00
"Vladimir N. Oleynik" 350865e339 remove bug: fsck do not know path 2005-11-26 11:01:23 +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
"Vladimir N. Oleynik" 65bb10f253 reduce bss 2005-11-24 12:10:13 +00:00
Rob Landley fe25715792 Update to modprobe usage from Yann E. Morin 2005-11-23 04:55:02 +00:00
Rob Landley c819ca98ee Can't store a pointer in an int on 64 bit platforms. 2005-11-22 17:09:14 +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 fae1dc8620 Support # comments after s/// option list. 2005-11-20 07:44:35 +00:00
Mike Frysinger 4ee2eee2fc Quote the user we pass to addgroup so funky chars are preserved. Fix by dragan_marinkovic in Bug 544 2005-11-15 05:53:00 +00:00
Rob Landley 79e1cab0d1 Yann Morin's modprobe multiple options patch. There's more work to be done,
but let's ship 1.1 first...
2005-11-15 00:08:29 +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 5412843e79 I noticed that "tar tvjf file.tbz" was segfaulting. This fixed it. 2005-11-12 02:54:06 +00:00
Rob Landley 64a5f96780 telnetd -b (bind to specific address) support from Iuri Gomes Diniz. 2005-11-10 22:37:40 +00:00
Rob Landley 990025a7d9 Ok, I've converted the contents of the "testing/sed" directory into a
sed.tests file.  My brain hurts now.  (Lots of boggling at sed minutiae and 
corner cases and going "why is gnu giving that output".  The behavior of N 
and n with regard to EOF are only understandable if you read the Open Group 
spec, not if you read the sed info page, by the way...)

Some of the existing sed tests are just nuts.  For example, sed-next-line is 
testing for our behavior (which is wrong), and would fail if run against gnu 
sed (which was getting it right.  Again, this was a spec-boggling moment, 
with much head scratching.  I've got to add a debug mode where the stuff 
output by the p command is a different color from the stuff output by normal 
end of script printing (when not suppressed by -n).)

As for sed-handles-unsatisifed-backrefs: what is this test trying to _do_?  I 
ran it against gnu sed and got an error message, and this behavior sounds 
perfectly reasonable.  (It _is_ an unsatisfied backref.)  The fact we 
currently ignore this case (and treat \1 as an empty string) isn't really 
behavior we should have a test depend on for success.

The remaining one is sed-aic-commands, which is long and complicated.  I'm
trying to figure out if I should chop this into a number of smaller tests, or
if having one big "does-many-things" test is a good idea.

In any case, the _next_ step is to go through the Open Group standard and
make tests for every case not yet covered.  (And there are plenty.  There
are few comments in the file already.)  Plus I have notes about corner
cases from development that I need to collate and put into here.  This file
is maybe the first 1/3 of a truly comprehensive sed test.

Rob
2005-11-10 06:26:40 +00:00
"Vladimir N. Oleynik" ecfd1f6a35 change osbolete sigpause() to sigsuspend() 2005-11-09 09:19:29 +00:00
Rob Landley 6f03722448 Patch from Tomasz Mateja: don't try to CWD to a _filename_, just send the full
path to the STOR command.
2005-11-08 00:52:31 +00:00
Rob Landley c98a359a16 It was a bit out of date. 2005-11-07 09:06:34 +00:00
Rob Landley 48c6157eb9 Fix the test suite so that individual *.tests files can be run ala
COMMAND=sort ./sort.tests
So we can compare against non-busybox versions, and possibly our testsuite
will be useful to somebody like the Linux Test Project someday.

Redid testing.sh to add new command, "optional", to skip tests that require
certain features.  (use: `optional FEATURE_SORT_BIG`, or `optional ""` to
stop skipping.)  Note that optional is a NOP if the environment variable
"OPTIONFLAGS" is blank, so although we're marking up the tests with busybox
specific knowledge, it doesn't interfere with running the tests without
busybox.

Moved setting the "OPTIONFLAGS" environment variable to runtest.  Philosophy:
busybox-specific stuff belongs in runtest; both testing.sh and the tests
themselves should be as busybox-agnostic as possible.

Moved detecting that a command isn't in busybox at all (hence skipping the
entire command.tests file) to runtests.  Rationale: optional can't currently
test for more than one feature at a time, so if we clear anything with
optional "" we might perform tests we don't want to.

Marked up busybox.tests to know which tests need CAT enabled.  Fixed up other
tests to be happy with new notation.

I suspect egrep should be appended to grep.  It's a sub-feature, really...
2005-11-07 08:50:53 +00:00
Rob Landley 7ad4b30ed4 Yann E. Morin pointed out that rpcsvc/nfs_prot.h isn't needed with any
reasonably recent glibc, and breaks with uClibc.  So yank it.
2005-11-06 23:37:47 +00:00
Rob Landley 7b7c99ca33 Size I zapped the bb_close() error, might as well make a TODO item. 2005-11-04 20:45:54 +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 c2ce2c5b4b It's no longer a temporary location. Smooth out the text a bit. 2005-11-04 00:50:48 +00:00
Eric Andersen fc94638330 point to the official links 2005-11-03 23:32:14 +00:00
Rob Landley 3d283ddecd Announce 1.1.0-pre1 already. Erik, please move links to the downloads directory
once you've got the signed tarballs up.
2005-11-03 22:11:00 +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 dbc608b568 We've got fuser, fix some typos, and move Vodz's comment about UTF8 into
a new "internationalization" section, with some related concerns.
2005-10-31 23:52:02 +00:00
Rob Landley c63fe9137f \0 is a synonym for &. Our own "make allbaseconfig" breaks without this. 2005-10-30 10:08:13 +00:00
Mike Frysinger 7790cd5fad add ZyXEL to the shame list 2005-10-29 08:14:34 +00:00
Mike Frysinger d505e3ee67 fix <p> and <a> tags 2005-10-29 08:03:54 +00:00
Mike Frysinger 46b77c203e update doctype and add a charset encoding 2005-10-29 07:57:51 +00:00
Bernhard Reutner-Fischer 62d7acc97e - add BB_APPLET_RUNLEVEL used by emdebian via /etc/init.d/rc.
Note that we leave the buggy CONFIG_* namespace now, so please fix any applet you thouch.
2005-10-28 20:37:03 +00:00
"Vladimir N. Oleynik" 4922f2a06f update 2005-10-28 16:17:09 +00:00
"Vladimir N. Oleynik" 7eb8e45348 Please don't use if(asprintf(&t)<0) free(t); Use concat_subpath_file() for scan dir. Added losed chdir(".."). Removed warnings for 64-bit inode size. Why use memcpy and do not let? Very strange code for me 2005-10-28 16:08:47 +00:00
"Vladimir N. Oleynik" ea97282af1 bb_opt_complementally for rdate applet. Add losed record to util-linux/Makefile.in for switch_root applet 2005-10-28 15:43:41 +00:00
Rob Landley aa87276bed New applet, fuser, from Tony J. White. (Needs some cleanup.) 2005-10-28 13:05:12 +00:00
Bernhard Reutner-Fischer 30c7de068b - move GETXXKEY_R_FUNC into an internal helper file to allow for compiling
with IMA.
2005-10-28 11:21:40 +00:00
Bernhard Reutner-Fischer 6973abcfa8 - remove warning about "'static' is not at beginning of declaration". 2005-10-28 09:45:07 +00:00
Rob Landley 1b751c894b Rob Sullivan sent in some cleanups, which I beat on slightly. 2005-10-28 09:24:33 +00:00
Rob Landley 0f34a821ab Add a switch_root utility (like kconfig's utils/run_init.c, although not
actuall using any of that code).  This is needed because pivot_root doesn't
work right under initramfs.  (See the menuconfig help.)
2005-10-27 22:55:50 +00:00
Rob Landley 2454ebd85d Somebody suggested this, but I've forgotten who. 2005-10-27 22:50:04 +00:00
Rob Landley f3d6c94c7f Add --no-same-owner and --no-same-permissions options to tar. 2005-10-27 22:49:08 +00:00
Bernhard Reutner-Fischer 47ea7b7f96 - Matthias Wenzel writes:
without the fix below md5sum will always report a correct md5 on _any_
wrongly formattet input files.
- use short boilerplate and remove superfluous keyword extern.
2005-10-27 14:43:27 +00:00
Bernhard Reutner-Fischer ee9cf48620 - correct boilerplate
- use bb_xgetlarg for the patch_level to catch invalid arguments.
2005-10-27 06:59:05 +00:00
Rob Landley c9c959cc7c Reference for new patch feature we'll need to be compatible with... 2005-10-27 00:57:50 +00:00
Bernhard Reutner-Fischer ab1878245c * uniq.c: remove unneeded include and use short boilerplate.
* coreutils.h: remove prototype of non-existing xgetoptfile_sort_uniq
	and add boilerplate.
	* networking/{ipaddr,ip,iplink,iproute,iptunnel}.c: touch includes
	and use short boilerplate.
	* libiproute/iproute.c: rename round to avoid clashes with older
	SuSE gcc and use short boilerplate.
2005-10-26 10:47:26 +00:00
Rob Landley c58fd15db5 Update the TODO list to reflect stuff we've already done. 2005-10-25 20:22:50 +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
Rob Landley 2d5d88ebc0 Two changes. One from Shaun Jackman makes libbb/interface.c compile only if
it's going to be used.  (I'm guessing it doesn't work with newlib.)

The other one is from me: allyesconfig shouldn't enable devfs because that
changes all sorts of unrelated stuff (like /dev/loop0->dev/loop/0), which
can come as a bit of a surprise.  (It's still there, but you have to go into
menuconfig and select it manually.)
2005-10-25 02:19:55 +00:00
Bernhard Reutner-Fischer 38d6615ed2 - fix bug to avoid aliasing busybox' main to zcip_main in IMA mode. 2005-10-21 10:43:11 +00:00
"Vladimir N. Oleynik" 1f0262bcdb another more const 2005-10-20 11:17:48 +00:00
"Vladimir N. Oleynik" 0fa9deda17 more const 2005-10-20 09:48:28 +00:00
"Vladimir N. Oleynik" 5cf9a03b3f more const, attribute_noreturn saved 200 bytes 2005-10-19 09:21:51 +00:00
Bernhard Reutner-Fischer bb20462cb3 - consume space between functionname and opening brackets
Fixes Rob's issue using busybox awk for building gcc-4_0 optionlist (http://busybox.net/lists/busybox/2005-October/016659.html)
2005-10-17 14:21:06 +00:00
"Vladimir N. Oleynik" 86ac072b44 more const, use bb_getopt_ulflags, insert XXX for show place of problems 2005-10-17 10:47:19 +00:00
"Vladimir N. Oleynik" 485d7cbdf1 data --> text 2005-10-17 09:48:57 +00:00
Rob Landley a4d45d423f The fact "tar tvjf thing.tbz" didn't work was due to the "-1" in -r11859,
which was apparently never tested.  That meant that there always had
to be at least one unparsed argument left over, which is not the case for
tar.
2005-10-16 08:42:18 +00:00
Rob Landley 60fe7bfa41 Whitespace and curly bracket cleanup (our tabstop is 4 in busybox),
and switch more stuff from CONFIG to ENABLE.
2005-10-16 03:54:49 +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
"Vladimir N. Oleynik" c961a44e0b more const, all data to text 2005-10-15 14:41:08 +00:00
"Vladimir N. Oleynik" d3d829aaf0 20 bytes data to bss 2005-10-15 14:24:01 +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" b4b6d26287 data --> code 2005-10-15 14:10:36 +00:00
"Vladimir N. Oleynik" 1f2dc40ede data --> bss 2005-10-15 13:56:17 +00:00
"Vladimir N. Oleynik" b32b1db9d8 complex RESERVE_CONFIG_BUFFER --> bb_common_bufsiz1 2005-10-15 13:49:21 +00:00
"Vladimir N. Oleynik" a2eec6051f RESERVE_CONFIG_BUFFER --> bb_common_bufsiz1 2005-10-15 13:45:32 +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" 84e7511607 llist must initialize, add loses ifdef, small indent correction 2005-10-15 06:32:38 +00:00
Rob Landley 3ee6c24ea2 Add --exclude option (to make uClibc-0.9.28 headers install using busybox tar).
I have no idea how to apply bb_getopt_complementally to a --longopt that
has no short option.  The documentation from vodz has a bad case of
babelfish poisoning, and I can't understand it.  It sort of seems to
suggest there is a way, but what it is I have no idea.  So I used \n as
the short option, which is fairly unlikely to be used for something else. :)
2005-10-15 03:06:21 +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
Bernhard Reutner-Fischer 8c7a7e6e63 - split VERSION into parts
- add some filesystem operation wrapper variables for use in the makefiles and
  pull them in early in the toplevel makefile
- use the cross-toolchain for "make sizes"
2005-10-13 10:40:18 +00:00
Bernhard Reutner-Fischer bb66a6c94e - initialize the correct variables 2005-10-13 10:24:44 +00:00
Bernhard Reutner-Fischer 309dc2d642 - typo in makefile variable: s/archvial/archival/ 2005-10-13 10:19:35 +00:00
Rob Landley 046d6e7a95 show_usage should use bb_default_error_retval. 2005-10-12 21:50:02 +00:00
Rob Landley e4164b5666 Did you know the uclibc IRC channel has daily logs on the web going back to
2002?
2005-10-12 19:10:34 +00:00
"Vladimir N. Oleynik" 368f66492e perror correction 2005-10-12 16:45:21 +00:00
"Vladimir N. Oleynik" d20cfbd303 create e2fs_set_sbin_path(), noticed by Tito, Thanks 2005-10-12 16:22:19 +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" 3ade65fc04 remove 1 CR, correct strange bb_opt_complementally, add #if 0 and XXX-comment: pleace examine this\! 2005-10-12 14:36:42 +00:00
"Vladimir N. Oleynik" 3ebb895218 make fsck.h as common, e2fsck: includes correct 2005-10-12 12:24:01 +00:00
"Vladimir N. Oleynik" ab57f76e13 more busyboxes, remove 1 extern function (mainstream also have for one fsck) 2005-10-12 12:11:42 +00:00
"Vladimir N. Oleynik" 1c275de6a2 more busyboxes 2005-10-12 11:38:09 +00:00
"Vladimir N. Oleynik" 87210b5f4b trivial generate exit code 2005-10-12 08:43:00 +00:00
"Vladimir N. Oleynik" ffe17b51b4 correct strange *3 isatty(0) code 2005-10-12 08:38:28 +00:00
"Vladimir N. Oleynik" f1ab127077 Prepend '-' to the first argument if required, more const, indent 2005-10-12 08:34:27 +00:00
"Vladimir N. Oleynik" f588869696 new featured bb_opt_complementally, correct argc checking 2005-10-12 08:17:29 +00:00
Rob Landley 161aae7273 There doesn't seem to be a standard header for makedev(), but this is close. 2005-10-11 20:17:30 +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
Bernhard Reutner-Fischer 554a9ff7ea - do not use bb_xgetularg10_bnd as a lower value of -1 doesn't work due to lowe
being unsigned.
- minor correction: use stdin only when no file was given via -i.
- use shorter boilerplate.
2005-10-10 13:34:19 +00:00
"Vladimir N. Oleynik" 54cb5c6af3 better check usage with options, correct show problem error message, indent 2005-10-10 12:17:33 +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
Rob Landley ff9f2f6fba Fluff out INSTALL a bit. 2005-10-09 20:18:32 +00:00
Bernhard Reutner-Fischer 332fc1006c - remove passing PREFIX and CROSS to make which was added for bug #94.
My recent Makefile touch-up assures that make O=/tmp/o PREFIX=/tmp/i install
  works as expected without this ugly workaround.
2005-10-09 19:12:34 +00:00
Rob Landley d27d3be6cd The readme in 1.0 is more up to date than the 1.1 version... 2005-10-09 18:20:54 +00:00
Paul Fox 61e45dbb2f catch and report errors from file_write() 2005-10-09 14:43:22 +00:00
Paul Fox 90372ed51a make Hit_Return() available when CONFIG_FEATURE_VI_COLON is off. it's
needed elsewhere as well now.
2005-10-09 14:26:26 +00:00
Rob Landley ae907f38f0 When lstat returns an error (such as file not found), the value of
st_mode is random garbage (under uClibc), leading to random triggering
of the S_ISDIR() case when the destination will be a normal file which
doesn't exist yet.  I.E. checking the return value of lstat is not optional.
2005-10-09 11:16:01 +00:00
Rob Landley f1048143ee Rob Sullivan added character and equivalence classes to tr. I changed some
comments.
2005-10-08 21:21:08 +00:00
Bernhard Reutner-Fischer 1d62d3b7b9 - make libiproute compile.. 2005-10-08 20:47:15 +00:00
Rob Landley 4a7252babd Rename CONFIG_NFSMOUNT to CONFIG_FEATURE_MOUNT_NFS so allbaseconfig can
find it (and tweak defconfig to catch up).
2005-10-08 18:49:45 +00:00
Rob Landley 45ad0e87d6 Rename CONFIG_SORT_BIG to CONFIG_FEATURE_SORT_BIG so allbareconfig can find it. 2005-10-08 17:48:25 +00:00
Rob Landley 1ba19d6bf7 Coprolith polishing time: Tito switched devfsd over from CONFIG_ to ENABLE_. 2005-10-08 17:42:35 +00:00
Bernhard Reutner-Fischer be5c10314d - rename bareconfig to allbareconfig and emit "is not set" strings needed for
oldconfig.
2005-10-08 11:08:28 +00:00
Rob Landley 25413bfe00 Shaun Jackman pointed out that fgets_unlocked() and friends are gnu extensions
not in newlib, and also that all the _unlocked variants are kind of pointless
in this context.
2005-10-08 02:23:22 +00:00
Bernhard Reutner-Fischer a9d8913bc7 - add config target bareconfig. Enables all applets but without any features.
Rob wanted to have regression tests if a bug crops up. Here you are wrt find :)
2005-10-07 18:45:03 +00:00
Bernhard Reutner-Fischer b8faa7ea60 - Note that directories for make have to be given as absolute paths. 2005-10-07 17:44:14 +00:00
"Vladimir N. Oleynik" dfd1eb0387 trim dep lines 2005-10-07 15:53:21 +00:00
Bernhard Reutner-Fischer ab52db8d5e - size reduction of pidof
- fix typo in reverse_pidlist
2005-10-07 15:44:37 +00:00
"Vladimir N. Oleynik" 6c0642d772 fast replace if src outside 2005-10-07 15:36:26 +00:00
Bernhard Reutner-Fischer 0b42a6a8cf - remove superfluous C statements ";;" in decompress_unzip.c, dpkg_deb.c ifconfig.c
- gzip.c: see if O_NOFOLLOW is defined before using it, else take alternate path
closes bug #221 (partially; The rest will follow later).
2005-10-07 11:34:50 +00:00
Bernhard Reutner-Fischer 4d63525f76 - fix bug #94: 'make install' does not respect PREFIX nor CROSS when using O=
- other minor cosmetic tweaks while at it
2005-10-07 10:53:15 +00:00
Rob Landley cee605c525 The supposedly trivial CONFIG->ENABLE conversion wasn't so trivial. The
-exec feature shouldn't be tangled up with this, so revert everything but
the new exec feature for the moment.
2005-10-06 16:39:17 +00:00
Bernhard Reutner-Fischer 81c3a518d3 - pidof(8): make -s optional and optional -o; closes #168
first cut.
2005-10-06 15:37:02 +00:00
"Vladimir N. Oleynik" b31cb87fdc to bb_getopt_ulflags() 2005-10-06 15:30:17 +00:00
"Vladimir N. Oleynik" ba248206fe change strange depend to libbb.h, but require busybox.h 2005-10-06 15:18:09 +00:00
"Vladimir N. Oleynik" 664c6e7ea0 update documentation 2005-10-06 14:53:43 +00:00
"Vladimir N. Oleynik" d5f2a18e19 bb_mkdep can use src outside now 2005-10-06 14:47:16 +00:00
Bernhard Reutner-Fischer 82338d8460 - add a few basic tests for pidof(8) 2005-10-06 12:50:11 +00:00
Bernhard Reutner-Fischer e34e8782a9 - support make check V=1 to run the checks in verbose mode
- pass verbose from runtest to testing.sh
2005-10-06 12:48:03 +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
Bernhard Reutner-Fischer 14b1c1da9a - remove explicit dependency of busybox.o and applets.o and usage.h from the
Makefile. Instead fix the invocation of bb_mkdep.
2005-10-05 14:52:21 +00:00
"Vladimir N. Oleynik" c06e80e1e7 more lost changes BSD signals -> SysV signals. Noticed by Bernhard 2005-10-05 14:14:55 +00:00
"Vladimir N. Oleynik" f382c0236e BSD signals -> SysV signals, int->socklet_t. Noticed by Bernhard 2005-10-05 14:01:13 +00:00
"Vladimir N. Oleynik" 4a5ce08688 another more correction for getopt_ulflags() documentation (examples) 2005-10-05 13:58:40 +00:00
Bernhard Reutner-Fischer b48bfe795e - fix generation of .depend when building out of tree.
point bb_mkdep to the source directory and not the build-directory.
2005-10-05 13:55:45 +00:00
Bernhard Reutner-Fischer 83e1884d0c - busybox.o and applets.o depend on usage.h 2005-10-05 13:53:46 +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
Bernhard Reutner-Fischer 7abe709867 - Fix spurious rebuilds for (parallel) out-of-tree builds.
Make sure that the directories are order-only prerequisites. Otherwise we
  may have object files created after the timestamp of the directory was
  updated which would lead to spurious rebuilds (as some of the dentries
  may be older than the dir itself).
2005-10-05 10:06:11 +00:00
Bernhard Reutner-Fischer 5c071bcf2f - fix building out-of-tree;
to test, checkout the source (let's assume /scratch/src/busybox), then
  mkdir /tmp/bb ; cd /tmp/bb
  make top_srcdir=/scratch/src/busybox O="$(pwd)" -f /scratch/src/busybox/Makefile allyesconfig check
- default to O=$(pwd) if no O was specified. Now you can just specify
  the top_srcdir (without O=/somewhere) to create the obj-tree in pwd.
- make "make configtarget buildtarget" work. Previously this didn't
  work due to how HAVE_DOT_CONFIG was evaluated. Two separate steps were
  needed before, e.g. make config ; make busybox.
- remove some unneeded variables from Rules.mak (BB_SRC_DIR from Mr.
  ldoolitt@recycle.lbl) which suggest that the stuff fixed above
  didn't work before.
- move selinux libraries to where they belong (from Makefile to Rules.mak)
- update the docs to mention svn instead of cvs and provide an example
  for building out-of-tree in INSTALL.
2005-10-05 07:40:46 +00:00
Mike Frysinger dc2510327b as Tito points out, e2fsck and fsck need more dependencies 2005-10-05 00:52:37 +00:00
Mike Frysinger 23fedb3ad4 dont typecast lvalue since gcc hates that 2005-10-05 00:50:03 +00:00
"Vladimir N. Oleynik" 9c44dce304 ps selinux logic correction, but do not tested too 2005-10-04 17:09:50 +00:00
"Vladimir N. Oleynik" be0ed3d0b9 use updated bb_getopt_ulflags() for ps applet 2005-10-04 16:48:26 +00:00
Bernhard Reutner-Fischer 6d6a40cc4b - add option 'w' to ps (wide output, optional feature defaults to off).
- move to ENABLE_ and use shorter boilerplate.

sizes without selinux-support:
   text	   data	    bss	    dec	    hex	filename
    356	      0	      0	    356	    164	procps/ps.o.with-w
    300	      0	      0	    300	    12c	procps/ps.o.no-w
    302	      0	      0	    302	    12e	procps/ps.o.oorig
2005-10-04 14:31:18 +00:00
Bernhard Reutner-Fischer 5209e18ba7 - add prototype for llist_add_to_end to libbb.h 2005-10-04 13:39:06 +00:00
Rob Landley 5d3a0e8ed3 Add find -exec support from Rob Sullivan, and convert CONFIG_ to ENABLE_
while we're in the area.
2005-10-04 03:34:39 +00:00
"Vladimir N. Oleynik" d128b71820 speed up * 2 2005-10-03 10:08:46 +00:00
"Vladimir N. Oleynik" 1a2f4d9af7 sync inetd with slackware-10.2 inetd (OpenBSD-1.79), have destroy bug 455 2005-10-03 08:08:58 +00:00
Mike Frysinger 7f782da048 excellent shrinkage patch by Tito 2005-10-02 08:10:31 +00:00
Mike Frysinger 9134dff078 clean out unneeded E2FSCK variables 2005-10-02 08:09:50 +00:00
Mike Frysinger c31fcbbaf3 remove debug warning 2005-10-02 07:54:07 +00:00
Mike Frysinger cb1ce7b974 reorder arches into alphabetical order 2005-10-02 07:50:49 +00:00
Mike Frysinger fa17c4b949 fixup whitespace 2005-10-02 07:14:06 +00:00
Mike Frysinger 86a4bfb30a remove all Elf32 hardcodes to make sure the elf handling is 64bit clean 2005-10-02 07:02:16 +00:00
Mike Frysinger 91fbdac6ab svdavidson writes in Bug 459: add support for x86_64 relocations from modutils 2.4.27 2005-10-02 06:44:39 +00:00
Bernhard Reutner-Fischer e6d5539ebb typo 2005-09-30 09:46:27 +00:00
Bernhard Reutner-Fischer f24e0f5e6f - remove duplicate entry of resolve.c in BLKID_SRC
- use the sourcedir to look for includes rather than the builddir
2005-09-30 08:25:50 +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
"Vladimir N. Oleynik" 6a60c821a8 forgotten putenv 2005-09-29 15:53:34 +00:00
"Vladimir N. Oleynik" 8e1bd4a05b don't out \r to syslog 2005-09-29 12:55:21 +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" 3e245c9e21 getty must chdir(/). Use bb_getopt_ulflags. Indent. error() perfect 2005-09-29 11:31:26 +00:00
"Vladimir N. Oleynik" 6160d45e05 more busybox's style for fsck.c, size reduce 2005-09-29 09:45:22 +00:00
"Vladimir N. Oleynik" 74078685e6 busybox.c: ENABLE_LOCALE logic correct. 2005-09-29 08:19:04 +00:00
"Vladimir N. Oleynik" 843c5ef0f9 reorder include <sys/types.h> and <sys/types.h>. 2005-09-29 07:55:51 +00:00
"Vladimir N. Oleynik" 69d728be18 more const, inline, forward declaration usage, strip 20k source size ;-) 2005-09-28 15:16:22 +00:00
Mike Frysinger 747fc5d5fd allow people to adjtime location 2005-09-28 03:21:21 +00:00
"Vladimir N. Oleynik" 3978e5576e move e2fsck/* to e2fsck.c, one e2fsck_main and jornal exported, small automatic size reduction 2005-09-27 11:43:29 +00:00
Mike Frysinger 16ce8aa412 fix building w/out et headers and w/out debug 2005-09-27 04:21:48 +00:00
Mike Frysinger f87b3e30a7 as pointed out in Bug 17, use uint32_t instead of unsigned long since the code expects the size of the info variables to be 32bits and sizeof(long) on 64bit hosts is not 32bits 2005-09-27 04:16:22 +00:00
Mike Frysinger 67451849de pass EXTRA_CFLAGS to final link since it may contain things that affect linking (such as -m32) 2005-09-27 04:06:39 +00:00
Mike Frysinger de2b93859c eat misappropriated whitespace 2005-09-27 03:18:00 +00:00
Mike Frysinger 10a11e23ba uncuddle function scope brackets 2005-09-27 02:23:02 +00:00
Bernhard Reutner-Fischer 1c943eb88a - remove unused variable TOPDIR 2005-09-26 16:01:43 +00:00
Rob Landley d24eaac9e6 add "make help" 2005-09-26 15:49:41 +00:00
"Vladimir N. Oleynik" 7090800870 revert wait zombie, it have as linux-specific signal(SIG_CHLD,SIG_IGN) already, do not confuse me\! 2005-09-26 13:55:43 +00:00
"Vladimir N. Oleynik" 11d7c52912 correct set prompt if CONFIG_ASH_EXPAND_PRMT enabled, small automatic space->tabs convert by my personal editor 2005-09-26 13:24:45 +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 95544f78cb whitespace sucks 2005-09-25 05:23:58 +00:00
Mike Frysinger 7ad978045d fix building with debugging enabled #413 2005-09-25 05:18:04 +00:00
Mike Frysinger de242f6d5f this should fix parallel building with .depend/bb_config.h 2005-09-25 04:53:35 +00:00
Rob Landley 1ff789c567 Stop gcc4 from nit-picking about signedness of char *. 2005-09-25 03:12:26 +00:00
Mike Frysinger 3978abd05b Cristian Ionescu-Idbohrn writes to fix a warning: networking/ifconfig.c uses an uchar ptr to work with a char ptr so change the uchar to char 2005-09-24 23:52:09 +00:00
Mike Frysinger 036f299137 Cristian Ionescu-Idbohrn says: touchup whitespace/display 2005-09-24 23:50:14 +00:00
Mike Frysinger b7f88e01a4 touchup argc/argv handling to shrink a bit and fix a segfault when given wrong number of parameters as noted and fixed by Cristian Ionescu-Idbohrn 2005-09-24 23:48:18 +00:00
Mike Frysinger a630cb15b1 re-order a little for alphabetical 2005-09-24 23:15:53 +00:00
Mike Frysinger 7f8797c8ee re-order a little for alphabetical 2005-09-24 23:15:28 +00:00
Mike Frysinger f51d2069ff re-order a little for alphabetical 2005-09-24 23:14:11 +00:00
Mike Frysinger d1c8ae5dc9 re-order a little for alphabetical 2005-09-24 23:13:22 +00:00
Mike Frysinger 75aa1928ac re-order a little for alphabetical 2005-09-24 23:12:38 +00:00
Rob Landley 16722554bf Tito switched option parsing over to switch umount over to bb_getopt_ulflags(). 2005-09-24 22:41:08 +00:00
Mike Frysinger 5423df9ebc force nodebug by default 2005-09-24 07:20:59 +00:00
Mike Frysinger 62f18e1f20 use the shorter license header 2005-09-24 07:16:29 +00:00
Mike Frysinger 51a43b47fe import the very fat e2fsck/fsck applets 2005-09-24 07:11:16 +00:00
Mike Frysinger bfe773f471 make sure we include local header files 2005-09-24 07:10:37 +00:00
Mike Frysinger 016d6289a1 fix parallel building again 2005-09-24 06:15:23 +00:00
Mike Frysinger 0f8a63896e err, fix stupid mistake in previous do_findfs() change 2005-09-24 06:07:34 +00:00
Mike Frysinger 0d65565210 add a attribute_noreturn macro 2005-09-24 06:07:15 +00:00
Mike Frysinger 0d4ee68be5 use brief license line 2005-09-24 06:01:57 +00:00
Mike Frysinger 97b43a7999 fix broken whitespace and remove pointless mkdir 2005-09-24 05:58:39 +00:00
Mike Frysinger a1c6a57fea make e2label and findfs optional 2005-09-24 05:55:03 +00:00
Mike Frysinger 9ac178ab40 rename menu and touchup whitespace 2005-09-24 05:49:36 +00:00
Mike Frysinger ce0cf1d44b make test an alias for check 2005-09-24 05:47:52 +00:00
Mike Frysinger 3f91d7a9f6 cleanup option parsing 2005-09-24 00:52:58 +00:00
Bernhard Reutner-Fischer 30b17863bd - ifupdown needs run-parts. Thanks Derosnec for pointing this out. 2005-09-23 19:37:13 +00:00
Bernhard Reutner-Fischer 23bc647b35 - remove dangling symlinks after the runs
- check if the temporary directory containing the links exists rather
  than unconditionally creating it for every single applet.
2005-09-23 17:42:33 +00:00
Rob Landley 380ad123ac We've gotten enough questions that are related to building systems rather
than anything about busybox that I'm deeming it a FAQ, and answering it.

I gave a quick swipe to a couple of other slightly stale questions along
the way.  The busybox 1.01 README has much more detailed versions of these
answers, that should probably be propogated to the 1.1 line and perhaps bits
of it transplanted to the FAQ?  (Or just have the README visible on the
web page someplace?)
2005-09-23 16:52:09 +00:00
Bernhard Reutner-Fischer 1eb645d8d7 - set executable bit 2005-09-23 15:56:39 +00:00
Bernhard Reutner-Fischer b47a74f4e7 - introduce variable _BB_CONFIG_DEP to the new test harness.
This is used to see if given tests should be run (are available) or not.
  Print "UNTESTED: descr" if the applet or feature is not available.
- add _BB_CONFIG_DEP to existing new.tests
- move old grep test to new test infrastructure and add a few more test for
  grep.
2005-09-23 15:44:46 +00:00
Bernhard Reutner-Fischer 0a44c17771 - add missing descriptions of supported arguments 2005-09-23 15:40:15 +00:00
Bernhard Reutner-Fischer aaf0e23330 - replace variables by defines to save space
- rename string denoting stdin from "-" to "(standard input)" to match
  GNU grep.
2005-09-23 15:38:49 +00:00
"Vladimir N. Oleynik" bf4497406f SUSv3 -q compatibily exit status correction for grep again 2005-09-23 13:50:24 +00:00
"Vladimir N. Oleynik" c96b703ab0 SUSv3 -q compatibily exit status correction for grep 2005-09-23 13:44:03 +00:00
"Vladimir N. Oleynik" cf40d8175b grep must have exit code >1 if input file not found. Small indent correcion also. 2005-09-23 13:23:15 +00:00
"Vladimir N. Oleynik" b628409b1e more make safe the exported namespace for udhcp. Move to bb-specific file for reduce change into udhcp-CVS 2005-09-23 11:25:29 +00:00
"Vladimir N. Oleynik" 53ad366fe7 remove 1 exported 2005-09-23 10:44:02 +00:00
Paul Fox b6f71645f4 move a couple of functions from common code (options.c) to udhcpd private
code (files.c) to make udhcpc a little smaller.
2005-09-22 19:03:24 +00:00
Paul Fox 28de951b02 add support for setting the dhcp vendor class option (option 60).
udhcpc now has a -V (--vendorclass), which will replace the default
"udhcpRELEASE" string in this option.
2005-09-22 18:59:13 +00:00
"Vladimir N. Oleynik" 2f9c30a2d5 safe exported namespace for udhcp. Not full, bore :-( 2005-09-22 15:07:33 +00:00
"Vladimir N. Oleynik" ac9731704a Reduce exported from msh applet 2005-09-22 14:38:17 +00:00
"Vladimir N. Oleynik" 264e771b8b Reduce exported from lash applet 2005-09-22 14:35:29 +00:00
"Vladimir N. Oleynik" 19c370167a Reduce exported from hush applet 2005-09-22 14:33:15 +00:00
"Vladimir N. Oleynik" b8fa7e88f2 quick patch - have removed stranges for me 2005-09-22 14:19:34 +00:00
"Vladimir N. Oleynik" 1f0ac23c20 very small size reduce for nohup applet 2005-09-22 13:26:23 +00:00
"Vladimir N. Oleynik" 24cca8d958 Reduce exported from ipcs applet 2005-09-22 13:13:23 +00:00
"Vladimir N. Oleynik" e4baaa2d27 more remove lost exported 2005-09-22 12:59:26 +00:00
"Vladimir N. Oleynik" 007a011647 network "default" --> bb_INET_default. Reduce 2 exported from find applet 2005-09-22 11:11:11 +00:00
Bernhard Reutner-Fischer 9d7010ca86 - add applet nohup(1) 2005-09-21 18:25:05 +00:00
Bernhard Reutner-Fischer d4cffd1cc3 - make sure to include dmalloc.h at the very end of busybox.h or libbb.h. 2005-09-21 17:38:30 +00:00
"Vladimir N. Oleynik" cef737f038 moved include/bbconfigopts.h from miscutils to to top Makefile before generate .depend. Remove allyesconfig build problem, noticed by Bernhard Fischer 2005-09-21 07:49:34 +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
Bernhard Reutner-Fischer f912ebb740 - Remove unnecessary warning from libbb and move bb_wfopen_input near bb_wfopen 2005-09-20 20:58:11 +00:00
Bernhard Reutner-Fischer 6ab402ce27 - typo in documentation 2005-09-20 20:32:02 +00:00
Rob Landley 52d2f4bd90 Get "make check" ($srcdir) to work with the new testsuite. 2005-09-20 18:19:34 +00:00
Rob Landley 90252bb4c9 The testsuite/links directory wasn't being created. 2005-09-20 14:09:57 +00:00
"Vladimir N. Oleynik" 7fe6520e75 This is strange typically modern mistake. Learn please: stat(2) used sys/types.h and not reverse 2005-09-20 10:02:36 +00:00
Mike Frysinger 6d5aa4539a Bernhard Fischer writes:
Attachet patchlet updates the screenshot of busybox perusing the stable branch.
2005-09-20 03:01:29 +00:00
"Vladimir N. Oleynik" 8cbaa45030 remove duplicate depend, its work for bb_mkdepend 2005-09-19 16:31:25 +00:00
"Vladimir N. Oleynik" 2f01eb161a correct build bbconfig applet, correct previous change 2005-09-19 16:25:19 +00:00
"Vladimir N. Oleynik" 4a5d95d3fb corect build bbconfig applet, Thanks, Bernhard Fischer 2005-09-19 16:18:46 +00:00
"Vladimir N. Oleynik" 9bfb2fc922 hmm, forgoten remove llseek? 2005-09-19 14:25:55 +00:00
"Vladimir N. Oleynik" bc37480e9c 1) read from stdin work now
2) destroy segfault in number_process
3) removes dead code

complex patch my and Tito
2005-09-19 14:23:46 +00:00
"Vladimir N. Oleynik" b71e6024f9 mke2fs.c can compiled for me, more bb_xstrdup and bb_xasprintf usage, remove 1 exporing, ext2fs_llseek/blkid_llseek->llseek 2005-09-19 13:48:39 +00:00
"Vladimir N. Oleynik" 54deebf4e4 destroy bug #421 2005-09-19 10:46:44 +00:00
"Vladimir N. Oleynik" a0ae6de848 quick patchs: drop founded memory leak, more libbb, more C-compatibility, size reduction 2005-09-19 10:28:43 +00:00
"Vladimir N. Oleynik" 4cbe45934e small bug found after strength test 2005-09-19 10:26:45 +00:00
Mike Frysinger 9ed109429b Bernhard Fischer writes:
Attached patch moves bbconfig's entry in Config.in in the alphabetically
correct place.
2005-09-18 04:43:32 +00:00
Rob Landley d57ae8b796 First cleanup pass, from Rob Sullivan. More to be done... 2005-09-18 00:58:49 +00:00
Rob Landley 07e42dc056 Tito pointed out that if readlink doesn't have -f, there's no need to call
the option parsing code at all.
2005-09-17 11:13:25 +00:00
Rob Landley a882126fee Update TODO with mention of the CONFIG->ENABLE migration and ruminations
about FEATURE_CLEAN_UP.
2005-09-16 14:58:55 +00:00
"Vladimir N. Oleynik" af0dd596a8 speed up +10%, update (c), make CONFIG_FEATURE_MOD2_4 as config/feature/mod_2_4 2005-09-16 13:57:33 +00:00
"Vladimir N. Oleynik" 8d3c40d492 more C-compatibily, Thanks Bernhard Fischer 2005-09-16 13:16:01 +00:00
"Vladimir N. Oleynik" 38013e394f removed 'less' section from TODO 2005-09-16 13:03:21 +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
Paul Fox c350485b18 initialize a couple of vars whose warnings were suppressed because
i was building w/ debug on before, which suppresses optimization.
2005-09-16 12:48:18 +00:00
"Vladimir N. Oleynik" 2b306e906f small change for highlihting flags, more busyboxes: indent, forward declaration, paste BSS 2005-09-16 12:32:22 +00:00
Paul Fox 8552aec7fd some combinations of status line and screen refresh don't give a
correct screen, and bug 215 reports trouble with the status line
on small screens.

with this change a) the status line should always be refreshed
properly, b) the status line is a little shorter than it used to
be ("I" instead of "--INSERT--"), c) the status line will be
truncated if it doesn't fit on the screen, and d) if the screen
is too narrow for an error or transient status message (from
psb() or psbs()), then that message will be followed by a "Hit
Return" prompt.  (it wasn't until i did this last bit that the
size grew.  with this, these changes add about 150 bytes.)

- pgf
2005-09-16 12:20:05 +00:00
Mike Frysinger 2d5e4f6b05 accept unlimited number of swap arguments like the real swap{on,off} and shrink do_em_all a little 2005-09-16 04:41:20 +00:00
Mike Frysinger 0ec71bf4b8 update for newer build system 2005-09-16 04:21:25 +00:00
Rob Landley 9200e79d21 New applet "less", from Rob Sullivan. 2005-09-15 19:26:59 +00:00
Rob Landley bfd94c4331 Whitespace patch (and removal of gratuitous use of cat) by Berhnard Fischer. 2005-09-15 18:33:30 +00:00
Rob Landley 6a65d2f8cc Amir Shalem observed that telnetd doesn't really require login, so forcing
it is wrong.
2005-09-15 18:22:43 +00:00
Manuel Novoa III 84b93f7ef1 Get rid of warnings, remove compat with older gnu uniq to truly conform to susv3, and cut size a bit. 2005-09-15 08:06:42 +00:00
Mike Frysinger 86097b3f31 Bernhard Fischer:
[busybox][patch][janitorial] correct typo in news.html and make site html compliant
2005-09-15 01:37:36 +00:00
Mike Frysinger 887a1ad57f BsAtHome writes in Bug 433:
Ping packets sent by busybox have wrong endian on f.x. mips32 (openwrt). Attatched is a patch that 
uses htons() and ntohs() to be platform independent.
2005-09-15 01:32:48 +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" b4f3cff6f5 removed strange extern void xregcomp(... from some applets, but declared from libbb.h 2005-09-14 16:22:50 +00:00
"Vladimir N. Oleynik" 1e07f852e0 FEATURE->ENABLE_FEATURE loses one for 'top' applet 2005-09-14 16:08:06 +00:00
Rob Landley 2d2c868aab Patch from Berhnard Fischer to keep duplicate objects out of the library. 2005-09-14 15:41:18 +00:00
"Vladimir N. Oleynik" 0c520e03b9 remove unrequired dependences 2005-09-14 15:36:56 +00:00
Rob Landley 570f655ee4 Cleanup patch from tito: migrate option parsing to the bb_ functions and fix
types.
2005-09-14 15:36:52 +00:00
Rob Landley b7285001c9 Cleanup patch from Tito. 2005-09-14 15:28:15 +00:00
"Vladimir N. Oleynik" 7573ac6edf bb_mkdep version 2.0. speed up *2, remove problem of find e2fsprogs/uu*.h, spelling corrections by Bernhard Fischer 2005-09-14 15:09:06 +00:00
Rob Landley 2ee82723a8 Our config should write out each symbol once and only once, but still write
out all symbols in all sub-menus.  I think this finally does it right.
2005-09-14 14:40:01 +00:00
Rob Landley 1e51925684 Test full susv3 spec for uniq (except internationalization).
I think this covers it.  We fail two corner cases, both of which are explicit
violations of the spec, and both of which gnu passes.
2005-09-14 14:36:40 +00:00
Paul Fox db485cf7bc committing bug #7:
0000007: which and wd-located files
	     which doesn't search $PATH when there's a file in the WD with
	     the same name of the 'filename' parameter...
2005-09-14 14:08:38 +00:00
Mike Frysinger bc48ebd86a initial ppc64 support 2005-09-14 00:07:26 +00:00
Paul Fox f2de0b7ae4 allow either backspace or DEL, in addition to the user's erase
char, to be used in get_input_line()
2005-09-13 22:20:37 +00:00
"Vladimir N. Oleynik" 676e95ea3d bb_mkdep release. speed up *3, clearing, more comments 2005-09-13 16:50:53 +00:00
Mike Frysinger 6943a9489e whitespace/syntax cleanups, dont mind me :p 2005-09-13 02:29:39 +00:00
Mike Frysinger 68071e46b1 touch up usage for swap utils 2005-09-13 02:26:24 +00:00
Rob Landley bc3d4a175f Cleanup patch from Tito. 2005-09-13 01:30:19 +00:00
Eric Andersen 5d38f5ba89 sysctl was seriously broken. And since in some cases 'CONFIG_SYSCTL'
could be included into application space via the kernel config option
of the same name, nasty compilation problems could result.
2005-09-12 21:42:48 +00:00
Eric Andersen 2c6b41812f Kunihiko IMAI writes:
We're using busybox and thank the authors.

I found a short buffer allocation at busybox/sysklod/syslod.c.  It
mis-declares length of filenames, seems to forget for '\0' or two
column numbered suffix of backup files (ex. messages.10).

Here is a patch for the problem.

Thanks.
2005-09-12 19:16:11 +00:00
"Vladimir N. Oleynik" b1fe462116 bb_mkdep speed up * 10! 2005-09-12 16:39:47 +00:00
"Vladimir N. Oleynik" 5e60dc4a20 new my scripts/mm_mkdep, dependences work now 2005-09-12 12:33:27 +00:00
Rob Landley ba50217281 Clean up memory allocation. 2005-09-11 23:45:28 +00:00
Rob Landley a7e14db495 This combines a patch from Bernhard Fischer (moving the clean of
scripts/config from distclean to clean) with a sed consolidation that's
been in my tree for a bit, and switching the GPL boilerplate to just point
at LICENSE.
2005-09-11 01:16:47 +00:00
Rob Landley b7128c6236 Cleanup patch by Bernhard Fischer, removing unnecessary includes of
getopt.h, whitespace changes, typos, etc.
2005-09-11 01:05:30 +00:00
Mike Frysinger db289b258d use CONFIG_BUFFER macros like cow suggested and shrink code size some more by using less variables and more gotos ;) 2005-09-10 04:10:18 +00:00
Rob Landley 98ea849623 Patch from Dirk Clemens so df doesn't run numbers together on drives >100gig. 2005-09-10 02:59:35 +00:00
Mike Frysinger a80b290e30 some tweaks by cow to shrink a little 2005-09-10 02:47:19 +00:00
Rob Landley 6b00d0d3ca Put the menu_is_visible test back because it avoids printing spurious
(albeit commented out) garbage.
2005-09-08 11:50:48 +00:00
Manuel Novoa III 415f6c9628 Rob, I don't know why you feel some unexplainable compulsion to get rid of
a meaningless warning.  But I do expect you preserve the coding style
and variable names when all you're doing is tweaking some of my code.

I repeat... do NOT change whitespace, variable names, or coding style in
any of my code simply to conform to your coding style.
2005-09-08 06:02:49 +00:00
Rob Landley ae32016fc9 A bit overdue... 2005-09-08 03:48:47 +00:00
Rob Landley 9f0e00fc61 Tito sent more size tweaks. 2005-09-08 03:27:06 +00:00
Rob Landley 230b411de8 Fix the warning by rewriting the function to be smaller and simpler.
I'd appreciate somebody on a __BIG_ENDIAN platform testing this out; I haven't
got the hardware...
2005-09-08 03:22:09 +00:00
Rob Landley 658d2cf986 Tito sent in a few patches converting instances of CONFIG_FEATURE_CLEAN_UP to
ENABLE_FEATURE_CLEAN_UP.
2005-09-08 03:11:58 +00:00
Paul Fox 02eb934b0f committing:
Summary      0000242: ash: read -t broken
this also implements -n and -s options to read.  (they're configured
together because most of their code is in common, and separating them
seemed silly.
2005-09-07 16:56:02 +00:00
Rob Landley a70aa86e25 Yeah, Linus is the original author of three of our apps, but A) he doesn't
work at transmeta anymore so that email's bogus, B) hands up everybody who
thinks emailing him about a problem in the busybox version of those apps
would be productive?
2005-09-07 07:12:19 +00:00
Rob Landley 20a825aed8 Fix warnings. 2005-09-07 07:04:56 +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
Rob Landley 14efdc58ce Don't comment warnings. Don't put #warnings about warnings. _FIX_ warnings.
This fixes the warning, and makes the binary smaller out of sheer pique.
(Yes, since Manuel did this one it's nice tight code that took several
attempts to shrink, but I was ticked.)

Add the start of a test for uniq; this is about the first 1/3 of the
tests we need for full susv3 coverage of uniq.
2005-09-07 04:18:36 +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
"Vladimir N. Oleynik" 1443487c92 typo, thanks, Bernhard Fischer 2005-09-06 13:21:39 +00:00
Rob Landley 1283a150ae Whitespace-level changes. Replace s0,s1,e0,e1 with real variable names and
clean up whitespace and curly brackets a bit.  Resulting binary should be
identical.
2005-09-06 01:57:11 +00:00
Rob Landley 9955c45907 get_terminal_width_height.c was in there twice. 2005-09-05 18:42:18 +00:00
Rob Landley ecce943e25 Bernhard Fischer pointed out that CONFIG_FEATURE_MOUNT_FORCE no longer exists. 2005-09-05 17:52:47 +00:00
Rob Landley f6acb660ea Regarding 11330: when you fix a bug that the testsuite doesn't catch, add
a test case to the test suite.
2005-09-05 16:27:19 +00:00
"Vladimir N. Oleynik" d0c41a8519 destroy bug [0000381] 2005-09-05 15:50:56 +00:00
"Vladimir N. Oleynik" f087480da1 destroy bug [0000404] 2005-09-05 15:46:26 +00:00
"Vladimir N. Oleynik" a8c23aa795 - usage fresh bb_getopt_ulflags for ls -- very size reduce.
- small indent corrections
- remove unecessary malloc and free
2005-09-05 15:06:57 +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
"Vladimir N. Oleynik" bef14d7a87 1) sync with dash_0.5.2-7
2) but expand PS# as config option
3) correct kill error message again
4) remove show "line number" for interactive run (patch pending for dash)
2005-09-05 13:25:11 +00:00
"Vladimir N. Oleynik" 10a1fe6169 remove infinity loop ./busybox --help busybox 2005-09-05 11:25:27 +00:00
Rob Landley 8f99104362 The previous commit left confdata writing out:
CONFIG_NUMERIC_CONSTANT=

And on reading it back in, it would complain that '' was an invalid value for
that field.  I.E. "make allnoconfig && make" worked fine, but
"make allnoconfig && make menuconfig" barfed reading in the config file.

So now I have it write out "0" as the blank value.  (It's initialized to the
default value when the menu becomes visible anyway; I checked.)  That seems
to work.
2005-09-05 11:04:30 +00:00
Rob Landley d1fa5859d6 Now that "make sizes" is in, the faq should mention it... 2005-09-05 10:25:51 +00:00
Rob Landley dbaf97e463 Fix the warnings, and fix the following two obvious segfaults:
./busybox getopt -n one -n two woot
	./busybox getopt -o one -o two woot

This entire applet is still an enormous pile of garbage, which I can't clean
up because I really have no idea what it's for.  (Both "man getopt" and trying
it out on the command line a bit fail to enlighten me.  Reading the code, the
fact half of it seems to be special cases for bash vs tcsh does not fill me
with confidence.)
2005-09-05 06:16:53 +00:00
Rob Landley cc1669bcde Actually returning ret might be good. 2005-09-05 05:36:15 +00:00
Rob Landley 8a7a678b03 Fixes so "make allnoconfig" works again.
The configure system's save function edited out sub-menus that wouldn't be
displayed in the current configuration, meaning config.h wouldn't have #udef
entries for those symbols, meaning bb_config.h would have the relevant
ENABLE_ missing instead of defined to 0.  This broke the build.

So I fixed it, and then reorganized the applets.c and busybox.c to take
away the warnings this revealed (code that would be optimized out was making
calls to functions that hadn't been prototyped.  So I added an #else case
to those #ifdefs to #define the relevant functions to empty macros to
placate the warnings.

I also reorganized the applets.c code to make adding such an #else case less
of a pain (and make the need for prototyping go away by moving the functions
up before they were used, and generally wind up with fewer #ifdefs in
the code by putting all the logic in one place).  This resulted in a huge
seeming patch, when most if it just moves code from one place to another
without touching it...

Upside: make allyesconfig and make allnoconfig should both work now.
2005-09-05 04:13:33 +00:00
Rob Landley a1a1a9fa2c Remove trailing crud from busybox.tests. (Sleep deprivation strikes again...) 2005-09-04 11:13:10 +00:00
Rob Landley b766c39456 General cleanup of command line parsing to allow "busybox" to work as a prefix.
(I.E. any argv[0] that starts with "busybox" winds up in busybox_main().)

Added testing/busybox.tests which tests the following permutations:

./busybox
./busybox-suffix
./busybox cat
./busybox-suffix cat
./busybox --help
./busybox-suffix --help
./busybox --help cat
./busybox-suffix --help cat
./busybox --help unknown
./busybox-suffix --help unknown
./unknown

Also repair the test suite so ./runtest calls the ".tests" scripts properly.

Note: you can now go "busybox busybox busbox ls -l" and it'll take it.  The
new code is pretty generic.  I can block that if anybody can come up with a
good reason to...
2005-09-04 11:10:37 +00:00
Mike Frysinger 9754b91c16 touchup some grammar, formatting, and remove some outdated notes 2005-09-02 23:06:30 +00:00
Eric Andersen f46f1b4d8a update the verbage describing what is needed for developer access 2005-09-02 14:10:47 +00:00
Rob Landley 7f90ae436f This goes along with the new testsuite code... 2005-09-02 01:55:58 +00:00
Rob Landley 1689075c99 Working on a new test harness. Moved the sort tests into it. 2005-09-02 00:41:53 +00:00
Rob Landley babd3fbba6 Missing break was screwing up 'y//' command. Bug #248. 2005-09-02 00:10:06 +00:00
Rob Landley 92255d60b8 Fix for bug 383: attempting to "tar c /" would error out because stripping
trailing / turns that into an empty string.
2005-09-01 11:36:21 +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 344ea471ef Tracking system but #4: php needs the environment variable SCRIPT_FILENAME. 2005-09-01 09:38:32 +00:00
Rob Landley f815469a76 Bernhard Fischer trimmed down dos2unix a bit. 2005-09-01 03:11:19 +00:00
Rob Landley 078bacf1e9 Patch -i support from Berhnard Fischer. 2005-09-01 03:02:23 +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
Rob Landley 37adefc670 Off by one error in max_leases sanity check. Bug 349, apparently. 2005-09-01 02:43:39 +00:00
Rob Landley ac692b2cf7 Bernhard Fischer sent a patch to make "make sizes" work when building in
another output directory.
2005-09-01 02:40:21 +00:00
Rob Landley 9139770764 Busybox should only multiplex based on argv[1] when it's called as "busybox".
Otherwise if you build busybox without a given applet you get the wrong error
message when you call it via a symlink to that applet.

(You also get the wrong behavior; it tries to use argv[1] as the command
name just like busybox does for _any_ unknown, and although I doubt
"echo rm -rf *" is common usage there's no upside and enough downside to
make me nervous.)

This fixes it.
2005-09-01 00:02:56 +00:00
Rob Landley 29ee76cb2b Anand Avati hit an integer overflow problem in our unzip code. 2005-08-31 22:03:15 +00:00
Rob Landley c8b8a2d0cf Don't comment warnings, _FIX_ warnings. (And putting in #warnings about
other warnings is just gross.)

On a side note, while I was there, I made the code slightly smaller.
2005-08-30 20:26:17 +00:00
Rob Landley c3386a4304 Why have a separate CONFIG_INIT_SWAPON when we already have CONFIG_SWAPONOFF? 2005-08-30 18:50:37 +00:00
Rob Landley 7a8f6792f3 Bug system entry #1 says that when busybox doesn't have swapoff,
init shouldn't call swapoff.
2005-08-30 18:17:05 +00:00
Rob Landley 9a643149de Amir Shalem found some bugs in the new mount code; unknown options didn't get
added to the list, and my assumption that nfsmount() actually called
mount() was incorrect (and I coded it wrong anyway; I hate having to touch
codepaths I can't personally test).
2005-08-30 17:07:49 +00:00
Rob Landley cc8885f6f3 Dirk Clemens pointed out how easy it is to support bzip2 compression, since we
shell out to an external program to handle gzip anyway...
2005-08-30 03:40:03 +00:00
Eric Andersen de55987667 point to busybox.net 2005-08-28 12:47:39 +00:00
Rob Landley d9f7165de1 Dumb little hack, "make sizes". Try it. 2005-08-28 08:24:21 +00:00
Mike Frysinger ddddb94f05 make sure __NF_sysfs exists before trying to use it 2005-08-27 18:19:01 +00:00
Mike Frysinger 038b076e55 some portability fixes by rmh in Bug 395 2005-08-27 18:18:06 +00:00
Rob Landley e1d9633e20 Bernhard Fischer submitted a couple of Makefile patches:
- Fix building out-of-tree
- remove duplicate rule in toplevel Makefile
- peruse make's builtin notion of `dirname $@'
2005-08-24 00:41:52 +00:00
Rob Landley a937640bff Remove something we did, not that I'm doing something, and add something we
haven't done.  Woo.
2005-08-23 23:08:17 +00:00
Rob Landley f4c684a1ef When compiling with FEATURE_MTAB_SUPPORT disabled, the call to erase_mtab()
can never be made because useMtab is initialized to 0, and all the other
assignments of that variable assign 0 to it.  Any compiler that can perform
simple constant propogation on local variables will optimize away if statements
testing against that variable, thus the call to erase_mtab() will never be
made.

When compiling for arm using gcc 3.3.3 with FEATURE_MTAB_SUPPORT disabled,
the linker complains that it can't find erase_mtab().  The arm optimizer isn't
exactly the brightest member of the family, and apparently needs to be hit over
the head with a hammer to get its' attention...
2005-08-23 20:03:17 +00:00
Rob Landley 6417564eeb Two FEATURE_CLEAN_UP patches from Shaun Jackman, closing filehandles. 2005-08-22 15:57:50 +00:00
Rob Landley d00b3a5e94 Bernhard Fischer provided a mountpoint(1) applet. This is apparently something
sysvinit provides, and which is used by the debian init scripts.
2005-08-20 05:07:08 +00:00
Rob Landley fc3f048f8f Announce busybox 1.01. 2005-08-17 01:55:58 +00:00
Mike Frysinger b8d004631a Tito (among others) writes: previous patch was wrong, please stop screwing things up 2005-08-17 01:20:10 +00:00
Eric Andersen 4306bb13f6 When doing 'make release' nuke the .svn directories, not the
CVS dirs (since they are no longer present)
2005-08-17 00:03:23 +00:00
Mike Frysinger 6ebbc7414e the () around isspace actually matters 2005-08-16 05:39:07 +00:00
Mike Frysinger 1eef0c4571 Bernhard Fischer says: use xmalloc() instead of malloc() 2005-08-16 05:32:42 +00:00
Mike Frysinger 71224980e1 Bernhard Fischer says: fix comment typo 2005-08-16 05:27:51 +00:00
Mike Frysinger c8e2de6e1b Bernhard Fischer writes: fix devfsd usage 2005-08-15 22:13:21 +00:00
Rob Landley de5fd23f25 If we goto singlemount, do _not_ try to continue through the loop we jumped
into.  (That means "mount -t ext2 /dev/thingy thingy" would segfault if
it failed instead of giving us an error message.)
2005-08-14 19:26:14 +00:00
Rob Landley 23246f39ed Patch from Stephane Billiart to improve ash error message. 2005-08-14 19:16:51 +00:00
Rob Landley 6e98521d68 Stephane Billiart noticed that the return code of the new mount was horked.
(Cleaned up the return code path to consistently use numbers so I don't keep
confusing EXIT_SUCCESS with TRUE and EXIT_FAILURE with FALSE...)
2005-08-14 18:46:34 +00:00
Rob Landley 58a651b2e5 Very minor tweak to tail. 2005-08-13 00:35:00 +00:00
Mike Frysinger f9bd87b0a7 make sure distclean punts include/bbconfigopts.h 2005-08-11 21:59:52 +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
Paul Fox 3f11b1bf63 commiting:
0000025: vi-editing mode for ash
2005-08-04 19:04:46 +00:00
Paul Fox 8eeb655661 applying jim bauer's patch to eliminate modprobe's dependency
on /bin/sh.  bug #8.
     0000008: modprobe applet is dependent on having a shell
2005-08-04 18:33:36 +00:00
Rob Landley 157e8071be In bb_config.h, replace AUTOCONF_INCLUDED guard with the more reasonable and
obvious (and less side-effect prone in strange build environments) BB_CONFIG_H.

Yeah, I know Erik ripped it out of our copy of menuconfig (which is a good
thing), but that doesn't fix people whose headers have it inherited from
linux-kernel headers or old versions of uclibc, and Erik's fix could easily
get forgotten and reverted the next time we update menuconfig anyway...
2005-08-02 10:02:23 +00:00
Eric Andersen ff3a61b71d Do not define 'AUTOCONF_INCLUDED' 2005-08-02 00:59:44 +00:00
Paul Fox 4240364098 commiting:
0000028 03-16-05 patch: new setsid applet
2005-08-01 22:52:09 +00:00
Mike Frysinger f1dbd4a6f7 fix bbconfigopts.h depend 2005-08-01 20:49:32 +00:00
Mike Frysinger fcafa4bfc1 screw around with whitespace 2005-08-01 20:48:00 +00:00
Paul Fox b831753676 commiting:
0000073: Add option to inetd applet to run in foreground
this option was already there for uclinux -- this just exposes
it in the normal case as well.
2005-08-01 19:39:47 +00:00
Paul Fox 156dc41cbc commiting patch from bug 71:
0000071: patch: implement "--color" option for ls coloring control
2005-08-01 19:33:30 +00:00
Paul Fox fc2256a6ca applying patch for bug 72:
0000072: Add applet to redirect console output via ioctl(..., TIOCCONS)  
applet name changed to setconsole, since suse has a very similar
utility.  better to treat differences as bugs than invent a new command.
2005-08-01 18:12:30 +00:00
Paul Fox 41a72ecd19 applying patch from bug 24:
0000024 03-16-05 patch: allow init to set controlling tty
2005-08-01 16:43:13 +00:00
Paul Fox 79c142d938 new config display applet, from bug 46. i've changed the name
of the applet from "config" to "bbconfig", and renamed the
source filenames and symbols to match appropriately.
2005-08-01 16:04:40 +00:00
Paul Fox a39bba33c8 allow suppression of default client-id. fixes bug 000037. allows
busybox to match kernel and u-boot behavior with respect to client-id.
2005-08-01 14:31:13 +00:00
Mike Frysinger 9d6e0833bc patch by pkj in Bug 3 to not export all make variables 2005-07-31 22:50:17 +00:00
Mike Frysinger d84a35f649 patch by apgo in Bug 345 to not use ether_hostton() with uClibc 2005-07-31 22:49:12 +00:00
Mike Frysinger 15ca58648a patch by srowe in Bug 359 to fix fgrep aliasing 2005-07-31 22:41:05 +00:00
Mike Frysinger 66c37d1390 typecast to int 2005-07-31 22:22:20 +00:00
Mike Frysinger 2e3054f413 use socklen_t instead of size_t with socket related functions 2005-07-31 22:20:02 +00:00
Mike Frysinger 1c1655a301 move -s from LDFLAGS to STRIPCMD 2005-07-31 22:11:33 +00:00
Mike Frysinger 7e64db23d0 use defines instead of const integers 2005-07-31 22:09:33 +00:00
Mike Frysinger e11ff718ac shrink the flag setting by reversing the operation 2005-07-31 22:06:38 +00:00
Mike Frysinger 6f978dbacd eat leading whitespace with preprocessor 2005-07-31 21:05:19 +00:00
Mike Frysinger 08c20362f5 replace for loops with one function call 2005-07-31 20:51:58 +00:00
Rob Landley de7f9b7332 Ahem: add new faq entry to list at top of FAQ.html 2005-07-31 04:27:19 +00:00
Rob Landley c7a3e1be8f Fix "nm --size-sort" on the busybox binary and document how to make it work. 2005-07-31 04:25:00 +00:00
Mike Frysinger e70aa9de7e only declare do_swap if we need it 2005-07-30 09:43:58 +00:00
Mike Frysinger 223b887960 touchup syntax 2005-07-30 09:42:05 +00:00
Mike Frysinger 198ea3c86a cleanup the error message so we dont use glibcism of %m and cast a pointer to an int (bad on 64bit arches) 2005-07-30 09:29:10 +00:00
Mike Frysinger f28c7ec7e5 cleanup syntax 2005-07-30 09:24:49 +00:00
Mike Frysinger 0d3ca7289e tell people to ignore the dups/e0 warnings 2005-07-30 08:59:38 +00:00
Mike Frysinger cc428da83f punt unused variable 2005-07-30 08:58:19 +00:00
Mike Frysinger d6a2d41db2 tell people to ignore the save_name warning 2005-07-30 08:57:35 +00:00
Mike Frysinger 14445fd9a1 in order to make sure the INET6 prototypes are exported, we would have to include the libbb.h header file ... but then we have to worry about including too early/etc...
since simply defining the prototype in an internal header file doesnt hurt anyone, lets not worry about the header file crap and just always prototype the inet6 functions
2005-07-30 08:54:43 +00:00
Mike Frysinger b953134bba apgo in Bug 322 writes: kill off CONFIG_FEATURE_MTAB_FILENAME 2005-07-30 08:48:10 +00:00
Mike Frysinger 69024551bf rename the accept/reject names since accept overrides the accept() socket function 2005-07-30 07:30:26 +00:00
Mike Frysinger f7eaf5a012 apgo in Bug 351 says: punt parse_version_number since it is no longer used 2005-07-30 07:29:22 +00:00
Paul Fox bb9a0ad95a commiting fix from:
0000353: [PATCH] start-stop-daemon -q is not quiet
2005-07-29 14:58:09 +00:00
Mike Frysinger b3b756dab3 further refine check_gcc usage so it is only called the bare min number of times 2005-07-28 22:26:25 +00:00
Mike Frysinger c99e2c5f4c dont output anything when running in silent mode 2005-07-28 22:14:35 +00:00
Rob Landley 088ee4134b From Rich Paul:
I've noticed that when I compile busybox on my laptop, it compiles more
slowly than one would expect, and although it's a (more-or-less)
multiprocessor system and I use -j5, make never seems to run more than 
one job at a time.

I believe I have found the culprit:  each time a file is compiled, gcc
runs about 5 times.  This is because the $(check_gcc) macros and the
TARGET_ARCH macros are late binding.

The attached patch cuts the compilation time by 66%, from 1.5 minutes to
30 seconds.  Your mileage may very.  These statements have not been
evaluated by the FDA.
2005-07-28 19:38:52 +00:00
Rob Landley ef8f423e90 Erik pointed out that in the last try at the #ifdef cleanup
infrastructure, the compiler isn't smart enough to replace const static 
int with the constant, and allocates space for each set of them, 
bloating the executable something fierce.  Oops.

So now, we #define ENABLE_XXX to 0 or 1 for each CONFIG_XXX (which
is still there so the 1000+ #ifdef/#ifndef tests don't have to be
replaced wholesale).  Changed the test instance in networking/ifconfig.c 
to use this.
2005-07-28 19:36:33 +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
Rob Landley 193c8c7383 #ifdef reduction infrastructure, based on an argument between Shaun Jackman,
Rob Landley, and others.

Currently CONFIG options are defined or undefined, so we chop out code with
#ifdefs, ala:
#ifdef CONFIG_THING
  stuff();
#endif

This creates a new header file, bb_config.h, which sets the CONFIG entry to 1
or 0, and lets us do:

  if(CONFIG_THING) stuff();

And let the compiler do dead code elimination to get rid of it.  (Note: #ifdef
will still work because for the 1 case it's a static const int, not a #define.)
2005-07-27 06:55:36 +00:00
Eric Andersen 77804ce53d The change in getty.c in Busybox 1.01 caused the /etc/issue file to not
be displayed unless CONFIG_FEATURE_UTMP is set.  This was not the intended
result.
2005-07-27 06:05:38 +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 03e827a422 2005-03-19 Shaun Jackman <sjackman@gmail.com>
* networking/ping.c (ping): Change the type of fromlen to socklen_t.
2005-07-26 23:00:59 +00:00
Mike Frysinger dbc049fda4 remove unused variable ret as reported by apgo in Bug 350 and touchup syntax along the way 2005-07-26 22:57:51 +00:00
Mike Frysinger 6e05312ba9 no longer used as reported by apgo in Bug 348 2005-07-26 22:51:57 +00:00
Mike Frysinger 726b2cb5da just punt all the f_frsize crap since not all linux headers support it Bug 346 2005-07-26 22:39:56 +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 37dd6247dd applying fix for:
0000093: Patch for dpkg - can't handle scripts
	      Attached patch is needed to fix dpkg's support for preinst,
	       postinst etc script files.
2005-07-22 13:17:41 +00:00
Paul Fox 7b86134032 remove duplicate check against chaddr. 2005-07-21 20:23:56 +00:00
Paul Fox 8de331def0 revert 10881, and refix by changing "if (vallen)" to "if (val)". this
is per the upstream fix for dash, in dash_0.5.2-6.diff.  thanks vodz, for
catching this.
2005-07-21 12:03:05 +00:00
Paul Fox 0840b76602 applying fixes from:
0000142: unzip enhancements
2005-07-20 20:26:49 +00:00
Paul Fox f2ddc05ee7 applying fix for:
0000026: poor man's "scriptable" telnet
2005-07-20 19:55:19 +00:00
Paul Fox 1d4c88c8a5 applying fix for:
0000271: [PATCH] tftp -g fails if a TFTP_ACK is lost
2005-07-20 19:49:15 +00:00
Paul Fox 4905434b8a applying fix for:
0000265: tail -f should keep following files even if they
                    were truncated
2005-07-20 19:46:32 +00:00
Paul Fox 982d35ffa2 applying fix for:
0000263: nc cannot use -e when initiating a tcp connection
    	to something else
2005-07-20 19:40:30 +00:00
Paul Fox 94ff9f1010 applying fix for:
0000262: tar -x doesn't believe it has reached the end of archive
2005-07-20 19:24:13 +00:00
Paul Fox 6f267f022f applying fix for:
0000261: Unsafe empty env var export in ash
2005-07-20 19:18:45 +00:00
Paul Fox 01f67987e0 applying fix for:
0000260: udhcpc doesn't validate client hardware address
2005-07-20 19:13:21 +00:00
Paul Fox 379ac89c30 applying patch from:
0000227: sort use wrong type for getopt return variable
2005-07-20 19:07:27 +00:00
Paul Fox 5dc0ceeb9e applying fix for:
0000203: 'ip route flush cache' not implemented
2005-07-20 19:01:05 +00:00
Paul Fox 77ee52333c applying fix for:
0000185: httpd infinite loop when piping to CGI script
2005-07-20 18:42:52 +00:00
Paul Fox 54690dc0b2 applyinf fix for:
0000155: variable expansion with braces in backticks in msh
2005-07-20 18:33:12 +00:00
Paul Fox c3850c83d9 applying fix from:
0000152: ash: quoting rules for local variables different to globals
2005-07-20 18:23:39 +00:00
Paul Fox 27cbffddd8 applying fix for:
0000143: sysklogd remote logging adds a space between facility and tag
2005-07-20 18:02:11 +00:00
Paul Fox 18433aadf6 applying fix for:
0000118: vi join command does not mark file as modified for certain lines.
2005-07-20 17:39:52 +00:00
Paul Fox 28069404a4 much more concise fix for bug #45. just align the packet... 2005-07-20 11:55:08 +00:00
Rob Landley 3c12ff7c89 If /tmp and /home were different partitions, then "mv /tmp/file /home/file"
would delete /home/file even if /tmp/file didn't exist.

This fixes that, although the logic of both mv and cp is a bit tangled and
should probably be untangled.
2005-07-20 00:45:40 +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 146e83a60e applying fix from:
0000108: busyboxy/networking/ftpgetput.c not conforming to
                    RFC 959.  ftpget and ftpput send <LF> as EOL.
2005-07-19 21:26:57 +00:00
Paul Fox 127adc559f applying fix from;
0000092: looks like the initializer for .need_suid was missing.
2005-07-19 21:21:58 +00:00
Paul Fox deac371690 applying fix from:
0000088: inetd chargen stream does not generate the
	    characters as recommended in RFC 864
	    Chragen service is generating garbage characters.
2005-07-19 21:19:20 +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
Paul Fox 574fee4f99 applying:
0000054: Tab completing filenames in ash causes SEGV
	Simple tab completion operations cause busybox (ash) to
	access illegal addresses.
2005-07-19 20:41:06 +00:00
Paul Fox b270315b21 applying fix for:
0000045: traceroute causes an alignment trap due to unaligned buffer on arm
2005-07-19 20:37:15 +00:00
Eric Andersen 90161c9213 Fixup makedevs to handle regular files, and also fix
it to properly update file permissions as specified.
2005-07-18 22:40:59 +00:00
Paul Fox 7b71d740b9 fix for "0000027: patch: nc will spin if stdin closed" 2005-07-18 22:23:16 +00:00
Paul Fox d13b90b9e8 allow both ^H and DEL to backspace in insert mode (bug #23) 2005-07-18 22:17:25 +00:00
Eric Andersen 0ef24c672a Fix vi so that error messages, insert mode messages, etc are
all actually displayed in the status line as expected
2005-07-18 10:32:59 +00:00
Eric Andersen 2ada89b60f a bit more polish 2005-07-18 09:45:35 +00:00
Eric Andersen 54e57da96a a bit of polish on makedevs 2005-07-18 09:42:37 +00:00
Eric Andersen 1b7058c653 the makedevs config option was pretty much totally broken 2005-07-18 09:36:49 +00:00
Eric Andersen e8614dbcd7 Fixup device table based makedevs so it actually works 2005-07-18 09:28:36 +00:00
Mike Frysinger 10427ab528 move var decls around a little to help gcc make smaller code 2005-07-06 05:00:48 +00:00
Mike Frysinger e548bdff96 2005-07-04 Shaun Jackman <sjackman@gmail.com>
* init/init.c: Do not include sys/mount.h.
        (message): Use O_NONBLOCK instead of O_NDELAY.
        (console_init): Ditto.
2005-07-06 04:46:14 +00:00
Mike Frysinger 95ef16528c 2005-07-05 Shaun Jackman <sjackman@gmail.com>
* init/Config.in (CONFIG_FEATURE_INIT_SWAPON): New option.
        * init/init.c (check_memory): Disable the swapon feature unless
        CONFIG_FEATURE_INIT_SWAPON is defined.
2005-07-06 04:39:08 +00:00
Mike Frysinger 72a4c33568 rename log var to log_console so we dont override internal gcc/glibc log func 2005-07-05 02:19:20 +00:00
Mike Frysinger b381009740 2005-06-30 Shaun Jackman <sjackman@gmail.com>
* loginutils/getty.c: (open_tty): Use dup2 instead of close/dup.
2005-07-01 01:29:44 +00:00
Mike Frysinger f413e241ba 2005-06-30 Shaun Jackman <sjackman@gmail.com>
* loginutils/getty.c: Include utmp.h only if
        CONFIG_FEATURE_U_W_TMP is defined.
        (getty_main): Use ISSUE only if it is defined.
2005-07-01 01:07:16 +00:00
Mike Frysinger 8deb686d2e Patch by jonlar in Bug 312 to split the U_W_TMP feature into sep UTMP and WTMP options 2005-07-01 01:04:32 +00:00
Mike Frysinger a87bb60809 patch by Shaun Jackman to combine dup/close funcs into dup2 2005-06-30 03:43:14 +00:00
Mike Frysinger 8804c6a3b7 dont use f_frsize unless linux-2.6.0 or better 2005-06-29 01:07:04 +00:00
Mike Frysinger fc379ba077 rip out all the non-linux code and ugly workarounds 2005-06-28 23:50:18 +00:00
Mike Frysinger 9e164578f2 tweak signed/unsigned char usage to avoid mismatches 2005-06-24 21:37:59 +00:00
Ned Ludd 778ee6da60 - remove extra/unneeded function call. testing svn 2005-06-24 03:47:57 +00:00
Eric Andersen 5043ea1986 Enabling runtime SUID/SGID configuration via /etc/busybox.conf
is not a very good default.  Better to default to having it off
and let people get the default behavior.  If they want to enable
/etc/busybox.conf they should explicitly ask for it.
2005-06-23 19:15:40 +00:00
Eric Andersen 576db48ef0 applets specified as _BB_SUID_ALWAYS in applets.h should also select
CONFIG_FEATURE_SUID to ensure proper behavior when installed.
2005-06-23 18:58:57 +00:00
Eric Andersen 3efa51d943 characters encoded as html should have a trailing semicolon
to be interpreted properly
2005-06-23 05:51:48 +00:00
Rob Landley 6eb1e41674 Rodney Radford submitted ipcs and ipcrm (system V IPC stuff). They could use
some more work to shrink them down.
2005-06-20 04:30:36 +00:00
Mike Frysinger df1eda82b9 Tito says: unify verbose/quiet flags 2005-06-17 02:13:57 +00:00
Mike Frysinger d0615ae73a Tito says: strip unused program_name
Vladimir N. Oleynik says: uname() can be replaced with get_kernel_revision()
2005-06-17 01:35:52 +00:00
Mike Frysinger d5826903c1 use xmalloc instead of malloc 2005-06-12 00:45:09 +00:00
Mike Frysinger 7fde8debc4 use malloc instead of xmalloc 2005-06-11 22:37:25 +00:00
Mike Frysinger d1a9d57bd6 use xmalloc() instead of malloc() 2005-06-11 22:25:27 +00:00
Mike Frysinger 2401ce5343 use xmalloc() and bb_perror_msg_and_die() 2005-06-11 22:24:15 +00:00
Rob Landley 958fa2a9cc Note that memory allocaiton needs to be cleaned up too. 2005-06-11 22:10:42 +00:00
Mike Frysinger 0b3fc1a9ac remove com_err.h includes 2005-06-11 20:29:02 +00:00
Mike Frysinger 16bc6159f3 DOS only crap 2005-06-11 20:28:47 +00:00
Mike Frysinger 6447ac0ef4 import initial fat mke2fs 2005-06-11 05:29:40 +00:00
Mike Frysinger 174808cedb import tune2fs support 2005-06-11 01:14:09 +00:00
Mike Frysinger a34f99930d fix signed/unsigned char pointers 2005-06-11 00:50:59 +00:00
Mike Frysinger 7ffce0c119 oops, we only want to affect local CFLAGS 2005-06-11 00:45:50 +00:00
Mike Frysinger d5624dcc0d initial fat tune2fs/findfs/e2label source 2005-06-11 00:40:20 +00:00
Mike Frysinger cae717e1f6 replace simple is_null func with a memcmp define 2005-06-11 00:36:04 +00:00
Mike Frysinger f3d28845f8 force including of e2fsbb.h and move the HAVE_* defines to it 2005-06-11 00:27:50 +00:00
Mike Frysinger e9903cfa0f move config.h requirement to the actual .depend target rather than the depend alias 2005-06-11 00:13:58 +00:00
Mike Frysinger e037622641 make sure clean removes objects in subdirs 2005-06-11 00:12:12 +00:00
Mike Frysinger f98f5e37cd need strings.h for ffs() 2005-06-11 00:11:46 +00:00
Mike Frysinger 0301ffab3d only define some variables if legacy EXT2FS_ENABLE_SWAPFS is enabled 2005-06-11 00:11:37 +00:00
Mike Frysinger 1f96c97984 replace simple functions with defines 2005-06-11 00:10:44 +00:00
Mike Frysinger 68497c0bd3 whitespace updates 2005-06-11 00:10:29 +00:00
Mike Frysinger 3968082df4 replace functions with defines 2005-06-11 00:09:46 +00:00
Mike Frysinger a1c9c66ac0 whitespace updates 2005-06-11 00:09:39 +00:00
Mike Frysinger e2c51a8dc6 whitespace updates 2005-06-11 00:09:24 +00:00
Mike Frysinger 85cffcc83d recode functions to shrink size 2005-06-11 00:08:50 +00:00
Mike Frysinger 942e137679 setup the HAVE_* defines 2005-06-11 00:03:13 +00:00
Eric Andersen 3d9256225f About time to just apply this and kill off the patches 2005-06-09 10:16:02 +00:00
Rob Landley 06813d066b Tito posted a devfsd error message fix. It's highly deprecated and will
presumably be removed eventually (use udev), but as long as it's in there.

Tito says:

The sense of this patch is to call:
read_config_file_err:
#ifdef CONFIG_DEVFSD_VERBOSE
    msg_logger(((optional ==  0 ) && (errno == ENOENT))? DIE : NO_DIE, LOG_ERR, "read config file: %s: %m\n", path);
#else
    if(optional ==  0  && errno == ENOENT)
        exit(EXIT_FAILURE);
#endif

just after the failure of the  call that set errno ( stat and fopen)
to avoid false error messages.
2005-06-07 03:47:00 +00:00
Rob Landley 16cd02e01e Clean up strings.c to use busybox's option processing. Bug 006, apparently. 2005-06-07 03:21:20 +00:00
Rob Landley ed830e8693 Patch from Dmitry Zakharov:
Charlie Brady wrote:
> Here's another awk parsing problem - unary post increment - pre is fine:
>
>bash-2.05a$ echo 2,3 | gawk -F , '{ $2++ }'
>bash-2.05a$ echo 2,3 | /tmp/busybox/busybox awk -F , '{ $2++ }'
>awk: cmd. line:1: Unexpected token
>
Here's a fix for this. There is another problem with constructions like 
"print (A+B) ++C", I don't
know whether somebody uses such constructions (fixing both these 
problems would require very
serious change in awk code).
2005-06-07 02:43:52 +00:00
Rob Landley f3133c4149 Thus spake Brenda J. Butler:
We were seeing some timeouts when getting files with the busybox tftp
client.

With tcpdump, we saw that the tftp client was receiving blocks and
ack'ing them, but the server was failing to receive the occasional
ack.

When that happened, the server would send the last block over again,
but the tftp client was expecting the next block.

This patch allows the client to recover from this situation
(it sends an ack for the repeat block but does not write it
to the local file).

I hope it meets your approval, please don't hesitate to send
me comments for improvement.

The patch is against "head" in svn, I tested it on an older version
of busybox in our environment.  It applied cleanly to the older
version.

Credit for this goes to my co-worker John McCarthy for finding
it and me for fixing it (assuming it works for everyone else too).

cheerio,
bjb
2005-06-07 02:40:39 +00:00
Rob Landley f7662da2af Shaun Jackman submitted a patch converting an allocation to use
CONFIG_RESERVE_BUFFER.  (Rob Landley removed an #ifdef, per discussion on
the list.)
2005-05-28 23:55:26 +00:00
Rob Landley 47bc802e9e Patch from Shaun Jackman to save a few bytes. 2005-05-28 23:36:38 +00:00
Rob Landley 0b1ff5a606 Tobias Krawutschke found a bug where the DHCP client would accept packets
with the wrong ARP address, meaning we could easily get somebody else's IP.
That is a bad thing, and this is the minimal two-line fix.
2005-05-26 05:25:12 +00:00
Paul Mundt 8b2d02ed34 Add readprofile applet support. 2005-05-20 17:22:18 +00:00
Rob Landley 93850a56b2 Patch from Colin Watson (mangled slightly by Rob Landley):
This patch implements the 'T' command in sed. This is a GNU extension,
but one of the udev hotplug scripts uses it, so I need it in busybox
anyway.

Includes a test; 'svn add testsuite/sed/sed-branch-conditional-inverted'
after applying.
2005-05-18 06:34:37 +00:00
Rob Landley 5797c7f0ef Doug Swarin pointed out a security bug in the -i option of sed.
While the permissions on the temp file are correct to prevent it from being 
maliciously mangled by passing strangers, (created with 600, opened O_EXCL, 
etc), the permissions on the _directory_ might not be, and we re-open the 
file to convert the filehandle to a FILE * (and automatically get an error 
message and exit if the directory's read-only or out of space or some such).

This opens a potential race condition if somebody's using dnotify on the 
directory, deletes/renames the tempfile, and drops a symlink or something 
there.  Somebody running sed -i as root in a world writeable directory could 
do damage.

I dug up notes on an earlier discussion where we looked at the security 
implications of this (unfortunately on the #uclibc channel rather than email; 
I don't have a transcript, just notes-to-self) which pointed out that if the 
permissions on the directory allow other people's files to be deleted/renamed 
then the original file is vulnerable to sabotage anyway.  However, there are 
two cases that discussion apparently didn't take into account:

1) Using another user's permissions to damage files in other directories you 
can't access (standard symlink attack).

2) Reading data another user couldn't otherwise access by having the new file 
belong to that other user.

This patch uses fdopen to convert the filehandle into a FILE *, rather than
reopening the file.
2005-05-18 05:56:16 +00:00
Mike Frysinger 1fb7961e08 use more busybox functions and remove redundant code 2005-05-16 22:35:59 +00:00
Mike Frysinger b2312e9901 make sure we add the local dir to the include path 2005-05-16 22:05:07 +00:00
Rob Landley 4079b00119 Tito pointed out I'd broken -t (argv[optind] can't be before getulflags),
and replaced the use of system() (and resulting security implications).
2005-05-15 01:32:47 +00:00
Rob Landley 9ea8836357 Add automatic umount support to eject command. Patch from Tito,
with tweaks from Mike Frysinger and Rob Landley.

Note: this will still fail to umount a path that contains an ' or \ character.
Is it worth the extra size to filter for that?
2005-05-14 00:46:18 +00:00
Mike Frysinger 1ece21bddd as Rob Landley pointed out, need to fix the 1 versus i typo in indexing 2005-05-13 03:09:20 +00:00
Mike Frysinger 0fb397e617 blah, forgot to save last time to fix whitespacing 2005-05-13 00:58:18 +00:00
Mike Frysinger 867a6080fe remove duplicated code and rework algorithms to end up with smaller code 2005-05-13 00:57:30 +00:00
Mike Frysinger dad4cf7e63 use a bunch of if statements since it is a few bytes smaller than a switch; also use bb_xfopen() instead of fopen() so comm doesnt segfault when given non-existant files :( 2005-05-12 22:50:12 +00:00
Mike Frysinger b3a6ec3e62 err, added 2 to the wrong var :) also touchup the option detection to shrink size 2005-05-12 22:41:13 +00:00
Mike Frysinger 3ba93c0438 fix segfault if user only specifies 1 file 2005-05-12 22:36:32 +00:00
Mike Frysinger 4d149205c3 update usage to match actual behavior 2005-05-12 22:36:07 +00:00
Mike Frysinger 0d605e98b2 fix whitespace/coding style 2005-05-12 22:25:41 +00:00
Mike Frysinger a84a512700 add missing comm.o rule 2005-05-12 22:23:15 +00:00
Mike Frysinger 5b300dd3a9 whitespace touchups 2005-05-12 22:22:50 +00:00
Eric Andersen 9cc7f3230a This makefile was a mess. Fix it to work as intended.
-Erik
2005-05-11 23:20:09 +00:00
Rob Landley 2acfd7bd26 Small comm implementatin from Rob Sullivan. Needed to build perl. 2005-05-11 23:12:49 +00:00
Mike Frysinger b662f0d58b import ether-wake applet by haveaniceday Bug 252 2005-05-11 03:59:53 +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 55e2cf6533 import eject by Peter Willis / Tito Ragusa 2005-05-11 00:25:47 +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
Rob Landley 00e76cb6b9 Patch from Jason Schoon to add IPV6 support to telnetd. Reworked by Rob
Landley to remove an #ifdef and move another one out of the flow of code.
2005-05-10 23:53:33 +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 38a33f91c0 import more libs to prep for new e2fsprogs 2005-05-09 22:13:22 +00:00
Mike Frysinger 1fd98e039d import ext2fs lib to prep for new e2fsprogs 2005-05-09 22:10:42 +00:00
Mike Frysinger b32011943a no longer applies 2005-05-09 22:10:10 +00:00
Mike Frysinger 7a121e92eb import base_device.c for fsck 2005-05-09 22:09:00 +00:00
Mike Frysinger 8d929dab60 remove unused files 2005-05-09 21:58:36 +00:00
Mike Frysinger a88d52237b trim out useless defines and use some busybox funcs 2005-05-09 21:57:44 +00:00
Mike Frysinger 507d1f76e5 override nls P_() macro 2005-05-09 21:53:25 +00:00
Mike Frysinger ae38d65e95 abort if user passes -r or if they dont pass anything 2005-05-09 21:51:41 +00:00
Mike Frysinger 9dc93ac561 syntax/whitespace touchup 2005-05-09 21:51:15 +00:00
Rob Landley 540d3f60f3 Patch from Shaun Jackman:
> This patch modfies expr to use portable POSIX regex rather than BSD
> regex.
...
> This updated patch implements an anchored regex by checking that the
> match starts at offset 0.

More to the point, this patch uses the same regex that sed.c is already using
(opportunity to suck in less library code), and even building a dynamically
linked busybox with just expr the result is a slightly smaller binary (by 94
bytes, I dunno what nm --size-sort has to say about it because I didn't build
with debug info, since that changes the binary size a lot by disabling
optimization...)

Your mileage may vary.  Handle with caution.  Do not taunt happy fun ball.
2005-05-09 21:42:42 +00:00
Rob Landley b9dfb8c03f Manuel points out that if printf needs a flush to act like dprintf, the result
is bigger.  Revert last patch.
2005-05-07 17:45:38 +00:00
Rob Landley 0fcd9430ce This one's from me. Fix ash "standalone shell".
If we exec /proc/self/exe and only fall back to /bin/busybox if /proc isn't
there, then we have a reasonable chance of having the standalone shell work
even if busybox isn't installed in /bin on the system in question.

Still won't work in a chroot environment, but it's an improvement.
2005-05-07 08:27:34 +00:00
Rob Landley cce1ae2ce5 Shaun Jackman pointed out that dprintf(STDOUT_FILENO,...) is just a printf. 2005-05-07 07:53:16 +00:00
Mike Frysinger ea338fffb5 patch by Tito which uses a lot more busybox functions to reduce size nicely 2005-05-07 07:17:43 +00:00
Mike Frysinger 6adfd349e9 update e2p target to match condensed files 2005-05-07 07:16:54 +00:00
Mike Frysinger 548ffd49a3 patch by Tito which unifies common get/set functions into 1 get/set function and cuts down on the size used significantly :) 2005-05-07 07:14:41 +00:00
Mike Frysinger ba3a01f5e0 add/remove defines to handle more e2fsprogs 2005-05-07 06:49:54 +00:00
Mike Frysinger 9c85ecdef4 use shared busybox error messages to save a few bytes 2005-05-07 06:45:29 +00:00
Mike Frysinger 7dc7f402a7 make the exec (-e) an optional feature of netcat 2005-05-06 05:00:34 +00:00
Mike Frysinger 60a5c38a4b In bug 247, haveaniceday writes:
The option "-w secs" adds a timeout for writing.
2005-05-06 04:45:38 +00:00
Rob Landley 4f65360a5f Tweak the "pretty lsmod for 2.6" patch to be seperately selectable.
Patch from Takeharu Kato.
2005-05-04 23:55:06 +00:00
Rob Landley 918f2ab3d7 Revert the uptime() removal. Let the list sort it out... 2005-05-04 02:15:23 +00:00
Rob Landley 8b80c71d70 Patch from Shaun Jackman:
Replace uptime with time(NULL). time is more portable than uptime and
eliminates the need to define uptime, reducing code size slightly.
2005-05-04 00:38:15 +00:00
Rob Landley 15d3f7f143 Takeharu Kato's patch added 2.6 support to lsmod; this changes menuconfig
dependencies so 2.6 support depends on insmod or lsmod...
2005-05-04 00:25:49 +00:00
Rob Landley 627814bdc3 Takeharu Kato said:
I found that lsmod in busybox does not support linux-2.6.
I fix this issue(it is caused by changes of /proc/modules format).
If you use lsmod in busybox with kernel-2.6, please use this patch.
2005-05-03 22:34:03 +00:00
Rob Landley 0d38301d85 From: Shaun Jackman <sjackman@gmail.com>
To: busybox@mail.codepoet.org
  
Wrap sockaddr_in6 in a ifdef CONFIG_FEATURE_IPV6.
Include sys/types.h instead of asm/types.h.
Include netinet/if_ether.h instead of linux/if_ether.h
The ioctl request argument is an int, not an unsigned short.
2005-05-03 22:30:08 +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 988a78c61c Add David Brownell as zcip maintainer. 2005-05-03 03:33:23 +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
Rob Landley 6624daeb4d On Wednesday 13 April 2005 09:12 pm, Shaun Jackman wrote:
> This patch fixes a memory leak in hash_file by using the BUFFER macros
> instead of xmalloc. Please apply.
2005-04-30 05:11:57 +00:00
Rob Landley ad8071f582 David Brownell submitted a new applet, zcip, based on RFC 3927. This is
version 0418b.  It compiled.
2005-04-30 03:49:37 +00:00
Rob Landley 55b1efc6de New help text for Matthew S. Wood's "ln" update adding -b and -d. 2005-04-29 22:14:28 +00:00
Rob Landley 3071e2fda3 Patch from Matthew S. Wood:
> The following patch adds support for the -S and -b flags to `ln'.  These
> flags [especially -b] are used extensively in Debian pre and post
> installation scripts.

Comments from Vladimir Oleynik influenced the final patch, and I also ripped
out the in-file changelog since it belongs here.  At the time, it said:

/* Apr 15, 2004      Matthew S. Wood    (mwood@realmsys.com)
 *
 * Implement '-b' (backup) flag.
 * Implement '-S' (backup suffix) flag.
 *
 *
 * Mar 16, 2003      Manuel Novoa III   (mjn3@codepoet.org)
 *
 * Fixed bug involving -n option.  Essentially, -n was always in effect.
 */
2005-04-29 22:13:04 +00:00
Rob Landley fdc4c203e5 On Wednesday 27 April 2005 05:23 am, Patrick Huesmann wrote:
> This is really confusing for users who don't know all details of the
> *nix file permission system.
> Today, I changed my busybox system to use CONFIG_FEATURE_SUID_CONFIG.
> After fighting with the file permissions for hours, I decided that
> updating the documentation might be a good idea.
2005-04-29 19:48:29 +00:00
Eric Andersen 70a5a1abde Do not attempt to free() the application's environment, which is was
not dynamically allocated.  Instead, use a private variable to store
the environment array, which is used when we exec applications.
2005-04-27 11:44:11 +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 edb3fbc305 fix stupid build mistake i made earlier as pointed out by psm 2005-04-26 00:43:19 +00:00
Mike Frysinger d6a8f5f0d0 use a generic error message 2005-04-25 05:27:12 +00:00
Mike Frysinger c238a97a9e use asprintf in place of malloc/sprintf as suggested by solar 2005-04-25 05:24:35 +00:00
Mike Frysinger 7eb6457c4c moved to e2fsprogs too 2005-04-25 05:00:33 +00:00
Mike Frysinger d2a64d2fc2 bbify to shrink size 2005-04-25 04:10:35 +00:00
Mike Frysinger 560047ce86 use busybox funcs to make smaller 2005-04-24 05:39:52 +00:00
Mike Frysinger cf131bb328 new version of ed taken from sash 2005-04-24 05:18:00 +00:00
Mike Frysinger d89e5e6450 svn didnt auto add these ... 2005-04-24 05:15:12 +00:00
Mike Frysinger d89e629e52 add new subdir for e2fsprogs 2005-04-24 05:07:59 +00:00
Mike Frysinger 408ae211ce rework human_fstype to cut down size 2005-04-24 04:11:44 +00:00
Mike Frysinger f06c494636 rework options to get rid of extra variables 2005-04-24 03:53:12 +00:00
Mike Frysinger 058e740d1e fix whitespace usage, fix un-escaped quotes in a bunch of examples, and standardize a bunch of trivial/full usage statements (no trailing newline in either, and when listing options, dont append a . each time) 2005-04-23 07:00:33 +00:00
Mike Frysinger 82e6c0b3db fix inconsistent whitespace 2005-04-23 06:35:06 +00:00
Mike Frysinger 964a368e5c remove extra whitespace 2005-04-23 06:28:42 +00:00
Mike Frysinger 9b5f71ec02 stat implementation based upon coreutils 2005-04-23 06:26:38 +00:00
Mike Frysinger 84ab267e22 patch for a very alpha busybox ed 2005-04-23 01:50:55 +00:00
Mike Frysinger 6b05b0ce93 whitespace fix 2005-04-23 01:46:55 +00:00
Mike Frysinger 3b59821cbd remove lsattr/chattr to prepare for a top level e2fsprogs dir with more stuff in it 2005-04-23 01:45:08 +00:00
Mike Frysinger 0ea3a6f660 update example to use bb_ prefixed names and remove old note about config.h (since the header is generated automatically now) 2005-04-23 01:43:45 +00:00
Mike Frysinger 19d7021d99 add comments about ignoring some warnings which are OK 2005-04-23 01:43:07 +00:00
Mike Frysinger 7202e00b4c remove unused variable and declare writepid inline 2005-04-23 01:42:29 +00:00
Mike Frysinger 5b2e27137d cast the time pointer so gcc stops warning over nothing 2005-04-23 01:42:03 +00:00
Mike Frysinger 5cfa5ef6f3 use bb_fflush_stdout_and_exit instead of exit 2005-04-23 01:41:51 +00:00
Mike Frysinger de9f1f757a import lsattr and chattr from e2fsprogs 2005-04-22 02:33:37 +00:00
Mike Frysinger 2c12d435e5 output busybox help to stdout, not stderr 2005-04-22 02:19:01 +00:00
Mike Frysinger 95d3c4503f printenv / sum defines 2005-04-21 23:29:24 +00:00
Mike Frysinger 4a2117027f grab sum from coreutils, clean it up, and make it busybox happy 2005-04-21 23:24:46 +00:00
Mike Frysinger 6d1d2e59bf add a printenv implementation 2005-04-21 23:23:13 +00:00
Mike Frysinger c0bc9652fd fix whitespace 2005-04-21 23:19:57 +00:00
Mike Frysinger 78333d0452 fix typos 2005-04-21 23:17:57 +00:00
Mike Frysinger f547d672cf fix typoe (buildddir -> builddir) 2005-04-21 01:49:05 +00:00
Mike Frysinger 5c9ed9f41a fix printf warning 2005-04-20 00:28:44 +00:00
Mike Frysinger 618d62f593 fix whitespace 2005-04-19 23:50:22 +00:00
Peter Kjellerstedt bae38db8e4 Updated to match trunk/uClibc/extra/config as of r10132, and thus
Linux 2.6.11.
2005-04-19 09:55:06 +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
Mike Frysinger 91d8f0e892 touchups as suggested by Vladimir N. Oleynik 2005-04-18 18:52:15 +00:00
Mike Frysinger ef614ecca6 err, use name attr of a tag, not href 2005-04-17 07:25:32 +00:00
Mike Frysinger fa69f110d9 import fakeidentd module started by Thomas Lundquist 2005-04-17 07:24:19 +00:00
Mike Frysinger 77dbe738d2 add a new list of external tiny utilities 2005-04-17 04:32:22 +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
Mike Frysinger a77b4f3970 jfb2 writes in Bug 119:
The init applet will restart (re-exec) itsself when it
receives a SIGHUP. However, just before it enters its
main loop, it resets SIGHUP to either re-load the inittab
(or ignore it if no inittab is used). Thus preventing
the re-exec option from being triggerable.

This patch adds a signal handler for SIGQUIT for init that
always causes init to re-exec itsself (along with killing
anything else that might be still running).
2005-04-16 08:21:34 +00:00
Eric Andersen 63e5e7bf0e Fix broken macro 2005-04-16 08:04:31 +00:00
Eric Andersen 42e3b00ae5 Only define a local environ when not using the prototype from unistd.h 2005-04-16 08:02:15 +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 5ba5f4d2e7 In Bug 78, shortkey points out:
If you run `grep -h . file1 file2 file3 ...`, the output is not prefixed 
with the filename.  If you run `grep -h . file1` however, the filename 
will incorrectly prefix the output.
2005-04-16 04:56:11 +00:00
Mike Frysinger b31566ef32 minor style touchups 2005-04-16 04:48:48 +00:00
Mike Frysinger 4e5936ef95 In Bug 208, bernhardf writes:
On machines with only ANSI compliant compilers, not explitily delcaring
an empty parameter list 'void' causes failure.
2005-04-16 04:30:38 +00:00
Mike Frysinger 5c63a72968 In Bug 207, bernhardf writes:
proper escape strings in usage.h
2005-04-16 04:23:58 +00:00
Mike Frysinger 3cc01a80a3 In Bug 209, bernhardf writes:
struct named {
    named_field: init,
};
appear to be depraced by now; rather use C{99} format as in
struct named {
    .named_field = init,
};
2005-04-16 04:17:39 +00:00
Mike Frysinger a9ae74d25b bernhardf reports with Bug 210:
For certain non-gcc compilers, alloca_h is defined (included) but there, 
no alloca() is declared.  Fallback to malloc if _ALLOCA_H is defined but 
still, there is no alloca() in the included _ALLOCA_H.
2005-04-16 04:06:14 +00:00
Eric Andersen afe023d136 Use a sane VEOL setting 2005-04-14 20:48:58 +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 75ac42b1ae add aliases == and [[ for = and [ to support more bash scripts 2005-04-14 02:49:22 +00:00
Peter Kjellerstedt c089ccdb44 Removed the incorrect and confusing facility argument specified with
openlog() as the correct facility will be specified with syslog()
anyway.
2005-04-06 10:56:57 +00:00
Eric Andersen 3603f79ce5 Point to osuosl 2005-03-31 18:15:42 +00:00
Peter Kjellerstedt 540769d566 Corrected the list of section names in add_ksymoops_symbols() so
that the bss and sbss sections can be correctly identified.
2005-03-30 16:36:40 +00:00
Mike Frysinger 354b527e03 amd64 is rela, not rel 2005-03-30 06:29:41 +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 dcc40b7ecc Shaun Jackman writes: Newlib uses both __getopt_initialized and optind to track initialization of getopt() 2005-03-04 01:33:17 +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
Mike Frysinger ca1b6fc745 newlib fixe from Shaun Jackman 2005-03-04 01:09:43 +00:00
Manuel Novoa III df7bfb433e Bandaid to make "gzip file1 file2 ..." set the decompression lengths correctly
in the 2nd and later headers.  But this and gunzip really need to be rewritten.
2005-03-02 04:10:46 +00:00
Manuel Novoa III 0d8c652c46 When filling the bit buffer, gzip decompression apparently never checked for end of file, causing it to hang on corrupted input. 2005-03-01 19:29:29 +00:00
Eric Andersen 6ddc0d7f6b Update buildroot pointers 2005-02-21 22:04:21 +00:00
Eric Andersen b413a7009e remove whitespace 2005-02-13 22:20:35 +00:00
Eric Andersen 5bf4658dea remove whitespace 2005-02-13 22:17:44 +00:00
Eric Andersen bcf27247d1 Remove whitespace 2005-02-13 22:15:59 +00:00
Manuel Novoa III 2c511609c4 Add 'nice' and replace 'renice' with a new implementation. 2005-02-13 20:14:05 +00:00
Eric Andersen d2fe81706c Takeharu KATO writes:
Hi,

I found that gcc in cvs (HEAD in 2005/02/11) reject the gzip source
in the busybox.

This is caused by changing gcc's error handling behavior(
The gcc check the function prototype more strictly).

I show the compilation log as follow:
-- compilation log

-- compilation log
To fix the problem, apply the patch which is attached with this
mail.

Please take a look the patch and apply the patch into svn repository.
2005-02-11 19:06:51 +00:00
Ned Ludd d1e3cbdb5a - no need to check if JOBS is defined. Config.in ensures it. 2005-02-10 00:44:31 +00:00
Ned Ludd 2123b7cded - add ash read -t timeout support. initial code provided by Tim Yamin on Oct/21/2004 on the busybox mailing list. Edited his code a little to keep syntax highlighers happy and make it optional when CONFIG_ASH_TIMEOUT is defined 2005-02-09 21:07:23 +00:00
Eric Andersen 8063d5ca25 fix typo 2005-02-09 18:25:10 +00:00
Eric Andersen fdab4b1917 update 2005-02-09 06:44:36 +00:00
Eric Andersen 0762364c59 Cut-n-paste strikes again 2005-02-09 06:41:13 +00:00
Eric Andersen 6047ae3379 Remove mention of CVS and instead point to Subversion 2005-02-09 03:52:46 +00:00
Eric Andersen ff4b924d20 Update the bug submission stuff to point to bugs.busybox.net 2005-01-31 13:05:02 +00:00
Rob Landley 16b8579f53 Add me as sort maintainer. 2005-01-24 07:03:37 +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
Rob Landley f4bb212d6c Much bigger to-do list. 2005-01-24 06:56:24 +00:00
Eric Andersen bc321653d1 fix spelling 2005-01-14 17:08:13 +00:00
Eric Andersen 75a7e195ff minor doc cleanup 2005-01-13 17:23:28 +00:00
Eric Andersen 7d1b3d8685 Mention the new bug tracking system 2005-01-13 17:15:34 +00:00
Mike Frysinger 6077d90c26 cp: make -P a synonym for -d 2005-01-07 00:56:47 +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
Mike Frysinger 63654c1b08 alpha/parisc support 2004-12-26 09:13:32 +00:00
Eric Andersen 6feb2002f0 fix typo 2004-12-20 18:10:03 +00:00
Rob Landley ec4f3d95e7 Minor in-passing crapectomy. 2004-12-17 05:23:36 +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
Ned Ludd c6fbed5dba - CONFIG_FEATURE_READLINK_FOLLOW readlink -f patch from Colin Watson <cjwatson@debian.org> on busybox mailing list 08/11/04 2004-12-08 16:47:28 +00:00
Mike Frysinger d824853de3 merge from udhcp module 2004-12-06 14:59:45 +00:00
Rob Landley dcc286607c Hiroshi found another bug. Currently sed's $ triggers at end of every file,
and with multiple files SuSv3 says it should only trigger at the end of the
LAST file.

The trivial fix I tried first broke if the last file is empty.  Fixing this
properly required restructuring things to create a file list (actually a
FILE * list), and then processing it all in one go.  (There's probably a
smaller way to do this, merging with append_list perhaps.  But let's get
the behavior correct first.)

Note that editing files in place (-i) needs the _old_ behavior, with $
triggering at the end of each file.

Here's a test of all the things this patch fixed.  gnu and busybox seds produce
the same results with this patch, and different without it.

echo -n -e "1one\n1two\n1three" > ../test1
echo -n > ../test2
echo -e "3one\n3two\n3three" > ../test3
sed -n "$ p" ../test1 ../test2 ../test3
sed -n "$ p" ../test1 ../test2
sed -i -n "$ p" ../test1 ../test2 ../test3
2004-11-25 07:21:47 +00:00
Rob Landley a8b98d63e7 Don't document compiler warnings. _FIX_ compiler warnings. 2004-11-16 12:07:04 +00:00
Peter Kjellerstedt 88da3ef506 Correct the install-hardlinks target the same way as was already done
for the install target.
2004-11-02 09:05:22 +00:00
Rob Landley 92271e5a0d Alright, I guess I should be in this too... 2004-10-30 07:04:10 +00:00
Rob Landley ce4f0e982b Hiroshi Ito found some bugs. The 'c' command (cut and paste) was hardwired
to not put a newline at the end (which was backwards, it should have been
hardwired _to_ put a newline at the end, whether or not the input line
ended with a newline).  Test case for that:

echo | sed -e '$ctest'

And then this would segfault:

echo | sed -e 'g'

Because pattern_space got freed but the dead pointer was only overwritten
in an if statement that didn't trigger if the hold space was empty.  Oops.

While debugging it, I found out that the hold space is persistent between
multiple input files, so I promoted it to a global and added it to the
memory cleanup.  The relevant test case (to compare with That Other Sed) is:

echo -n woo > woo
sed -e h -e g woo
echo "fish" | sed -e '/woo/h' -e "izap" -e 's/woo/thingy/' -e '/fish/g' woo -

And somebody gratuitously stuck in a c99 int8_t type for something that's just
a flag, so I grouped the darn ints.
2004-10-30 06:54:19 +00:00
Eric Andersen 332c472865 1.00 is stable 2004-10-27 02:39:46 +00:00
Eric Andersen 5f9a422cfa mention scratchbox and openembedded 2004-10-18 06:31:18 +00:00
Eric Andersen 6302486ce6 egor duda writes:
egor duda wrote:
>Ok, here's an updated patch.
>'make check' should work now, and one make creates Makefile in build
>directory, so one can run 'make' in build directory after that.

ahem. It looks like i'm slightly late with it but... Here's a little
addition to make 'make O=/some/where PREFIX=/some/where/else install'
work. Sorry for delay :(

egor
2004-10-13 17:45:57 +00:00
Eric Andersen 9395ca4f68 prepare for release 2004-10-13 09:42:10 +00:00
Eric Andersen 9789bf1019 return failure when nslookup fails 2004-10-13 07:25:01 +00:00
Eric Andersen 1aee3ff8bb Simon Poole writes:
Erik,

Attached is a patch for the udhcpc sample scripts, to correct the order in
which routers are applied if the DHCP server provides more than one (as per
section 3.5 of RFC2132).

Apologies for not being on the mailing list and thanks for your continued
efforts.

Simon.
2004-10-13 07:18:05 +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 9315842242 Patch from David Daney:
It seems that date  -s MMDDHHMMYYYY.ss

will ignore the .ss part.  This patch tries to fix the problem.

David Daney.
2004-10-11 20:52:16 +00:00
Eric Andersen 62e0037d2d oops 2004-10-08 11:11:02 +00:00
Eric Andersen 5c5f983faf unmerged fix 2004-10-08 10:54:20 +00:00
Eric Andersen 90d3317fbf Bump version 2004-10-08 10:52:33 +00:00
Eric Andersen fdfa09b5c7 Fix the supported architectures section 2004-10-08 10:52:08 +00:00
Eric Andersen 6c4a6b1a23 Add an initial FAQ 2004-10-08 10:50:08 +00:00
Eric Andersen ad63cb2514 Fix CONFIG_ASH_MATH_SUPPORT_64 so it actually works 2004-10-08 09:43:34 +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 abf58d6ba5 Wade Berrier writes:
Hello,

Here's a patch for a first attempt at static leases for udhcpd.
Included in the tarball are 2 files (static_leases.c, static_leases.h)
and a patch against the latest cvs.

In the config file you can configure static leases with the following
format:

static_lease 00:60:08:11:CE:4E 192.168.0.54
static_lease 00:60:08:11:CE:3E 192.168.0.44

Comments/suggestions/improvements are welcome.


Wade
2004-10-08 08:49:26 +00:00
Eric Andersen 751750e3ee Patch from Denis Vlasenko to fix a problem where
wget http://1.2.3.4/abc/ loses last '/'
2004-10-08 08:27:40 +00:00
Eric Andersen 82baf63de5 Hiroshi Ito writes:
Hello, all.

Busybox init does not handle removed inittab entry correctly.

# I'm sorry about my poor english, but you can find
# what I would like to say from patch, isn't it?

even if you apply this path,
when yoy try to change a command line option in inittab,
you have to do following steps.
1. remove old line from initrd
2. send HUP signal to init
3. kill old proces which is invoked from init.
4. append new line to inittab
5. send HUP signal to init, again

patch is against current CVS + last patch witch I send it last.
2004-10-08 08:21:54 +00:00
Eric Andersen 2271809d75 Hiroshi Ito writes:
"kill -HUP 1" reloads inittab, and when I append one line to inittab
and send HUP signal two times, It will starts 2 process.

patch against current CVS is attached.
2004-10-08 08:17:39 +00:00
Eric Andersen c00e11df85 Hiroshi Ito writes:
ash
   "unset OLDPWD; cd -"  causes segmentation fault.
    ( OLDPWD is not set when sh is invoked from getty. )

patch against current CVS is attached.
2004-10-08 08:14:58 +00:00
Eric Andersen 31c27a9c65 Hiroshi Ito writes:
Hello

    I'm using busy box on mipsel machine.

    "grep -f file" will cause segmentation fault.

Vladimir N. Oleynik writes:

Hiroshi,

Thank for bug report, but your patch is full broken.
Worked patch attached.
(really changes is zero initialize, and indent correcting).


--w
vodz
2004-10-08 08:10:57 +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 07f2fea62c last_patch139.gz from Vladimir N. Oleynik:
>I also don't mean to disagree about leaving 30x status codes until after
>1.0.  In fact, although redirecting http://host/dir to http://host/dir/
>with a 301 is common practice (e.g. Apache, IIS), AFAIK it isn't
>actually required (or mentioned) by the HTTP specs.

Ok.
Attached patch have 302 and 408 implemented features.


--w
vodz
2004-10-08 08:03:29 +00:00
Eric Andersen 9e954abc4f As noticed by egor duda, current_menu is declared as 'extern struct menu
*current_menu;' in scripts/config/lkc.h line 63, and this conflicts with
static definition in mconf.c.
2004-10-08 07:58:30 +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
Eric Andersen d952ee2e9e Make it more apparent that archive creation is not supported 2004-10-07 00:35:59 +00:00
Glenn L McGrath f86391e7d7 Patch from William Barsse to fix a segfault when multiple files are specified. 2004-09-30 00:24:21 +00:00
Glenn L McGrath ca29ffc206 Patch from Dmitry Zakharov to fix a bug triggered by freeswan's scripts. 2004-09-24 09:24:27 +00:00
Glenn L McGrath bdf6319d3a Patch from Egor Duda
Attached patch prevents modprobe from trying to call 'insmod (null)'
whenever nonexistent module is either passed to modprobe via command
line or mentioned in modules.dep

this replaces cryptic error
sh: Syntax error: word unexpected (expecting ")")
with
modprobe: module some-module not found.

egor.
2004-09-24 09:18:55 +00:00
Glenn L McGrath 53090cdedd Fix a typo 2004-09-24 09:09:44 +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 afc9ab8686 Patch from David Daney to make the -i option work with -l. 2004-09-24 02:04:13 +00:00
Eric Andersen 6f8542b98d A bit of extra explanation regarding STANDALONE 2004-09-24 01:25:39 +00:00
Eric Andersen 31ec93e580 Add some notes on how to make telnetd actually work 2004-09-23 20:08:46 +00:00
Glenn L McGrath ca1c1afadc Add a missing brace, patch by Hideki IWAMOTO 2004-09-15 03:24:32 +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
Glenn L McGrath 995d96a99d Only write to shadow file is shadow passwords are enabled. Patch by magicfox modified by myself to retain check for shadow file access. 2004-09-15 02:39:09 +00:00
Glenn L McGrath 240a91d8a1 Patch by Felipe Kellermann, use the common escape handling function and remove some unused code. 2004-09-15 02:05:23 +00:00
Glenn L McGrath b6570d07c4 remove a cut/paste mistake, i better get some sleep. 2004-09-14 19:14:00 +00:00
Glenn L McGrath 225be8c1f0 Apply patch from Felipe Kellermann to simlify logic of sort functions.
I reversed the result of the sort functions to make the big numbers go to the top.
2004-09-14 18:56:52 +00:00
Glenn L McGrath 73ebb889da Patch by Felipe Kellermann, fix a bug introduced in the last patch by adding a condition around the remote logging, also adds some comments. 2004-09-14 18:12:13 +00:00
Glenn L McGrath d4004ee6a9 Patch from Felipe Kellermann, remove some unnecessary dups, i declared a few extra const's also. 2004-09-14 17:24:59 +00:00
Glenn L McGrath ab1955c236 Patch from Felipe Kellermann, adds missing applet usage options, removes usage
for options that are currently not implemented and fixes typos.
2004-09-14 16:23:56 +00:00
Glenn L McGrath d2bd7d8dd5 Patch from tito to add argument checking. 2004-09-14 16:08:02 +00:00
Glenn L McGrath e11db0ed35 I have to assume both Avaks and LSILogic are deliberatly ignoring me. 2004-09-14 13:59:44 +00:00
Eric Andersen e9c826f12a Fixup URL 2004-09-08 20:13:05 +00:00
Eric Andersen f91b9282a3 Felipe Kellermann writes:
The Togg's sysklogd patch to use sendto() on remote logging is formatting
strangely (using `<' and '>' surrounding the `msg' string message).  This
is OK, but this is not the standard way of formatting this message.

So this patch does the following:

o Fix the formatting to the standard way.
o Uses `MAXLINE' when needed;
o Don't loop sending messages without a "sleeping time",
  I'm now doing `now = 1', `now <<= 1';
o Don't die on `init_RemoteLog' when starting up (feature!)
  We're now trying to connect every time we have an invalid fd;
o Removes one static uneeded variable.
o Removes two automatic uneeded variables.
2004-09-08 10:56:06 +00:00
Eric Andersen 4a79c0e9e1 Patrick Huesmann noticed BusyBox would not link when
CONFIG_FEATURE_COMMAND_EDITING was defined *and*
CONFIG_FEATURE_COMMAND_TAB_COMPLETION was undefined.

Vladimir N. Oleynik writes:

Its declare always, also if CONFIG_FEATURE_COMMAND_TAB_COMPLETION
undefined.
Patch to CVS version attached.

--w
vodz
2004-09-08 10:01:07 +00:00
Eric Andersen fd7a4c8c28 Jonas Holmberg from axis dot com writes:
This patch makes msh handle variable expansion within backticks more
correctly.

Current behaviour (wrong):
--------------------------

BusyBox v1.00-rc3 (2004.08.26-11:51+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.

$ A='`echo hello`'
$ echo $A
`echo hello`
$ echo `echo $A`
hello
$


New behaviour (correct):
------------------------

BusyBox v1.00-rc3 (2004.08.26-11:51+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.

$ A='`echo hello`'
$ echo $A
`echo hello`
$ echo `echo $A`
`echo hello`
$

The current behaviour (wrong according to standards) was actually my
fault. msh handles backticks by executing a subshell (which makes it
work on MMU-less systems). Executing a subshell makes it hard to only
expand variables once in the parent. Therefore I export all variables
that will be expanded within the backticks and let the subshell handle
the expansion instead.

The bug was found while searching for security leaks in CGI-scripts.
Current behaviour of msh makes it easy to expand backticks by mistake
in $QUERY_STRING. I recommend appling the patch before release of bb
1.00.

/Jonas
2004-09-02 23:13:10 +00:00
Eric Andersen 7b08cdd98c No longer needed 2004-09-02 23:11:53 +00:00
Eric Andersen 45a0513a64 Based on patches from Mike Frysinger, add insmod support for
sparc and ia64 (itanium).

Also, reorganize the insmod architecture support code to be
alphasorted and less messy.

Update the readme to list current insmod arch support.
2004-09-02 23:03:25 +00:00
Eric Andersen 192c35f6eb Tito writes:
The second patch contains:
1) a size optimization for adduser.c
2) removes a warning about an unused variable in syslogd.c if CONFIG_FEATURE_REMOTE_LOG is not set
3)cosmetic fixes for addgroup_full_usage and adduser_full_usage

Ciao,
Tito
2004-09-02 22:22:17 +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 b225e2a76b Fixup some warnings 2004-08-28 00:43:07 +00:00
Eric Andersen 785001468d Quiet a few warnings 2004-08-27 19:55:28 +00:00
Eric Andersen 75813eea23 Togg writes:
Syslogd wont start if remote-logging is enabled and the connection to the
remote-log server is not possible on syslogd startup.

I found a patch somewhere which works like a charm. It uses sendto() which
seems more reliable for this issue.

Please see attached patch. Many people will be more happy with this included
I think.

Regards,
Togg
2004-08-26 23:15:29 +00:00
Eric Andersen 138791050d Improve the setuid situation a bit, and make it more apparent
when people really ought to make busybox setuid root.
 -Erik
2004-08-26 23:13:00 +00:00
Eric Andersen 37ba6bfb6d The login applet should always be setuid root 2004-08-26 23:01:34 +00:00
Eric Andersen 095dd0c46d Tito writes:
Hi,
I've fixed also the issue of whoami cutting down usernames.
This time I cannot send a diff because i don't know if my previous patches will be applied
or not, so I send in the whole file.
The changes I've made don't affect size but ensure that usernames of whatever lenght
are correctly displayed.
root@localhost:/dev/pts/3:/root/Desktop/busybox/coreutils# size whoami_orig.o
   text    data     bss     dec     hex filename
    102       0       0     102      66 whoami_orig.o
root@localhost:/dev/pts/3:/root/Desktop/busybox/coreutils# size whoami.o
   text    data     bss     dec     hex filename
     93       0       0      93      5d whoami.o

This should be applied even if the other patches aren't as this matches the behaviour of the  GNU whoami.

Thanks in advance,
Ciao,
Tito
2004-08-26 22:36:02 +00:00
Eric Andersen 713d6e3dd3 Save a line or two 2004-08-26 22:26:26 +00:00
Eric Andersen 97a1de10e9 Vladimir N. Oleynik writes:
Ming-Ching,

>>No. Here there are no mistakes.
>>You using POST metod.
>>For get data you should read from stdin CONTENT_LENGTH bytes.

>Hower as I posted a little while ago, there is indeed a bug
>in POST method if the CONTENT_LENGTH is bigger
>than sizeof(wbuf[128]). So if your CGI script is expecting to
>read the full CONTENT_LENGTH, it might block forever,
>because it will only transfer sizeof(wbuf) to the CGI.

Ok, Ok. I should find time to understand with a problem.
Try attached patch.


--w
vodz
2004-08-26 22:22:50 +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
Glenn L McGrath b619419962 Patch from Manousaridis Angelos to cleanup stale file descriptors, it was preventing unmounting an initial filesystem. 2004-08-25 02:02:19 +00:00
Eric Andersen a4d27d2d38 Patch from Rodney Radford adding x86_64 support. 2004-08-19 19:17:30 +00:00
Eric Andersen a9eb33ddc7 regularly update the status line display
-Erik
2004-08-19 19:15:06 +00:00
Eric Andersen 807bd846b6 Patch from Mike Castle to cleanup some modutils issues, in
particular making alias support work better.
2004-08-19 18:30:31 +00:00
Eric Andersen a4fcccefa6 Patch from Tito adding support for '-q' 2004-08-19 18:26:26 +00:00
Eric Andersen b131db4326 Patch from Tito documenting the '-q' option 2004-08-19 18:25:02 +00:00
Eric Andersen cb01bb1d68 Patch from Vladimir N. Oleynik:
On Wed Aug 18, 2004 at 06:52:57PM +0800, Matt Johnston wrote:
> I've come across some strange-seeming behaviour when running programs
> under Busybox (1.0.0-rc3) ash. If the child process sets stdin to be
> non-blocking and then exits, the parent ash will also exit. A quick strace
> shows that a subsequent read() from stdin returns EAGAIN (as would be
> expected):

Thanks!
Patch attached.


--w
vodz
2004-08-19 18:22:13 +00:00
Eric Andersen 9ab4657c89 Fixup 'dc' usage 2004-08-18 17:57:16 +00:00
Eric Andersen b36900c4b4 Prepare for release 2004-08-16 10:29:29 +00:00
Eric Andersen 85ae1bb67d Bump version 2004-08-16 10:23:33 +00:00
Eric Andersen e3a792c80c Only pass modprobe module params with 2.6.x kernel support.
-Erik
2004-08-16 10:22:34 +00:00
Eric Andersen 1f50e84283 Do not use vfork, as init is not vfork safe. Do not allow
askfirst when mmuless.
2004-08-16 09:29:42 +00:00
Eric Andersen 88e38ca2fb Bertrand Baudet writes:
Looks like the -D and -H options of the adduser applet aren't handle
properly in BusyBox.

This patch fixes the masks definition for those options according to
there position in the optstring.

Patch against RC2 but should also apply cleanly against CVS.

Bertrand
2004-08-16 09:07:39 +00:00
Eric Andersen acd647c877 Joe.C writes:
This bug is in busybox 1.0.0-rc2. When using lash exec
builtin with redirection, the opened file fd keep increasing.
For example, please try the following command with lash.


ls -al /proc/<lash pid>/fd
exec /bin/sh 2>/dev/null
ls -al /proc/<lash pid>/fd

  The last 'ls' command output will look like this. The fd
number 4 shouldn't exist.

lrwx------    1 501      100         64 Aug 13 13:56 4 -> /dev/pts/5
l-wx------    1 501      100         64 Aug 13 13:56 2 -> /dev/null
lrwx------    1 501      100         64 Aug 13 13:56 1 -> /dev/pts/5
lrwx------    1 501      100         64 Aug 13 13:56 0 -> /dev/pts/5
dr-xr-xr-x    3 501      100          0 Aug 13 13:56 ..
dr-x------    2 501      100          0 Aug 13 13:56 .

  This one-line patch fix this problem by setting CLOEXEC flag for
squirrel fd. Please apply.

Joe.C
2004-08-16 08:38:34 +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 beaef16315 Christian Ostheimer writes:
Hello,

function build_dep in modprobe.c assumes that dependencies of one module
have not more than 255 chars;
that is not sufficient in kernel 2.6.7 (alsa sound modules). - Below is
a diff that solves the problem for me.

With regards, Christian Ostheimer
2004-08-14 20:57:33 +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 4014ab1c60 Set default command to list rather than get, its default behaviour now
coincides with upstream. Patch from debian diff.
2004-08-11 08:10:58 +00:00
Glenn L McGrath fcf47321d4 Patch from Mike Castle, dont print an empty line (patch modified by me to
change formatting).
2004-08-11 05:56:30 +00:00
Glenn L McGrath 18bbd9bf3b Patch from Tito to fix memory leak upon error. 2004-08-11 03:50:30 +00:00
Glenn L McGrath 73db8be80a Patch from Bastian Blank to add 64 bit support to the test command.
Example of broken usage: ./busybox test 2147483648 -gt 2147483648
2004-08-11 02:45:47 +00:00
Glenn L McGrath d2c6f9a1f9 Patch from Phil Blundellto improve substring match 2004-08-11 02:32:18 +00:00
Glenn L McGrath 65c8c7ba27 Willian Barsse wrote
"There seems to be a slight problem with the "mod_strcmp" function in
modprobe.c, it scans for the first occurence of the module name in the
"mod_path" variable and expects it to be the last path element. ie
/lib/modules/2.4.22-debug/kernel/fs/vfat in my example. The comparison
will always fail if mod_path contains another substring matching the
module name."

Robert McQueen wrote
"Although William Barsse's patch fixed mod_strcmp for 2.4 kernels, there
was a remaining problem which prevented it from working for me. I've
just tracked it down - when you enable kernel 2.6 module support it
hard-wired the extension to .ko instead of checking at runtime like the
other places where 2.4 differs from 2.6. The attached patch fixes this
for me."
2004-08-11 02:30:30 +00:00
Glenn L McGrath 2f325a030b Patch from Tito to fix warnings about redifined functionions barrier and likely. 2004-08-06 01:49:04 +00:00
Glenn L McGrath 12ed333714 Part of patch from William Barsse, fixes a problem with unescaped %. 2004-08-06 00:58:53 +00:00
Eric Andersen 12de6cf0d7 Michael Leibow, MichaelLe at belkin.com writes:
A question was posted a month ago by Mark Alamo to see if others had
problems with sourcing subscripts within msh.  We asked his firm to fix the
msh.c bug he described because we didn't have enough time to do it
ourselves.

When msh.c is executing a compound statement and there is a . command to
source another script file, msh.c will not execute the subscript until it's
completed executing the rest of the compound statement.

His example was this:

Echo "Start" ; . ./subA; echo "mid" ; . ./subB ; echo "end"

subA and subB execute AFTER end is printed in reverse order.  The same is
true if the sourced files are inside an if else fi, case esac, or any
compound statement.

Attached is a patch to msh.c.  It fixes the problem.  Cd to the root of your
busybox tree and execute "patch -p1 < msh.c.patch"

Unfortunately, I won't have more time to work on this so I hope that there
aren't any problems!

Michael Leibow
Senior Software Engineer

Belkin Corporation
2004-08-04 19:19:10 +00:00
Eric Andersen 8401eeafd6 Run msh through indent 2004-08-04 19:16:54 +00:00
Eric Andersen 44b5758247 William Barsse writes:
fixes two other issues (plus the previous as well) with a 2.4 kernel :

- should be able to modprobe an already loaded module and get 0 return
code :
# modprobe <something> && modprobe <something> && echo "ok" || echo "failed"
....
failed

Well, hope this helps and that I didn't screw up again,
- William
2004-08-03 08:23:33 +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
Eric Andersen ec91de762a fixup cut-n-paste problem 2004-08-01 18:54:45 +00:00
Eric Andersen 67776bef59 Simon Poole reports that awk segfaults when environment variables
with no value exist, i.e.

	$ export BOB=''
	% ./busybox awk
	Segmentation fault

This patch teaches awk to not blow chunks on empty env variables.
 -Erik
2004-07-30 23:52:08 +00:00
Eric Andersen cbcdbc41ff Fix incorrect arguments being passed to mknod 2004-07-30 17:48:21 +00:00
Eric Andersen b737b1a68b Umm. Not guilty by reason of insanity.
-Erik
2004-07-30 17:39:08 +00:00
Eric Andersen aad29b37a7 Fixup getty, login, etc so the utmp and wtmp are updated, allowing
the 'who' and 'last' applets among other things to work as expected.
 -Erik
2004-07-30 17:24:47 +00:00
Eric Andersen 15b588559b use SIGTERM to kill off udhcpd, not SIGKILL 2004-07-30 14:45:08 +00:00
Eric Andersen e71e760a99 Fix up brain damage with the way major and minor are used to
create a dev_t
2004-07-30 14:36:37 +00:00
Eric Andersen 373bc1eaee As noted by Eric Spakman, calling static_down() and then calling
bootp_down() seems redundant, esp since bootp_down was a subset
of static_down, so just use that...
2004-07-30 14:31:01 +00:00
Manuel Novoa III 413db4d583 Clean up hex escape support. 2004-07-29 23:15:16 +00:00
Eric Andersen 27645b4345 Thanks to Ken Roberts, fix the slackware url 2004-07-28 19:15:04 +00:00
Eric Andersen ccfc44806d Felipe Kellermann noticed a missing `break'. 2004-07-27 16:45:46 +00:00
Robert Griebl 9768a65eb4 document stuff I have done 2004-07-26 18:57:49 +00:00
Eric Andersen 7f8bcbefc7 add missing ; 2004-07-26 12:22:33 +00:00
Eric Andersen 461cdc89a9 bump version to -rc2 2004-07-26 12:12:06 +00:00
Eric Andersen b2a300590d bother. unrevert my fix. 2004-07-26 12:11:32 +00:00
Eric Andersen 8f38782a6e Prepare for release 2004-07-26 12:07:01 +00:00
Eric Andersen 53f5c0d5bf Allow hex escape sequences 2004-07-26 12:06:19 +00:00
Eric Andersen ac594257c3 Make certain that udhcp shuts down the interface 2004-07-26 12:05:44 +00:00
Eric Andersen 882cec3e40 YAEGASHI Takeshi writes:
Hi,

With the following /etc/fstab (any two or more lines of nfs), mount -a
-t nfs causes a segmentation faults.

server:/exports/aaa /mnt/aaa nfs defaults 0 0
server:/exprots/bbb /mnt/bbb nfs defaults 0 0

In util-linux/nfsmount.c, it overwrites malloc'ed pointer *mount_opts
with a static pointer.  With this patch it does proper memory realloc
and data copy instead.
2004-07-26 12:05:12 +00:00
Eric Andersen 29128cd412 oops 2004-07-26 11:46:50 +00:00
Eric Andersen f54176de6d bump version to -rc2 2004-07-26 11:45:47 +00:00
Eric Andersen 06e62fd5f0 Make certain that udhcp shuts down the interface 2004-07-26 11:45:25 +00:00
Eric Andersen 380919905c Allow hex escape sequences 2004-07-26 11:28:47 +00:00
Eric Andersen 4f807a84c5 BusyBox has no business hard coding the number of major and minor bits for a
dev_t.  This is especially important now that the user space concept of a dev_t
and the kernel concept of a dev_t are divergant.  The only bit of user space
allowed to know the number of major and minor bits is include/sys/sysmacros.h
(i.e. part of libc).  When used with a current C library and a 2.6.x kernel,
this fix should allow BusyBox to support wide device major/minor numbers.
 -Erik
2004-07-26 09:11:12 +00:00
Eric Andersen 5dcf15e02d Paul Whittaker writes:
With job control enabled, ash fails to tcsetpgrp back to initialpgrp
upon exit.  exitshell() should call setjobctl(0) to do this.

Context: I am using a lightweight menu system (replimenu[.sf.net]) on my
console, which invokes "/bin/sh -i -c /bin/login", where /bin/sh and
/bin/login are busybox applets.   /bin/sh is ash, with
CONFIG_ASH_JOB_CONTROL=y as the sole suboption.  The shell of the user
concerned (nobody) is also /bin/sh (ash).  When the user /bin/sh exits
(and thereby login and its parent sh), replimenu receives EIO when it
tries to read from the terminal.
2004-07-24 12:44:13 +00:00
Glenn L McGrath 7991ad1720 Patch by Paul Whittaker, make busybox dc compatable with GNU dc.
the following example was broken, echo "1 1 +" | dc
2004-07-24 06:01:52 +00:00
Glenn L McGrath 6caf13bc7f Update Tito's contributions 2004-07-24 01:55:56 +00:00
Glenn L McGrath efc6bf6365 Patch from Felipe Kellermann, fix endless loop when first > last and
increment > 0.
2004-07-23 06:43:29 +00:00
Glenn L McGrath c0dd26f68d Patch from Felipe Kellermann, fixup usage for pidof, poweroff, remove
some trailing '\n'
2004-07-23 06:06:21 +00:00
Glenn L McGrath d250167bd2 Patch from Felipe Kellermann, fixup usage for halt command 2004-07-23 05:16:17 +00:00
Glenn L McGrath 72b14a8638 iUpdate reboot usage, patch by Felipe Kellermann 2004-07-23 03:33:38 +00:00
Glenn L McGrath 1fbc909570 Patch from Dmitry Zakharov to fix a bug discovered via the freeswap
script.
2004-07-23 02:11:25 +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 9c83e83628 Felipe Kellermann writes,
"As noticed today by Steven Scholz, the od's `-v' was broken.
I've fixed that and now both the flags `-v' and `-a' are OK"

Fixes a segfault in
echo "uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu\02bar\4"| ./busybox od -av
2004-07-23 01:42:28 +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 435962327a Patch from Felipe Kellermann to fix some typo's 2004-07-23 01:27:56 +00:00
Glenn L McGrath b875631754 Patch from Adam Slattery to add bzip2 support to rpm2cpio 2004-07-23 01:20:57 +00:00
Glenn L McGrath 4d405bbc05 Patch from Manousaridis Angelos to bring dhclient down more elegently 2004-07-23 01:10:22 +00:00
Glenn L McGrath 5529b7bb87 Reverse my previous change, "::" is a GNU getopt extension that allows
an optional argument.
Looks like a glibc bug to me
2004-07-22 04:23:18 +00:00
Robert Griebl 36a836d564 Patch from Mike Snitzer <snitzer@gmail.com>:
Support for /etc/modprobe.conf (for 2.6 kernels) should likely be added
to bb's modprobe, see attached patch.

modprobe.conf is just a (even simpler) variant of modules.conf
2004-07-22 00:03:39 +00:00
Glenn L McGrath 0177ce1256 Patch from Mike Snitzer to fix return codes.
"I have a need to _really_ know if the interface was properly configured
via ifup so I made busybox's ifupdown pass the return codes through rather
than dropping them on the floor."

"All the functions in ifupdown.c return 1 on success and 0 on failure
(which happens to the opposite of standard practices but whatever).
So it is important for all these functions to not blindly return 1."

"The problem with blindly returning ret, even if it is != 1, is the
callers expect a 0 or 1 and accumulate the return codes.  So a function that
makes 3 calls to execute will have a value of 3 accumulated.  That value
of 1 (success) was almost always returned even if 1 of the commands in the
command sequence failed.  The attached patch fixes the lack of checking
to verify thar result == expected_reult."
2004-07-21 23:56:31 +00:00
Glenn L McGrath e8f46515cb Fix bug in accepting buffer size argument 2004-07-21 13:06:30 +00:00
Glenn L McGrath 8539667279 Patch from Tito, ass usage for strings -a options 2004-07-21 12:25:55 +00:00
Glenn L McGrath 469a1ead53 Patch from Mike Snitzer, bring down dhclient using its correct pid, fix
a grammatical error.
2004-07-21 12:21:39 +00:00
Glenn L McGrath 28939ade2d Patch from Jean Wolter, fixes compiler warning when ASH_ALIAS is
disabled.
2004-07-21 10:20:19 +00:00
Glenn L McGrath a88ae491e3 Fixup -T (--files-from) option, works for non-directories now 2004-07-21 09:00:39 +00:00
Eric Andersen f828da0020 Avoid a naming conflict with include/bits/fcntl.h 2004-07-20 22:53:59 +00:00
Robert Griebl bd8dd1e763 Patch from Mike Snitzer <snitzer@gmail.com>:
Please see the attached patch for the following crash with busybox'
2.6 rmmod support
2004-07-20 18:36:51 +00:00
Robert Griebl 809387fe9e new_process_module_arguments returns 0 on error and 1 if everything went ok
somehow the ! got lost..
symptoms: modules could only be loaded _without_ parameters
2004-07-20 15:43:57 +00:00
Eric Andersen 83676f1731 oops 2004-07-20 11:41:16 +00:00
Eric Andersen a212af1ef2 Yet more doc updates 2004-07-20 11:31:52 +00:00
Eric Andersen 24c20b1d10 more doc updates 2004-07-20 11:31:08 +00:00
Eric Andersen ab95e3cd66 cut-n-paste strikes again 2004-07-20 11:23:45 +00:00
Eric Andersen f429d511b1 Update for release 2004-07-20 11:08:30 +00:00
Eric Andersen 197d6d45f3 Update changelog 2004-07-20 10:12:21 +00:00
Eric Andersen c0693ed61b Deal with the fact that 2.6.x kernels replace any '-'s in the
module name with a '_'.
 -Erik
2004-07-20 10:05:13 +00:00
Eric Andersen aea8e0eea7 Bump version up to release candidate 1 2004-07-20 09:23:41 +00:00
Eric Andersen 98e4eab0c6 Include some documentation posted to the list by vodz 2004-07-20 08:07:10 +00:00
Eric Andersen 165e8cbf34 Assign 'forced' before the goto to avoid a warning 2004-07-20 06:44:46 +00:00
Eric Andersen 5e136f269b Prevent "bootp_down' was declared implicitly extern' and later `static'" warning 2004-07-20 06:35:54 +00:00
Eric Andersen 65659be213 Add missing type for CONFIG_FEATURE_QUERY_MODULE_INTERFACE 2004-07-20 06:09:14 +00:00
Eric Andersen f9584a19ca Update the default config to not ask stuff 2004-07-20 06:06:56 +00:00
Eric Andersen 8f41bfc05c The 'tests' target is long gone. 2004-07-20 06:04:28 +00:00
Eric Andersen 9615a08218 Replace the old and somewhat buggy pwd_grp stuff with the shiny
new stuff mjn3 wrote for uClibc
2004-07-15 12:53:49 +00:00
Eric Andersen 837f058fb3 Peter Kjellerstedt at axis.com writes:
Hello,

the attached patch should bring extra/config in line
with the Linux 2.6.7 sources.

The following are the commit messages for the respective
files from the Linux bk-repository:

checklist.c:
* fix menuconfig choice item help display

confdata.c:
* config: choice fix
* kconfig: don't rename target dir when saving config

expr.c, expr.h:
* config: disable debug prints

mconf.c:
* fix menuconfig choice item help display

menu.c:
* Kconfig: use select statements

symbol.c:
* config: choice fix
* Avoid bogus warning about recursive dependencies
* c99 struct initialiser conversions

textbox.c:
* janitor: don't init statics to 0

util.c:
* fix lxdialog behaviour

//Peter
2004-07-15 06:01:05 +00:00
Eric Andersen 449f2bca96 Fixup a few documentation bugs 2004-07-14 10:01:04 +00:00
Eric Andersen e8521f14a2 Fixup some cases of "QM_MODULES: not implemented" for both
lsmod and rmmod when using 2.6.x module support
 -Erik
2004-07-13 00:09:34 +00:00
Eric Andersen fe9b9cdfa5 Paul Fox writes:
hi --

working with ifupdown, i've found a couple of buglets --
the wrong string is passed to an error message.

paul
2004-06-29 00:48:30 +00:00
Eric Andersen d926149d26 Avoid a number of places where large drives could wrap a uint, and
instead use off_t which will be automagically promoted to 64bit if
compiled with support for large drives.
 -Erik
2004-06-28 23:50:31 +00:00
Eric Andersen 0373cf1396 Do not mess with the console logging level unless
asked to do so.
 -Erik
2004-06-25 11:23:03 +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
Glenn L McGrath 5f2a23c3c6 Fix compile error when math support disabled. 2004-06-25 07:05:13 +00:00
Eric Andersen 5275b1e49f fix a stupid compile error when CONFIG_FEATURE_INSMOD_VERSION_CHECKING
is disabled
2004-06-22 20:10:53 +00:00
Eric Andersen fac312d78b Stupidity-1, Erik-0 2004-06-22 20:09:40 +00:00
Eric Andersen e983584c70 Bastian Blank notices a couple of int64_ts that should have
been longs
2004-06-22 19:07:21 +00:00
Eric Andersen bb692cdb32 Add missing 'S' to the getopt string. 2004-06-22 19:05:05 +00:00
Eric Andersen cb3b9b1fed kill off insmod support for older pre 2.1 Linux kernels,
which are not supported with the current busybox 1.0 release
 -Erik
2004-06-22 11:50:52 +00:00
Eric Andersen d943837dab Patrick Huesmann writes:
Hi,

    There was some problem with busybox modprobe. For details see
    http://www.busybox.net/lists/busybox/2004-May/011507.html

    I made a patch against busybox-1.00-pre10 to fix that one.

This is a slight variant of Patrick's patch with a slightly
cleaner implementation of mod_strcmp()
 -Erik
2004-06-22 10:43:09 +00:00
Eric Andersen 4872ed9737 Robin Farine writes:
Hi,

Package: BusyBox
Version: 1.0.0-pre10

When an incomplete read or write from/to a local file occurs (i.e.
not an EOF condition), the tftp client prematurely exits. This
problem can be reproduced by slowly piping data to the tftp client
like this:

  (for v in 1 2 3; do echo $v; sleep 1; done) | \
  tftp -p -l - -r output.txt <host>

The output file on the TFTP server will contain "1".

The attached patch provides a possible solution to this problem.

I can reproduce this on ARM sa1110 and ARM xscale boards, both
running Linux-2.6.4 & glibc-2.3.2. Thanks for the wonderful
program!

Robin
2004-06-22 10:18:30 +00:00
Eric Andersen 7f94a5caa2 Patch from Bastian Blank:
Hi folks

    The following patch adds a new log message output to syslogd. This
    output omits hostname and priority and is used in d-i to make the syslog
    output better readable without lossing information.

    Bastian

I am applying this since I have syslogd hacked up in my wife's
access point with the same format string....  Might as well make
this hack official.
 -Erik
2004-06-22 10:12:59 +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
Eric Andersen 78a5ddeff0 Robin Farine writes:
Package: BusyBox
Version: 1.0.0-pre10

Passing the -q <integer> option to inetd causes it to dereference an
invalid pointer (optarg). The attached patch provides a fix to this
problem.

Robin
2004-06-22 08:40:54 +00:00
Eric Andersen ed9ecf7894 Patch from Bastian Blank:
The updated patch adds a config option to explicitely enable 64 bit
    arithmetic.

    Also it removes the arith prototype from libbb.h as it is not used
    outside of ash.

    Bastian

this patch has been slightly modified by Erik for cleanliness.
2004-06-22 08:29:45 +00:00
Eric Andersen 16a4c41674 note the new mailing list policy 2004-06-19 06:26:30 +00:00
Eric Andersen 3023317a91 Typo fix from Niemann Hartmut 2004-06-09 10:00:20 +00:00
Glenn L McGrath f34b0e996b Update reference for zip format 2004-06-06 10:22:43 +00:00
Glenn L McGrath 07e1ccdf75 Woops, the previous commit was an accident, its supplied in the patch,
dont commit yet as we are in feature freeze
2004-06-05 07:58:18 +00:00
Glenn L McGrath 84b6264670 Device table support for makedevs, the previous behaviour can been
selected at configure time.
2004-06-05 07:54:52 +00:00
Rob Landley 58b118ae33 Ahem. ("I'm just tweaking a documentation string, I don't need to compile
test it before checking in..."  New entry for famous last words list.)

Add the missing backslash at the end of the new sed doc string line.

(This one actually compiled with "show verbose applet usage messages"...)
2004-05-26 22:09:37 +00:00
Rob Landley 1ce5968443 Update sed help. (Add -r option to long help, add -i option to brief help,
and alphabetizie the option list.)
2004-05-26 21:59:31 +00:00
Eric Andersen 86af052d25 Kevin P. Fleming writes:
Yes, I know busybox is in feature freeze. If this two-liner is too much
that's fine, but it's handy.

This patch allows busybox mount to support "-o move" just like it
supports "-o bind", which is the equivalent of util-linux "mount --move".

Usage is:

mount -o move /mnt/point/1 /mnt/point/2

where /mnt/point/1 is an already mounted filesystem; it will be moved to
/mnt/point/2.
2004-05-26 21:26:07 +00:00
Eric Andersen 2c1f1bc7f6 Update U.S. Robotics and Actiontec entries 2004-05-26 17:17:39 +00:00
Manuel Novoa III d709743b09 If read were to return with an error, bad things would happen. Fix it.
Also, make sure read errors are reflected in the applet exit code.
2004-05-26 15:21:19 +00:00
Eric Andersen a6f6a95ba4 oops 2004-05-26 12:06:38 +00:00
Eric Andersen 42f8883c71 Per suggestion from Bastian Blank, be less evil when we force fdisk to
transparently remap 32-bit interfaces to actually use 64 bit interfaces.
 -Erik
2004-05-26 11:59:19 +00:00
Eric Andersen 823b17263a Use tab not space 2004-05-26 11:50:37 +00:00
Eric Andersen abc513a90f Make the grep option values a bit less horrible 2004-05-26 11:48:29 +00:00
Eric Andersen dec7f81370 Rick Richardson writes:
Here is a patch that adds egrep -L support (the opposite of egrep -l).

I realize this is probably too late for 1.0.  But I offer it for your
future consideration.

egrep -L is used in some networking startup scripts I inherited.

-Rick
2004-05-26 11:47:55 +00:00
Eric Andersen ee70fa5523 Patch from Yoshinori Sato:
This patch is uClinux-2.4.x for H8/300 module support.
please apply.

--
Yoshinori Sato
2004-05-26 11:38:46 +00:00
Eric Andersen 0dfe4e9956 As discussed, drop minit, which was not being supported in busybox.
People wishing to use minit can obtain it and obtain support from
http://www.fefe.de/minit/
2004-05-26 10:28:32 +00:00
Eric Andersen febd744d31 Use STDIN_FILENO rather than '0' 2004-05-26 10:26:10 +00:00
Eric Andersen 9855548a77 Rob Landley writes:
add sed -r support.

I bumped into a couple of things that want to use extended regular expressions
in sed, and it really isn't that hard to add.  Can't say I've extensively
tested it, but it's small and isn't going to break anything that doesn't use
it, so...

Rob
2004-05-26 10:03:33 +00:00
Eric Andersen d4d01d2b9b Rob Landley writes:
Run this test, against both busybox and a non-busybox version of "tee".

while true; do i=$[$i+1]; echo "hello $i"; sleep 1; done | ./busybox tee

Now run the busybox one again with the following small patch applied:
2004-05-26 09:54:36 +00:00
Eric Andersen 7f164cd052 Patch from vodz to correct 'grep -e pattern1 -e pattern2' logic 2004-05-26 09:46:41 +00:00
Eric Andersen f086ed8ddd Do not prompt about FDISK large disk support when LFS is enabled.
Resolve a dependancy problem with the various malloc debug libs
and make them mutually exclusive.
 -Erik
2004-05-25 11:30:22 +00:00
Eric Andersen 1be01072e9 Do not select LFS 2004-05-19 11:06:20 +00:00
Eric Andersen 84bdea8cb2 Erik,
>http://busybox.net/cgi-bin/cvsweb/busybox/util-linux/fdisk.c?r1=1.22&r2=1.23&diff_format=u

Its hack for "force" ;-)

If to return the previous version of a Config.in
http://busybox.net/cgi-bin/cvsweb/busybox/util-linux/Config.in?r1=1.12&r2=1.13
and to apply last patch, then I shall calm down. ;-)


(OOPS, last patch have autocorrected from my editor begins spaces to tabs and
removed spaces from empty lines too).


--w
vodz
2004-05-19 10:49:17 +00:00
Russ Dill 5c9323f4e6 use busybox sysinfo struct 2004-05-19 09:18:04 +00:00
Eric Andersen 256c4fd587 Make vodz happy and make fdisk always use large file support if
possible, even if LFS is not enabled for the rest of busybox.
 -Erik
2004-05-19 09:00:00 +00:00
Eric Andersen 28885c3f20 Fix a compile problem 2004-05-19 08:54:28 +00:00
Russ Dill 309c7b71e6 fix timewarp in client (server fix later) 2004-05-19 08:29:05 +00:00
Russ Dill 91e006c1ad remove uneccessary check (already done in pidfile.c) 2004-05-19 07:46:23 +00:00
Russ Dill 57f49d3185 fix memory leak caused by switch to vfork 2004-05-19 07:45:47 +00:00
Glenn L McGrath 21d7d61de1 Use int instead of char for return type, in theory avoiding a cast 2004-05-16 02:35:49 +00:00
Glenn L McGrath 5d2edbf16d Fix for debian bug #248106, should use int for returned getopt value. 2004-05-10 08:59:17 +00:00
Eric Andersen 6c0396ba2a Steve Grubb writes:
Hi,

I just re-reviewed the patch I just sent...and it needed to be BUFSIZ-3 in
dos2unix.c . tempFn is BUFSIZ so the last addressable spot it BUFSIZ-1. The loop
increments by 2. That's why it should be BUFSIZ-3.

Best Regards,
Steve Grubb
2004-05-05 19:39:21 +00:00
Eric Andersen aaff79a8dd Steve Grubb writes:
Hello,

I found and patched 2 more bugs. The first is a misplaced semi-colon. The second
one is a buffer overflow. I doubt the buffer overflow is triggered in real life.
But you never know what those wily hackers are up to.

Thanks,
Steve Grubb
2004-05-05 10:37:49 +00:00
Eric Andersen 6c8161d69f Steve Grubb writes:
Hello,

Last November a bug was found in iproute. CAN-2003-0856 has more information.
Basically, netlink packets can come from any user. If a program performs action
based on netlink packets, they must be examined to make sure they came from the
place they are expected (the kernel).

Attached is a patch against pre8. Please apply this before releasing 1.00 final.
All users of busy box may be vulnerable to local attacks without it.

Best Regards,
Steve Grubb
2004-05-05 07:05:32 +00:00
Glenn L McGrath 5ec58285c3 Fix size command, safe_strtoul gives and error if the \r is left in, the
RFC spec says the \r should be there.
This fix is the same as a recent wget fix
2004-05-04 10:43:34 +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
Glenn L McGrath cbc453c7a2 Update dpkg-deb usage to match current practices 2004-05-02 03:01:08 +00:00
Glenn L McGrath d14084019f This patch makes the id command SuS3 compliant and provides a groups
applet via an alias to id.
 - Add G option
 - Pedantic option checking
 - If effective group and user differs from the real one show both.
id.
 - Alias id -Gn to groups applet
2004-05-01 11:47:24 +00:00
Eric Andersen 6f9a7783ce Do not use getpass(3) 2004-05-01 01:27:30 +00:00
Glenn L McGrath 90d2bff4c6 Re-add the TODO list, mention tr 2004-05-01 00:49:49 +00:00
Glenn L McGrath edaf39156a Bugfixes
1) a non NULL terminated buffer that can mess up output, spotted by Ian
Latter
2) in miscutils/strings.c: get rid of useless pointer dereference in
third part of for(;;), spotted by Larry Doolittle
3) bug when reading from a pipe and being invoked as strings
"cat Readme | strings" is broken
"cat Readme | busybox strings" works
spotted by Ian Latter and fixed by Tito.
2004-04-30 23:09:39 +00:00
Glenn L McGrath faa3546fd7 Fix symlink handling and small memory leak 2004-04-29 09:24:19 +00:00
Eric Andersen f71ad6c9e4 Thomas Koeller writes:
Hi,

    the following output is from BusyBox 1.0.0-pre10:

    ~ # ip link help
    ip: Command "help" is unknown, try "ip link help".

    tk

This patch fixes it by removing the advertisements for
the "ip blah help" stuff that is not implemented.
2004-04-26 19:32:49 +00:00
Glenn L McGrath 51ba90ef51 Sync my tasks with AUTHORS file 2004-04-25 06:05:14 +00:00
Glenn L McGrath c6992feee3 Update my email address, document some of my tasks in the AUTHORS file 2004-04-25 05:11:19 +00:00
Eric Andersen b94669543d This sed patch can only be described as "duh". Stat the source file, chmod
the _destination_ file.  (Ah hah!  That works _much_ better...)  I
implemented the behavior, I just forgot to test this corner of it.  My fault,
sorry...

No, gnu sed -i doesn't preverve ownership information.  I checked.
Permissions, yes, ownership info, no.

Rob
2004-04-21 00:57:14 +00:00
Eric Andersen faa7d863fc So I'm building a linux from scratch system, using a working script to do this
that the _only_ change to is that gnu sed has been replaced with busybox sed.
And ncurses' install phase hangs.  I trace it down, and it's trying to run
gawk.  (Insert obligatory doubletake, but this is FSF code we're talking
about, so...)

It turns out gawk shells out to sed, ala "sed -f /tmp/blah file.h".  The
/tmp/blah file is basically empty (it contains one character, a newline).  So
basically, gawk is using sed as "cat".  With gnu sed, it works like cat,
anyway.

With busybox sed, it tests if its command list is empty after parsing the
command line, and if the list is empty it takes the first file argument as a
sed command string, and if that leaves the file list empty it tries to read
the data to operate on from stdin.  (Hence the hang, since nothing's coming
in on stdin...)

It _should_ be testing whether there were any instances of -f or -e, not
whether it actually got any commands.  Using sed as cat may be kind of
stupid, but it's valid and gawk relies on this behavior.

Here's a patch to fix it, turning a couple of ints into chars in hopes of
saving a bit of the space this adds.  Comments?

Rob
2004-04-21 00:56:22 +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
Glenn L McGrath c6a99b993d Add two fundamental tests for copying directories 2004-04-18 13:35:56 +00:00
Eric Andersen 7ff33f1b42 Thats odd. I guess this was cut-n-paste error, but vodz
email address was wrong!
2004-04-16 15:02:10 +00:00
Eric Andersen b054aeb4fe Update Acronis and Belkin 2004-04-15 19:16:28 +00:00
Eric Andersen 73afd89610 Steven Scholz writes:
Hi there,

the "-h" option of httpd is not described in the usage text.

Please find the attached patch.

Thanks.

Steven
2004-04-14 17:59:21 +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 4c8b0dd973 bump version, prepare for -pre10 2004-04-13 19:38:17 +00:00
Eric Andersen 3561b017ce Fix incorrect ipcalc usage text 2004-04-13 19:27:20 +00:00
Eric Andersen a4375047d3 slightly clean the whacked out formatting 2004-04-13 19:25:57 +00:00
Eric Andersen 625da9d61e Fix several problems with start-stop-daemon, add -m support 2004-04-13 18:28:46 +00:00
Eric Andersen 3ddff210e6 Put the glibc nss junk back at the end 2004-04-13 16:31:41 +00:00
Eric Andersen b37f883478 Sigh. The patch from David Anders (prpplague) broke standard
securetty files since the /dev was not stripped.
2004-04-12 22:49:06 +00:00
Eric Andersen 99fcd168cc Wolfgang Denk writes:
He,

there is a bug in HUSH's handling of "if" / "elif" commands:

        $  if true
        > then
        > echo 1
        > elif
        > true
        > then
        > echo 2
        > elif
        > true
        > then
        > echo 3
        > else
        > echo 4
        > fi
        1
        2
        3
        $

The same bug exists in all versions of HUSH from BB v0.60.x up to and
including v1.00-pre9. The attached patch fixes this:

        $ if true
        > then
        > echo 1
        > elif
        > true
        > then
        > echo 2
        > elif
        > true
        > then
        > echo 3
        > else
        > echo 4
        > fi
        1
        $



Best regards,

Wolfgang Denk
2004-04-12 21:41:29 +00:00
Eric Andersen 238e354b58 Eric Spakman noticed that ifdown' will attempt to run 'ifconfig'
even if built with CONFIG_FEATURE_IFUPDOWN_IP when shutting down
a dhcp connection.
2004-04-12 20:57:17 +00:00
Eric Andersen 87812dc3b0 Silly me 2004-04-12 19:21:54 +00:00
Eric Andersen 4e19fa9b64 As reported by Quy Tonthat, init has problems with inittab's that
contain only actions sysinit/wait/once. It does not clean up zombies
in that case.
2004-04-12 19:17:13 +00:00
Eric Andersen 1e6aba967c Peter Milne writes:
Just upgraded from 0.6 to 1.00-pre8

Dot command handling handled args correctly (same as bash) in 0.60,
but failed in 1.00:

I fixed this by reverting the dotcmd function back to previous 0.60
instantiation,
please consider using the older version.

Thanks


Peter
2004-04-12 19:12:13 +00:00
Eric Andersen e3efc9230c Jamie Guinan writes:
It looks like latest uClibc defines ARCH_HAS_MMU, but a few busybox files
test UCLIBC_HAS_MMU, resulting in vfork() getting called instead of
fork(), etc.

Patch below.   Only tested for lash.

Cheers,
-Jamie
2004-04-12 17:59:24 +00:00
Eric Andersen a08345598d Add an extra link 2004-04-12 15:23:19 +00:00
Eric Andersen f802ff76d0 Patch from Rob Landley to fix sed documentation.
The -i option was not documented, and in genereal
the formatting was a bit ugly.
2004-04-12 15:12:06 +00:00
Eric Andersen 2d71756217 "Mac OS X" is how it is written on the Apple website 2004-04-12 15:05:10 +00:00
Eric Andersen 9b3ce77b07 Fix spelling. "sort of" is two words. 2004-04-12 15:03:51 +00:00
Eric Andersen ee4b7d496d make mount ignore -n when CONFIG_FEATURE_MTAB_SUPPORT is disabled 2004-04-12 15:02:53 +00:00
Glenn L McGrath 19efb3dc59 Fix compile error if CONFIG_FEATURE_IP_ADDR isnt enabled 2004-04-12 02:35:44 +00:00
Glenn L McGrath 36c7478992 Fix up conditional compile of files needed by ip applets 2004-04-12 02:22:39 +00:00
Glenn L McGrath 958ac18d4e Add a comment explaining why we have to check for an extra \n 2004-04-09 06:59:05 +00:00
Glenn L McGrath 32da885a91 Fix ftp resume
Terminate returned message at <CRLF> so strtoul returns without error
2004-04-08 10:27:11 +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 57a0d9156c Add the Tritton Technologies NAS120 2004-04-07 16:59:59 +00:00
Eric Andersen 957879ae1e Document insmod -o 2004-04-07 15:07:55 +00:00
Eric Andersen e54e8ef053 Update for release 2004-04-07 14:19:41 +00:00
Eric Andersen 23465579df Update changelog for release 2004-04-07 14:19:26 +00:00
Eric Andersen 6534fc764d Fix url 2004-04-07 14:07:27 +00:00
Eric Andersen 28738ff42d Minor update 2004-04-07 14:02:40 +00:00
Eric Andersen 47b73d09ba Mention Acronis PartitionExpert 2004-04-07 12:57:15 +00:00
Eric Andersen b48847319c More doc updates 2004-04-07 12:26:57 +00:00
Eric Andersen cd2af2475c Add an example inetd.conf file 2004-04-07 10:34:16 +00:00
Eric Andersen 075dd81c44 Remove the CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN option. It was sortof
stupid and didn't work properly anyways.
2004-04-07 09:34:27 +00:00
Eric Andersen b80c67e32c Update the default config 2004-04-07 09:17:14 +00:00
Eric Andersen 01bf3d0c92 Bump version to -pre9 2004-04-06 17:58:37 +00:00
Eric Andersen c4e5bfd65b Fix buffalo url 2004-04-06 17:53:09 +00:00
Eric Andersen 15c03c315f Yet more doc updates 2004-04-06 17:52:02 +00:00
Eric Andersen a151d19504 Yet more doc cleanups. Many thanks to Robert P. J. Day for
kindly reviewing the existing docs and providing helpful feedback.
2004-04-06 17:16:36 +00:00
Eric Andersen 0a87ac6546 Seem not many people are using 'ipaddr' since it has
never worked....  Most people use 'ip addr foo' I suppose.
2004-04-06 16:59:43 +00:00
Eric Andersen 7b5bb51f6a Fix indenting 2004-04-06 16:56:00 +00:00
Eric Andersen 178de17969 yet-more doc updates and cleanups 2004-04-06 16:36:20 +00:00
Eric Andersen 69bd0d1e89 Yet more doc updates 2004-04-06 15:39:20 +00:00
Eric Andersen f730088bbc Eliminate all trace of the sgml based docs. It was a noble effort,
but it just never worked out...
2004-04-06 15:26:25 +00:00
Eric Andersen 515881c6e1 Fix it so build dependancies actually work and do something useful 2004-04-06 15:19:52 +00:00
Eric Andersen 674b08a6b8 Fix it so usage is _always_ in sync with applets.c. Previously,
broken depends allowed these to get out of sync.
2004-04-06 14:28:35 +00:00
Eric Andersen 7e496a71cf Michael Tokarev, mjt at tls dot msk dot ru writes:
Fix parsing of all tag-value pairs (in modules.conf in particular).
Without this fix, code chokes badly on lines where either value or
both tag+value are missing, like bare
 alias
line, or alias w/o the value like
 alias some-module
(syntactically incorrect, but no need for coredumps either).
2004-04-06 12:06:03 +00:00
Eric Andersen d298bd1d51 Michael Tokarev, mjt at tls dot msk dot ru writes:
alias 'off' parsing fix.
It is not
 alias off module
it is
 alias module off
2004-04-06 12:05:04 +00:00
Eric Andersen ba05e79815 Michael Tokarev, mjt at tls dot msk dot ru writes:
Initialize all fields of struct dep_t.
Without that, e.g. `busybox modprobe -v char-major-10-144' *sometimes*
fails this way (strace):

 write(1, "insmod    nvram `\213\f\10\n", 21) = 21

Note the garbage after module name which is taken from the m_options field,
which is not initialized in the alias reading/parsing part.
(Shell properly complains to this command, telling it can't find the
closing backtick)
2004-04-06 12:04:14 +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
Eric Andersen b07ae7ba10 Yet more 'make allyesconfig' adjustments 2004-04-06 11:51:45 +00:00
Eric Andersen 8ee6943d3e Make 'allyesconfig' be a bit less stupid 2004-04-06 11:46:56 +00:00
Eric Andersen 5c1ee519ea Minor tar test update 2004-04-06 11:34:02 +00:00
Eric Andersen ba9b22a8cc Simplify, make formatting better match the procps version 2004-04-06 11:10:50 +00:00
Eric Andersen 650fe63467 Kill off the old 'tests' stuff. Write a ton of new tests for the
'testsuite' dir.  Fix a bunch of broken tests.  Fix the testsuite
'runtest' script so it actually reports all failures and provides
meaningful feedback.
 -Erik
2004-04-06 11:10:30 +00:00
Eric Andersen 39396b95fc Fix non standard 'date -R' formatting 2004-04-06 09:38:18 +00:00
Eric Andersen c354f6ee54 Fix the test suite script so it actually works and actually flags
all errors as such.  Make verbose mode exit on FAIL and provide a
printout of the failed test run.
2004-04-06 00:41:39 +00:00
Eric Andersen b2e267f153 Some test additions 2004-04-05 18:46:24 +00:00
Eric Andersen 18751cd4a2 Patch adding support for ibs= and obs= to dd 2004-04-05 14:30:15 +00:00
Eric Andersen 009617f413 Per suggestion by Pawel Sakowski, fix the dash_arith() prototype
to return a long.  We were needlessly truncating to an int.
2004-04-05 13:24:07 +00:00
Eric Andersen b2aa776f89 Tito, farmatito at tiscali dot it writes:
Hi to all,
I discovered a little bug in hdparm.c
(really two little bugs...I've made...sigh! Mea culpa).
Some vars were  modified only locally and this could lead to wrong
results to be displayed with the -I switch and maybe with others.
Attached is a patch that fix it ( +88b).

Also attached is second patch that reduces the size a little bit:
   text    data     bss     dec     hex filename
    27984     624     900   29508    7344 hdparm.o (without bug-fix)
    28072     624     900   29596    739c hdparm.o (with bug-fix)
    28141     624     900   29665    73e1 hdparm.o (original)
but maybe this one can wait as we are in a feature freeze.

Ciao,
Tito
2004-04-05 13:08:08 +00:00
Eric Andersen 762c64fdf1 rename uncompress.c to decompress_uncompress.c
rename unzip.c to decompress_unzip.c
2004-04-05 13:03:34 +00:00
Eric Andersen 522a2f3b39 Everything should be made as simple as possible. But no simpler. 2004-04-03 12:36:03 +00:00
Rob Landley 25d82397f7 The last patch broke:
sed -i "/^boo/a fred" ipsec.conf

Which works in gnu sed.  (And is _supposed_ to strip all the whitespace before
"fred".)

It also broke:
sed -i -e "/^boo/a \\" -e "   fred" ipsec.conf

I.E. there can legally be spaces between the a and the backslash at the end of
the line.

And strangely enough, gnu sed accepts the following syntax as well:
sed -i "/^boo/a \\  fred" ipsec.conf

Which is a way of having the significant whitespace at the start of the line,
all on one line.  (But notice that the whitespace BEFORE the slash is still
stripped, as is the slash itself.  And notice that the naieve placement of
"\n" there doesn't work, it puts an n at the start of the appended line.  The
double slashing is for shell escapes because you could escape the quote, you
see.  It's turned into a single backslash.  But \n there is _not_ turned into
a newline by the shell.  So there.)

This makes all three syntaxes work in my tests.  I should probably start
writing better documentation at some point.  I posted my current sedtests.py
file to the list, which needs a lot more tests added as well...
2004-04-01 09:23:30 +00:00
Eric Andersen 0b5bf45d32 Patch from Hideki IWAMOTO adding support for 'cmp -n' 2004-03-31 11:53:37 +00:00
Eric Andersen 46390ed829 Junio Hamano, junio at twinsun dot com writes:
The sed command in busybox 1.0.0-pre8 loses leading whitespace
in 'a' command ('i' and 'c' commands are also affected).  A
patch to fix this is attached at the end of this message.

The following is a transcript that reproduces the problem.  The
first run uses busybox 1.0.0-pre3 as "/bin/sed" command, which
gets the expected result.  Later in the test, /bin/sed symlink
is changed to point at busybox 1.0.0-pre8 and the test script is
run again, which shows the failure.

=== reproduction recipe ===
* Part 1.  Use busybox 1.0.0-pre3 as sed; this works.

root# cd /tmp
root# cat 1.sh
#!/bin/sh

cd /tmp
rm -f ipsec.conf ipsec.conf+
cat >ipsec.conf <<\EOF
version 2.0

config setup
        klipsdebug=none
        plutodebug=none
        plutostderrlog=/dev/null

conn %default
        keyingtries=1
        ...
EOF
sed -e '/^config setup/a\
	nat_traversal=yes' ipsec.conf >ipsec.conf+
mv -f ipsec.conf+ ipsec.conf
root# sh -x 1.sh
+ cd /tmp
+ rm -f ipsec.conf ipsec.conf+
+ cat
+ sed -e /^config setup/a\
        nat_traversal=yes ipsec.conf
+ mv -f ipsec.conf+ ipsec.conf
root# cat ipsec.conf
version 2.0

config setup
        nat_traversal=yes
        klipsdebug=none
        plutodebug=none
        plutostderrlog=/dev/null

conn %default
        keyingtries=1
        ...
root# sed --version
sed: invalid option -- -
BusyBox v1.00-pre3 (2004.02.26-18:47+0000) multi-call binary

Usage: sed [-nef] pattern [files...]

* Part 2.  Continuing from the above, use busybox 1.0.0-pre8
  as sed; this fails.

root# ln -s busybox-pre8 /bin/sed-8
root# mv /bin/sed-8 /bin/sed
root# sed --version
This is not GNU sed version 4.0
root# sed --
BusyBox v1.00-pre8 (2004.03.30-02:44+0000) multi-call binary

Usage: sed [-nef] pattern [files...]
root# sh -x 1.sh
+ cd /tmp
+ rm -f ipsec.conf ipsec.conf+
+ cat
+ sed -e /^config setup/a\
        nat_traversal=yes ipsec.conf
+ mv -f ipsec.conf+ ipsec.conf
root# cat ipsec.conf
version 2.0

config setup
nat_traversal=yes
        klipsdebug=none
        plutodebug=none
        plutostderrlog=/dev/null

conn %default
        keyingtries=1
        ...
root#
=== reproduction recipe ends here ===

This problem was introduced in 1.0.0-pre4.  The problem is that
the command argument parsing code strips leading whitespaces too
aggressively.  When running the above example, the piece of code
in question gets "\n\tnat_traversal=yes" as its argument in
cmdstr variable (shown part in the following patch).  What it
needs to do at this point is to strip the first newline and
nothing else, but it instead strips all the leading whitespaces
at the beginning of the string, thus losing the tab character.
The following patch fixes this.
2004-03-31 11:42:40 +00:00
Eric Andersen c11a6a887b Patch from Thomas Winkler:
ifconfig did not look up hostnames, so
	ifconfig lo localhost
would not work, you have to do
	ifconfig lo 127.0.0.1
2004-03-31 11:30:08 +00:00
Eric Andersen 11e5516d67 Patch from Thomas Winkler showing the the system time for each process
when running 'top'
2004-03-31 11:21:24 +00:00
Eric Andersen 90fb65f7a6 Patch from Thomas Winkler -- vi -R did not work 2004-03-31 11:12:51 +00:00
Eric Andersen bbbbcfef24 Sigh. what a mess. 2004-03-30 09:33:18 +00:00
Eric Andersen 0a92f35702 As waldi noticed, checks for the size of an off_t and casting
etc was also redundant and possibly buggy...
2004-03-30 09:21:54 +00:00
Eric Andersen 259cf97803 Go ahead and kill off the FDISK_SUPPORT_LARGE_DISKS option,
as it is redundant....
2004-03-30 09:13:05 +00:00
Eric Andersen 1236631700 The fdisk llseek junk was redundant, since both uClibc and glibc
automatically promote lseek and friends to their 64 bit counterparts
when CONFIG_LFS is enabled, since it enables __USE_FILE_OFFSET64
2004-03-30 09:08:58 +00:00
Eric Andersen 75eb90f288 As noted by Martin Schwenke, the example for find was wrong 2004-03-29 08:20:08 +00:00
Eric Andersen 38748fddf3 Yet more doc cleanups 2004-03-27 11:35:46 +00:00
Eric Andersen 8ee2b27f0c Add missing include files 2004-03-27 11:26:32 +00:00
Eric Andersen ea9bcda373 passwd and sulogin also need libcrypt, via libbb/pw_encrypt() 2004-03-27 10:08:53 +00:00
Eric Andersen 70060d25d2 s/fileno\(stdin\)/STDIN_FILENO/g
s/fileno\(stdout\)/STDOUT_FILENO/g
2004-03-27 10:02:48 +00:00
Eric Andersen edd580a088 Vladimir N. Oleynik (vodz) writes:
Ok. Last patch reduce 73 bytes for compensate (and over) your changes ;-)

Comments:
Added cin_fileno variable, auto setted to 0 from BSS and have "eq" stdin
descriptor if isatty(stout)==0, removed global variable FILE* cin.
Removed default setting to terminal_width/terminal_height, this used
only from main() and setted after call get_terminal_width_height()
always correct.
Variable please_display_more_prompt changed to bits logic, have size
reducing.
--w
vodz
2004-03-27 09:49:57 +00:00
Eric Andersen fbcf06d296 Update docs 2004-03-27 09:40:15 +00:00
Eric Andersen 97310d0253 Brian Pomerantz writes:
I've noticed a bug in the "autowidth" feature more, and is probably in
others.  The call to the function get_terminal_width_height() passes
in a file descriptor but that file descriptor is never used, instead
the ioctl() is called with 0.  In more_main() the call to
get_terminal_width_height() passes 0 as the file descriptor instead of
fileno(cin).  This isn't a problem when you more a file (e.g. "more
/etc/passwd") but when you pipe a file to it (e.g. "cat /etc/passwd |
more") the size of the terminal cannot be determined because file
descriptor 0 is not a terminal.  The fix is simple, I've attached a
patch for more.c and get_terminal_width_height.c.


BAPper
2004-03-23 23:15:36 +00:00
Robert Griebl 6bb80870b8 Some corrections from vodz:
- Make -u/-l mutually exclusive
- Minor size reduction
2004-03-22 21:27:39 +00:00
Robert Griebl c8685ead57 The utc variable was not modified according to the -u/-l command line
parameters.
2004-03-21 18:01:46 +00:00
Eric Andersen bfb51574ae Tito noticed a printf that should have been a bb_error_msg. 2004-03-20 00:56:46 +00:00
Manuel Novoa III 539fa95e0d Oops.. got a bit to aggressive with size optimization and global replace. :-( 2004-03-19 23:27:08 +00:00
Eric Andersen 1daa0c6097 As noted in a patch from Kendrick Hamilton, rmmod was only
half way converted, and still used the old delete_module(),
call rather than a syscall, in one spot.
2004-03-19 21:00:03 +00:00
Eric Andersen 9e458f5b7a Add missing ELFCLASSM for m68k 2004-03-19 12:17:04 +00:00
Eric Andersen 16451a07b4 Only use R_68K_GOTOFF if it is defined 2004-03-19 12:16:18 +00:00
Eric Andersen 06d4ec2a4b Fix broken arg parsing (was not passing pointer to items so p, argc, and argv
were only modified locally).  Fix error reporting to properly describe why
ioctls fail.
2004-03-19 10:53:52 +00:00
Eric Andersen 16767e2377 Patch from vodz to fix the dynamic vars patch, which I should not
have checked in.  Vladimir writes:

Your patch have many problem.
1. You always added + time(). This cannot reset RANDOM=value for debuging
with
replay sequential.
2. Hmm. I examine bash 2.04 source. This pseudorandom generator use low bits
of
counter value. You use high bits. This make bad pseudorandom values after
have
0-value. For example, if + time() do remove, your generator always return 0
after
first generate 0.
3. Memory leak per call. Use ash-unlike unecessary bb_strdup function.
4. Unsupport show last $RANDOM value for "set" and "export" command.
5. Bloat code. Busybox-unlike patch - added unstandart feature as default
hardcode.

Last patch attached.

Erik, why you apply Paul patch with have 5-th point problem? :(

Last patch have ash change xwrite() to fresh libbb/bb_full_write interfase
(haved loop after EINTR).


--w
vodz
2004-03-16 05:14:10 +00:00
Eric Andersen ca65ca7d45 Oops. Using the wrong variable was a rather stupid
thing for me to do.
2004-03-15 08:46:37 +00:00
Eric Andersen c7bda1ce65 Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
Manuel Novoa III 8854004b41 I redid route. 2004-03-13 18:17:37 +00:00
Eric Andersen 63a1a7aaa5 Update docs for start_stop_daemon to match reality. Update
the reality a bit to better match debian behavior.
2004-03-13 08:33:10 +00:00
Eric Andersen 55c704c119 Fix some doc generation problems 2004-03-13 08:32:14 +00:00
Eric Andersen ed43806c3b Hideki IWAMOTO writes:
Current `tr' implementation has a problem, if `plain char' is signed.

[current cvs version]

>echo a | _install/usr/bin/tr '\0' '\377'
Segmentation fault (core dumped)

[patched version]

>echo a | _install/usr/bin/tr '\0' '\377'
a
2004-03-12 22:10:40 +00:00
Eric Andersen d20d37559f Fix some goofy formatting 2004-03-12 22:08:42 +00:00
Eric Andersen 3cac0c7d7f Add prototypes for safe_strtol and friends 2004-03-12 22:08:13 +00:00
Eric Andersen 08f59e32c1 Fix awk entry, which was not showing up in BusyBox.txt for some reason 2004-03-12 22:07:10 +00:00
Eric Andersen ef02f82bcf Paul Mundt, lethal at linux-sh dot org writes:
Here's a follow-up replacement to the patch I sent earlier, this adjusts some
of the semantics of the dynamic variable setting. Namely, dynamic vars can hook
a set handler (which RANDOM uses to adjust the seed). They'll only lose their
dynamic status if they're unset.

I've used the same approach that bash does to come up with the random number,
mostly just for consistency.

For example:

$ echo $RANDOM
13759
$ echo $RANDOM
20057
$ echo $RANDOM
1502
$ export RANDOM=42
$ echo $RANDOM
24179
$ echo $RANDOM
2046
$ unset RANDOM
$ echo $RANDOM

$ export RANDOM=42
$ echo $RANDOM
42
$
2004-03-11 13:34:24 +00:00
Glenn L McGrath b7b3bda3ba Patch from Thomas Frohlich to fix an option ordering bug of mine. 2004-03-10 10:47:37 +00:00
Glenn L McGrath c66ebe4200 When displaying the size in 1kB blocks round up if an odd number of
blocks
2004-03-10 09:58:51 +00:00
Glenn L McGrath 44c0e17dbe Patch by Seth W. Klein, the -l switch was reversed 2004-03-10 09:10:53 +00:00
Manuel Novoa III 7d0c51919c In spite of the feature freeze, check in a complete rework of route which
fixes some bugs, adds some error checking, and removes _lots_ of bloat.
Text size on i386...
              old     new
   ipv6      5425    3523
   no ipv6   3143    2193
2004-03-10 07:42:38 +00:00
Eric Andersen 2715fa147a Note that /proc must be mounted for filesystem type autodetection
to work.  Without /proc mounted, one must explicitly specify the
type of every filesystem being mounted.
2004-03-09 21:32:57 +00:00
Eric Andersen 21d308601e David Anders (prpplague) submitted this patch to allow login to work
when the device nodes are symlinks on a read only file system.
2004-03-09 21:27:32 +00:00
Manuel Novoa III 1117c5281b Fix broken sort order flags. 2004-03-08 10:54:29 +00:00
Manuel Novoa III 948d4907a0 My bug. :-( 2004-03-08 05:44:30 +00:00
Eric Andersen 2479445562 Fix/eliminate use of atol 2004-03-06 22:11:45 +00:00
Glenn L McGrath c4db0833a6 Patch from Matt Kraai to fix debian bug number 231994.
There was an extra blank line preceding the first directory.
2004-03-06 09:12:55 +00:00
Glenn L McGrath a89bbfb257 Woops, how did that get in there 2004-03-06 07:38:27 +00:00
Manuel Novoa III adab517f76 Don't build these support functions for uClibc, as it always supplies
versions.
2004-03-06 00:32:54 +00:00
Glenn L McGrath db6ee81c99 Patch from John Powers, adds multicast (rfc2090) and timeout (rfc2349)
options
2004-03-05 15:52:57 +00:00
Glenn L McGrath ec58bce363 Patch from duane no-name, optionally request additional items 2004-03-05 14:35:00 +00:00
Glenn L McGrath 3f79300e37 Patch by Andrew Victor,
In arpping.h, fix structure alignment of "struct arpMsg".
GCC can insert padding in the structure which causes udhcpd to send an
invalid ARP packet on the network.  It will then not receive a valid
reply, which can cause it to assign an IP address that's already in use
on the network.
(With kernels before 2.4.20, the "struct ethhdr" in linux/if_ether.h
wasn't marked as packed.  This is also an issue if your toolchain was
built with a pre-2.4.20 kernel).
2004-03-05 14:25:49 +00:00
Glenn L McGrath 0226596dcb Fix a typo, patch by Andrew Victor 2004-03-05 14:23:16 +00:00
Glenn L McGrath 1bdc5d87f4 Patch from Tony J. White to allow paths to be configured 2004-03-05 13:23:40 +00:00
Glenn L McGrath bd5d84ddca Patch by Denis Vlasenko to add forground support. 2004-03-05 13:11:05 +00:00
Glenn L McGrath fbe984e1c9 Fix debugging output, patch by Hideki IWAMOTO 2004-03-05 13:04:39 +00:00
Glenn L McGrath c45146cf24 Patch by Felipe Kellermann to fix a compiler compatability problem 2004-03-05 12:55:30 +00:00
Glenn L McGrath 3d752f7ab2 Patch from Steven Scholz to fix compiler warnings 2004-03-05 09:38:16 +00:00
Glenn L McGrath fca056f691 New applet, eject, by Peter Willis 2004-03-05 07:26:28 +00:00
Glenn L McGrath 95ed8d9f35 Close bracket in description from Peter Willis's eject applet 2004-03-05 06:47:25 +00:00
Glenn L McGrath d2b860fecb Patch from Vernon Sauder.
The off_t type is not a consistent size; it depends on the kernel options
(something about large file support). Therefore, the format string for
printing an address is not always the same.
2004-03-05 05:47:19 +00:00
Glenn L McGrath bbf2ce36d8 Fix a compile error identiefied by Steven Scholz.
Declare variables first for compatability.
2004-03-03 21:12:16 +00:00
Glenn L McGrath e84152e9e1 Check file has execute permission for the current user, minor formating 2004-03-01 08:32:49 +00:00
Glenn L McGrath d5d5e54290 Quick fix for tftp truncation bug 2004-02-26 07:47:20 +00:00
Glenn L McGrath d1daf8b6f4 Patch from Denis Dowling to fix a ocuple of usage entries 2004-02-25 10:35:55 +00:00
Glenn L McGrath 10b781345f Fix option handling, -i or -t must be given, if both ignore the -t.
Use bb_getopt_ulflags.
2004-02-25 09:30:06 +00:00
Eric Andersen d8746cdc40 Joe.C, joe at numa dot com dot tw writes:
Hi,

When downloading files over slow network (e.g. wireless/
internet) using IE, sometimes it will stop downloading and
show error message 'connection closed' when the download
is almost complete. This is because IE can't handle server
close connection properly.

Apache http_main.c fix this problem by close the connection
after client close the connection. This patch do exactly the
same thing. Please consider include this patch.

Joe.C
2004-02-24 07:28:38 +00:00
Eric Andersen 60be069d58 Prepare for release 2004-02-23 09:14:07 +00:00
Glenn L McGrath 181f0773e2 bb_full_fd_action was incorrectly returning an error message causing
major breaking.
2004-02-23 08:11:07 +00:00
Eric Andersen a9d8f9c7bf Bump up version in preparation for -pre8 2004-02-22 12:27:04 +00:00
Eric Andersen 539ffc9129 Fernando Silveira writes:
Hi,

  Well, I made this patch a long time ago (08/2002) because it was a
  need of a project, but had no time to send it to you. It adds support
  to `autologin' option of the telnet protocol. It has been used since
  made with busybox 0.60.3 at production and I had no problems with it.
  I have ported it to the HEAD revision of the CVS server (20040211) and
  I hope you enjoy and apply it to the official sources. :)

Thanks a lot!
2004-02-22 12:25:47 +00:00
Glenn L McGrath df2c56529c Fix from Paul Kortekaas for syslog -C option, size should be in kB. 2004-02-22 12:17:33 +00:00
Glenn L McGrath 4bded58207 Patch from Dmitry Zakharov, this line was missedfrom the last patch 2004-02-22 11:55:09 +00:00
Eric Andersen 817565a0ff For the time being, revert the changes for detecting copying
a directory into itself.  It is harder to do this correctly
than it appears.  Not trying at all seems a better compromise
for the time being, untill we can implement this correctly.
2004-02-22 11:46:49 +00:00
Glenn L McGrath 15a4f1ee50 Patch from Chris Larson (kergoth), to allow multiple directores to be
unmounted at once.
2004-02-22 11:35:13 +00:00
Glenn L McGrath df7d84cf25 Patch from Vodz, cleanup memory usage, send strdup error messages to
syslog.
2004-02-22 11:25:13 +00:00
Glenn L McGrath 7fc504c6f7 Vodz. last_patch_128
- declare applet_using as static from applets.c
- small correction to cmdedit,
   previous version cleared history after Ctrl-C
- small spelling correction (by Friedrich Lobenstock)
2004-02-22 11:13:28 +00:00
Glenn L McGrath 90ed9a0eb6 Patch from James Zhu, telnetd window resizing support. 2004-02-22 09:45:57 +00:00
Glenn L McGrath 689e4b9531 Use bb_getopt_ulflags, marginal saving, better argument checking. 2004-02-22 09:11:33 +00:00
Glenn L McGrath f461e0123d Use /var/lib/hwclock for adjtime, its really a state file rather than a
config file, so it should be in /etc, FHS mentions it also.
2004-02-22 08:33:37 +00:00
Glenn L McGrath fa134cd954 Patch from Florian Schirmer. compile fix for debug builds 2004-02-22 07:38:36 +00:00
Glenn L McGrath d33278dea5 Patch from Hideki IWAMOTO, output debugging messages to stderr 2004-02-22 07:20:25 +00:00
Glenn L McGrath 34e1469f24 remove duplicate header declarations 2004-02-22 04:58:36 +00:00
Glenn L McGrath 9079ad0cab Fixup braces (patch from Thomas Geulig), run through indent and manually
adjust.
2004-02-22 04:44:21 +00:00
Glenn L McGrath e7f2b2bf31 Thomas Geulig, remove duplicate header 2004-02-22 04:17:26 +00:00
Glenn L McGrath 58fd67fa98 Update usage for ftpget and ftpput 2004-02-22 04:12:58 +00:00
Glenn L McGrath c699778fbb Ptch by Hideki IWAMOTO, fix a bug preventing tftp from getting or
putting more than 0xffff blocks.
2004-02-22 03:33:53 +00:00
Glenn L McGrath 6db8c22d07 Return 1 upon failure 2004-02-22 02:58:57 +00:00
Glenn L McGrath f1c4b11b24 No need to check proxy env variable twice, ignore proxy env variable if
its set to 0
2004-02-22 00:27:34 +00:00
Glenn L McGrath 15c3512614 Sometimes i get carried away with the use of function pointers, im sure
it seemed like a good idea at the time.
2004-02-21 09:20:56 +00:00
Glenn L McGrath 96099d51b6 Use return instead of exit, use == instead of & ==, left justify labels,
adjustment of whitespace.
2004-02-21 07:49:54 +00:00
Eric Andersen ced9705c42 Document missing cp options 2004-02-20 09:55:37 +00:00
Glenn L McGrath 916ba53f1a Fix up hard links 2004-02-20 02:34:42 +00:00
Glenn L McGrath c9f1fce9bb A strict interpretation of the ustar format requires the type flag to be
interpreted, we cannot depend on the file type being set in the mode
field.
2004-02-20 02:25:18 +00:00
Glenn L McGrath b0e163a93b Add extra comments, freakout if a pax archive is encoutered. 2004-02-19 08:48:30 +00:00
Eric Andersen e7d244cc96 Chris Larson (kergoth) writes:
As Manuel points out, this is a flawed fix, and doesnt fix the
following:

mkdir -p cpa cpb cpc
cp -a cpa cpa/cpb/cpc

Attached what appears to be a more sane fix.  Apply on top of previous.
Please confirm sanity.
2004-02-19 01:52:29 +00:00
Eric Andersen e0cbe48637 Chris Larson (kergoth) writes:
I was adding -s/--symbolic-link support to busybox cp when I noticed a
bug with -r/-a.  Test case:

mkdir -p test/out
cd test
busybox cp -a * out/

Will never return until we run out of open files or similar.
Coreutils cp on the other hand will error with "cannot copy a directory,
`out', into itself, `out'".  Patch attached.
2004-02-19 00:44:08 +00:00
Glenn L McGrath 03a0643fbc Dont use same variable and struct name 2004-02-18 13:19:58 +00:00
Glenn L McGrath 82d42dbb57 Formatting 2004-02-18 13:12:53 +00:00
Glenn L McGrath aac2a19e50 remove debugging 2004-02-18 12:58:00 +00:00
Manuel Novoa III 21fbe0e375 Patch from OpenWrt. 2004-02-18 10:14:17 +00:00
Rob Landley 53302f80da Add -i option to sed, to edit files in-place. 2004-02-18 09:54:15 +00:00
Manuel Novoa III be8a6ae6eb Fix vstype[] to match VS* defines. Patch from OpenWrt by mbm. 2004-02-18 09:40:41 +00:00
Eric Andersen 37aac6489e Remove the unused CONFIG_FEATURE_HTTPD_SET_CGI_VARS_TO_ENV option. 2004-02-17 20:08:11 +00:00
Eric Andersen 60bb3f31af Mark Lord writes:
The config file processing for inetd in busybox-1.00-pre7 and newer
is broken -- the saved command argv[] values overwrite each other.

Patch to fix it is attached.

Cheers
--
Mark Lord
Real-Time Remedies Inc.
2004-02-17 20:04:34 +00:00
Glenn L McGrath 01cdb66987 Add the -r option, patch from Rob with some help from myself. 2004-02-17 12:22:21 +00:00
Glenn L McGrath a8f756fc7f Remove debugging 2004-02-17 12:04:13 +00:00
Glenn L McGrath 6aa52234e8 Dont strip trailing '/' until _after_ i test to set if its there ! 2004-02-17 11:55:06 +00:00
Manuel Novoa III 7b565a0c8a Patch from Florian Schirmer <jolt@tuxbox.org>. When I rewrote the parser,
I overlooked the case of someone wanting to use a valid but empty suid
config file.
2004-02-17 10:16:21 +00:00
Glenn L McGrath c2266bd519 Woops, im getting ahead of myself, we dont have the -r (refernece)
option yet
2004-02-17 07:58:04 +00:00
Glenn L McGrath 5f11541bd4 define option names to be clearer, simplify nested if statements, remove
un-needed if statement, minor indenting change
2004-02-17 07:51:31 +00:00
Eric Andersen 7e8f41cb5b Avoid naming conflict with symbol in newer glibc headers 2004-02-14 21:33:39 +00:00
Eric Andersen ec359e9ebb Accomodate the fact that newer libc versions may in fact not
contain query_module and friends and more
2004-02-13 08:09:43 +00:00
Eric Andersen 95b26250a7 oops. Leave the default feature set enbled for now... 2004-02-10 01:30:21 +00:00
Eric Andersen 37032b4d6c Initial effort at disabling job control as well 2004-02-10 01:28:36 +00:00
Eric Andersen ff9ad47d79 Support disabling pipe and redirect support 2004-02-10 01:07:45 +00:00
Eric Andersen a0e4c3f119 Update URL 2004-02-09 10:57:04 +00:00
Eric Andersen 2af7f4c404 Buffalo appears to have resolved their GPL problems 2004-02-09 10:01:01 +00:00
Eric Andersen 5cc90eade5 Richard Kojedzinszky writes:
Hi All,

I aplogoize for the mistake, but i have just recognized that somehow the
last patch I sent in was wrong, and a '0' was instead of a '-1'. Because
of this, vi does behave the wrong way. So again, it should be the last
patch for vi. This is for pre7.
2004-02-06 10:36:08 +00:00
Eric Andersen fa06a77040 Patch from vodz, based on bug report from Richard Kojedzinszky:
Richard,

>I have a problem, which I can reproduce now. I am using pre7 version of
>busybox, and the tab completion works fine. I mean, with an empty command
>line I press the TAB twice, and ash shows me the available commands. But
>when i process the profile file below, as
> $ . /etc/profile
>then it stops working, and the double-tab lists the directories available
>from the cwd, and not the commands. Has someone else meet this problem
>before, or am i doing something wrong?
>
>This is  my '/etc/profile':
>- ---
># System profile
>
>PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
>export PATH
>trap ":" INT QUIT TERM
>
>export PS1="\h \w # "

Thanks. Patch attached.


--w
vodz
2004-02-06 10:33:19 +00:00
Eric Andersen ef8cd3be17 Make the loop support stuff be much less evil, and make it cope
with 2.6.x asm/posix_types.h, which has done singularly evil thing
by yanking __kernel_dev_t and renaming it.  The loop interface was
really poorly designed in the first place.  The new 64 bit loop
interface looks to be somewhat less horrible, too bad it is only
present in 2.6.x kernels.
 -Erik
2004-02-06 07:16:36 +00:00
Eric Andersen 7495b0d4b1 Eliminate use of a kernel scsi header file.
Prevent potentially misaligned accesses while indexing a pointer
to the partition table, which would be a bad thing on i.e. arm.
2004-02-06 05:26:58 +00:00
Manuel Novoa III 68474f3b36 Make sure stdlib.h is always included before dmalloc.h to avoid problems
parsing problems.
2004-02-05 14:45:58 +00:00
Eric Andersen d07cf59a98 Vladimir N. Oleynik writes:
Hi, Glenn.

Current CVS "ls" applet have small problem: some options
ignoring. Last patch attached ;-)


--w
vodz
2004-02-05 13:52:03 +00:00
Eric Andersen 54426d5297 Vladimir N. Oleynik writes:
Ok. I found my mistake :(
The trivial patch attached.

--w
vodz
2004-02-05 13:49:29 +00:00
Eric Andersen 31d898feff Elaborate on CONFIG_SELINUX, and explain that most people should
not enbable this option.
2004-02-05 00:18:26 +00:00
Eric Andersen 96e9785493 Grammar fix 2004-02-04 12:07:40 +00:00
Eric Andersen 4da3dbb7df Minor grammar fixup 2004-02-04 11:59:48 +00:00
Eric Andersen 7cce16cf21 Bump version number for release 2004-02-04 11:44:58 +00:00
Eric Andersen aeea32ca69 Richard Kojedzinszky writes:
Hi,

I've noticed the bug also, and here is another patch for it. I hope it'll
not introduce more bugs. Not too nice, but works for me.

Here it is for busybox-1.00-pre6
2004-02-04 11:19:44 +00:00
Eric Andersen ef43749e83 Joe.C writes:
Hi,

   When httpd connection is closed, bosybox httpd will
not stop reading from CGI program. This patch fix this
problem. It check the return value of bb_full_write and
stop reading from CGI if the connection is closed.
Please apply this patch.

Joe.C
2004-02-04 11:10:28 +00:00
Eric Andersen c71c18957d Jean Wolter writes:
Hello,

when calling seq with

    seq 1 1

it generates an "endless" list of numbers until the counter wraps and
reaches 1 again. The follwoing small patch should introduce the
expected behavior (output of 1 and termination):

regards,
Jean
2004-02-04 11:01:19 +00:00
Eric Andersen c06f568dda Rob Landley writes:
While building glibc with busybox as part of the development environment, I
found a bug in glibc's regexec can throw sed into an endless loop.  This
fixes it.  Should I put an #ifdef around it or something?  (Note, this patch
also contains the "this is not gnu sed 4.0" hack I posted earlier, which is
also needed to build glibc...)
2004-02-04 10:57:46 +00:00
Eric Andersen 4575bbf7b8 The variable 'complementaly' used to be allocated with calloc, which zeroed it
out during the allocation process.  When vodz changed it to be allocated on the
stack, he forgot to explicitly zero it, leaving its value filled with whatever
used to be sitting on the stack.  It would garbage values, depending on the
garbage that happened to be sitting on the stack when the function was called.
The result was that applets using bb_getopt_ulflags() were showing
unpredictable behavior (such as segfaults), which naturally broke many things.
2004-02-04 10:48:37 +00:00
Glenn L McGrath 5b0d7deb75 Bug fix from Tito. 2004-02-04 08:27:57 +00:00
Glenn L McGrath 16e45d7e29 Vodz last_patch_125_2, this patch have:
- synced with dash 0.4.21
- better handle trap "cmds..." SIGINT (strange, i make bad hack for ash 
  and cmdedit, but this work only with this...)
- may be haven`t problem with Ctrl-D
2004-02-04 08:24:39 +00:00
Manuel Novoa III 31b98dd097 Rewrite parse_config_file(). Among the old version's problems:
No checking for lines that were too long.
  No checking that fgets returning NULL was actually due to EOF.
  Various whitespace handling inconsistencies.
  Bloat (switches and multiple identical function calls).
  Failure to check for trailing characters in some cases.
  Dynamicly allocated memory was not free()d on error.
Given that this controls suid/sgid behavior, the sloppy coding was
really inexcusable.  :-(
2004-02-01 10:03:05 +00:00
Manuel Novoa III 083862228a Use bb_xstrdup() instead of strdup(). 2004-02-01 07:34:28 +00:00
Glenn L McGrath 24cb17f9be Fix http proxy use, bytes were swapped 2004-01-31 08:08:57 +00:00
Eric Andersen 35db2281b7 Mention changes to the daily snapshots 2004-01-31 06:11:39 +00:00
Eric Andersen a3212eb4cc Update docs for release 2004-01-31 05:44:07 +00:00
Eric Andersen dfe30032af Bump version for release 2004-01-31 05:27:17 +00:00
Eric Andersen ad95373efc Use standard C99 types 2004-01-30 23:45:53 +00:00
Eric Andersen 1a834be1ce Use proper C99 types 2004-01-30 22:59:50 +00:00
Eric Andersen d242079387 Fixup use of 'u_int' to instead use 'unsigned int' 2004-01-30 22:56:20 +00:00
Eric Andersen dfcb5b0412 s/u_int/uint/g 2004-01-30 22:54:20 +00:00
Eric Andersen 0f56de665c s/u_int/unsigned int/g
s/u_short/unsigned short/g
2004-01-30 22:52:27 +00:00
Eric Andersen 39cdf4e2ab Use proper C99 types 2004-01-30 22:40:05 +00:00
Eric Andersen ad84a516bb Use proper C99 types throughout. So not use silly typedefs. 2004-01-30 22:31:58 +00:00
Eric Andersen ab26cc3d8a Avoid symbol naming conflict with libm 2004-01-30 22:24:32 +00:00
Manuel Novoa III ebce2daa60 Support new uClibc stdio core. 2004-01-30 21:44:20 +00:00
Eric Andersen f88bb72f1f Apply a couple of optimizations 2004-01-29 22:33:28 +00:00
Eric Andersen 242ab83499 Teach busybox ps to get the correct uid when displaying stuff 2004-01-27 20:17:39 +00:00
Glenn L McGrath 82364bb591 New applet, seq. No options, just the basics. 2004-01-27 09:22:20 +00:00
Glenn L McGrath 43112b4b65 Align using spaces to furthurest character and then one tab, now they
should always be aligned.
2004-01-27 07:36:07 +00:00
Eric Andersen 13cf6626c8 A few little updates, mostly cosmetic 2004-01-26 08:23:36 +00:00
Eric Andersen 63bcf1a55f Sigh. TRENDware has released source -- only for busybox and udhcp.
So despite their not providing kernel source, they have compiled with
the requirements for busybox at least...
2004-01-26 07:59:42 +00:00
Eric Andersen f2ec37902a Pascal Brisset writes:
uuencode fails to encode binary data because it right-shifts
bytes as signed chars and keeps the duplicated sign bits.

The original base64_encode() from wget/http.c is broken as well,
but it is only used to encode ascii data.

-- Pascal
2004-01-26 07:17:30 +00:00
Manuel Novoa III 7018385fe7 Be stricter when converting strings to integers. Should fix the problem
reported by Rob.
2004-01-25 19:47:10 +00:00
Glenn L McGrath bbbe21d6b0 Fix compile error when tab completion disabled 2004-01-25 08:46:10 +00:00
Glenn L McGrath 4766a2d56c Add the -r option as a synonym of -R 2004-01-25 05:50:28 +00:00
Glenn L McGrath 303e989a11 Add the -h, --dereference option for archive creation. 2004-01-25 05:48:28 +00:00
Glenn L McGrath ca43b485de Enable long options, adds 150 bytes. 2004-01-23 21:57:16 +00:00
Glenn L McGrath 2d016a3715 Correct check for only one of K or S options 2004-01-23 21:43:49 +00:00
Glenn L McGrath 654a99b691 Check valid options were given 2004-01-23 21:40:19 +00:00
Glenn L McGrath 711bb92d7c Dont change ownership unless we created the directory. 2004-01-23 20:28:53 +00:00
Glenn L McGrath 578eff5066 Remove unneeded conditions and logic, fix bug where ownership didnt
change.
Dont use bb_make_directory it doesnt have the features, and its ugly to
work around it.
2004-01-23 10:57:00 +00:00
Glenn L McGrath 475820c9de last_patch_124 from Vodz, fix an ash bug when alt-1 was pressed, debian
bug #228915
2004-01-22 12:42:23 +00:00
Glenn L McGrath 8d44178381 Check one and only one of start, stop are given.
Remove some global variables.
#define some getopt values.
2004-01-22 09:04:58 +00:00
Glenn L McGrath 85c5152cb8 Vodz, last_patch_123, patch have new version getopt_ulflags.
- size reduced 34 bytes
- don`t use dynamic memory allocation
- small indent correction.
2004-01-22 07:10:13 +00:00
Glenn L McGrath a1e4a0ef67 Patch from Atsushi Nemoto, recent MIPS kernel headers
does not provide PAGE_SHIFT for userland (because now mips-linux kernel
supports PAGESIZE other than 4K).
2004-01-21 11:36:44 +00:00
Glenn L McGrath ee829065cb Patch by Richard Kojedzinszky, when using END at end of lines it was
skipping to next line, cw command was leaving one char in buffer
2004-01-21 10:59:45 +00:00
Glenn L McGrath eaf5bc0038 Redo getconfigent, save 150 bytes, still small memory leak when
parsing invalid entries.
2004-01-20 15:32:39 +00:00
Glenn L McGrath 348672d46d Patch from Tito, reduce size, merge functions that are only used once. 2004-01-20 12:57:18 +00:00
Eric Andersen 15eb39c25a Stephane Billiart writes:
bb_lookup_port now takes 3 parameters but rdate has not been modified
accordingly and fails to compile in the current CVS version.
The modification below fixes the problem.

Now, RFC868 allows both UDP and TCP implementations of the time protocol
so this may not work if someone defines a udp time service other than 37
but who would do that?
2004-01-18 18:18:33 +00:00
Glenn L McGrath 53766c4063 Fix up a couple of bugs i introduced in yesterdays cleanup. 2004-01-18 08:58:06 +00:00
Glenn L McGrath 65b6d8bdb6 Fix a bug where ls -le would print the time twice. 2004-01-18 05:41:30 +00:00
Glenn L McGrath 792cae5f2a Use bb_getopt_ulflags, save 200-300 bytes 2004-01-18 05:15:16 +00:00
Glenn L McGrath 58a2e0e262 Patch from Leif Lindholm (slightly modified by me), to fix http
redirection.
Example of incorrect behaviour was the following url, busybox wget didnt
get redirected to the busybox url as it should.
http://freshmeat.net/redir/busybox/953/url_homepage/www.busybox.net
2004-01-17 23:07:14 +00:00
Glenn L McGrath 036dbaa082 Modify bb_lookup_port to allow the protocol to be specified, allowing
/etc/services support for inetd, netcat and tftp.
2004-01-17 05:03:31 +00:00
Glenn L McGrath b03be7f567 Patch from Arthur Othieno, clarify common options between dpkg and dpkg-deb 2004-01-17 03:24:05 +00:00
Glenn L McGrath a277e02663 The functions setconfig, enter and bump_nofile were only called once, marge them into the calling
function.
2004-01-17 03:20:46 +00:00
Glenn L McGrath ff6ec8a2ae Use 1 line for function name and return value,
remove dofork define/variable,
dont check pid value is < or > than 0 if we know it is 0.
2004-01-17 02:47:45 +00:00
Glenn L McGrath 3e77b4e954 Remove some defined statements 2004-01-17 01:44:32 +00:00
Glenn L McGrath c3b134f3b7 Changed #define names for common features (superficial) 2004-01-17 01:26:53 +00:00
Glenn L McGrath 2faf306c73 Use bb_get_chomped_line_from_file 2004-01-17 00:34:31 +00:00
Eric Andersen 16f94a6722 Minor updates from linux 2.6.1 2004-01-16 12:49:06 +00:00
Glenn L McGrath 17b4a20a9c Patch by Tito, reduce size of deallocvt, also make the usage message
clearer (from N to [N]) and indirectly (through bb_xgetlarg) adds support
for  -h ;-)
2004-01-15 11:50:19 +00:00
Glenn L McGrath 67285965f3 Vodz last_patch_122, Check $PATH at runtime to fix tab completion 2004-01-14 09:34:51 +00:00
Glenn L McGrath 6a78631164 Patch by Tito, use bb_xgetlarg, reduce size 2004-01-14 07:34:37 +00:00
Eric Andersen 1cda715bbc Fix a bug where mount could check the wrong device. st_rdev is the correct
device ID iff the named file is a character or block special device.  Otherwise
it is meaningless junk, in which case st_dev should be used.  This was done
incorrectly, which could cause mount to display bogus mount info.
 -Erik
2004-01-13 11:39:22 +00:00
Glenn L McGrath 7c87b67c08 Patch from Bastian Blank, allow the buildtime to be overriden with a
different string, used by the debian busybox-cvs to specify the debian
date based version number.
2004-01-13 10:57:32 +00:00
Glenn L McGrath 76620620ec Vodz last_patch_121, syncing with dash_0.4.19, reduce code size. 2004-01-13 10:19:37 +00:00
Glenn L McGrath dfb6211df3 Patch by Tito, remove some unneeded variables to save some space. 2004-01-13 10:12:16 +00:00
Glenn L McGrath 447bc2d17f Patch from Matt Kraai to fix debian bug #227081
cp does not truncate existing destinations.  That is, after
running

 echo foo > foo
 echo fubar > fubar
 cp foo fubar

the contents of fubar are

 foo
 r

instead of

 foo
2004-01-11 05:20:59 +00:00
Eric Andersen 716ccb2635 whitespace cleanup 2004-01-10 11:29:31 +00:00
Eric Andersen 8e2f74f5a7 Woody Suwalski writes:
I have found the problem in modprobe, so here is the promised patch
At the current stage I can use it as modprobe while switching between
2.4 and 2.6 seemlesly...(that is good!)
2004-01-10 11:25:53 +00:00
Glenn L McGrath 95f75a3dcd Patch from Bastian Blank to fix debian bug #226722, test case:
mkdir foo
 touch foo/bar
 ln -s bar foo/baz
2004-01-08 10:51:09 +00:00
Glenn L McGrath 1f28b90a9c Use bb_getopt_ulflags, save 100 bytes and strict argument checking. 2004-01-07 09:24:06 +00:00
Eric Andersen 9d65ab2beb Woody Suwalski writes:
accept more then 1 dependency per modules.dep line. Also white space cleanup...
I think that parsing still breaks sometimes, but is mostly functional now.
2004-01-06 00:07:17 +00:00
Eric Andersen 66e21fd161 Fix broken #else 2004-01-05 23:49:37 +00:00
Glenn L McGrath ab7780655b Use bb_getopt_ulflags, save 150 bytes. 2004-01-05 12:35:05 +00:00
Glenn L McGrath 6cb3bc056c Use bb_getopt_ulflags, simplify some logic, saves some bytes. 2004-01-05 11:49:55 +00:00
Glenn L McGrath 08ca752c68 Fix usage with libraries, skip symbol table. 2004-01-04 11:06:34 +00:00
Glenn L McGrath 930453bdcf Use bb_getopt_ulflags, saves some space, better argument checking.
Remove ar specific extraction code, always use common extraction code.
2004-01-04 10:28:22 +00:00
Rob Landley 40ec4aeb8e Thinko in s//options. (Whitespace skipping in the wrong place.) 2004-01-04 06:42:14 +00:00
Glenn L McGrath 3b25185733 Declare dependencies of command line editing in the build system 2004-01-03 12:07:32 +00:00
Eric Andersen ffa28d1b46 fixes from Selwyn Tang 2004-01-02 10:07:40 +00:00
Eric Andersen 8f3eb1dbab Add some details on exactly how to comply with the GPL
-Erik
2004-01-02 09:08:45 +00:00
Glenn L McGrath a43faccbde Sync to waldi's subversion archive 2004-01-01 00:23:01 +00:00
Glenn L McGrath 5c9f0d05b3 Fix debian bug #215612, insmod should be silent on request 2003-12-31 23:20:10 +00:00
Glenn L McGrath cfc0ad4260 Batch from Bastian Blank to fix debian bug #216435;
When linking a non existing file busybox ln will report the target
missind and not the source:
2003-12-31 23:10:44 +00:00
Eric Andersen 7f48a959f5 Update example slightly 2003-12-28 05:06:56 +00:00
Tim Riker 7b253f8c72 ws, show date setting format 2003-12-28 05:02:40 +00:00
Glenn L McGrath f980bd5848 Fix a bug of mine, identified by Stephane Billiart 2003-12-27 00:21:47 +00:00
Russ Dill 6caa073760 it should work even if you don't assign a pidfile 2003-12-26 23:41:28 +00:00
Glenn L McGrath ce91c8ac2b Isolate code better for unused options, config option to enable long
options, add some conditions to the tar tests in testsuite.
2003-12-26 14:01:37 +00:00
Glenn L McGrath ab8215431f Vodz last_patch120, more busybox integration, saves 330 Bytes. Tested. 2003-12-26 02:19:34 +00:00
Eric Andersen 3b1a74467a re-indent 2003-12-24 20:30:45 +00:00
Russ Dill d242e49c89 fix a long standing underallocation bug 2003-12-24 19:57:13 +00:00
Russ Dill a8992635b1 move debugging to safe place (before vfork) 2003-12-24 19:31:08 +00:00
Eric Andersen b90502828c Patch from Ned Ludd, solar at gentoo dot org:
I had previously provided you with a patch to help complete busybox's
props suite, but have heard no word back. Sense then I've made use of as
many of busybox's native API settings as I could find and would really
love for you to include support for this. If there is something more I
need to do to get this supported added in please let me know.
2003-12-24 06:02:11 +00:00
Eric Andersen 5089534be0 match changes made to cmdedit 2003-12-23 20:47:22 +00:00
Eric Andersen d10f36fe2e Match changes made to cmdedit 2003-12-23 20:45:14 +00:00
Eric Andersen 3a5ed56803 fix broken formatting 2003-12-23 20:37:54 +00:00
Eric Andersen 9cccc18141 don't mess up errno 2003-12-23 20:37:23 +00:00
Eric Andersen 27bb79080d Cmdedit update from Vladimir N. Oleynik (vodz) 2003-12-23 20:24:51 +00:00
Eric Andersen a6beeb6a7e Show the news by default 2003-12-23 10:00:00 +00:00
Eric Andersen f0da28c91b Prepare for release 2003-12-23 09:12:09 +00:00
Eric Andersen 52a3c2726e Patch from Matt Kraai:
sed is broken:

 busybox sed -n '/^a/,/^a/p' >output <<EOF
 a
 b
 a
 b
 EOF
 cmp -s output - <<EOF
 a
 b
 a
 EOF

The attached patch fixes it.
2003-12-23 08:53:51 +00:00
Glenn L McGrath b89fcd4430 Fix compile error, the indenting really needs to be fixed here 2003-12-23 07:21:33 +00:00
Glenn L McGrath 334dc65c92 Fix a bug of mine where extracting files to stdout would extract to
much, modified patch from Bastian Blank
2003-12-22 21:02:41 +00:00
Eric Andersen a120c32cfa Bump version 2003-12-21 09:04:54 +00:00
Eric Andersen 67ff3a1ffd Don't hose up perms for files that happen to have symlinks
in the tarball that point to them.
 -Erik
2003-12-21 08:59:24 +00:00
Eric Andersen 0933a92f5a bother. It seems I can't read. 2003-12-20 10:23:28 +00:00
Eric Andersen f295b5a408 doh! 2003-12-20 09:17:50 +00:00
Glenn L McGrath 8f3bc4ce52 New applet, rx, by Christopher Hoover 2003-12-20 07:30:35 +00:00
Eric Andersen a8d82fe52e Try to accomodate systems that do not define PAGE_SHIFT 2003-12-20 07:26:10 +00:00
Eric Andersen b868f55c78 Eradicate all references to loadacm 2003-12-20 07:16:22 +00:00
Eric Andersen 08573e0ac4 Kill off the loadacm applet. It is unused, unmaintained
garbage leftover from before I started maintaining BusyBox.
As the Klingon's like to say, Today is a good day to die.
 -Erik
2003-12-20 07:07:22 +00:00
Glenn L McGrath 02e0355504 Use bb_xopen 2003-12-20 06:00:08 +00:00
Glenn L McGrath 236e93d133 Allow recieving file to stdout, sending files from stdin, use the '-'
filename. Save a variable.
2003-12-20 05:43:34 +00:00
Glenn L McGrath f62ea20aff Use low level file descriptors to match bb_copyfd_eof 2003-12-20 04:38:01 +00:00
Glenn L McGrath 266c1f5eff display the port number number correctly, other minor optimisations 2003-12-20 03:19:27 +00:00
Glenn L McGrath ffccf6eb5d Change interface to bb_lookup_host, dont try and set port inside this
function as there is no gracefull way of handling failures.
Rename bb_getport to bb_lookup_port, allow a default port to be
specified so it always returns a correct value.
Modify ftpgetput/rdate/wget to use the new interface.
wget/rdate now use etc/services with a falback default value.
2003-12-20 01:47:18 +00:00
Eric Andersen 03d8091859 Patch from Woody Suwalski:
Erik, I think we have met online some time ago when I was in Corel/Rebel
    Netwinder project....

Anyway, I would like to use BB on 2.6.0 initrd. 1.00-pre4 works OK, if
insmod is actually presented with a full path to the module. Otherwise -
problems (not to mention conflicts when 2.4 modutil is enabled)

Here are some patches for insmod and modprobe which try to walk around
the default ".o" module format for 2.2/2.4 modules (you have probably
noticed it is now .ko in 2.6 ;-)) Trying to steal as little space as
possible if 2.6 not enabled...

The modprobe is still not perfect on 2.6 - seems to be jamming on some
dependencies, but works with some (to be debugged). Anyway after the
patches it at least tries to work....

Will there be a 1.00-pre5 coming any time soon?

Thanks, Woody
2003-12-19 21:04:19 +00:00
Glenn L McGrath 514aeabc36 Use getopt_ulflags 2003-12-19 12:08:56 +00:00
Glenn L McGrath 28c111e1c5 Allow escaped 8 bit characters in bb_opt_complementaly 2003-12-19 12:03:18 +00:00
Eric Andersen d4a5e255c4 Patch from Fillod Stephane:
You will find in the attached file "syslog.patch" a patch which adds
  config options to set at compile time the size of the circular buffer,
  and some documentation update.
2003-12-19 11:32:14 +00:00
Eric Andersen 3752d337b3 Patch from Fillod Stephane:
* While I'm at it, there's also a "telnetd.patch" which maps CRLF to CR,
  like netkit-telnet does, required by the loosy Windows telnet clients.
2003-12-19 11:30:13 +00:00
Eric Andersen 89f10bcf37 Patch from Fillod Stephane:
* The "rdate.patch" file makes rdate to NOT settimeofday if the date to be
set equals current date. This prevents the system from experiencing nasty time
discontinuities caused by sub-second changes, with a protocol that has only
over second resolution. Depending on your taste, the "fprintf(stderr..." may be
removed.
2003-12-19 11:29:29 +00:00
Eric Andersen 769a3ef08d Patch from Stephane Billiart:
This removes references to config->remoteuser when
CONFIG_FEATURE_HTTPD_CGI=y but CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set
2003-12-19 11:23:47 +00:00
Eric Andersen f18bd8931d Tito writes:
Hi to all,
here is a new patch for bb's devfsd. The news are:

1) Size reduction for the basic setup with no options compiled in from :
     text        data     bss     dec       hex   filename
    10591     392      543    11526   2d06 devfsd.o
    rw-r--r--    1 root     root        18536 Dec 18 21:52 devfsd.o

    to:

    text        data     bss     dec        hex  filename
    9303      392      543    10238    27fe devfsd.o
    rw-r--r--    1 root     root        16528 Dec 18 22:02 devfsd.o

   With this setup you should not expect much output from devfsd
    ( just at start or with -v) and if some error occurs it only exits 1.
   To have more output enable:  " Increases logging (and size)" (+1568 b).

2) The option "Adds function names to program output" was removed from config menu
    and now to enable debug output you can use bb's standard option:
    "Build BusyBox with Debugging symbols".
    Be careful as with this option enabled a lot of data are outputted to /dev/log and/or to stderr.

3) A new option: "Enables the -fg and -np option" was added to config menu  (+128 b).

BTW: option "Adds support for MODLOAD keyword in devsfd.conf"  adds 268 b.

4) The following keywords in devsfd.conf are supported:
   "CLEAR_CONFIG", "INCLUDE", "OPTIONAL_INCLUDE", "RESTORE",
   "PERMISSIONS", "EXECUTE", "COPY", "IGNORE",  "MKOLDCOMPAT",
   "MKNEWCOMPAT","RMOLDCOMPAT", "RMNEWCOMPAT".

   But only if they are written UPPERCASE!!!!!!!!

5)Help text in usage.h was modified.

6)Something that I have forgotten..........

I've tested this for the last week on my box and it seems to work as expected.

Thanks in advance and please apply.

Ciao,

Tito
2003-12-19 11:07:59 +00:00
Eric Andersen 1a773a656e Manousaridis Angelos writes:
Another issue I found was with the iproute utility. While using another
program I found that it failed because the "ip route del" command was
not found. I looked at the full iproute implementation and this command
exists. The busybox version has the "ip route delete" command. I have
created a patch which makes the "ip route del" command an alias to the
"ip route delete" command.
2003-12-19 10:47:40 +00:00
Eric Andersen 658f8b1d1a Manousaridis Angelos writes:
Hello,

I have been using busybox for some time now, for an ARM based platform.
I was very pleased when I tried the 1.00preX series, with all the new
utilities and daemons.

I found out that the ifupdown in busybox does not behave exaclty like
the debian version. Then the pre-up script fails, the interface is
getting up. Also when the post-up script fails the return value is
ignored. Actually everything is always run and the return value is
always true. I looked at the original implementation from debian and
fixed the busybox version to do the same. A patch is attached if anyone
is interested.
2003-12-19 10:46:00 +00:00
Eric Andersen b8d2cd44a6 don't use kernel headers 2003-12-19 10:40:56 +00:00
Glenn L McGrath b51eb26568 Use getopt_ulflags 2003-12-19 10:37:52 +00:00
Eric Andersen 07d2f4052f vodz noticed we need to cast things back to an unsigned long
or the syscall will not get the proper arguments.
2003-12-19 10:34:36 +00:00
Glenn L McGrath 850b05fbde Fix a bug preventing use of escaped characters that use the signed bit 2003-12-19 10:13:10 +00:00
Russ Dill f796700cf0 rename __getgrent so that it doesn't conflict with some libc's 2003-12-18 22:40:58 +00:00
Russ Dill 4e864a36b6 Finish remerging busybox udhcp and udhcp. Some cleanups as well. 2003-12-18 22:25:38 +00:00
Russ Dill e30495654d clean up some bad, bad formatting 2003-12-16 22:46:33 +00:00
Russ Dill 76729b8c69 include headers with prototypes to make sure prototypes match 2003-12-16 20:44:15 +00:00
Eric Andersen 5f46f1c241 remove reference to missing header file which is breaking the build 2003-12-16 12:04:01 +00:00
Eric Andersen b627c54813 Using vlock also requires libcrypt 2003-12-16 07:43:20 +00:00
Russ Dill 6b3f757053 revert removal of define 2003-12-16 02:38:09 +00:00
Russ Dill 4040d3d712 forgotten include 2003-12-16 02:34:28 +00:00
Russ Dill 8b3845106a why the complication of a static string rather than a define? gcc isn't dumb 2003-12-16 02:30:53 +00:00
Russ Dill 4b77acafa6 start attempting to bring udhcp in busybox back to the state where it is (ideally) an exact copy of udhcp outside of busybox so that its easy to merge back and forth 2003-12-16 02:28:20 +00:00
Russ Dill 7becf5987a when compiled standalone, udhcp needs these headers 2003-12-16 01:42:18 +00:00
Russ Dill a3170d5aab whoops 2003-12-16 01:33:38 +00:00
Russ Dill 8f43126934 not sure who made this change, but it certainly mucks things up (note 'fwrite(leases, ...'), adds a bit more code, and some stack overhead. Anywho, this fixes it, and retains the spirit of what the submitter of this change was attempting to acheive (the entire lease is written at once in a struct) 2003-12-16 01:29:40 +00:00
Russ Dill 62419df95c make udhcp work under uclinux, to an extent 2003-12-15 22:11:26 +00:00
Russ Dill 4a9e34c148 options is a pretty common symbol, bad idea to use as a global in udhcp when compiling into busybox 2003-12-15 22:09:36 +00:00
Russ Dill a1fece2c70 Get vfork_daemon_rexec working under uclinux 2003-12-15 21:57:44 +00:00
Eric Andersen d4f7a5edad Be certain we use a correct entity when performing the
BLKGETSIZE64 ioctl -- don't just assume 8,
2003-12-12 19:05:15 +00:00
Eric Andersen c1893c5801 Doh! I broke automatic filesystem type guessing. Fix mount so
it will properly fall back to /proc/mounts when /etc/filesystems
is missing, allowing mount to guess the correct fs type when a
fs type is not explicitly specified.
 -Erik
2003-12-12 07:01:14 +00:00
Eric Andersen 416c24224d Fix compile when CONFIG_FEATURE_HDPARM_GET_IDENTITY is disabled 2003-12-12 00:08:57 +00:00
Eric Andersen 7dad86601a It appears the Netgear WG602 distributes source 2003-12-11 18:03:15 +00:00
Eric Andersen e06bea7767 Fixup some html bugs 2003-12-11 08:04:49 +00:00
Eric Andersen 5b8a59400c some minor website cleanups 2003-12-11 07:13:15 +00:00
Eric Andersen c181f34c87 prepare for release 2003-12-11 02:48:15 +00:00
Eric Andersen e7047887b0 Update modutils with 2.6 module support 2003-12-11 01:42:13 +00:00
Eric Andersen 37f4116ecb go directly to current cvs 2003-12-11 01:29:46 +00:00
Eric Andersen de4f07e56e remove some spaces that mess up autodocifier.pl 2003-12-11 01:18:07 +00:00
Eric Andersen 9f6c12a42e add missing copyright text 2003-12-10 20:50:14 +00:00
Eric Andersen 2e0455d82b some minor updates 2003-12-10 20:41:48 +00:00
Eric Andersen 539eef6f28 update website 2003-12-10 12:08:20 +00:00
Eric Andersen d5c746f3a8 Fix indenting.
Fix a bug noticed by Pete Flugstad.  Make certain we close what we open, and
don't try to close invalid files when /etc/filesystems exists and is used.
2003-12-09 23:50:24 +00:00
Eric Andersen 747f2f7d78 Bump version number 2003-12-09 17:31:48 +00:00
Glenn L McGrath f6bba3d689 Splitting statements with #define's can cause trouble for cross
compilers (and it looks a bit messy)
2003-12-08 20:31:25 +00:00
Glenn L McGrath 9adcf73152 Stop sending data to the client after the first failure.
Patch by Joe.C
2003-12-08 20:21:53 +00:00
Glenn L McGrath 5c0d84aaf0 Bring usage upto date, patch by Steven Scholz 2003-12-08 20:11:55 +00:00
Glenn L McGrath 142abc18ce Fix a compile error when only using ar, patch by Paul van Gool 2003-12-05 02:51:21 +00:00
Manuel Novoa III 22e1ca382b Add (untested) support for cris, based on the (old) busybox insmod
that axis distributes.
2003-12-04 15:02:57 +00:00
Glenn L McGrath c83e3a6406 Patch from Steven Scholz, make usage more consistent with actual
behaviour.
2003-12-04 13:06:44 +00:00
Eric Andersen 50547c0745 Do not use the _syscall5 macro -- use syscall(2) instead 2003-12-04 07:07:14 +00:00
Glenn L McGrath 3860b2ebd6 Patch from Tito, size optimisation, cleanup noise when in debugging
mode, adds support for MODLOAD keyword in devfsd.conf, provides a
cleaned up version of example/devfsd.conf
2003-11-30 23:46:06 +00:00
Glenn L McGrath 5be6a200f0 Correct Matteo's email address 2003-11-28 22:55:03 +00:00
Glenn L McGrath b8c3a54531 Patch from Ian Campbell, fix or'ed dependencies and handle virtual
dependencies.
2003-11-28 22:38:14 +00:00
Glenn L McGrath 11e69471be Fix a bug, ignore the source path when installing to a directory.
We may be installing symlinks, so use lstat/lchown.
Make use of bb_getopt_ulflags and cp_mv_stat2, save 100 bytes.
2003-11-27 22:40:08 +00:00
Glenn L McGrath e39ee01821 Fix tar hard links 2003-11-27 00:01:43 +00:00
Glenn L McGrath fea4b446df Important bugfixes from Ian Campbell.
init_archive_deb_data()
        We want to filter for data.tar.* in the AR file not the TAR
        file, else we get nothing.

all_control_list()
        Make the 'extensions' array of control file names a global so it
        can be used in unpack_package as well. Name the global
        all_control_files. Don't hard code the length of
        all_control_files but instead used sizeof.

unpack_package()
        Only unpack the control files we are interested in (from
        all_control_files). Extract the data.tar.gz into / rather than
        the current directory.

dpkg_main()
        Configure packages in a second pass so all the packages being
        installed are unpacked before configuring.

Some purely cosmetic changes:

header
        update list of differences since two of them are no longer true.
        The .control file is no longer stored as a result of this patch
        -- it was redundant since the info is in status. New packages
        appear to be added to the end of the status file now rather than
        the start.

remove_package()
        Make message printing optional, so we can avoid a redundant
        message when replacing/upgrading a package. When we do print
        stuff then include the version number.

purge_package()
        Print "Purging xxx (yyy) ..." message like the other actions.

configure_package()
        Add "..." to "Setting up" message to be consistent with other
        actions.
2003-11-26 21:53:37 +00:00
Glenn L McGrath 4ddddd180e Fix for "Broken pipe" issue, vodz last_patch116_3 2003-11-25 20:45:38 +00:00
Glenn L McGrath c3498f678a When a size of 0 is passed to copyfd_size, dont do anything, it was
reading untill eof which breaks tar
2003-11-24 23:50:07 +00:00
Glenn L McGrath f0515dad66 Fix warning 2003-11-22 02:13:41 +00:00
Glenn L McGrath 7ffe133864 As we no longer use function pointers for read in common archiving code
archive_xread can be replaced with bb_full_read, and archive_copy_file
with bb_copyfd*
bb_copyfd is split into two functions bb_copyfd_size and bb_copyfd_eof,
they share a common backend.
2003-11-21 22:24:57 +00:00
Glenn L McGrath 1a2d75fd72 Use safe read 2003-11-21 22:17:28 +00:00
Glenn L McGrath d0550d8fc9 Fix warning 2003-11-21 21:54:07 +00:00
Glenn L McGrath acbdc47aac Make use of libbb functions bb_xopen, bb_full_read, used #define's
instead of static consts, avoid xmalloc.
2003-11-21 09:27:02 +00:00
Glenn L McGrath 2cd1eb16ad Remove unused function 2003-11-20 22:36:57 +00:00
Glenn L McGrath 78cd84da8a Dont over-read fd, use function pointer for hash function. 2003-11-20 21:30:58 +00:00
Glenn L McGrath e857122c97 Fix tar-handles-nested-exclude testcase 2003-11-20 10:47:06 +00:00
Glenn L McGrath d9c8ab40a4 Update status of tests which should pass 2003-11-20 09:57:44 +00:00
Glenn L McGrath 3a2fcc63b8 remove controversial tests 2003-11-20 09:56:34 +00:00
Glenn L McGrath bebc40b406 Check at least one context is specified 2003-11-20 09:53:31 +00:00
Glenn L McGrath ba49651de9 Check there are files to add the archive before removing a specified
tar file.
2003-11-20 09:06:10 +00:00
Glenn L McGrath 90c9df93f3 Dont attempt to unlink directories 2003-11-20 08:00:38 +00:00
Glenn L McGrath 0413af0e27 Superficial changes 2003-11-20 06:27:33 +00:00
Glenn L McGrath 5c069aaf2f Fix up the -s option, and make usage consitent with behaviour,
patch by Steven Scholz
2003-11-20 05:58:26 +00:00
Glenn L McGrath d85421de22 Include stdint.h 2003-11-20 05:26:38 +00:00
Glenn L McGrath 931ae9d2f8 woops, we needed that function 2003-11-18 23:56:41 +00:00
Glenn L McGrath 0c5d9c27a5 COMPRESS, not UNCOMPRESS 2003-11-18 23:27:49 +00:00
Glenn L McGrath 7370f62493 Update usage for tar -Z 2003-11-18 21:49:23 +00:00
Glenn L McGrath 0b6539f7f9 Update md5sum, sha1sum options, patch by Steven Scholz 2003-11-18 21:40:30 +00:00
Glenn L McGrath 56f16b42c9 tar -Z, uncompress support 2003-11-18 21:37:52 +00:00
Glenn L McGrath 20872be9a4 Dont close original file handle, we may need it later. 2003-11-18 21:31:19 +00:00
Glenn L McGrath 3b9fc8fe2a Make unlink old files default behaviour and add a new option -k to
prevent overwritting existing files
2003-11-18 20:23:04 +00:00
Glenn L McGrath de3ea9f049 Only use getopt and associated flags if checking is enabled 2003-11-18 19:35:06 +00:00
Glenn L McGrath aee0fd8320 Replaced by md5_sha1_sum.c 2003-11-18 19:33:13 +00:00
Glenn L McGrath 303b7d83f0 Replaced by md5_sha1_sum.c 2003-11-18 18:56:25 +00:00
Glenn L McGrath f074afc2a0 Dont free filename, its needed in the extracted files list. 2003-11-17 21:58:00 +00:00
Glenn L McGrath cccf49fb0f This was made obsolete by config-udeb-linux-i386 2003-11-17 10:46:36 +00:00
Glenn L McGrath 7e4b3347b2 Remove net-udeb flavour, we dotn use it 2003-11-17 10:43:08 +00:00
Glenn L McGrath 0874a613d2 Use the PROG variable instead of 'busybox' in the release target 2003-11-17 10:26:43 +00:00
Glenn L McGrath 8dc8cb133c Fix a bug where cpio wouldnt work unless -u was specified 2003-11-15 23:44:31 +00:00
Glenn L McGrath 5699b8525e Move from read_gz to the pipe()+fork() method.
open_transformer(), common code for pipe+fork.
Function pointer for read() no longer needed.
Allow inflate to be initialised with a specified buffer size to avoid
over-reading.
Reset static variables in inflate_get_next_window to fix a bug where
only the first file in a .zip would be be extracted.
2003-11-15 23:19:05 +00:00
Glenn L McGrath 54ac057c00 Fix memory leaks 2003-11-15 00:24:43 +00:00
Glenn L McGrath 5c2c8eca4a Fix a "broken pipe" problem. vodz, last_patch_116-2 2003-11-14 21:01:26 +00:00
Glenn L McGrath e57feeb9e6 Keep trying to find a good header, if we exit it will cause .tar.gz
files to compute incorrect crc and length for gzip
2003-11-14 12:57:14 +00:00
Glenn L McGrath eba86e2adb Catch unsupported features 2003-11-14 12:53:42 +00:00
Glenn L McGrath e9080c9f41 NEW APPLET: pipe_progress, used by debian installer 2003-11-14 10:04:33 +00:00
Glenn L McGrath 7b215b99b2 Fix build error with tar -j 2003-11-14 09:22:24 +00:00
Glenn L McGrath 1a41db8eaf Remove some tar_gz stuff that get dragged in 2003-11-14 09:21:27 +00:00
Glenn L McGrath 94cf153c2b Remove debugging noise. 2003-11-14 08:30:46 +00:00
Glenn L McGrath d09bcecda8 Read in blocks rather than one char at a time, greatly improves speed 2003-11-14 08:26:25 +00:00
Eric Andersen 5f28455c6e Oskar Liljeblad writes:
Here's a fix for the hard-coded device name in fbset.
2003-11-14 03:11:29 +00:00
Eric Andersen b6e58d2b9a Michael Smith writes:
I noticed a problem with ifconfig in busybox 0.60.5. The matching code
seems to exist in busybox CVS as well, so I'll paste in the patch that
fixed it.

I was running:
 # ifconfig wan0 1.2.3.4 pointopoint 1.2.3.5 netmask 255.255.255.255

I was seeing the inet addr and P-t-P addr both being set to 1.2.3.5
(the pointopoint address).

wan0      Link encap:Point-Point Protocol
          inet addr:1.2.3.5  P-t-P:1.2.3.5  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          ...

The patch below seems to fix it.
2003-11-14 03:04:08 +00:00
Eric Andersen c16686c1e2 Ulrich Marx writes:
hello

i had some trouble with the filedescriptor in udhcp.
Two things happened on my device:
1.) broken or not connected cable (no dhcp-server)
2.) daemonizing (starting with option -b)

i got a filedescriptor fd=0 from function raw_socket,
after daemonizing (daemon call) the fd is closed.
Client can't recieve data's anymore.

i fixed this problem (like pidfile handling):
2003-11-14 03:00:04 +00:00
Eric Andersen 61b038accc Steven Seeger writes:
Hey guys. I've found a bug in modprobe where it generates bad strings and
makes sytem calls with them. The following patch seems to have fixed the
problem. It is rather inherited elsewhere, as there seems to be incorrect
entries in the list which results in more dependencies than really exist for
a given call to mod_process. But, this patch prevents the bad text from
going to the screen. You will notice there are cases where lcmd goes
unmodified before calling system.

Please consider the following patch.

Thanks.

-Steve
2003-11-14 02:49:19 +00:00
Eric Andersen 8211db5af0 Vladimir N. Oleynik (vodz) writes:
Hi Glenn.

I analysed BSS size gzip applet and found may be mistake:
updcrc() checking  if (crc_table_empty) but not resetted this var.
This do make slow gzip applet ;-)


--w
vodz
2003-11-14 02:44:28 +00:00
Eric Andersen e0c83af4ce Marc Kleine-Budde noticed a missing semicolon 2003-11-14 02:40:08 +00:00
Glenn L McGrath d2a897aab0 Merge common parts of sha1sum and md5sum, which is everything except the
algorithms.
Move algorithms to hash_fd and make them available via a common
function.
2003-11-10 04:33:55 +00:00
Eric Andersen 0bdf41ad7e Add some basic cvs usage info 2003-11-08 00:33:02 +00:00
Eric Andersen bbce615c7e Rob Landley writes:
Remove three entries in defconfig that config no longer has.

Rob
2003-11-08 00:23:23 +00:00
Eric Andersen 2849209db2 Patch from Steven Scholz to send the output from 'time'
to stderr, rather than stdout, so that things like

~ # time bunzip2 -c /tmp/test.bz2 > /dev/null
real    0m 29.44s
user    0m 29.30s
sys     0m 0.12s

operate as expected.
2003-11-07 21:39:14 +00:00
Eric Andersen 28d4e16cd7 This appears to be the correct fix to make CONFIG_FEATURE_DEB_TAR_BZ2
support compile.  Glenn, you may want to verify this.
 -Erik
2003-11-07 21:31:58 +00:00
Eric Andersen d2160aaeab fix comment 2003-11-07 21:22:09 +00:00
Tim Riker b1ffba0401 wrap bb help output if CONFIG_FEATURE_AUTOWIDTH 2003-11-07 19:37:20 +00:00
Eric Andersen 1b1942f93d As vodz pointed out, setting unset_env to NULL is sufficient 2003-11-07 11:20:21 +00:00
Glenn L McGrath 7f9de02ca6 Rewrite, 800+ bytes smaller and more robust. 2003-11-06 03:17:23 +00:00
Eric Andersen 5912acb670 By popular demand, revert to version 1.21, since Rules.mak:1.22
causes the build to ignore CROSS_COMPILER_PREFIX set in .config
2003-11-05 11:34:26 +00:00
Glenn L McGrath 2685724e23 Fix tar -j support
Use the old fork() method of tar compression support, rather than
read_bz2....
 - (*uncompress)(int in, int out) seems like a more natural interface
for compression code.
 - it might improve performance by seperating the work into one cpu
bound and one io bound process.
 - There is extra code required to do read_[gz|bunzip] since (*uncompress)(int in,
int out) will normally be used by the standalone compression applet.

There have been problems with this method so if you see a "Short read"
error let me know.
2003-11-05 04:55:58 +00:00
Eric Andersen 6d687817a8 Fix oversight with CONFIG_FEATURE_AUTOWIDTH handling 2003-11-04 23:16:48 +00:00
Eric Andersen b7077a7316 Set unset_env pointing to a NULL item, to prevent us from walking
off the end of the list and segfaulting.
 -Erik
2003-11-03 22:46:14 +00:00
Eric Andersen 04d055f4e1 Fix rdate and ftpget/ftpput so they compile with the new xconnect.
I have checked rdate.  Someone should also check ftpget/ftpput to
be sure they still work.
2003-11-03 21:20:18 +00:00
Eric Andersen f6067beaa9 Avoid conflicts with the 2.6 kernel headers, which define
_IOR rather differently, thereby breaking the BLKGETSIZE64
ioctl.
 -Erik
2003-11-03 08:59:51 +00:00
Eric Andersen e6dc439b3a Rework wget, the xconnect interface, and its various clients
in order to fix the problems with round robin DNS reported
by Andrew Flegg:
    http://busybox.net/lists/busybox/2003-October/009579.html

This removes the ipv6 specific xconnect dns lookups.  I do
not see why that would need to be special cased for ipv6 as
was done, but that will just have to be tested.

So IPV6 people -- please test this change!

 -Erik
2003-10-31 09:31:46 +00:00
Eric Andersen 8179cf2b78 Put back the tar support stubs (and warnings) for now. 2003-10-31 08:52:57 +00:00
Eric Andersen 252183e3f5 Try to make indent formatting less horrible 2003-10-31 08:19:44 +00:00
Glenn L McGrath e64bf409dd Patch from David Meggy to make the swap default to the new version if no
version is specified and the kernel is relatively new.
2003-10-31 02:04:18 +00:00
Glenn L McGrath 4ef5a84583 Move the tail -c option from FANCY_TAIL to the default tail, this makes
the default tail options conform to SUSv3, with the non-SUS
option all in FANCY_TAIL
2003-10-31 00:35:59 +00:00
Eric Andersen 0120be94a0 Fix stupid typo 2003-10-31 00:21:28 +00:00
Glenn L McGrath 9716575f1a Remove config options for sort -u and sort -r, they are always enabled 2003-10-31 00:04:24 +00:00
Glenn L McGrath 40c9489d33 Add a comment with link to the SUSv3 standard for xargs 2003-10-30 22:51:33 +00:00
Glenn L McGrath 09c295a5bc run through indent 2003-10-30 22:47:16 +00:00
Glenn L McGrath 00ed36fd52 Patch from Dmitry Zakharov,
Fixes two bugs:
- END block didn't execute after an exit() call
- huge memory consumption and performance degradation on large input
(now performance is comparable to gawk)
2003-10-30 13:36:39 +00:00
Eric Andersen b8b6816f7b make certain values specified in the environment always win 2003-10-30 07:48:38 +00:00
Glenn L McGrath f4fd3a1331 Accept the -c option and do nothing 2003-10-29 11:10:02 +00:00
Glenn L McGrath 984b45142a fix a bug where `which' doesn't check whether the file passed as an argument
is a regular file, patch by Arthur Othieno
2003-10-29 04:50:35 +00:00
Glenn L McGrath 6530f0d3a1 make CONFIG_FEATURE_UNARCHIVE_TAPE common between itar and cpio, patch
by Arthur Othieno
2003-10-29 04:46:30 +00:00
Glenn L McGrath 4636aa9dcd "A few references to sourcefiles and URLs in docs/contributing.txt had
gone stale" - Peter Korsgaard
2003-10-29 03:40:47 +00:00
Glenn L McGrath f235d05773 Use the return value from uncompress_bunzip, fix some typo 2003-10-29 03:37:54 +00:00
Glenn L McGrath 1c834407e3 Add some error messages, use xmalloc instead of malloc 2003-10-28 23:32:12 +00:00
Glenn L McGrath debb21ece7 Fix a logic error, the old bunzip code returned non-zero for success,
new code returns 0 for success.
2003-10-28 23:04:50 +00:00
Glenn L McGrath e81fc5fb30 Conditionally compile some files.
This hides a bug related to the new bunzip code in the tar and dpkg[-deb]
applets.
It will also reduce compile time a little as some unused files wont be
compiled.
2003-10-28 10:44:58 +00:00
Eric Andersen 5fa4db29f7 Another bzip2 update and speedup from Manuel Novoa III, with some
additional changes (primarily lots of comments) from Rob Landley.
2003-10-23 06:52:01 +00:00
Eric Andersen 2053a8c747 the dc applet now needs libm
-Erik
2003-10-22 22:29:08 +00:00
Eric Andersen e78fe2414b sigh 2003-10-22 11:36:55 +00:00
Eric Andersen a92877403a Goetz Bock writes:
Dear list,

during my quest do pack busybox into an RPM, I've fixed a small bug
(missing \n) in dc's usage. And added two additional operations: mod and
exp/power.

Feel free to drop them.
2003-10-22 11:24:39 +00:00
Eric Andersen a48b0a3af7 last_patch116 from vodz:
Stephane,

>Using busybox+uclibc, crond syslog messages look like:
>
>Oct  9 09:04:46 soekris cron.notice crond[347]: ^Icrond 2.3.2 dillon,
>started, log level 8

Thanks for testing.

>The attached patch corrects the problem.

Your patch is not correct.
Correct patch attached.

Also. Last patch have
- add "Broken pipe" message to ash.c
- busybox ash synced with dash_0.4.18

--w
vodz
2003-10-22 10:56:47 +00:00
Eric Andersen 514633bf3f Tomasz Motylewski reported that the 'which' applet does not find
files when the full file PATH is specified.

This patch from Arthur Othieno fixes it.
2003-10-22 10:38:22 +00:00
Eric Andersen 7f6295f516 Patch from Arthur Othieno for style-guide.txt conformance 2003-10-22 10:34:15 +00:00
Eric Andersen 28672dd3b9 Patch from Arthur Othieno for docs/style-guide.txt conformance. 2003-10-22 10:30:53 +00:00
Eric Andersen 9ef6c93090 Patch from Arthur Othieno to fix a compiler warning 2003-10-22 10:26:38 +00:00
Eric Andersen 976a55e168 make this a little bit less messy 2003-10-22 10:23:04 +00:00
Eric Andersen f1d3ac429e Update mail location 2003-10-22 10:19:01 +00:00
Eric Andersen 637d2266e1 Disable any buffering to stdout 2003-10-22 10:18:24 +00:00
Eric Andersen 5289969f08 Tito writes:
Hi to all,
I'm sorry but  I didn't spot this big fat bug until now,
Matteo Croce emailed me about it.
Please apply this patch as the devfsd applet is broken
and works only on a system booted with a standard devfsd
( the test I mostly did :-(   ), but if used at boot time
it DOESN'T WORK.

Thanks in advance and please apply
Tito
2003-10-22 10:10:50 +00:00
Eric Andersen 88c916bdec Andreas Mohr writes:
the busybox menuconfig triggered my "inacceptable number of spelling mistakes"
upper level, so I decided to make a patch ;-)

I also improved some wording to describe some things in a better way.

Many thanks for an incredible piece of software!

Andreas Mohr, random OSS developer
2003-10-22 09:58:56 +00:00
Eric Andersen 951df20b7e Do a better job of dealing with screwy s390 abi changes 2003-10-21 06:45:29 +00:00
Eric Andersen acf6c917e2 ccording to this:
http://sources.redhat.com/ml/binutils/2003-01/msg00290.html
The name R_390_GOTOFF was changed to R_390_GOTOFF32.
 -Erik
2003-10-20 05:40:40 +00:00
Eric Andersen 1acfb72e71 Manuel Novoa III writes:
Hello Rob,

Here's a patch to your bunzip-3.c file.  Nice work btw.

One minor bug fix... checking for error return when read()ing.
Some size/performance optimizations as well.  One instance of
memset() seems unnecssary.  You might want to take a look.

Anyway, on my machine, decompressing linux-2.6.0-test7.tar.bz2
to /dev/null gave the following times:

        bunzip-3.c    bzcat (system)   bunzip-3.c (patched)
real    0m24.420s     0m22.725s        0m20.701s
user    0m23.930s     0m22.170s        0m20.180s
sys     0m0.070s      0m0.080s         0m0.140s

Size of the patched version is comparable (slightly larger or
smaller depending on compiler flags).

Manuel
2003-10-18 01:59:46 +00:00
Eric Andersen 0d6d88a205 Rob Landley's new micro-bunzip version 3. Rob writes:
The API for using partial writes, as described in my last message, sucked.

So here's a patch against my last patch that changes things so that
write_bunzip_data calls read_bunzip_data itself behind the scenes whenever
necessary.  So usage is now just start_bunzip(), write_bunzip_data() until it
returns a negative number, and then the cleanup at the end of
uncompressStream.

It adds 32 bytes to the executable, but it should allow the caller (tar) to be
simplified enough to compensate.  Total -Os stripped exe size now 6856 bytes.

Rob

P.S.  I attached the whole C file so you don't have to keep incremental
patches straight if you don't want to. :)

P.S.  In the version I'm banging on now, I've simplified the license to just
LGPL.  I read the OSL a bit more closely and the patent termination clause
would have bit IBM in their counter-suit of SCO if the code in question had
been OSL instead of GPL, and I've decided I just don't want to beta-test
legal code right now.
2003-10-18 01:58:35 +00:00
Tim Riker 6fe55ae939 old gcc 2003-10-17 18:54:55 +00:00
Eric Andersen 7857c03808 Paul Mundt (lethal) writes:
Erik,

The format for /proc/meminfo has changed between 2.4 and 2.6, quite considerably.
In addition to the removal of the two-line summary that was present in 2.4,
MemShared was also removed. Presently (at least in busybox CVS HEAD), top fails
to parse this correctly and spews forth a:

top: failed to read 'meminfo'

message. This patch switches around some of the semantics a little to do sane
parsing for both 2.4 and 2.6. Also, in the event that the summary gets yanked
from 2.4, this patch will deal with that as well. With this patch, I'm able
to run top correctly on 2.6.0-test7 (tested on sh).

Please apply.

 procps/top.c |   60 +++++++++++++++++++++++++++++++++++++++++++++++------------
  1 files changed, 48 insertions(+), 12 deletions(-)
2003-10-11 18:47:20 +00:00
Glenn L McGrath d12061b299 Vodz last_patch_117, update options for new xargs 2003-10-10 23:15:23 +00:00
Glenn L McGrath 61796945e3 Vods versions of xargs 2003-10-10 12:10:18 +00:00
Eric Andersen 75a5684793 I don't need to have my email adder listed twice 2003-10-09 21:19:21 +00:00
Eric Andersen 2af70005b9 Do not use kernel headers 2003-10-09 21:02:23 +00:00
Glenn L McGrath fe4704e948 Fix an ommision preventing building, patch by Tito. 2003-10-09 13:40:17 +00:00
Glenn L McGrath 12940e1ce0 example devfs config file, patch from Tito. 2003-10-09 13:25:00 +00:00
Glenn L McGrath 17d21fa519 New applet, devfsd, by Matteo Croce and Tito 2003-10-09 11:46:23 +00:00
Glenn L McGrath a55d72bbb4 Patch from Steven Scholz, fix some warnings 2003-10-09 11:38:45 +00:00
Glenn L McGrath 99825960c1 Bugfix for xargs 2003-10-09 11:06:45 +00:00
Eric Andersen 29c77f71ba Arnd Ben Otto writes:
Hi Eric

I have written a small patch for the Busybox syslogd. With this patch
one can limit the size of the messagfile. As soon as the limit is
reached the syslogd can rotate or purge the messagefile(s) on his own.
There is no necessity to use an external rotatescript.

Even if logread does something similar, its very handy to have some
messagefile after your box crash.

I wrote this patch initial vor BB 0.6x where no cron daemon was avail.
Now I adapted it for the new Version and i hope it is still useful. At
least I still use it :-)

bye
Arnd
2003-10-09 09:43:18 +00:00
Eric Andersen dae099b2f9 We did not have a safe_write, which is the analog to safe_read. Convert
full_write to use safe_write internally, which is needed to guarantee proper
behavior, i.e. when writing to a pipe.
2003-10-09 08:35:42 +00:00
Eric Andersen 638da75f4b Fix some warnings that have crept in recently 2003-10-09 08:18:36 +00:00
Glenn L McGrath 07085855ad Patch from Tito, size optimisation and fix error in exit code of -V
option
2003-10-09 07:28:22 +00:00
Glenn L McGrath 586d86cc8c Comaptability with gcc-2.95 2003-10-09 07:22:59 +00:00
Glenn L McGrath 9d1a33c690 Vodz last_patch_105 without his xargs patch which doenst apply cleanly 2003-10-06 13:23:06 +00:00
Glenn L McGrath add3eadc46 Add the x, n, s and E options, remove -r as its expected behaviour. 2003-10-04 14:44:27 +00:00
Glenn L McGrath 42c25735e6 Patch from Rob Landley;
Moving on to building diffutils, busybox sed needs this patch to get
past the first problem.  (Passing it a multi-line command line argument
with -e works, but if you don't use -e it doesn't break up the multiple
lines...)
2003-10-04 05:27:56 +00:00
Glenn L McGrath fd7bc13557 Woops, the previous patch reversal wasnt complete, breaking everything. 2003-10-04 00:05:47 +00:00
Glenn L McGrath f86bd9f2cd Reverse my previous changes and make a note about why its dont this way 2003-10-03 13:21:10 +00:00
Glenn L McGrath 07cf92676a Dont mix xarg options with utility option, fixes example of
`echo "README" | xargs ls -al`
Dont specify a path for the default behaviour of echo
args allocated space for an extra ptr
Use defines for the different options
2003-10-03 13:15:44 +00:00
Glenn L McGrath 1dc0ccafdd Vodz, last_patch_114
- env vars CONTENT_TYPE, CONTENT_LENGTH, HTTPD_REFERER, REMOTE_USER and
AUTH_TYPE(Basic always).
- POST data pipied now (previous version have loading into memory may be
big size data and reducing with hardcoded limit)
- removed $CGI_foo environment variables, else my have rubbish
enviroment if POST data have big binary file
2003-10-03 10:50:56 +00:00
Glenn L McGrath 8ac86e33a2 Patch by Rob Landley, fix warning 2003-10-03 08:28:59 +00:00
Glenn L McGrath 4a77c781ef argc has already been decremented 2003-10-03 07:51:30 +00:00
Glenn L McGrath cb920d9778 Patch from Rob Landley, Simplify organisation of arguments. 2003-10-03 03:25:30 +00:00
Glenn L McGrath 91b3d460c7 Fix -C option when creating tar files.
Need to chdir after the tar file is opened, so make common tar filename
parsing and send the file descriptor rather than filename to
writeTarFile.
Modify the verboseFlag operation to determine wether to display on
stderr or stdout at display time, simpler than doing it in tar_main.
2003-10-02 14:33:23 +00:00
Glenn L McGrath 9c91e4142d Thomas Lundquist, update for current structure 2003-10-01 11:33:46 +00:00
Glenn L McGrath 0ad4daa54e Patch from Rob Landley to fix backrefs 2003-10-01 10:26:23 +00:00
Glenn L McGrath 738fb33994 Patch by Rob Landley, fix "newline after edit command" 2003-10-01 06:45:11 +00:00
Glenn L McGrath aa5a602689 Patch by Rob Landley, work in progress update, fixes lots of bugs,
introduces a few others (but they are being worked on)
2003-10-01 03:06:16 +00:00
Glenn L McGrath e6ba16f830 Patch by Guillaume Morin
Fix two race conditions, as described at.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=212764
2003-09-26 10:45:55 +00:00
Glenn L McGrath f7dd10f67c Patch from Fillod Stephane
Add follow mode to logread, ala "tail -f /var/log/messages"
Note: output to a slow serial terminal can have side effects
on syslog because of the semaphore. In such case, define 
RC_LOGREAD.
2003-09-26 01:03:16 +00:00
Glenn L McGrath a79220db6e add size parameter to syslogd -C
Patch by Padraig, resubmitted by Fillod Stephane
2003-09-26 00:49:05 +00:00
Glenn L McGrath 6b0658f5c0 Patch by Fillod Stephane, declare variables as static to not clobber
busybox namespace
2003-09-26 00:33:18 +00:00
Glenn L McGrath 6376b583e2 Use a variable for the config files, makes it easier to syncronise with
debian builds
2003-09-24 15:48:29 +00:00
Glenn L McGrath c98c7d9a14 Syncronise with debian busybox-cvs package 2003-09-24 15:30:44 +00:00
Glenn L McGrath 761ec20f81 Fix some typo's, remove some extra free statements 2003-09-24 10:23:39 +00:00
Glenn L McGrath a406a9c853 Add the -d option 2003-09-24 05:00:29 +00:00
Glenn L McGrath eebcc1d98a Add the "install" applet, move get_ug_id to libbb as its used by chown,
chgrp and install.
2003-09-24 03:22:57 +00:00
Glenn L McGrath d72e34c752 Patch by Steinar H. Gunderson to fix debian bug #211675.
Linking to my_getgrnam from libpwdgrp wasnt working, instead it was
trying to use functionality from glibc, which pulled in libnss.
2003-09-20 00:59:35 +00:00
Glenn L McGrath d3612178b7 Patch by Junio C Hamano to workaround a gcc compiler bug.
The construct certain vintages of GCC (the one I have trouble
with is 3.2.3) have trouble with looks like the following:

    static struct st a;
    static struct st *p = &a;
    struct st { int foo; };
    static void init(void) { a.foo = 0; }

The problem disappears if we move the struct declaration up to
let the compiler know the shape of the struct before the first
definition uses it, like this:

    struct st { int foo; }; /* this has been moved up */
    static struct st a;
    static struct st *p = &a;
    static void init(void) { a.foo = 0; }
2003-09-17 00:22:26 +00:00
Glenn L McGrath 2570b43e82 Configuration option to define wether to follows GNU sed's behaviour
or the posix standard.
Put the cleanup code back the way it was.
2003-09-16 05:25:43 +00:00
Glenn L McGrath 204ff1cea4 Fix a bug that creapt in recently with substitution subprinting, and add
a test for it.
2003-09-16 01:46:36 +00:00
Glenn L McGrath 96fd1b98f1 Compile get_terminal_width_height 2003-09-16 00:50:36 +00:00
Glenn L McGrath baaa6e9e7d Patch from Stephane Billiart to fix an unused variable warning. 2003-09-15 15:00:43 +00:00
Glenn L McGrath a3822de23e Patch from Bastian Blank to fix a problem when runing find under ash.
"If the shell is compiled with -DJOBS, this is all fine -- find wasn't
stopped (it was killed), so it correctly uses WTERMSIG instead of WSTOPSIG.
However, if the shell _isn't_ compiled with -DJOBS (which it isn't in d-i),
only WSTOPSIG is used, which extracts the high byte instead of the low
byte from the status code.  Since the status code is 13 (SIGPIPE), "st"
suddenly gets the value 0, which is equivalent to SIGEXIT. Thus, ash prints
out "EXIT" on find's exit."
2003-09-15 14:42:39 +00:00
Glenn L McGrath e16ab475ad Patch from Tito, Reduces the size of busybox's strings applet from 1900 to
1788 bytes (for strings.o).
2003-09-15 14:22:37 +00:00
Glenn L McGrath 977451ef44 Fix a simple mistake with pattern space, and add a test for it 2003-09-15 12:07:48 +00:00
Glenn L McGrath 47e5ca1ecb Patch by Jean Wolter to fix a bug where a script wouldnt be executed
unless it had #!/bin/sh in the first line

"It correctly locates the script, tries to execute it via execve which
fails. After that it tries to hand it over to /bin/sh which fails too,
since ash

    - neither provides the absolute pathname to /bin/sh
    - nor tries to lookup the script via PATH if called as "sh script"
"
2003-09-15 12:00:19 +00:00
Glenn L McGrath e3e28d3bb6 Fix some memory allocation problems
----------------------------------------------------------------------
2003-09-15 09:22:04 +00:00
Eric Andersen 8efe967018 Be entirely consistant when using ioctl(0, TIOCGWINSZ, &winsize)
to ensure proper fallback behavior on, i.e. serial consoles.
 -Erik
2003-09-15 08:33:45 +00:00
Eric Andersen c4f72d1426 fix function prototype 2003-09-15 08:13:43 +00:00
Eric Andersen 45638df230 Needs prototype for close() 2003-09-15 08:12:53 +00:00
Eric Andersen 2205c84de4 comparison was always false due to limited range of data types.
Carefully cast to unsigned long long prior to multiply to get
the expected result.
2003-09-15 08:11:29 +00:00
Eric Andersen 1393a39df4 Do not shadow the global name 'accept' 2003-09-15 08:06:15 +00:00
Glenn L McGrath 2eed0e2d47 Add a test for the 'P' command and fix current implementation so it
doesnt permanently modify the pattern space.
2003-09-15 06:28:45 +00:00
Glenn L McGrath 6e5687abc3 A test and fix for the sed 'n' command 2003-09-15 06:12:53 +00:00
Glenn L McGrath 7b35121297 Test for use of newline in regex's, this feature is used by most
configure scripts.
2003-09-15 05:53:28 +00:00
Glenn L McGrath 73116311e5 Fix for the sed-append-next-line test 2003-09-15 05:42:05 +00:00
Glenn L McGrath 65f9dc01f3 Test the N command 2003-09-15 05:35:47 +00:00
Glenn L McGrath 640c1f547f Fix recursion problem 2003-09-15 04:55:29 +00:00
Glenn L McGrath ba5eb27ce3 Check sed doesnt go into an infinite loop (yes it does) 2003-09-15 04:41:17 +00:00
Glenn L McGrath c43f9edf88 Update Matteo Croce's email address 2003-09-15 03:37:32 +00:00
Glenn L McGrath 294d113adb Memory cleanups and fix for echo "foo" | sed 's/foo/bar/;H;q' 2003-09-14 16:28:08 +00:00
Glenn L McGrath 8417c8c38b Cleanup memory usage 2003-09-14 15:24:18 +00:00
Glenn L McGrath 7bf8f5bc5e Update sed branch tests 2003-09-14 11:10:08 +00:00
Glenn L McGrath 8a0b59fb82 Add two new tests, sed-recurses-properly should always work 2003-09-14 09:38:24 +00:00
Glenn L McGrath edc388cf4e The previous fix for 's/a/1/;s/b/2/;t one;p;:one;p' broke the case of
echo fooba | ./busybox sed -n 's/foo//;s/bar/found/p'

I really need to start adding these tests to the testsuite.

keep the substituted and altered flags seperate
2003-09-14 08:52:53 +00:00
Glenn L McGrath 3fe475677a Preserve substitution flag value within the current line.
Fixed the following testcase
# cat strings |./busybox sed -n -f test3.sed
1
1
2
c
c
# cat strings
a
b
c
2003-09-14 07:59:28 +00:00
Glenn L McGrath f4523562b6 Fix branching commands.
If a label isnt specified, jump to end of script, not the last command
in the script.

Print an error and exit if you try and jump to a non-existant label

Works for the following testcase
# cat strings
a
b
c
d
e
f
g
# cat strings | ./busybox sed -n '/d/b;p'
a
b
c
e
f
g
2003-09-14 06:01:14 +00:00
Glenn L McGrath 8aac05bfe5 Patch from Rob Landley
Fixed a memory leak in add_cmd/add_cmd_str by moving the allocation
of sed_cmd down to where it's actually first needed.
                                                                                
In get_address, if index_of_next_unescaped_regexp_delim ever failed, we
wouldn't notice because the return value was added to idx, which was 
already guaranteed to be > 0.  (This is buried in the changes made when 
I redid get_address to be based on pointer arithmetic, because all the tests 
were gratuitously dereferencing with a constant zero, which wasn't obvious.)
         
Comment in parse_regex_delim was wrong: 's' and 'y' both call it.
 
The reason "sed_cmd->num_backrefs = 0;" isn't needed is that sed_cmd was
allocated with cmalloc, which zeroes memory.

Different handling of space after \ in i...

Different handling of pattern "s/a/b s/c/d"

Cool, resursive reads don't cause a crash. :)

Fixed "sed -f blah filename - < filename" since GNU sed was handling 
both - and filenames on the same line.  (You can even list - more than 
once, although it's immediate EOF...)
2003-09-14 04:06:12 +00:00
Glenn L McGrath 7c59a83a77 Stupid typo 2003-09-14 02:37:46 +00:00
Glenn L McGrath 4dc1d25a30 Fix some memory allocation problems 2003-09-14 01:25:31 +00:00
Glenn L McGrath f36635cec6 Fix the following testcase by disabling global substitution if the regex
is anchored to the start of line, there can be only one subst.
echo "aah" | sed 's/^a/b/g'
2003-09-13 15:12:22 +00:00
Glenn L McGrath c18ce373a2 Fix the following testcase by storing the state of the adress match with
the command.
# cat strings
a
b
c
d
e
f
g
# ./busybox sed '1,2d;4,$d' <strings
c
# ./busybox sed '4,$d;1,2d' <strings
# sed '4,$d;1,2d' <strings
c
# sed '1,2d;4,$d' <strings
c
2003-09-13 06:57:39 +00:00
Glenn L McGrath c2b9186be1 Fix compile error, Vodz, last_path_113 2003-09-12 11:27:15 +00:00
Glenn L McGrath 2af30446f1 Typo. 2003-09-12 10:58:54 +00:00
Eric Andersen eb213bd2a2 As vodz just pointed out, I screwup up the call to bb_xasprintf! 2003-09-12 08:39:05 +00:00
Eric Andersen 7f2935ba0e Remove final \n 2003-09-12 08:32:24 +00:00
Eric Andersen 70af8834df Fix obligitory typos 2003-09-12 07:36:46 +00:00
Eric Andersen aa2afee922 Final changelog update 2003-09-12 07:03:52 +00:00
Eric Andersen 839bd4a73b Remove version # 2003-09-12 07:03:14 +00:00
Eric Andersen 3acfedfafe I suppose it is now Sept 12... 2003-09-12 06:59:52 +00:00
Eric Andersen 23bc836f42 Update webpage a bit 2003-09-12 06:59:17 +00:00
Glenn L McGrath beb3bbd991 Fix handling of hardlinks when OLDGNU and GNU extensions arent enabled. 2003-09-12 06:49:09 +00:00
Glenn L McGrath ef91bf67ed Use the typeflag to identify if its a hardlink on OLD and GNU posix
modes, fixes a bug extracting hardlinks to symlinks.
2003-09-12 06:31:28 +00:00
Eric Andersen 51ed242ad6 Invoke run-parts on /etc/network/if-*.d per the behavior of
the upstream ifupdown code...
2003-09-12 05:59:53 +00:00
Eric Andersen e15138a870 Teach rdate to timeout in 10 seconds to avoid blocking forever
with odd or broken networking setups
2003-09-12 05:50:51 +00:00
Eric Andersen f57a614db9 config option CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN must depend
on CONFIG_FEATURE_SH_STANDALONE_SHELL.
2003-09-12 04:49:21 +00:00
Eric Andersen a4389cfb51 Update changelog for release 2003-09-12 04:43:49 +00:00
Glenn L McGrath 14092a1ed2 Busybox CVS version ipcalc have problems:
- Can`t use 255.255.255.255 address
- typo: double check for valid ip address and uncheck for valid mask

httpd unseted SERVER_PORT (my bug from last_patch111).

last_patch_112 from Vladimir N. Oleynik
2003-09-12 00:44:50 +00:00
Eric Andersen 81155f8fa8 Update definition of struct serial_struct, per linux-2.6.0-test5,
to avoid stack corruption problems on some 64bit architectures
when sizeof(void*) != sizeof(int).  Thanks to Atsushi Nemoto
for finding this problem.
2003-09-11 08:52:22 +00:00
Eric Andersen 2fdba24620 Marc A. Lehmann writes:
The tar -x command in busybox does not restore the file mode correctly.

The reason is most probably this code in
archival/libunarachive/data_extract_all.c:

       chmod(file_header->name, file_header->mode);
       chown(file_header->name, file_header->uid, file_header->gid);

chown clears the set*id bits (on current versions of linux :). Flipping
the order around fixes the problem.

(tested with 1.00pre3 from cvs).
2003-09-11 08:32:40 +00:00
Eric Andersen 6231f092bd Patch from Philip Blundell:
On Thu, 2003-09-11 at 01:09, Glenn McGrath wrote:
> Applied

Thanks.  Unfortunately there was one small bug in that last patch.
Could you apply this one as well?

p.
2003-09-11 08:25:11 +00:00
Glenn L McGrath cc20ebc11e add ipv6 literal support to wget 2003-09-10 23:52:15 +00:00
Glenn L McGrath 1cb2622f9c Fix a bug where make clean complained about having both : and :: entries.
Remove tester.log on make clean
Patch by Arthur Othieno
2003-09-10 23:47:10 +00:00
Glenn L McGrath fe538ba5d6 Vodz, last_patch_104 2003-09-10 23:35:45 +00:00
Glenn L McGrath 87af49f26b If a tar entry is a regualr file ending in a '/' then its really a
directory.
From http://www.gnu.org/manual/tar/html_node/tar_123.html
REGTYPE
AREGTYPE
    These flags represent a regular file. In order to be compatible with
older versions of tar, a typeflag value of AREGTYPE should be silently
recognized as a regular file. New archives should be created using
REGTYPE. Also, for backward compatibility, tar treats a regular file
whose name ends with a slash as a directory.
2003-09-09 17:41:03 +00:00
Glenn L McGrath 640fb86b28 Update the config file by running it from menuconfig, get rid of some
unused entries.
2003-09-09 15:53:56 +00:00
Glenn L McGrath 07f6b95d8f Patch from Jean Wolter
expr currently always adds even if told to subtract
2003-09-08 23:19:12 +00:00
Glenn L McGrath 5875be406e Vodz, last_patch_110
no limit, no memory usage for env buffer, always call putenv().
remove small error for previous last_patch109.
2003-09-08 15:39:09 +00:00
Glenn L McGrath 55bf79f944 Preserve suid/sgid bits 2003-09-08 14:34:23 +00:00
Glenn L McGrath b65422cf65 last_patch_109 from Vladimir N. Oleynik
Busybox`s httpd have the defect (from born):
ip 1.2.3.1 have true comparing also with
1.2.3.10-1.2.3.19 and 1.2.3.100-1.2.3.199.
Last patch removed this bug and added feature:
allow/deny rule can support network/netmask
example: 1.2.3.0/255.255.255.128
  or
network/mask_bits
example: 1.2.3.0/25
now; old format
1
1.2
1.2.3
1.2.3.4
too support and converted to
1/8 1.2/16 1.2.3/24 1.2.3.4/32
automaticaly.

Also, current CVS have small problem: ignores
A:IP, (loses 'A', 'a' only work). Corrected.
2003-09-08 10:59:27 +00:00
Glenn L McGrath 350733abb8 Busybox modprobe has a couple of irritating quirks:
- attempting to modprobe a module that is already loaded yields "Failed
to load module", whereas modutils quietly ignores such a request.

 - if a module genuinely can't be loaded due to missing symbols or
similar problems, modprobe doesn't produce any useful diagnostics
because the output from insmod has been redirected to /dev/null.

Here's a patch to address these issue

Patch by Philip Blundell
2003-09-08 00:32:49 +00:00
Glenn L McGrath d6bdd5dc08 Small bug in silent option 2003-09-05 02:37:15 +00:00
Glenn L McGrath b77158a934 Set the default password to md5, patch by Joshua Jackson 2003-09-04 08:21:36 +00:00
Glenn L McGrath 99bd5adf99 more crond+crontab integrating with loginutil libbb functions and deleted
patch from Thomas Gleixner to init.
Viodz last_patch_108
2003-09-03 12:18:42 +00:00
Glenn L McGrath 759d7ececd To load GPLONLY symbols its is required that CHECK_TAINTED_MODULES be
enabled, if not GPLONLY symbols are ignored.
2003-09-03 00:42:58 +00:00
Glenn L McGrath 530ea42abc adds the ability to use and calculate network prefix specifications instead
of netmasks. It also fixes the parameters for network and netmask to match
that of the official Red Hat version (-n for network and -m for netmask).
Patch by Joshua Jackson
2003-09-02 06:59:57 +00:00
Glenn L McGrath dc4e75ef7c move all "-/bin/sh" "/bin/sh" and "sh" to libbb/messages.c file as one
constant.
Vodz last_patch_107
2003-09-02 02:36:18 +00:00
Glenn L McGrath 005f83adf5 Fix compile error and reducing size for libbb/get_console.c to previous size.
Vodz last_patch106
2003-09-01 08:53:32 +00:00
Glenn L McGrath d9461f887e Allow one to detect and handle the case where no lease could be obtained
via DHCP. (Just add a section "failed" to your script.)
Patch by Steven Scholz
2003-09-01 04:08:36 +00:00
Glenn L McGrath c2942f0904 "insmod caches the symbolname in a variable before modifying it and uses
the cached value afterwards." - Jean Wolter
2003-08-31 01:58:18 +00:00
Glenn L McGrath bb13624d8c save a couple of bytes 2003-08-30 12:38:13 +00:00
Glenn L McGrath 502907f5b3 The default behaviour for run-parts is corrected to continue if an error
is encountered in a script.
Patch by Philip Blundell
2003-08-30 12:27:36 +00:00
Glenn L McGrath 759515c26a handle GPLONLY symbols 2003-08-30 06:00:33 +00:00
Glenn L McGrath 29a05f56d5 "Without this patch, udhcpcd output may be buffered and delayed for
for minutes if stdout is not a tty." -vda@
2003-08-30 04:47:36 +00:00
Glenn L McGrath 9b04f1841e Fix the substitution print subcommand, it should only print if its
own substitution matched, not previous ones.
e.g
echo fooba | sed -n 's/foo//;s/bar/found/p'
shouldnt print anything
2003-08-30 04:35:07 +00:00
Glenn L McGrath 72f5f02184 Remove some unwanted code, patch from Holger Schurig, confirmed by vodz 2003-08-29 16:19:03 +00:00
Glenn L McGrath 5cd6461b6f "Due to a wrong format parameter in a printf httpd does not work when
compiled for with CONFIG_LFS (large file support).
The attached patch suggested by Vladimir fixes that." - Steven Scholz
2003-08-29 15:53:23 +00:00
Glenn L McGrath e01c550eab "A little patch for the strings applet of the busybox development tree
that substitutes two lines of code with a libbb function saving a couple
of bytes." - Tito
2003-08-29 15:48:37 +00:00
Glenn L McGrath 21aacba2b7 Logic error, patch by Matteo Croce 2003-08-29 15:39:07 +00:00
Glenn L McGrath 8ce8f9b482 Remove stray '\n' 2003-08-29 15:19:44 +00:00
Glenn L McGrath 2233685f00 Remove unused files 2003-08-29 15:03:12 +00:00
Glenn L McGrath 2ce002a732 Help for date -I when CONFIG_FEATURE_DATE_ISOFMT is enabled.
Patch by Steven Scholz
2003-08-29 14:18:26 +00:00
Glenn L McGrath b19c73dee6 Change make to $(MAKE), patch by Hideki IWAMOTO 2003-08-29 13:25:55 +00:00
Glenn L McGrath 3bff66617a Substitute busybox for uClibc, patch by Hideki IWAMOTO 2003-08-29 12:23:09 +00:00
Glenn L McGrath 87470def24 * Since busybox binary is unnecessary, deleted it from prerequisites.
* Changed so that not only links but /bin/busybox might be deleted.
* When double quoted PREFIX is defined by `.config' is used,
  `make uninstall' does not work correctly.
  When default PREFIX `pwd`/_install defined by Rules.mak is used,
  similarly it does not work correctly.
  Changed $$PREFIX into $(PREFIX) in order to fix this.
Patch by Hideki IWAMOTO
2003-08-29 12:20:31 +00:00
Glenn L McGrath b54a748621 Fix for compiling with ipv6 2003-08-29 11:34:08 +00:00
Glenn L McGrath 08dea3e5a7 "This function was not updating the argc and argv pointers to reflect
the arguments it consumed, which means the calling function encountered
them as well.  As a result, a command like "ip -6 addr" was yielding a usage
error." - Philip Blundell
2003-08-29 10:58:46 +00:00
Glenn L McGrath 62b031fb82 label's dont work in v4 tunnels, patch by Eric Spakman 2003-08-29 07:47:52 +00:00
Glenn L McGrath a6b7bdcf8c Vodz, last patch 105
Busybox "mount" applet unsupport "user" option and
result: must have _BB_SUID_NEVER applet option (my bug).
Last patch have reducing 216 bytes for "su" applet also.
2003-08-29 07:38:56 +00:00
Glenn L McGrath dc72f3ace2 Vodz, last patch 104 2003-08-29 07:35:08 +00:00
Glenn L McGrath 7b8765c808 vodz, last patch 103 2003-08-29 07:29:30 +00:00
Glenn L McGrath 23365976f8 Correct logic in determining size of block to download, as pointed out
by Junio C Hamano
2003-08-29 06:25:04 +00:00
Glenn L McGrath 523c1675a2 "Typo and/or thinko: scanning till the end of NUL terminated string
should check the byte pointed at not the pointer itself." -junkio@
2003-08-28 22:12:53 +00:00
Glenn L McGrath e7bdfccb3f "When the initial request by wget is responded by a 3XX redirect
response sent in chunked transfer encoding, the code path to
resubmit the request to the redirected URL forgets to reset
got_clen and chunked variables in the loop.  If the redirected
URL does not use chunked transfer encoding, this causes the code
that slurps the body of the response to incorrectly try to parse
out the chunk length which does not exist." - junkio@

----------------------------------------------------------------------
2003-08-28 22:03:19 +00:00
Glenn L McGrath 83e4a5bccf "When the filesize is known from content-length header, safe_fread is
always told to read sizeof(buf).  This waits until the underlying
fread() to time-out for the last part of the downloaded body.  Fix
this by sending the number of remaining bytes to read when known." -
junkio@
I reworked the logic in his patch
2003-08-28 21:55:22 +00:00
Glenn L McGrath 8b96b7169d *** empty log message *** 2003-08-28 19:54:16 +00:00
Glenn L McGrath 4cee66d5a8 Dont unlink when testing !
Always preserve creation date
Disable the -p option its for modification date
Remove some cpio header debugging noise
Syncronise file listing behaviour with upstream.
2003-08-28 19:12:23 +00:00
Robert Griebl 444566837c Removed some debug printfs 2003-08-26 11:06:39 +00:00
Glenn L McGrath b79db92a21 Syncronise some build files with busybox-cvs-20030819 2003-08-26 04:50:23 +00:00
Glenn L McGrath c3f2956cfa Woops, depend on SHA1 not the option 2003-08-26 04:28:05 +00:00
Glenn L McGrath 4d5e4685fe SHA1 options depend on SHA1 2003-08-26 04:25:59 +00:00
Glenn L McGrath ce6482eace Fix overflow for machines greater than 4GB, return unsigned int to avoid
a cast and for greater accuracy.
2003-08-26 02:14:58 +00:00
Eric Andersen 97e2426582 "staywithu" writes:
In BusyBox v1.00-pre2,
 commands like ls, df with -h option report a wrong file size for files larger than 4GBtye!!

For example,
   when I execute 'ls -l', it reports
      -rw-r--r--      1 root       root    5368709120    Aug    17  2003  large_stream.tp

   when I execute 'ls -lh', I expect that
      -rw-r--r--      1 root       root                5.0G    Aug    17  2003  large_stream.tp

  but it reports
      -rw-r--r--      1 root       root                1.0G    Aug    17  2003  large_stream.tp

I fixed this bug that...
 Line 31 in libbb/human_readable.c and line 275 include/libbb.h

     const char *make_human_readable_str(unsigned long size
      =>   const char *make_human_readable_str(unsigned long long size

It's OK!
2003-08-22 23:08:37 +00:00
Eric Andersen 6d3c7e7a9c trivial doc fix 2003-08-22 21:15:07 +00:00
Eric Andersen 24e098a77d Fixup 'make clean' to properly clean the _install directory 2003-08-22 20:53:38 +00:00
Glenn L McGrath d382c89467 Typo 2003-08-19 03:49:00 +00:00
Glenn L McGrath 3d5828fb6d Change hardlink handling for tar to work the same way as cpio 2003-08-14 02:55:15 +00:00
Manuel Novoa III 062913f662 Fix a bug reported by junkio@cox.net involving the mode_chars index. 2003-08-14 02:28:49 +00:00
Eric Andersen bf83355dda Patch from Paul Mundt (lethal) adding sh64 insmod support for busybox 2003-08-13 19:56:33 +00:00
Manuel Novoa III 4456f25e8f Rewrite timescmd() function to avoid the use of floating point and to
correct a bug in the seconds display where something like  65 seconds
would be output as "1m65.000000s".
2003-08-13 17:48:47 +00:00
Manuel Novoa III 5b3c05637d Remove unnecessary pointer dereference. 2003-08-13 12:11:33 +00:00
Eric Andersen 9a9f6777e9 fix style sheet so site doesn't look like crap with IE 2003-08-12 06:55:03 +00:00
Manuel Novoa III 96379b0d7d Adjust Erik's change, as I don't claim copyright of the applet. 2003-08-09 02:57:55 +00:00
Eric Andersen 8f4cdd516d Move shell descriptions to the config system 2003-08-08 23:41:50 +00:00
Eric Andersen b287e2e27a Use the new 'select' option to make the shell config
much less evil and far more obvious.
 -Erik
2003-08-08 23:40:12 +00:00
Eric Andersen c601ff149a Begin using the new "select" option. Good stuff! 2003-08-08 23:12:12 +00:00
Eric Andersen 2e9c257000 Implement a minimalist 'last' which allows the LEAF project to
no longer need dumtp.  Remove the 'dumtp' applet.
 -Erik
2003-08-08 22:26:06 +00:00
Eric Andersen f1c56a9306 quiet some noise 2003-08-08 22:13:41 +00:00
Eric Andersen 92fb9395f7 Kent Robotti noted that mt.c uses "rewind" not "rew" 2003-08-08 20:09:03 +00:00
Eric Andersen 99a75d1376 Patch from Kent Robotti to being fdisk in sync with v2.12 final. 2003-08-08 20:04:56 +00:00
Eric Andersen de6a6ae876 Remove unnecessary defamatory comment 2003-08-08 08:57:03 +00:00
Eric Andersen 6c0e0fb8ac Fix a stupid bug I introduced several months ago 2003-08-08 07:39:57 +00:00
Eric Andersen 3869f66eac Begin preparing for another release 2003-08-06 11:22:36 +00:00
Eric Andersen 9089844382 Latest dash update from vodz 2003-08-06 11:20:52 +00:00
Eric Andersen dc19af4179 Patch from Eric Spakman to update "run-parts" help text in Config.in. 2003-08-06 09:43:09 +00:00
Eric Andersen fdd2a0f318 Eric Spakman writes:
The attached patch adds "mtu" and "hwaddress" to the inet6 method and
"mtu", "hwaddr" and "pointopoint" to the inet4 method (just like in
the ifupdown part).
Note: "hwaddress" can't be used with the busybox ip applet (this
function isn't implemented in bb ip yet), but it can be of use with
an external "full blown" ip package.

The patch also removes "label" from the loopback configuration,
labels (subinterfaces) aren't used with loopback interfaces.

It further solves a problem in the bootp method, "ifconfig down
%interface%" should be "ifconfig %interface% down" and it's now also
possible to use ip with bootp.

The patch is fully tested with both busybox ip and "stand-alone" ip
and I didn't saw any problems.
2003-08-06 09:23:44 +00:00
Eric Andersen d3652bf334 Patch from vodz:
I wrote:
>>I think, fdisk have special ext2lseek special for:
>>disk can have size > 4Gb, but all any partitions have < 4Gb and lseek64
>>not require.
>>May be best create new configure option for set DOLFS for fdisk applet
>>if global DOLFS unset?
>


Erik Andersen wrote:
>Agreed.  Using an extra configure option when ! DOLFS
>would be a good idea.


Ok. Patch attached.
2003-08-06 09:07:37 +00:00
Eric Andersen 0a57a79e38 Patch from Steven Scholz:
should we rename the define into CONFIG_FEATURE_HDPARM_HDIO_DMA and
use it for "set" and "get" ???

Since although CONFIG_FEATURE_HDPARM_HDIO_GET_DMA is _not_ set I still
can use "hdparm -d 1 /dev/hda" to switch the DMA on.
Is this desireable or meant to be like that?

So how about the applied patch?
2003-08-06 08:57:35 +00:00
Eric Andersen 4b4e09854c Steven Scholz writes:
the output of lsmod (busybox-1.00-pre2) contains IMHO one "\n" too
    much when using CONFIG_FEATURE_CHECK_TAINTED_MODULE:

    ~ # lsmod
    Module                  Size  Used by    Tainted: P

    ds                      8364   1
    m8xx_pcmcia             5388   1
    pcmcia_core            40736   0 [ds m8xx_pcmcia]

and this patch from Steven fixes the problem
2003-08-06 08:53:13 +00:00
Eric Andersen 50af12dbd6 Sync hdparm -t and -T options with hdparm-5.3, which seems
to produce sensible results,
2003-08-06 08:47:59 +00:00
Eric Andersen 481772a4c2 Patch from vodz to cleanup libbb/obscure.c:password_check()
to not copy too much data.
2003-08-06 08:33:08 +00:00
Eric Andersen 5378fbcb33 Joe.C writes:
I've reported this bug in April and it still
    exists in 1.00-pre2. So I made patches for
    both 0.60.x and 1.00-pre2.  The patch is very
    simple, just use strncmp instead of strcmp.
    Please apply if it is OK.

   Here's the procedure to test this problem:
   Create a executable with very long name, say
   'test_1234567890123456' and execute it. Try
   using 'killall' or 'pidof' to find/kill this
   program.  Without this patch, you can't find
   the program.
2003-08-06 08:22:10 +00:00
Eric Andersen 8f4ef159f0 Fixup segfault on 'kill -q' 2003-08-06 07:43:58 +00:00
Eric Andersen c774efe317 extern inline is a bad bad thing. kill it (so mkfs_minix.c will
actually compile)
2003-08-06 07:34:19 +00:00
Eric Andersen 7001480a5e Seems I missed a spot 2003-08-05 05:59:48 +00:00
Eric Andersen 72d8e444f0 Merge/rework config system per the latest from linux-2.6.0-test2.
Fix the config bugs revealed by the updated config system.
 -Erik
2003-08-05 02:18:25 +00:00
Manuel Novoa III 461c279ac1 Might as well get my name in AUTHORS before 1.0... 2003-08-02 00:19:29 +00:00
Manuel Novoa III b1d5b741ac Save 0.5K. 2003-08-02 00:04:18 +00:00
Eric Andersen 546f21aa2d Remove code that too agressively disabled inlines 2003-08-01 22:27:57 +00:00
Eric Andersen e6b811583a Minor cleanup 2003-07-31 17:50:17 +00:00
Glenn L McGrath 91e464632b Fix bug when handling debian packages.
If we read the contents of compressed files within the ar archive,
e.g. control.tar.gz, then file position gets all out of whack, so
it has to be reset before reading thenext header.
2003-07-31 01:53:50 +00:00
Eric Andersen 6a9ca985b8 Remove LRP (now defunct) and replace it with leaf. 2003-07-30 17:17:33 +00:00
Eric Andersen 7a6a77362b Update webpage and changelog for release 2003-07-30 09:33:54 +00:00
Eric Andersen 25f95dee2d Lars Ekman writes:
When using "losetup" the device is always setup as Read-Only.

(I have only tested with the -o flag, but looking at the code the
 problem seems general)

The problem is the "opt" variable in "losetup.c" that is reused in
the "set_loop()" call. Clear it before the call and everything is OK;

  opt = 0;         /* <-------- added line */
  if (delete)
    return del_loop (argv[optind]) ? EXIT_SUCCESS : EXIT_FAILURE;
  else
    return set_loop (argv[optind], argv[optind + 1], offset, &opt)
      ? EXIT_FAILURE : EXIT_SUCCESS;
}

Best Regards,
Lars Ekman
2003-07-30 08:55:59 +00:00
Eric Andersen 040f440262 last_patch100 from vidz updating fdisk to 2.12pre 2003-07-30 08:40:37 +00:00
Eric Andersen 08804ceaf1 Do not require that the signal number be specified 2003-07-30 08:29:56 +00:00
Eric Andersen 76097edc0e Eric Spakman writes:
The recent changes in ifupdown where all calls to 'ip link set' and
'ip addr set' are swapped give some problems with v4tunnels.
For plain ipv4 and ipv6 interfaces it works correct, other methods
not tried. The patch below change the behaviour back for v4tunnels
only.

Without the patch the following errors are shown:
RTNETLINK answers: Network is down
RTNETLINK answers: No route to host
and the tunnel is not fully brought up

With this patch all works as expected.
2003-07-30 08:22:53 +00:00
Eric Andersen 3124a9ecee Vladimir N. Oleynik writes:
This moment have algoritmicaly problem, not overflow:
    strcat(wrapped, wrapped) - may be looped.

    Hand patch:

    - else if (strstr(strcat(wrapped, wrapped), newmono))
    + else {
    +    safe_strncpy(wrapped + lenwrap, wrapped, lenwrap + 1);
    +    if (strstr(wrapped, newmono))
    +}

    --w
    vodz
2003-07-30 07:57:06 +00:00
Eric Andersen b99aec0ba5 Christian Meyer provided this patch to fix more bugs with the tftp client 2003-07-30 07:16:39 +00:00
Eric Andersen d8ceba959a Ronny L Nilsson writes:
The login process should always timeout if user don't login sucessfully within
reasonable time. Otherwise we're sensetive to a DOS attack by simply doing a
bunch of simultaneous telnet connections (deploys all availible TTY's).

This patch make login.c terminate the connection after  "TIMEOUT" seconds.
2003-07-30 06:56:07 +00:00
Eric Andersen eef2317b9f Ronny L Nilsson writes:
If BusyBox was compiled with -DCONFIG_FEATURE_CLEAN_UP dmesg command
    segfaults if invoked with the "-n" option. (Due to a free() of an
    uninitialized pointer).
2003-07-30 06:52:33 +00:00
Eric Andersen eac20451d2 Set libbb dead last in the link order 2003-07-29 07:45:05 +00:00
Eric Andersen c663ab0c6b Match up interfaces 2003-07-29 07:37:39 +00:00
Eric Andersen ca16204c31 Fixup typo noticed by Nick Fedchik 2003-07-29 07:15:17 +00:00
Eric Andersen 2a186890ee Bruno Randolf writes:
this patch fixes run_parts when it's called by ifupdown. 1) argv has to be a
NULL terminated char* array, not just a string. 2) run_parts now explicitly
sets the environment. this environment is populated from the
/etc/network/interfaces config file and is needed by the scripts in
/etc/network/if-pre-up.d/. when run-parts is called from the command line the
environment is taken from the current process.


Vladimir Oleynik then wrote:

You can simplify this if use:

+       bb_xasprintf(&buf[0], "/etc/network/if-%s.d", opt);
+       buf[1] = NULL;
+
+       run_parts(&buf, 2, environ);
+       free(buf[0]);

--w
vodz
2003-07-29 07:05:40 +00:00
Eric Andersen 81fe123040 Vladimir N. Oleynik writes:
Last patch have synced form Manuel Nova III xxreadtoken() function,
corrected (C) form dash debian/copyright, removed my small mistake
with IFS_BROKEN (thanks by Herbert), and synced cmdedit.c from
current CVS (removed libc5 support, your email correction, my (C) year
corertion).
2003-07-29 06:38:40 +00:00
Eric Andersen 9cdef5d928 Yang Xiaopeng writes:
>I'm sure that no user process use old root now,  but when run "umount
>/old_root", it says:
>   umount: /old_root: Device or resource busy
>
>I have tried to remount /proc within the new root *after* chroot, but
>get the same result.
>
>
I found the problem, I said that no user process use old root when run
my scripts, but
I'm wrong, actually there is a '3' fd open the file
"/old_root/dev/console". By adding
debug message in init/init.c, I found the problem: when init restart(in
exec_signal()),
before open the new terminal device, there is still a file opened(I
don't know which file it is), so the
terminal device(stdin) get fd '1', and the first dup(0)(stdout) return
'2', the second(stderr) return '3'.

I attach a simple patch to solve this problem.
2003-07-29 06:33:12 +00:00
Eric Andersen 930c59675a bump version to 1.0.0-pre2 2003-07-28 10:34:38 +00:00
Eric Andersen cad4c5b0f3 A small update to the new docs. Plenty more is needed... 2003-07-28 10:13:03 +00:00
Eric Andersen 4052051864 Patch from vodz to update httpd usage 2003-07-28 09:59:05 +00:00
Eric Andersen c470f4477a This is synced from dash-0.4.17 and full ready for insert to new busybox
version:
ftp://ftp.simtreas.ru/pub/my/bb/new

News:

- code is smalest!
- support ${var...} expr
- used new very strongly steal controlling terminal
2003-07-28 09:56:35 +00:00
Eric Andersen 9b47661165 Avoid shadowing built-in function `log' 2003-07-28 09:37:56 +00:00
Eric Andersen 68d4a85f12 Fixup bugs in last patch 2003-07-28 09:31:28 +00:00
Eric Andersen f3a02bbf41 Update docs a bit 2003-07-28 08:31:56 +00:00
Eric Andersen 05df91a3ac last_patch98 from vodz:
Denis,

># ./busybox env - echo zzz
>zzz
># ./busybox echo -n zzz
>zzz
># ./busybox env - echo -n zzz
>env: invalid option -- n
>
>       obviously, env tried to understand -n as env's option
>       instead of blindly passing it to echo...
>
>BusyBox v1.00-pre1 (2003.07.16-07:53+0000) multi-call binary
>
>Usage: env [-iu] [-] [name=value]... [command]

Ah, you found very old problem.
Last patch also have:

- multiple "-u unsetenv" support
- GNU long option support
- save errno after exec failed before bb_perror_msg()


--w
vodz
2003-07-28 07:42:19 +00:00
Eric Andersen 35e643b39f last_patch95 from vodz:
Hi.

Last patch have new libbb function
vfork_rexec() for can use daemon() to uClinux system.
This patched daemons: syslog, klogd, inetd, crond.
This not tested! I havn`t this systems.
Also. Previous patch for feature request MD5 crypt password for
httpd don`t sended to this mailist on 07/15/03
(mailist have Pytom module problem?).
The previous patch included, and have testing.


--w
vodz
2003-07-28 07:40:39 +00:00
Eric Andersen 4f4631732c Add a "search google" button 2003-07-28 06:42:59 +00:00
Eric Andersen f96675bc50 James Petterson writes:
I've found a possible bug in libbb/interface.c, in function
if_readlist_proc(). This function calls get_name(), and passes
as an argument 'name', a buffer of 16 bytes (IFNAMSIZ).  The
function get_name(), however, may use more than 16 bytes,
when it is searching for aliases. Even if you don't have an
alias interface, you can run into trouble if the interface
has received more than 99999999 bytes, in which case the
space between the interface name and the rx stats
disappears, as in the /proc/net/dev example below:
 wan0.200:264573315  462080    ...
In this case get_name() correctly identifies the interface name
as "wan0.200", but to do that it uses 18 bytes of the 'name'
buffer, which could lead to an unpredictable error.

A simple solution would be to increase the size of the buffer:
2003-07-28 06:37:04 +00:00
Eric Andersen 727f529211 There should be only one instance of CONFIG_FEATURE_AUTOWIDTH 2003-07-26 09:33:16 +00:00
Eric Andersen 342aea967f Allow people to use the full blown iproute2 programs with busybox ifupdown. 2003-07-26 09:27:02 +00:00
Eric Andersen a1ed06b047 Move start_stop_daemon to debianutils.
Cleanup run_parts a bit and add long opts
2003-07-26 09:16:00 +00:00
Eric Andersen aa820dbc00 cleanup and add long options 2003-07-26 09:10:35 +00:00
Eric Andersen 480f1533f3 The logger utility does not really depend on CONFIG_SYSLOGD,
since it can also be used with other syslog daemons
 -Erik
2003-07-26 08:20:46 +00:00
Eric Andersen 05e662ab4d Patch from Christian Meyer:
The client gives up way too soon because timeout is set to 0 ...
    There's a solution for that problem.
2003-07-26 08:16:10 +00:00
Eric Andersen ac00aa7599 Some additional description based on a patch from Terje Kvernes 2003-07-26 08:07:56 +00:00
Eric Andersen ef73d3b5d9 Patch from Nick Fedchik to fixup paths in busybox/libpwdgrp
which were not properly using the bb_path_*_file strings.
2003-07-26 07:48:13 +00:00
Eric Andersen 7d72e796d6 Rework kill / killall so it behaves itself, even when subjected
to abuse.
 -Erik
2003-07-26 07:41:56 +00:00
Eric Andersen d5868c1692 Patch from Thomas Gleixner to reap any zombie processes that are
reparented to init...
2003-07-26 06:25:12 +00:00
Eric Andersen f231c72630 Don't depend on CONFIG_LFS. It is really a suggestion, not a requirement,
since fdisk will work just fine on smaller disks w/o it.
2003-07-26 00:45:52 +00:00
Manuel Novoa III b511f9cea9 Set the tm_isdst flag to -1 before calling mktime(). Otherwise, the current
timezone setting is used for the new date.
2003-07-23 23:24:31 +00:00
Eric Andersen e5272074c9 eliminate DOSTATIC, DODEBUG, etc and name them sensibly 2003-07-22 22:15:21 +00:00
Eric Andersen 20c9f1e5e7 Several simplifications and indenting changes, per
last_patch97 from vodz
2003-07-22 17:14:10 +00:00
Eric Andersen 4c6c236781 As vodz noticed, I screwed up reboot 2003-07-22 17:04:54 +00:00
Eric Andersen 340aa1cb3f the word "only" is repeated for CONFIG_FEATURE_SHADOWPASSWDS 2003-07-22 17:03:24 +00:00
Eric Andersen fe55b260e2 There is no need to expose CONFIG_FEATURE_TRACEROUTE_SO_DEBUG 2003-07-22 10:18:17 +00:00
Eric Andersen b24da33a06 Document CONFIG_FEATURE_INSMOD_LOADINKMEM 2003-07-22 10:16:58 +00:00
Eric Andersen 3857a184c7 Document CONFIG_ASH_CMDCMD 2003-07-22 10:14:32 +00:00
Eric Andersen 795c4bac91 Write some more docs 2003-07-22 10:11:48 +00:00
Eric Andersen a501d0f01f Remove the update utility, that is only relevant to older 2.0.x kernels
that are no longer supported.
2003-07-22 10:11:27 +00:00
Eric Andersen 9c3c38da55 Patch from Terje Kvernes adding quite a lot of missing documentation 2003-07-22 09:59:34 +00:00
Eric Andersen 6fd0e31e87 Patch from Andrew Flegg:
Here's a pretty crude patch to reload /etc/inittab when init receives a
    SIGHUP. The mailing list archives weren't entirely clear on whether or
    not it should already happen, but didn't appear to be.

    The patch:
       * Adds a new function, reload_signal() which just calls
	 parse_inittab() and run_actions(RESPAWN)

       * Before entering the while (1) loop set up SIGHUP to call
	 reload_signal()

       * Modify new_init_action to skip the action if the same command
	 already exists on the same terminal

    This last bit means that changing already running entries is a bit
    hairy as you can end up with, for example, two shells running on the
    same virtual console. However, for solely adding/removing entries this patch
    seems to work quite well.
2003-07-22 09:48:56 +00:00
Eric Andersen 0246222351 Support reboot, halt, and poweroff independent of busybox init.
Simplify and fixup some logic.
 -Erik
2003-07-22 09:41:39 +00:00
Eric Andersen 85e5e72bc1 Remove remaining libc5 support code 2003-07-22 08:56:55 +00:00
Eric Andersen 0a14c9f924 A minor update for handling older gcc versions 2003-07-22 08:56:01 +00:00
Eric Andersen d14d2a1f61 Update TODO list 2003-07-22 08:55:12 +00:00
Eric Andersen e199220d48 Add a default clean target 2003-07-22 08:54:02 +00:00
Eric Andersen 725db196c3 Very minor rdate updates 2003-07-22 08:26:05 +00:00
Eric Andersen d9fe958921 Error out early if people try to build mount with nfs support
using uClibc, but have not enabled UCLIBC_HAS_RPC...
 -Erik
2003-07-22 08:25:37 +00:00
Eric Andersen 680ec6eeae mention stresslinux 2003-07-22 07:50:18 +00:00
Eric Andersen cde8f53c60 Paul Mundt <lethal@linux-sh.org> writes:
Here's a bunch of fixes for the watchdog app in busybox. This does a
	couple of things:

		- configurable timer duration (userspace timer duration is
		  usually configurable within the device drivers themselves).
		- run as a daemon
		- shutdown the device properly on SIGINT or SIGHUP
		- clear the counter immediately instead of sleeping first

	as well as updating the usage information. This has also been switched
	over to getopt to deal with the optional timer duration specifier.

	The changes themselves are harmless and isolated, and I've veried that
	this works on sh and x86 without any problems.
2003-07-22 07:39:18 +00:00
Eric Andersen 592ebd507a Patch from Paul Mundt:
The current SC_x references automatically assume that everyone uses ttyS/tts
    as their naming scheme for their serial ports. This isn't the case for quite
    a few architectures, including sh, sh64, h8, arm, etc.
2003-07-22 07:33:14 +00:00
Eric Andersen 3443bd7286 Matteo Croce submitted a hdparm applet. 2003-07-22 07:30:36 +00:00
Eric Andersen 1ebcff191a Patch from Jeff Angielski <jeff@theptrgroup.com> recognizing
his work on ftpput and ftpget.
2003-07-22 05:57:29 +00:00
Eric Andersen 8212aa5a37 Fixup some little error in the webpage. Mention the Dell TrueMobile 1184. 2003-07-19 08:19:21 +00:00
Eric Andersen 85c3c3f091 Update required kernel version and note that libc5 is no longer
supported (it is unmaintained and lacks support for simple things
such as stdint.h) and uClibc is a better choice these days anyways.
2003-07-16 07:31:14 +00:00
Eric Andersen 1b0075d243 Fixup problem unconditionally converting all hard links to symlinks. 2003-07-16 06:29:51 +00:00
Eric Andersen c989724316 Update changelog and docs 2003-07-15 07:52:41 +00:00
Eric Andersen db210ae02c Document CONFIG_USE_BB_PWD_GRP 2003-07-15 07:15:03 +00:00
Eric Andersen bb9dc93477 Update the default set of applets that are listed 2003-07-15 00:31:25 +00:00
Eric Andersen d4fcb80609 Yet more preparation to make a release... 2003-07-15 00:28:26 +00:00
Eric Andersen 335816bc4c Fix a silly typo 2003-07-14 22:14:49 +00:00
Eric Andersen 43da9d19ef Looks like I forgot one little tiny detail... 2003-07-14 21:50:51 +00:00
Eric Andersen cb81e6484d Update a bunch of docs. Run a script to update my email addr. 2003-07-14 21:21:08 +00:00
Eric Andersen 74f270a317 decouple delgroup and deluser 2003-07-14 20:20:45 +00:00
Eric Andersen e5642119ee Patch from Thomas Cameron:
Hello all,
	    This patch adds more "Help" text to the config system.  Almost
    all applets now have a help entry.  Also, I cleaned up the spacing of
    the existing text so that things are consistent.  This patch is against
    this morning's CVS.

    Thomas Cameron
    CEI Systems, Inc.
2003-07-14 19:37:08 +00:00
Eric Andersen 1eceb127bd Use standard types 2003-07-14 19:32:40 +00:00
Eric Andersen b7ebc61b54 Michael Sternberg writes:
Latest BusyBox from CVS (Jul 7 2003).
    File coreutils/ls.c
    "if" at line 970 should be enclosed in #ifdef CONFIG_FEATURE_LS_SORTFILES
    "if" at line 976 should be enclosed in #ifdef CONFIG_FEATURE_LS_TIMESTAMPS
2003-07-14 19:20:46 +00:00
Eric Andersen fb0c6af286 Patch from Lars Kellogg-Stedman:
The attached two patches add config documentation to init/Config.in and
    fileutils/Config.in.
2003-07-14 19:18:43 +00:00
Eric Andersen 9edcabdc34 Patch from Lars Kellogg-Stedman:
Busybox vi is installed in /bin/vi, but crontab was looking for
    /usr/bin/vi.  This patch makes crontab look for /bin/vi instead.
2003-07-14 19:14:26 +00:00
Eric Andersen 96916b7f41 Require that LFS is enabled to get fdisk 2003-07-14 19:08:04 +00:00
Eric Andersen 341170b012 Remove all the llseek junk and just use regular old lseek. When DOLFS is
enabled, regular lseek is transparently promoted to lseek64 anyways, rendering
the llseek stuff pointless.
 -Erik
2003-07-14 19:03:14 +00:00
Eric Andersen feb283a437 On second thought, this is a better way to fix things 2003-07-14 08:49:43 +00:00
Eric Andersen 9059e3a37b Don't use Linux kernel headers
-Erik
2003-07-14 08:46:30 +00:00
Eric Andersen f890f9dd16 This declaration no longer needs to hide when using dmalloc 2003-07-07 06:10:31 +00:00
Eric Andersen e3393513c5 Be certain to not abort prematurely when reading stuff from pipes. 2003-07-05 23:10:27 +00:00
Eric Andersen 9f894f4062 Fixup compile problem with dmalloc 2003-07-05 22:15:43 +00:00
Eric Andersen 3c5a83c567 As noted by Thomas Eckert:
bb-tar "cjf" does not create a valid tbz2-archive -- if fact the result is a
    plain tar-file (no compression) -- but does not warn about the unrecognized
    parameter combination "cj" (bb does not have bzip2-compression yet, right?).

to fix this I have added an error message stating this does not work.

He also reported

    cosmetic: versose "-v" does not show any output when used with "create"

which I have now fixed as well.

 -Erik
2003-07-05 21:56:55 +00:00
Eric Andersen d5a2780aa2 oops 2003-07-05 08:39:47 +00:00
Eric Andersen 3c8064ff69 Daniel writes:
I've found a problem with job control when the init process is restarted.

If the system boots for the first time, I get job control on a serial terminal -
no problems. However, when I restart init by issuing "init -q", then the shell
no longer has job control.

I traced this a problem in console_init in the file init.c. What was happening
after the restart is that the first compare

    if (ioctl(0, TIOCGSERIAL, &sr) == 0) {
	...
    } else if (ioctl(0, VT_GETSTATE, &vt) == 0) {
	...
    } else {
	... // assume /dev/console
    }

returned error and subsequently the code assumes /dev/console as the console,
which does not support job control.

Checking the errno after the first call showed that the system was complaining
about the file descriptor. This is probably because the previous init process
had closed all its file descriptors which the new init process had inherited.
2003-07-05 08:29:01 +00:00
Eric Andersen 40ea66cd9d Patch from Lars Kellogg-Stedman:
Glibc 2.1.3 (used by the Hardhat Linux SDK distributed by Cyclades)
    does not define IF_NAMESIZE in net/if.h.
2003-07-05 08:00:17 +00:00
Eric Andersen 7207b88d06 Patch from Lars Kellogg-Stedman:
This patch fixes endian problems with get_netmask().  I don't know if
    this is the cleanest solution, but it makes 'ipcalc -n' work on both
    an i386 system and a ppc system.
2003-07-05 07:59:30 +00:00
Eric Andersen 65e20a33c2 Patch from Kent Robotti adding a bunch of needed docs!
-Erik
2003-07-05 07:52:35 +00:00
Eric Andersen 01c3d40f3c Add the fdformat utility, based on a patch from Kent Robotti,
but I then completely reworked the fdformat utility to comply
with the current busybox way of doing things.
2003-07-05 07:51:31 +00:00
Eric Andersen a21f4e018a Glenn McGrath (bug1) isaway from my email till the 17th, but caught me on IRC.
He took a look into the recent reports of tar problems, and found an obvious
typo in last_patch91 from vodz which converted tar to use bb_getopt_ulflags.
2003-07-05 06:38:41 +00:00
Eric Andersen e968ee3f70 Patch from Vladimir N. Oleynik (vodz):
Last patch have changed for "ipcalc" applet with usage new get_ulflags()
    function.
2003-07-03 10:28:07 +00:00
Eric Andersen 8a93179c14 Patch from Lars Kellogg-Stedman:
Erik, et al.

    The attached patch makes the following changes to networking/ifupdown.c:

    (1) It swaps all calls to 'ip link set' and 'ip addr set'.  This solves
    two problems:

      (a) Calling 'ip link set <dev> up' before assigning an address
      generates an error message, and

      (b) Under User Mode Linux, running in with ethernet interfaces
      in daemon mode, the MAC address for an interface is selected
      based on the IP address assigned to that interface.  If the
      interface is brought up before being assigned an IP address,
      it gets a null MAC.

    (2) It further cleans up run_mapping().

    This patch is against ifupdown.c revision 1.25.

    -- Lars
2003-07-03 10:20:29 +00:00
Eric Andersen bccb31533e Fix stupid unterminated parenthesis 2003-07-03 10:19:20 +00:00
Eric Andersen 9e48045e45 Patch from Russell Coker:
I've attached my latest SE Linux patch for busybox against the latest CVS
    version of busybox.
2003-07-03 10:07:04 +00:00
Eric Andersen c48d49ad98 Patch from Kent Robotti updating fdisk to version v2.11z 2003-07-03 10:02:32 +00:00
Eric Andersen e5920a2dc0 Patch from Kent Robotti adding a bunch of menuconfig help 2003-07-03 10:00:15 +00:00
Eric Andersen a5c488449e Using safe_read seems, well, safer... 2003-07-03 09:48:07 +00:00
Eric Andersen 61f6db130e As implemented, sha1sum would sometimes give the wrong answer.
This fixes it and uses faster sha1 code from Dr. Gladman.
 -Erik
2003-07-03 09:41:41 +00:00
Eric Andersen a63d09a517 Patch from Pavel Roskin to fixup toplevel help text 2003-06-30 18:14:36 +00:00
Eric Andersen b01ed65ad2 Apply last_patch93 from vodz:
andersen@busybox.net wrote:
    >Message: 4
    >Modified Files:
    >       init.c
    >Log Message:
    >Remove code for unsupported kernel versions

    Hmm. Current init.c have check >= 2.2.0 kernel one time too.
    Ok. Last patch removed this point and move common init code to new file for
    /init dir
2003-06-27 17:08:15 +00:00
Eric Andersen 0b0d393347 Remove bdflush garbage, which is only relevant to unsupported
kernel versions
2003-06-27 05:46:29 +00:00
Eric Andersen 4a2dcd904c oops. make this actually work as intended.... 2003-06-26 23:55:55 +00:00
Eric Andersen 7c512439b2 Make sure we end up with a unix2dos link to busybox 2003-06-26 21:53:51 +00:00
Eric Andersen f60d4b491a Oops. 2003-06-26 18:01:43 +00:00
Eric Andersen 27cb6846d7 last_patch91 from vodz to convert tar to use bb_getopt_ulflags 2003-06-26 09:07:59 +00:00
Eric Andersen a3bb3e6e0b Geir Thomassen wrote, regarding networking/httpd.c line 1358
Hello, I think the test for an unconfigured httpd is wrong in
    the CVS (busybox-unstable-20030620.tar.bz2)

    flg_deny_all is default 0

vodz then wrote:

    Oops. You are right.
    Also, this mistake haved from two place.
    Last patch rewroted to my new get_ularg() function for overcompensate size
    from this error found ;-)
2003-06-26 09:05:32 +00:00
Eric Andersen fd10c70521 Per patch from Nick Fedchik, use SHADOW_FILE, not "/etc/shadow".
Change fopen to bb_xfopen
2003-06-26 08:53:49 +00:00
Eric Andersen 1c25ba9de1 Oops. As Andrew Dennison just noticed, I left a stray
space in the Makefile, thereby totally breaking it.
2003-06-25 05:18:48 +00:00
Eric Andersen b6071ea5cb Regenerate the busybox.links file when the .config changes 2003-06-25 03:26:04 +00:00
Glenn L McGrath 655d814d75 New applet: patch, applies a unified diff 2003-06-22 15:32:41 +00:00
Glenn L McGrath a0b3705fa1 Save a few bytes by using bb_getopt_ulflags and a few other minor
improvments
2003-06-22 06:59:34 +00:00
Eric Andersen f0f754aeaf Based on a tinylogin patch from Philip Blundell, add several
additional options to adduser.
 -Erik
2003-06-21 20:03:07 +00:00
Eric Andersen 9d9cecfd63 Fix a silly bug I introduced yesterday 2003-06-21 09:05:49 +00:00
Eric Andersen 3c8bca364d Fixup whitespace handing, fixing some annoying behavior and
a couple of segfaults
2003-06-20 10:02:29 +00:00
Eric Andersen 25ea42de9b Fall back to looking in /lib/modules/modules.dep if
/lib/modules/<kernel version>/modules.dep is missing
2003-06-20 09:57:30 +00:00
Eric Andersen 908e362133 Patch from Andrew Dennison:
I've had some issues with modprobe which I reported a few months ago. This
is still an issue so I decided to sort it out.

The attached diff includes the changes against the unstable cvs tree that
work for me.

Changes are:
mod_process() will report success if the module at the head of the list
loads successfully. It will also report success if any module unloads
successfully.
The net result being that modprobe will succeed in the cases outlined below.
I've also added error reporting to modprobe -r. Previously it would silently
fail (but report success) if the module could not be unloaded.

Andrew
2003-06-20 09:56:37 +00:00
Eric Andersen 9d7f0f0fe8 Somewhere in the 2.4.x kernel series, /proc/mounts was changed to display a
"rootfs" entry as well as the traditional "/dev/root" entry.  This caused
applets such as mount and df to display two root filesystem entries....

This teaches the relevant utilities to ignore the "rootfs" entry.
 -Erik
2003-06-20 09:36:49 +00:00
Eric Andersen dd92c77bb0 Don't shadow a paramater 2003-06-20 09:25:34 +00:00
Eric Andersen 0cc7e6236a Fix a couple vars that could be used uninitialized 2003-06-20 09:23:34 +00:00
Eric Andersen 2a41ec6c63 use an explicit cast on some types that change size when
large file support is enabled.
2003-06-20 09:22:12 +00:00
Eric Andersen 1b2e7c3b2a Make gcc not whine about "deprecated use of label at end of compound statement" 2003-06-20 09:20:28 +00:00
Eric Andersen c9e7024924 Add prototype update missing from last_patch89. Fix screwy
formatting in cut.
2003-06-20 09:16:00 +00:00
Eric Andersen 0f08e53535 Patch from Lars Kellogg-Stedman:
I'm building BusyBox using a development kit for MontaVista Hardhat Linux
(PPC) -- which, at least in this instance, is based around kernel 2.2.14.
I've had to massage a few files in networking/libiproute/ to make it
compile.  Specifically:

  (1) Added a #include <sys/uio.h> for the iovec structure in
      libnetlink.c,

  (2) Put ifdefs in ll_types.c and ll_proto.c around various
      constants (ETH_P_xxx and ARPHRD_xxx) that weren't defined,

  (3) Make do_changename() in iplink.c require a kernel >=
      2.4.0 -- the ifr structure in my environment doesn't
      have the ifr_name attribute.  I've assumed this is
      a kernel dependency -- let me know if I ought to be
      checking something else.

      In the absence of the correct kernel, do_changename()
      always returns 0.

Attached is a patch against the current CVS that will make these changes.

-- Lars
2003-06-20 09:05:00 +00:00
Eric Andersen 8876fb2f59 last_patch89 from vodz:
Manuel,

    I rewrite bb_getopt_ulflags() function for more universal usage.
    My version support now:
    - options with arguments (optional arg as GNU extension also)
    - complementaly and/or incomplementaly and/or incongruously and/or list
    options
    - long_opt (all applets may have long option, add supporting is trivial)
    This realisation full compatibile from your version.
    Code size grow 480 bytes, but only coreutils/* over compensate this size
    after using new function. Last patch reduced over 800 bytes and not full
    applied to all. "mkdir" and "mv" applets have long_opt now for demonstrate
    trivial addition support long_opt with usage new bb_getopt_ulflags().
    Complementaly and/or incomplementaly and/or incongruously and/or list options
    logic is not trivial, but new "cut" and "grep" applets using this logic
    for examples with full demostrating. New "grep" applet reduced over 300
    bytes.

    Mark,
    Also. I removed bug from "grep" applet.
    $ echo a b | busybox grep -e a b
    a b
    a b
    But right is printing one only.

    --w
    vodz
2003-06-20 09:01:58 +00:00
Eric Andersen dfce3536ac Fix rpm usage msg 2003-06-15 07:00:54 +00:00
Eric Andersen a8da17acef Add missing pieces from vodz' last_patch88 2003-06-14 02:57:53 +00:00
Eric Andersen fa7532b91a Fix the location for the default config so 'make defconfig'
actually works
2003-06-12 22:09:08 +00:00
Glenn L McGrath b838420fd5 Handle hard links by converting them to symlinks 2003-06-12 13:47:16 +00:00
Glenn L McGrath 24833430bc Vodz, last_patch_88 2003-06-10 17:22:49 +00:00
Glenn L McGrath 6c43f743a3 sha1sum option to compare checksums 2003-06-08 13:32:12 +00:00
Glenn L McGrath a721204ec5 Better error handling 2003-06-07 17:38:33 +00:00
Glenn L McGrath a9e4617494 Minor correction 2003-06-07 17:11:00 +00:00
Glenn L McGrath 138d71bc35 Fix bug (wrong value computed) when reading file from stdin, implement
-s option
2003-06-07 17:06:28 +00:00
Glenn L McGrath 7aa62cf173 Run through indent 2003-06-07 14:54:24 +00:00
Eric Andersen 233b170a85 Patch from Lars Kellogg-Stedman, lars at larsshack.org, to
make ifupdown's mapping function work as documented.
2003-06-05 19:37:01 +00:00
Eric Andersen d130973f34 Put this back the way it was. I misunderstood what vodz was doing. 2003-05-27 20:45:59 +00:00
Eric Andersen 82ab3d7c3e Make all syscall declarations use the syscall() function 2003-05-26 18:48:56 +00:00
Eric Andersen b0cfca7544 This was doing some silly stuff that is not necessary when using
vfork(), so I have simplified it.
2003-05-26 18:12:00 +00:00
Eric Andersen a2d1982841 cleanup a bit to remove needless verify() function 2003-05-26 18:09:14 +00:00
Eric Andersen fab3e12cec Skip printing "/proc/%d/cmdline" stuff when it is not relevant 2003-05-26 18:07:30 +00:00
Eric Andersen 64191c3896 Remove cruft 2003-05-26 18:06:20 +00:00
Glenn L McGrath 2faee7b1ed Vodz, last_path_87, formatiing changes 2003-05-26 14:09:12 +00:00
Glenn L McGrath 393183dccc Vodz, last_patch_86 2003-05-26 14:07:50 +00:00
Eric Andersen ddfe18df75 Update mkdep, per the "touchless dependencies for 2.4.x" patch
from Geert Uytterhoeven posted to the lkml.
 -Erik
2003-05-24 07:30:58 +00:00
Eric Andersen 46ba568fc0 oops 2003-05-23 09:29:57 +00:00
Eric Andersen d4f90ed37e This patch from Vitezslav Batrla, is a cleaner fix for the
problem with syslogd logging the '<' char.
2003-05-23 09:28:01 +00:00
Eric Andersen 787ff55a69 Patch from Russell Coker:
The attached patch fixes a compilation error.  If you compile ping6 without
the CONFIG_FEATURE_FANCY_PING6 option then the compile will fail without this
patch.
2003-05-22 07:10:22 +00:00
Glenn L McGrath 4fe3ff8cff Patch from Glenn Engel
- more comments
- larger allowed number of CGI script variables
- ifdefs for regression test hooks
- default to ./ rather than /www (if unspecified) for compatibility with
earlier versions.
- Allow ip: as a synomym for A: rules for compatibility with earlier
versions.
- Setting of CGI_ARGLIST_  when automatic setting of env vars for form
scripting is utilized.  This helps with minimal systems like openap.
2003-05-19 05:56:16 +00:00
Matt Kraai 0861e828d0 Handle -O preceding -x. 2003-05-18 21:12:36 +00:00
Eric Andersen 900c8f3362 Apply patch from Georg Magschok to fix syslog behavior so that the
'>' charactor can be logged, per rfc3164.

Also, a small patch from me to fix it so we use MAXLINE when allocating the
buffer, which is consistant with use everywhere else.  This is needed since
uClibc defines BUFSIZE as 255, causing lines to be truncated at 255...
2003-05-16 08:35:02 +00:00
Glenn L McGrath d3af409eae Part of a patch from Glenn Engel, updates httpd help 2003-05-14 12:20:21 +00:00
Glenn L McGrath 874e3381db vodz, last_patch_85 2003-05-14 12:11:36 +00:00
Glenn L McGrath 0a3b0106ab Re-use existing variables, patch from Tito 2003-05-13 16:31:15 +00:00
Glenn L McGrath c9163fee91 last_patch84 by Vodz. 2003-05-13 16:20:11 +00:00
Glenn L McGrath 49e74effbc Add some missing lines for getty, patch by Steven Scholz 2003-05-13 14:59:07 +00:00
Glenn L McGrath 74fcbb0f7d Fix \l so it doesnt print the character as well as the tty, from old
patch by Nick Fedchik
2003-05-13 13:28:25 +00:00
Glenn L McGrath 1e11c34be4 minit, a Minimal init system. 2003-05-11 14:52:39 +00:00
Glenn L McGrath 8c6887c855 Use xopen instead of xfopen 2003-05-08 13:09:28 +00:00
Eric Andersen 7b3edeb14d Patch from Dmitry V. Levin to fix a fd leak 2003-05-02 16:25:01 +00:00
Eric Andersen a860bec167 A couple of patches from Tito <farmatito@tiscali.it> 2003-04-27 10:42:31 +00:00
Glenn L McGrath 7a54360cd4 Use bb_xgetlarg 2003-04-27 10:05:35 +00:00
Glenn L McGrath f01b805d91 New applet, fold 2003-04-27 06:02:14 +00:00
Glenn L McGrath c91ce57099 Config option to create an fgrep alias 2003-04-27 02:43:54 +00:00
Glenn L McGrath c5408fe7f7 Fix segfault when cleaning up 2003-04-27 02:22:01 +00:00
Glenn L McGrath 26df70a823 grep -f support, adds only 60 Bytes, but regex's now compiled as
required, rather than being pre-compiled.
2003-04-27 01:50:57 +00:00
Glenn L McGrath e2aed7ffd7 Always preserve date 2003-04-26 13:16:44 +00:00
Glenn L McGrath 91e1978ff0 New commands, 'G' and 'H' 2003-04-26 07:40:07 +00:00
Glenn L McGrath 69f28e7c0c Add the -d option, its used by old versions of config.guess, change to
use getopt.
2003-04-26 04:56:17 +00:00
Glenn L McGrath fbf0b8af41 iPatch from waldi, fixes usage of ip route flush (from)? (match|exact) 2003-04-26 02:22:19 +00:00
Eric Andersen 86f2cce6bf Patch from Steven Scholz to fix telnetd compile problem 2003-04-25 12:32:37 +00:00
Eric Andersen 2c1de61023 There have been many reports of init failing to reboot and/or failing to halt
over the years.  Well I finally took the time to track this down.  It turns out
that inside linux/kernel/sys.c the kernel will call
    machine_halt();
    do_exit(0);
when halting, or will call
    machine_power_off();
    do_exit(0);

during a reboot.  Unlike sysv init, we call reboot from within the init
process, so if the call to machine_halt() or machine_power_off() returns,                                       the call to do_exit(0) will cause the kernel to panic.  Which is a very
bad thing to happen.

So I just added this little patch to fork and call the reboot
syscall from within the forked child process, thereby neatly
avoiding the problem.

But IMHO, both calls to do_exit(0) within linux/kernel/sys.c
are bugs and should be fixed.

 -Erik
2003-04-24 11:41:28 +00:00
Glenn L McGrath afc01cd485 unlink a previous file before its extracted 2003-04-21 11:03:29 +00:00
Glenn L McGrath 923dd79af7 sync with waldi 2003-04-21 10:26:39 +00:00
Glenn L McGrath 35a5b08eee unlink() an existing file, before opening it, simply truncating can
cause nasty problems if overwriting glibc, spotted by waldi.
2003-04-21 10:07:48 +00:00
Eric Andersen 6f9a0d4bbb Add link to SimplyGNUstep 2003-04-21 03:34:01 +00:00
Eric Andersen 4a11e0fb45 Patch from David Updegraff to use calloc so that forward pointers start out
NULL, and so it can handle format strings that have stuff _after_ the last %?
specification
2003-04-19 23:18:35 +00:00
Eric Andersen 2894266f12 Patch from David Updegraff to avoid corrupting memory while parsing the
networks/iterfaces file with next_word routine.  Without this, next_word
increments one beyond the end of the string.
2003-04-19 23:15:06 +00:00
Eric Andersen 343658582b Minor .o file naming change 2003-04-16 23:02:35 +00:00
Eric Andersen 7cb6ef7982 enable CONFIG_USE_BB_PWD_GRP for the debian installer,
to prevent glibc from trying and failing to use NSS junk
that is not present.
 -Erik
2003-04-16 20:52:01 +00:00
Glenn L McGrath fc4cb4dbb5 Fix logic error in grouped commands 2003-04-12 16:10:42 +00:00
Glenn L McGrath d4185b0e15 Fix up indenting 2003-04-11 17:10:23 +00:00
Glenn L McGrath d7fe39b587 Really fix the 'r' command 2003-04-09 15:52:32 +00:00
Glenn L McGrath d87a7ac269 Fix the sed 'r' command 2003-04-09 15:26:14 +00:00
Glenn L McGrath 2410386611 fix substitution when replacing with &, we shouldnt check for an escape charcter. Its already been taken care of _somewhere_ else 2003-04-09 07:51:43 +00:00
Glenn L McGrath bd9b32bc0d Label ends at a newline, update comments, rename linked list field 2003-04-09 01:43:54 +00:00
Glenn L McGrath 8d6395d41a Run through indent 2003-04-08 11:56:11 +00:00
Glenn L McGrath c1d95076f0 Fixes block commands to correctly identify end of block, recognise the #n directive, fix substitue command when regex isnt specified 2003-04-08 06:42:45 +00:00
Glenn L McGrath 7ce9e247f0 Add hold space commands 'g', 'h', 'x' 2003-04-07 16:04:14 +00:00
Glenn L McGrath c6adada158 Rename "line" to pattern_space to be more descriptive and closer to the POSIX description 2003-04-07 12:24:44 +00:00
Glenn L McGrath 4957fc7a93 Sync with waldi's package 2003-04-06 15:35:52 +00:00
Glenn L McGrath 8353fe9298 Preparation for the new net-udeb based on required applets documented at
http://cvs.debian.org/debian-installer/doc/busybox-applets.txt
2003-04-06 03:39:24 +00:00
Eric Andersen 982da3e6b4 Add more help text 2003-04-04 15:20:53 +00:00
Eric Andersen 4762a48166 Test that cvs commit messages are working properly
-Erik
2003-04-04 14:35:36 +00:00
Manuel Novoa III 0c236a09ed Fix 'thinko'. 2003-04-03 19:29:11 +00:00
Eric Andersen 8320b425a3 Yet another rather large face lift. It now works for me as expected.
-Erik
2003-04-02 10:13:26 +00:00
Eric Andersen a71c7047cf Avoid errors with buggy preprocessors 2003-03-31 16:27:18 +00:00
Glenn L McGrath f3def2792b Update config to new menu options 2003-03-30 16:10:06 +00:00
Glenn L McGrath 1b6dfa7066 Rename, to specify kernel 2003-03-30 13:57:26 +00:00
Glenn L McGrath 9a52bb6878 Group common string 2003-03-30 09:38:40 +00:00
Glenn L McGrath 30b47df86b Small fix for sed 'y' command 2003-03-30 08:40:09 +00:00
Glenn L McGrath f01b46d7dd sed 'y' command, simplify some other code 2003-03-30 08:02:18 +00:00
Glenn L McGrath 0c51832b60 Experimental support for embeded newline. (im evil)
Fix segfault when using 'N' with an odd number of lines.
2003-03-30 03:41:53 +00:00
Eric Andersen b5b5ac3237 trivial fix to make sure we have sufficient arguments before
we mess with a possibly non-existant argv[1]
 -Erik
2003-03-28 16:54:14 +00:00
Glenn L McGrath a0f0f0cf76 Still fine tunning the printing of the substitute command 2003-03-28 14:11:34 +00:00
Glenn L McGrath 595a6a4199 sed 't' branching command 2003-03-28 08:36:52 +00:00
Glenn L McGrath ccd43a8301 Fix sed 's' command's 'p' flag, so it can print line twice 2003-03-28 07:44:03 +00:00
Glenn L McGrath b08e3e8c2e fix q command 2003-03-28 04:57:52 +00:00
Glenn L McGrath 961c6c19da Add basic branching support, sed ':' and 'b' commands 2003-03-28 04:43:39 +00:00
Glenn L McGrath 56c633c139 make sed cleanup use linked list 2003-03-28 04:23:23 +00:00
Glenn L McGrath c949bfa555 Use a linked list for sed commands in preparation for branching support 2003-03-28 03:53:31 +00:00
Manuel Novoa III 3a9b0bf0ba Oops... had != but meant ==. 2003-03-23 20:27:33 +00:00
Manuel Novoa III 4baef0c77f Minor cleanups. Document the cmp -l option. 2003-03-19 18:40:42 +00:00
Manuel Novoa III ea4c43445c Restrict octal perms to <= 07777. Cosmetic error message change. 2003-03-19 18:09:03 +00:00
Manuel Novoa III 1cb1b64c35 Obligatory forgotten item. 2003-03-19 09:42:33 +00:00
Manuel Novoa III 4eff18189a Things my compiler didn't catch... 2003-03-19 09:42:02 +00:00
Manuel Novoa III cad5364599 Major coreutils update. 2003-03-19 09:13:01 +00:00
Glenn L McGrath e01f9662a5 Match newlines, this fixes matching of ^ or $ when there is a '\n' in the pattern being matched. This fixes cases when the N command is used. 2003-03-18 08:37:57 +00:00
Glenn L McGrath 2971ef1730 Fix a bug that corrupted the string followed commands that had no arguments (Closes #1304) 2003-03-18 01:19:23 +00:00
Eric Andersen 737f5fb890 Patch from Jonas Holmberg, adjusted by Robert Schwebel, and
later re-adjusted by me to fix msh backtick handling
2003-03-14 16:05:59 +00:00
Eric Andersen d2b8118650 oops. args shuffled. 2003-03-13 20:54:26 +00:00
Eric Andersen c3b2dbec8c Fix obviously wrong names from older busybox 2003-03-13 18:57:08 +00:00
Eric Andersen 92b7e7baa1 Patch from Tito Ragusa:
The changes I've made: in strings.c:
1) fix memory allocation error I've detected with MALLOC_CHECK_=1 in *string;
2) code clean up;
3) fix compiler warnings about uninitialized vars;
2003-03-13 18:49:45 +00:00
Eric Andersen 3f1cf455a0 cope with crappy windoze ftp servers 2003-03-11 18:03:39 +00:00
Eric Andersen e68afefe56 Avoid potential rendering problems 2003-03-10 17:21:46 +00:00
Glenn L McGrath 4157a8a71e fix n, add N, P 2003-03-10 04:12:35 +00:00
Glenn L McGrath ff724fb076 add the 'n' command 2003-03-10 02:56:56 +00:00
Glenn L McGrath bed4033e96 Add the q (quit) option 2003-03-10 02:21:14 +00:00
Glenn L McGrath f3bd7c4631 Fix a delimiter matching bug i introduced. 2003-03-09 15:40:40 +00:00
Glenn L McGrath f50ce3135f Support grouped commands, i.e. {cmd1;cmd2} 2003-03-09 15:12:24 +00:00
Glenn L McGrath 4c6523a90b alloc array for commands, use string ptr in parse_command_string() 2003-03-09 11:06:38 +00:00
Glenn L McGrath e7a8bc949b use typedef for struct sed_cmd 2003-03-09 10:23:57 +00:00
Glenn L McGrath 1fb446795d redo get_addres(). save some space. possible fix a bug where the command might be set to 0 if no second address is given. dont parse sed_cmd struct to get_address, we only need the delim field. 2003-03-09 08:44:49 +00:00
Glenn L McGrath 2f8a401772 Woops, remove the code i didnt mean to commit 2003-03-09 02:44:49 +00:00
Glenn L McGrath d5eadea970 Mention the opengroup sed reference, add a check which is disabled at present. 2003-03-09 02:39:29 +00:00
Glenn L McGrath 505bd0f15a Fix matching for the $ address (last line) 2003-03-08 05:21:02 +00:00
Eric Andersen 77831c11d1 be more careful about cleaning up 2003-03-07 18:09:06 +00:00
Eric Andersen 3719e9e790 Scrub things a bit, shave off a few bytes.
-Erik
2003-03-07 18:03:02 +00:00
Eric Andersen 1bc5fa8c0c Save a few bytes and remove a redundant string 2003-03-07 17:59:32 +00:00
Eric Andersen 6067c08145 With nightmares of libbb ending up with 100 .c files starting
with "bb_" it seems best to rename this now and avoid starting
an evil KDE style naming trend.
2003-03-07 17:43:32 +00:00
Eric Andersen 2afcbe436f audit for proper error handling, apply a few size optimizations
-Erik
2003-03-07 17:33:40 +00:00
Eric Andersen a9c6bc41e9 Define bb_xgetlarg as a standard interface for extracting
numbers from getopt which includes careful error checking.
 -Erik
2003-03-07 17:29:12 +00:00
Eric Andersen bae7c1ac24 Explicitly define -DNDEBUG so asserts don't clutter release code 2003-03-07 17:27:51 +00:00
Eric Andersen 08f4a4c508 Add all the syslogd help text 2003-02-28 07:20:55 +00:00
Eric Andersen 5ef448285b There is no good reason to prevent nfs mounts from being mounted
during 'mount -a'.  If the user wants to do that, hey, its their
lifs.  If the nfs server is down and they don't want to wait for
nfs to time out, that is their problem.
 -Erik
2003-02-28 06:29:27 +00:00
Eric Andersen a0ac4523b1 Write all the help text for the util-linux utilities. Allow
people to locate the mtab file somewhere other that /etc to
accomodate read only root filesystems.
 -Erik
2003-02-27 03:14:04 +00:00
Eric Andersen ee6da5527c mention "katamaran" 2003-02-18 20:17:30 +00:00
Glenn L McGrath 008c01915b Fix for big endian machines 2003-02-17 12:18:16 +00:00
Glenn L McGrath ae0f1e7052 New applet sha1sum 2003-02-17 08:23:22 +00:00
Glenn L McGrath 4a4c677fcc Patch from Bastian Blank
- ip route flush
 - different usage for telnetd in inetd mode
 - changes for the default flags of the ip features
 - if no /usr requested, udhcpc should use the script also without /usr.
2003-02-15 11:50:33 +00:00
Glenn L McGrath 3238ea1673 Merge fileutils, textutils and shellutils into coreuils 2003-02-15 10:53:40 +00:00
Russ Dill 858fad722f sync with udhcp bug fixes 2003-02-12 22:20:19 +00:00
Eric Andersen 496411b489 Don't use HZ -- use sysconf(_SC_CLK_TCK) 2003-02-12 10:56:53 +00:00
Manuel Novoa III c2843563f3 Fix compile error... header problems. 2003-02-11 07:06:06 +00:00
Glenn L McGrath ae494a9086 last_patch83 by Vladimir N. Oleynik 2003-02-10 22:53:37 +00:00
Glenn L McGrath b1207b3320 Fix compile error, last_patch82 by Vladimir N. Oleynik 2003-02-10 22:31:09 +00:00
Glenn L McGrath 3d2405cfb3 Fix compile error, last_patch81 by Vladimir N. Oleynik 2003-02-10 22:28:21 +00:00
Eric Andersen 18d8a3b7e3 udhcpc is supposed to be in /sbin, not /usr/sbin/ 2003-02-10 09:22:36 +00:00
Glenn L McGrath 883d4842d2 Fix compiler warnings, patch by Steven Scholz 2003-02-09 22:40:34 +00:00
Glenn L McGrath 826b48b624 Woops, my gunzip fix broke unzip, these cant be static 2003-02-09 12:00:17 +00:00
Glenn L McGrath a837e2d9b3 Minor update to arping, patch from Nick Fedchik 2003-02-09 07:01:33 +00:00
Glenn L McGrath 06e9565b6c New applet, inetd, make httpd features more configurable, update authors, last_patch_80
from Vladimir N. Oleynik
2003-02-09 06:51:14 +00:00
Glenn L McGrath 877d418b39 Dont die if logging remotely fails, patch by Joshua Jackson 2003-02-09 05:07:42 +00:00
Glenn L McGrath def85e8752 Specify install path, patch by Nick Fedchik 2003-02-09 05:00:52 +00:00
Glenn L McGrath 1d21fb3c23 Moved to libunarchive/unzip.c 2003-02-09 04:49:17 +00:00
Glenn L McGrath cc616928d5 Fix endian probelm on PPC, i had different types for an extern variable. 2003-02-09 04:46:34 +00:00
Glenn L McGrath a88cb5025c Patch from mathuria, compatability with solaris 2003-02-08 23:36:16 +00:00
Glenn L McGrath 3aeaee33b6 Patch from Joshua Jackson, make md5 the default hash algorithm 2003-02-08 23:20:02 +00:00
Glenn L McGrath b4f3d7f594 Rewrite by Manuel Novoa III, very compact implimentation. 2003-02-08 23:11:19 +00:00
Glenn L McGrath cb665093b8 Patch from Nick Fedchik, CONFIG_SYSLOGD should determine getty's
behaviour.
2003-02-08 22:33:53 +00:00
Eric Andersen a486f469cb Mention penguru 2003-02-05 18:16:45 +00:00
Eric Andersen 46c203a6ce Fix a couple more ifupdown bugs 2003-02-03 12:44:59 +00:00
Glenn L McGrath 21110a0aa2 Fix long standing bug with old gnu tar files, add a check so tar will
complain "unknown file type" if it tries to extract an oldgnu tar file
and TAR_FEATURE_OLDGNU_COMPATABILITY sint defined.
Print a warning if unisupported gnu extensions are encountered.
2003-01-28 01:45:48 +00:00
Eric Andersen a99534354a Don't wipe the config system on 'make clean' 2003-01-27 22:11:59 +00:00
Eric Andersen 66a3af9d7c This seems sufficient for ifup and ifdown to actually work
as advertised.  Works for me (at least with glibc)
2003-01-27 17:41:19 +00:00
Eric Andersen 22237017a7 Fix a silly compile error, thanks to a patch from Wen-chien Jesse Sung 2003-01-23 07:08:26 +00:00
Eric Andersen ee9441f848 Patch from Brett Hunt at micron.com to fixup potential segfaults
during 'make menuconfig'
2003-01-23 06:36:15 +00:00
Eric Andersen bf77f61d69 Patch from Jason McMullan @ linuxcare.com adding insmod
support for s390 systems.
2003-01-23 06:02:39 +00:00
Eric Andersen 853c494efd A patch from John F. Kelly to add in a utility for configuring
vlan under linux, derived from Ben Greear's VLAN "vconfig" tool.
2003-01-23 05:59:32 +00:00
Eric Andersen 97d86f2bb5 Apply patch from Ghozlane Toumi to add -inum support to find.
Apply patch from Ghozlane Toumi to make find smaller by combining
    similar error messages
Forward port find -newer support from busybox stable that was
    missing from unstable.  -Erik.
Fixup usage messages for find.  -Erik
2003-01-23 05:27:42 +00:00
Eric Andersen be65c350ae Patch from Artem Egorkine to support the -m option 2003-01-23 04:57:35 +00:00
Eric Andersen 889dd20c69 Patch from Joel Vallier to add modules symbols to the kernel symbol
table in order to obtain better debug output from ksymoops.
2003-01-23 04:48:34 +00:00
Glenn L McGrath 8eb214edbd Patch from Basitan Blank to fix nasty bug 2003-01-22 21:09:48 +00:00
Eric Andersen d8fdf0c57d Fix a typo that broke it so busybox won't build 2003-01-22 01:20:35 +00:00
Russ Dill 6393d69f76 merge fixes with udhcp 2003-01-21 22:39:34 +00:00
Glenn L McGrath 6af21c2afa Login prompt function, part of waldi's telnetd from inetd patch 2003-01-21 20:59:34 +00:00
Glenn L McGrath 9e5d6c002c run telnet from inetd, present login prompt if login is configured,
patch from Bastian Blank
2003-01-21 20:55:56 +00:00
Glenn L McGrath 4c51202b9d re-order config options, part of a patch from Bastian Blank 2003-01-21 00:12:11 +00:00
Glenn L McGrath 5cc9ada0e4 header update 2003-01-21 00:03:05 +00:00
Glenn L McGrath 2e51a14d57 New test mode that allows run_parts to fail silently if the directory
is not found. Patch from Bastian Blank
2003-01-20 23:50:59 +00:00
Glenn L McGrath aad465efb7 Make test mode output same as official version 2003-01-20 23:34:12 +00:00
Glenn L McGrath a9adef0394 Dont use getopt_long, minor usage changes, patch by Nick Fedchik 2003-01-19 13:34:21 +00:00
Glenn L McGrath e6ae6e3d39 fix missed option argument for -I <device>, interface name checks
redesigned, patch by Nick Fedchik
2003-01-19 13:31:41 +00:00
Glenn L McGrath f2ba45e339 Compile option to avoid using /usr directory, patch by Bastian Blank 2003-01-19 12:55:13 +00:00
Glenn L McGrath 77c60e5c66 Use vsyslog instead of syslog, improve initalisation and cleanup of
variables, save 300 Bytes or so, patch by Vladimir N. Oleynik
2003-01-16 11:37:57 +00:00
Glenn L McGrath 8573704097 Fix leading spaces bug, free line buffer, redo next_word, save some
space.
2003-01-14 23:26:57 +00:00
Glenn L McGrath 147a3ca1a4 Patch for the debian-cvs package, ip* applets in /bin, patch from Bastian Blank 2003-01-14 21:41:12 +00:00
Eric Andersen fc4a0fd82e last_patch75_2 from vodz, 2003-01-14 18:13:13 +00:00
Eric Andersen 85d9d80db8 Ensure consistant sort order, sed behavior, etc
-Erik
2003-01-14 09:12:39 +00:00
Eric Andersen ab4e19afc6 Eliminate most instances where we use linux kernel headers
-Erik
2003-01-14 08:54:08 +00:00
Eric Andersen 92a06d0943 Clean config binsries on 'make clean' 2003-01-14 08:52:18 +00:00
Eric Andersen 8004bb7661 Eliminate use of kernel header file
-Erik
2003-01-14 08:06:07 +00:00
Eric Andersen e0716ba23b Fixup addgroup help text 2003-01-14 06:42:56 +00:00
Eric Andersen 4b525addb8 Only call free if it is necessary 2003-01-14 06:40:11 +00:00
Eric Andersen 65ddf77fbd Patch from Tito to rework strings applet, and some testsuite
stuff to test it added by me.
2003-01-13 23:19:31 +00:00
Glenn L McGrath b4a1baa312 Correct some init issues, update email address, last_patch78 by Vladimir
N. Oleynik
2003-01-13 22:09:50 +00:00
Glenn L McGrath d66370cd73 Option to allow ifupdown use ip commands instead of ifconfig, add flush
command to ipaddr, patch by Bastian Blank
2003-01-13 21:40:38 +00:00
Eric Andersen 4e486a5d00 Kiss Gabor noticed that ping compiled without BB_FEATURE_FANCY_PING
would return 0 instead of EXIT_FAILURE when no response was received.
2003-01-12 06:08:33 +00:00
Eric Andersen 1dcf218e60 Patch from Daniel J Walsh at redhat to make free work for systems
with more than 1 GB of memory...
2003-01-11 20:40:49 +00:00
Eric Andersen 575c78274a Patch from Robert Schwebel -- support ncurses installed in /usr/local 2003-01-11 18:07:38 +00:00
Eric Andersen b1c9469f65 Patch from Robert Schwebel fixing a missing \n 2003-01-11 18:06:02 +00:00
Eric Andersen aaab46baba Fix an obvious mistake 2003-01-11 18:02:51 +00:00
Eric Andersen f05fd444e8 Fix addgroup so it actually works
-Erik
2003-01-09 18:53:53 +00:00
Eric Andersen e931909d2d Additional patch from Tito to fix some anomolies 2003-01-09 14:36:26 +00:00
Glenn L McGrath 9e59841375 arping applet by Nick Fedchik 2003-01-09 10:06:01 +00:00
Glenn L McGrath dd3461af2f Make output the same as upstream, patch by Tito 2003-01-09 10:00:49 +00:00
Glenn L McGrath a69fd2ecf6 Patch by Stewart Brodie to terminate the string array correctly 2003-01-08 03:26:47 +00:00
Eric Andersen e40500f9cb Lineo has ceased to exist, and is no longer a sponsor. 2003-01-08 01:15:31 +00:00
Glenn L McGrath 7040ecc993 Minor cleanup, identified by Stewart Brodie, patch by Vladimir N.
Oleynik
2003-01-06 16:27:07 +00:00
Glenn L McGrath 4d00129d0f Correct column width for tab completion and ls 2003-01-06 01:11:50 +00:00
Glenn L McGrath 58c708af23 New applet: httpd, by Glenn Engel 2003-01-05 04:01:56 +00:00
Glenn L McGrath c2e74ca934 Prepare for new busybox-cvs upload 2003-01-05 02:02:02 +00:00
Glenn L McGrath ea2a1064b3 fixes for ia64 2003-01-05 00:43:00 +00:00
Glenn L McGrath 39dd4011e4 Sync with 20030104-2 cvs package, disable fdisk BSD label as they dont
compile on m68k
2003-01-04 13:45:42 +00:00
Glenn L McGrath 4dcc2ddfcc fdisk writable feature, allows compilation of a small fdisk that can
only read partition table, by Vladimir N. Oleynik
2003-01-04 11:56:06 +00:00
Eric Andersen 2c24bb80f9 Fix tab-tab listing of files so it properly reflects current
terminal width.
 -Erik
2003-01-02 07:25:47 +00:00
Robert Griebl 7ce75f44ae > Eliminate dependancy on kernel header files. Naughty naughty.
> Using linux kernel headers is a Bad Thing(tm) and should be
> punished.
>  -Erik

Doing this wrong should be punished even harder :)
 - Robert
2003-01-02 07:16:53 +00:00
Manuel Novoa III a6685585d8 Add "Broadcast +" support back in. Also cut the size down some. Not well
tested, but it is the holidays...
2002-12-27 17:42:01 +00:00
Glenn L McGrath 87444efbab Add usage for tar -j and -z 2002-12-27 00:45:35 +00:00
Glenn L McGrath d4c8d1a97f Sync with 20021214-1 debian package 2002-12-23 12:49:32 +00:00
Glenn L McGrath 76ff0da4d2 Support the obsolete '+' option 2002-12-23 11:54:56 +00:00
Glenn L McGrath c00c56e7c8 Fix STANDALONE_SHELL and ALWAYS_WIN options, last_path_73 by Vladimir N. Oleynik 2002-12-23 10:23:10 +00:00
Glenn L McGrath 0a65e190f4 Support the '=' command 2002-12-23 10:16:12 +00:00
Glenn L McGrath 4d7f965c8e Adjust for new .depend target 2002-12-20 10:06:38 +00:00
Glenn L McGrath e86e4a2282 busybox target wasnt checking .depend, clean kbuild binaries only on distclean 2002-12-20 06:03:47 +00:00
Glenn L McGrath 0f18271a8a Bugfix, wastn retrieving last block, patch by Jean-Christophe Dubois 2002-12-19 20:16:22 +00:00
Glenn L McGrath 1643f41986 When retrieving a file dont open file until we have to to prevent files of size 0 being created when retrieval fails, bug found by Jeff Angielski 2002-12-18 02:47:40 +00:00
Glenn L McGrath 688cf014af Get interface names using ioctl rather than /proc, from Nick Fedchik 2002-12-17 12:43:43 +00:00
Eric Andersen cf1fee06a5 Odd. I never brought this forward from bb.stable. Should handle
reaping child processes better.
 -Erik
2002-12-17 09:48:16 +00:00
Robert Griebl be2ae246fb Always print the routing table header for IPv4:
- this is consistent with IPv6 route
 - you can get very confused, if there are no routes and "route" prints
   nothing at all (not even "No routes" message)
2002-12-16 22:04:18 +00:00
Robert Griebl 53f133ac33 changed most assignments from ":=" to "=" to allow setting some variables
at the command line (this is also needed for cross-compilation)
2002-12-16 21:55:39 +00:00
Glenn L McGrath 275be87be7 Only included headers that are used. 2002-12-16 07:37:21 +00:00
Glenn L McGrath 1e132dd4dd fix warning 2002-12-16 06:40:37 +00:00
Tim Riker cf93274663 rmmod -a removed modules recursively 2002-12-14 01:58:59 +00:00
Tim Riker 6fe1960ff5 cleanup 2002-12-13 22:59:15 +00:00
Eric Andersen 068b6b07ff Don't build the ncurses stuff unless it is specifically asked for
-Erik
2002-12-13 22:53:28 +00:00
Tim Riker c118f99f73 use const group_file 2002-12-13 22:02:12 +00:00
Glenn L McGrath 8b08bda66b Fix bug when reading mac from command line, continue; if hwaddrr not found 2002-12-13 09:02:16 +00:00
Glenn L McGrath 25fe94fd32 Merge copyfd and copy_file_chunk 2002-12-13 08:20:44 +00:00
Glenn L McGrath a67dffe186 Change ftpput so it uses <remote-path> <local-file> as it should 2002-12-13 05:57:46 +00:00
Glenn L McGrath 3b33dd9b1e Fix possible bug if file length not known 2002-12-13 04:14:36 +00:00
Glenn L McGrath 02d7cbfe92 New applets, ftpget and ftpput 2002-12-13 02:43:50 +00:00
Glenn L McGrath f03c933e47 New applet, nameif by Nick Fedchik and myself. 2002-12-13 00:01:44 +00:00
Glenn L McGrath 9130c85847 full usage cleanup for udhcp 2002-12-12 12:56:18 +00:00
Glenn L McGrath 6ed77595f1 Update email address for Gennady Feldman <gena01@gena01.com> 2002-12-12 10:54:48 +00:00
Glenn L McGrath 6d07432b2f Support the o, f and p options, patch by Magnus M�rtensson 2002-12-12 10:31:53 +00:00
Eric Andersen b8dff0c2a2 Teach addgroup to add user names to groups 2002-12-12 08:57:16 +00:00
Eric Andersen b2bfd34a7b hehe. Screwed that one up. Lets do things right this time.
-Erik
2002-12-11 22:59:39 +00:00
Eric Andersen 1f1c3f9485 Makefile rework coordinate with Russ so udhcp will behave
-Erik
2002-12-11 22:45:33 +00:00
Russ Dill 54fde9ea5c slight change to reflect BB_VER change 2002-12-11 22:43:37 +00:00
Eric Andersen f4b273cbb4 A cleaner cleanup that avoids passing an off_t to scanf 2002-12-11 21:45:08 +00:00
Russ Dill 9f4395c54e sorry about all the noise, should be all synced up now 2002-12-11 21:40:46 +00:00
Russ Dill 920c1e8d6c another sync to udhcp cvs 2002-12-11 21:39:13 +00:00
Eric Andersen 9701411d21 squash a warning 2002-12-11 21:34:04 +00:00
Glenn L McGrath 49b0f86043 Fix -mtime, by Ian Abbott 2002-12-11 21:22:21 +00:00
Glenn L McGrath 4501dbe509 Small bugfix, last_patch72 from Vladimir N. Oleynik 2002-12-11 21:13:00 +00:00
Russ Dill 1eb7a17b12 resync with udhcp cvs 2002-12-11 21:12:45 +00:00
Eric Andersen d7e1a6c6eb Make sure we have a show_usage function prototype
-Erik
2002-12-11 07:46:30 +00:00
Eric Andersen 392947c860 Fixup all the horrible broken function prototypes
-Erik
2002-12-11 07:42:46 +00:00
Eric Andersen ece8fc2b9b Squash a warning by making function declaration a proper prototype 2002-12-11 04:26:28 +00:00
Eric Andersen 29f9b2fbdb Add missing header file to squash a warning 2002-12-11 04:25:02 +00:00
Eric Andersen 80ff9449bf Eliminate dependancy on kernel header files. Naughty naughty.
Using linux kernel headers is a Bad Thing(tm) and should be
punished.
 -Erik
2002-12-11 04:04:26 +00:00
Eric Andersen 0552b9a7ff Eliminate dependancy on kernel header files. Naughty naughty.
Using linux kernel headers is a Bad Thing(tm) and should be
punished.
 -Erik
2002-12-11 03:57:12 +00:00
Glenn L McGrath 84cc4e7e3e undefine sysinfo to prevent breakage on ia64 2002-12-11 03:55:52 +00:00
Eric Andersen acd244af1c Eliminate dependancy on kernel header files. Naughty naughty.
Using linux kernel headers is a Bad Thing(tm) and should be
punished.
2002-12-11 03:49:33 +00:00
Eric Andersen 8882ea53d5 Eliminate dependancy on kernel header files. Naughty naughty.
Using linux kernel headers is a Bad Thing(tm) and should be
punished.
 -Erik
2002-12-11 03:41:28 +00:00
Eric Andersen 39438c7c17 Fixup header file ordering 2002-12-11 03:40:10 +00:00
Glenn L McGrath b323162aab Use libbb/get_line_from_file instead of getline 2002-12-11 03:10:13 +00:00
Glenn L McGrath 11adab0535 Sync debian files with debian package version 0.60.99.cvs20021209-2 2002-12-10 11:28:40 +00:00
Glenn L McGrath 7b4e89b9e3 Fix undefined behaviour and save some bytes as suggested by Manuel Novoa III 2002-12-10 03:16:37 +00:00
Glenn L McGrath 38386d7fed include busybox after libc includes 2002-12-10 02:09:12 +00:00
Glenn L McGrath b72a735a32 rpm applet by Laurence Anderson 2002-12-10 00:17:22 +00:00
Glenn L McGrath 62fae308a3 Realpath applet 2002-12-10 00:14:33 +00:00
Glenn L McGrath 9bf9f1edbe Forgot to rename foo 2002-12-09 21:52:29 +00:00
Glenn L McGrath 919798d5a8 err.. Make clean in the scripts/config directory to remove some binaries 2002-12-09 21:16:39 +00:00
Glenn L McGrath a94c3108b1 Make clean in the scripts directory to remove some binaries 2002-12-09 21:14:38 +00:00
Glenn L McGrath 584baeb47d Stop linian warning about statically linked binary 2002-12-09 21:11:54 +00:00
Glenn L McGrath fad90db887 Fix a debug message, from Bastian Blank 2002-12-09 21:05:40 +00:00
Glenn L McGrath fdbbb04893 Command line history changes, lastpatch_71 from Vladimir N. Oleynik 2002-12-09 11:10:40 +00:00
Glenn L McGrath 6b5bd0e5ab Support using ip in udhcpc scripts.
Slightly modified version of patch by Bastian Blank
2002-12-08 22:17:54 +00:00
Glenn L McGrath c4698b3668 Updates for the new build system from Bastian Blank (waldi) 2002-12-08 20:45:47 +00:00
Glenn L McGrath a6bbf7929c Fix compile warning 2002-12-08 12:08:37 +00:00
Glenn L McGrath 35631a6e00 Fix compile warning with OSF 2002-12-08 11:51:05 +00:00
Glenn L McGrath e167d69309 Change #include order to fix warning 2002-12-08 11:47:52 +00:00
Glenn L McGrath 8e49caa54f Start to cleanup handling of the state file, save some space and uses linked lists. 2002-12-08 01:23:39 +00:00
Glenn L McGrath 66125c8065 Move add_to_list from libunarchive to libbb so it can be of more general use (eg ifupdown). Changed the name to llist_add_to as i plan on adding more llist_ functions as needed (e.g. llist_free). 2002-12-08 00:54:33 +00:00
Glenn L McGrath 346cdb1dde Re-sort filenames to alphebetical order. 2002-12-07 23:56:14 +00:00
Glenn L McGrath 4a6b4e393c Commit to reverse my previous commit, isnt cvs supposed to have some undo command ? 2002-12-07 23:30:11 +00:00
Glenn L McGrath 4e05b9b043 include "busybox" after the libc includes tofix compile errors 2002-12-07 23:14:40 +00:00
Glenn L McGrath 0325a1c9e3 Differentiate struct and type names 2002-12-07 07:45:42 +00:00
Glenn L McGrath 1d658263e8 Fix command that brings down loopback 2002-12-07 00:48:54 +00:00
Glenn L McGrath 80a60419f7 depends on for telnet and ipcalc 2002-12-06 23:11:30 +00:00
Glenn L McGrath 75360f951f It shouldnt depend on itself 2002-12-06 23:05:22 +00:00
Glenn L McGrath f795b027c6 Remove duplicate entry for kill 2002-12-06 22:45:07 +00:00
Glenn L McGrath 0337c467a0 Add some help descriptions 2002-12-06 22:40:54 +00:00
Eric Andersen a6b9051e16 Allow for people to select no default shell 2002-12-06 21:49:59 +00:00
Eric Andersen 110ee23515 Do the dumb/obvious thing for the killall->kill dependancy 2002-12-06 21:44:50 +00:00
Eric Andersen 27e99c8f09 Fixup dumpleases compile problem 2002-12-06 21:42:56 +00:00
Eric Andersen cc2bc454d1 Fix adjtimex applet compile 2002-12-06 21:41:09 +00:00
Eric Andersen b077c9f47d Fixup buffer allocation 2002-12-06 21:39:48 +00:00
Eric Andersen da15a496e2 Make hush comple once again 2002-12-06 21:37:08 +00:00
Glenn L McGrath 398ff9d981 Use libbb/get_line_from_file, change default state file location 2002-12-06 11:51:46 +00:00
Glenn L McGrath cdbe5e5d4c Make mapping a config option again to save space, turn off file locking, do we really need it ? 2002-12-06 08:35:55 +00:00
Glenn L McGrath 9227371b71 Fix bug that stoped -a working 2002-12-06 08:10:40 +00:00
Eric Andersen 83fdb317a7 Kill link now pointing to porn site. 2002-12-06 02:22:20 +00:00
Eric Andersen 23b5146247 Put stuff back into a sub-menu 2002-12-05 21:25:20 +00:00
Eric Andersen 536018278a Kill the now obsolete docs/Configure.help file, and move all existing
help texts into their respective Config.in file.
 -Erik
2002-12-05 21:12:42 +00:00
Glenn L McGrath f0a360ea19 Usage for klogd -c 2002-12-05 20:56:31 +00:00
Eric Andersen 08c358b604 Fix a silly oversight breaking cross compilation
-Erik
2002-12-05 18:28:41 +00:00
Eric Andersen c9f20d9fb9 Yet another major rework of the BusyBox config system, using the considerably
modified Kbuild system I put into uClibc.  With this, there should be no more
need to modify Rules.mak since I've moved all the interesting options into the
config system.  I think I've got everything updated, but you never know, I may
have made some mistakes, so watch closely.
 -Erik
2002-12-05 08:41:41 +00:00
Eric Andersen deca106b6d Kill CONFIG_FEATURE_USE_DEVPS_PATCH and the devps patch. I'm not
maintaining it anymore, and it is now terribly out of date.
 -Erik
2002-12-05 07:24:08 +00:00
Glenn L McGrath 6f9b45b9ef Unlink before mkdir, mknod, symlink to overwrite 2002-12-04 22:26:30 +00:00
Robert Griebl 350d26bbbb - the number of commands in the history list is now configureable via the
config system
 - added a new config option to allow persistant history lists. This is
   currently only used by ash, but the calls ({load,save}_history) could
   be added to the other shells as well.
2002-12-03 22:45:46 +00:00
Robert Griebl 3ba7ceebfc print an error message if we can't load a module 2002-12-03 22:41:36 +00:00
Glenn L McGrath 7127b58baa Fix crashme code, by Jim Treadway 2002-12-03 21:48:15 +00:00
Glenn L McGrath bf91f2eb1b Save 10 bytes or so, last_patch_70 from Vladimir N. Oleynik 2002-12-03 20:34:36 +00:00
Robert Griebl 69b5756594 A missing /etc/securetty is not an error when checking the tty name - the
comment is right, but the code was wrong ..
2002-12-03 19:54:12 +00:00
Glenn L McGrath 09adaca37d last_patch_69, 8 bit clean and other fixes from Vladimir N. Oleynik 2002-12-02 21:18:10 +00:00
Glenn L McGrath 06b1aeaf0a Its move to busybox-cvs-doc.docs 2002-12-02 21:14:56 +00:00
Glenn L McGrath 2626ef613e Use compare_string_array in ipaddress to save a few bytes, minor cleanups 2002-12-02 01:40:05 +00:00
Glenn L McGrath 18eae0031a Save a few more bytes 2002-12-02 00:54:10 +00:00
Glenn L McGrath c82f2324bd Save a hundred bytes or so on the do_iproute function 2002-12-02 00:35:23 +00:00
Glenn L McGrath b963875a3e Move compare_string_array to libbb 2002-12-02 00:01:36 +00:00
Glenn L McGrath f112daa232 Enable ip commands to be compiled seperate from ip, modifed patch from Bastian Blank 2002-12-01 23:04:06 +00:00
Glenn L McGrath f3faf41334 fix warning 2002-12-01 21:52:40 +00:00
Glenn L McGrath b9e57f45f3 Fix the package name, patch from Bastian Blank 2002-12-01 20:16:01 +00:00
Glenn L McGrath 941eb80795 Build files from Bastian Blank 2002-12-01 11:38:56 +00:00
Glenn L McGrath e1ad672216 add the -c option, modified version of a patch from Bastian Blank 2002-12-01 11:31:58 +00:00
Glenn L McGrath 6fc6d7fe4f Patch from Bastian Blank (waldi) for debian installer 2002-12-01 02:09:19 +00:00
Glenn L McGrath 4d4ef19c76 I miscalculated on this one, change it back 2002-11-28 21:49:06 +00:00
Glenn L McGrath 82d2cd4ead Clean up error messages 2002-11-28 12:45:48 +00:00
Glenn L McGrath 1b0813ab61 Minor error messages changes 2002-11-28 12:39:19 +00:00
Glenn L McGrath d4de975cd2 Cleanup error messages 2002-11-28 12:35:46 +00:00
Glenn L McGrath 8b6024449f Cleanup error messages 2002-11-28 12:19:51 +00:00
Glenn L McGrath e3e2a7b41c Syntax error 2002-11-28 12:01:25 +00:00
Aaron Lehmann a170e1c858 Change if(x)free(x); to free(x); 2002-11-28 11:27:31 +00:00
Glenn L McGrath 1652855fbc Style, error_msg 2002-11-28 11:17:19 +00:00
Glenn L McGrath eaed78a91f Style 2002-11-28 11:05:28 +00:00
Glenn L McGrath cdf142af90 Woops, forgot they printout applet name as well.... 2002-11-28 10:58:19 +00:00
Glenn L McGrath 9048ae5923 Use standard error messages 2002-11-28 10:56:38 +00:00
Glenn L McGrath df72536f8e Use error_msg instead of fprintf(stderr 2002-11-28 10:49:14 +00:00
Glenn L McGrath 68d949956a Use error_msg instead of fprintf(stderr 2002-11-28 10:35:40 +00:00
Glenn L McGrath b2e28a0e35 Use error_msg instead of fprintf(stderr 2002-11-28 10:27:50 +00:00
Glenn L McGrath b122217d90 Use error_msg( instead of fprintf(stderr 2002-11-28 10:25:19 +00:00
Glenn L McGrath 642f28903a Use error_msg instead of fprintf(stderr, other minor cleanups 2002-11-28 10:20:45 +00:00
Glenn L McGrath 30db423e11 Style, minor cleanups 2002-11-28 09:52:23 +00:00
Glenn L McGrath efdd0aed23 Use error_msg instead of fprintf(stderr 2002-11-28 09:40:36 +00:00
Glenn L McGrath d7d5f42934 Use error_msg instead of fprintf(stderr 2002-11-28 09:34:51 +00:00
Glenn L McGrath d4036f86e5 Use erorr_msg( isntead of fprintf(stderr, 2002-11-28 09:30:40 +00:00
Glenn L McGrath d211214d42 Use error_msg instead of printf(stderr 2002-11-28 09:22:14 +00:00
Glenn L McGrath fedbfe4059 Style 2002-11-28 09:09:47 +00:00
Glenn L McGrath 8e027f6474 Use printf instead of fprintf(stdout 2002-11-28 08:37:46 +00:00
Glenn L McGrath 6ead3abd55 Save a few bytes in show_usage 2002-11-28 08:33:04 +00:00
Glenn L McGrath 9c802416ab left out a \" 2002-11-28 00:51:38 +00:00
Glenn L McGrath 73ceca275e This test was hanging 2002-11-28 00:47:49 +00:00
Glenn L McGrath 2601559fb6 Adds a dummy entry to make it easier to make custom debs 2002-11-27 23:40:46 +00:00
Glenn L McGrath 10d905ce27 Install symlinks for the udeb, dont install changelogs for the udeb 2002-11-27 23:24:49 +00:00
Glenn L McGrath 062c74f710 last_patch_68 from Vladimir N. Oleynik 2002-11-27 09:29:49 +00:00
Glenn L McGrath ec87d37305 Check that one and only one of the [cxt] options is given 2002-11-27 07:52:22 +00:00
Glenn L McGrath 441e7efc72 fdisk applet by Vladimir N. Oleynik 2002-11-26 22:00:21 +00:00
Glenn L McGrath 0ff941e1c3 Name package busybox-unstable to keep a clean seperation between the official packages. 2002-11-26 09:05:15 +00:00
Glenn L McGrath 8ae4cab4a8 use #ifdef CONFIG_* instead of #if CONFIG_* 2002-11-26 09:02:06 +00:00
Glenn L McGrath c5dced17c5 Required file for busybox-doc package 2002-11-26 03:38:14 +00:00
Glenn L McGrath 2f79f5b60d Store a custom Rules.mak file to enable buildign static binaries 2002-11-26 03:08:31 +00:00
Glenn L McGrath efc6fbd452 use #ifdef instead of #if 2002-11-26 03:03:41 +00:00
Glenn L McGrath a2e24825a2 Include heaps of options as is tradional with this deb 2002-11-26 03:01:27 +00:00
Glenn L McGrath d7fb1b372c Use #ifdef instead of #if 2002-11-26 02:40:56 +00:00
Glenn L McGrath 2801eb925d Fix simple syntax error 2002-11-26 02:23:41 +00:00
Glenn L McGrath 12371f916b Make a seperate busybox-doc package 2002-11-26 02:16:06 +00:00
Glenn L McGrath f66de64a11 Use vfork instead of fork, some more cleanup from Vladimir N. Oleynik 2002-11-25 23:57:27 +00:00
Glenn L McGrath 393ad1a834 Handle name entries that have a \0 in them, last_patch_65 from Vladimir N. Oleynik 2002-11-25 22:31:37 +00:00
Glenn L McGrath bb2e9d47f3 last_patch_67 from Vladimir N. Oleynik 2002-11-25 22:12:28 +00:00
Glenn L McGrath 5b110874df Dont need a seperate function 2002-11-24 23:22:29 +00:00
Glenn L McGrath 822e7fd587 When making parent directories set permissions based on the base parent tree rather than the new directory to be created. 2002-11-24 22:48:20 +00:00
Glenn L McGrath eda4f53f2e Add an input buffer (currently 32kB) to speed things up heaps, it still requires 25% longer to decompress as compared to upstream. 2002-11-24 06:01:20 +00:00
Glenn L McGrath 7b1eca265a include libbb after stdlib.h as it breaks dmalloc 2002-11-24 01:32:56 +00:00
Glenn L McGrath b7a76df4d1 Fix long filename support 2002-11-23 10:44:47 +00:00
Glenn L McGrath 1b16bf6b1b New rules file for unstable 2002-11-23 07:14:55 +00:00
Glenn L McGrath 77dbaa48df Config file for the static deb, based on options from the stable 0.60.5 branch 2002-11-22 23:00:16 +00:00
Glenn L McGrath 2997fca414 Config file for the standard debian package based on 0.60.5 options 2002-11-22 22:16:19 +00:00
Glenn L McGrath 30a35d20d9 The tunnel option isnt required for the ip command 2002-11-22 21:43:08 +00:00
Glenn L McGrath f23fdf1717 Update configuration options 2002-11-22 11:39:42 +00:00
Glenn L McGrath 2f1f898228 Config file for udeb based on options from 0.60.5 2002-11-22 10:39:09 +00:00
Glenn L McGrath 157fea5960 Fix a vfork bug, by Nick Fedchik and Vladimir N. Oleynik 2002-11-21 22:17:11 +00:00
Glenn L McGrath 82701e4d67 Add entry for Laurence Anderson 2002-11-20 22:01:48 +00:00
Glenn L McGrath 83bf47c02f Speed and memory usage improvements from Laurence Adnerson 2002-11-20 22:00:31 +00:00
Glenn L McGrath 0126fda5bb read_gz patch 3 from Laurence Anderson 2002-11-20 06:46:46 +00:00
Glenn L McGrath efe7889086 Headers for the read_gz changes 2002-11-19 21:07:17 +00:00
Glenn L McGrath d1431073d1 Dont use xargs 2002-11-19 09:58:56 +00:00
Glenn L McGrath 83bcba26c0 dont use the -i option of xargs 2002-11-19 09:23:13 +00:00
Glenn L McGrath a0d395eac9 Use read_gz, remove fork() woohoo! 2002-11-19 08:22:03 +00:00
Russ Dill ae01fa99e1 udhcpc documentation update 2002-11-19 00:41:09 +00:00
Glenn L McGrath 50c00f4b45 Use error_msg_and_die, style 2002-11-18 07:26:42 +00:00
Glenn L McGrath 29d801b834 Remove mapping option, its should always be used 2002-11-17 21:48:11 +00:00
Glenn L McGrath fd73b8c2ce Patch from Laurence Anderson to provide a read_gz function, doesnt require fork(), pipe(), consistent with read_bz2 and more flexible. 2002-11-17 21:33:30 +00:00
Glenn L McGrath 36233bdd71 Remove #defines around get_header_ptr, we allways need it. 2002-11-16 21:34:57 +00:00
Glenn L McGrath 39289b54a7 Use vfork, by vodz 2002-11-15 22:18:01 +00:00
Glenn L McGrath 02fcd2d2df Allow short reads as we are looping anyway. 2002-11-15 21:58:30 +00:00
Eric Andersen 5780adb586 Patch from Bastian Blank:
hi erik

    the following patch fixes the handling of iproute add <route> dev <dev>.
    the code got lost while removing things.

    bastian
2002-11-15 09:12:47 +00:00
Glenn L McGrath 2666679692 Dont chdir untill after we open the archive 2002-11-15 08:48:47 +00:00
Eric Andersen 09eb000d7a Patch from Marcel Hamer to fix addgroup argument parsing 2002-11-14 11:10:14 +00:00
Eric Andersen f870148a04 A missing securetty file is not an error.
-Erik
2002-11-14 10:58:17 +00:00
Glenn L McGrath e356883ffb Minor cleanups 2002-11-13 00:24:20 +00:00
Glenn L McGrath 034c371bb2 Reduce block size to 512 to prevent short read's when reading from a pipe 2002-11-12 23:34:15 +00:00
Glenn L McGrath 9af8a72f10 Make ifupdown use internal run_parts 2002-11-11 07:03:02 +00:00
Glenn L McGrath 545106f8db Move awk from textutils to editors. Cleanup run-parts, saves 200 bytes, moves the guts of run_parts to libbb to be used by ifupdown. 2002-11-11 06:21:00 +00:00
Glenn L McGrath 8f0722a53b Move readlink, mktemp, run-parts and which to a new debianutils dir. 2002-11-11 03:00:12 +00:00
Glenn L McGrath c11986d89e ipcalc applet by Stephan Linz and Jordan Crouse 2002-11-10 23:42:27 +00:00
Glenn L McGrath 912d8f4cbc run through indent and manually check result 2002-11-10 22:46:45 +00:00
Glenn L McGrath f234e7c755 Config feature DEVPTS defined and used in telnetd, by Pavel Roskin 2002-11-10 22:26:19 +00:00
Glenn L McGrath e16860df08 Will the real od.c please stand up! (my previous commit was a mistake) 2002-11-10 22:16:09 +00:00
Glenn L McGrath 3ff3f4ac35 Fix for hostname -s, by Stephan Linz 2002-11-10 22:07:48 +00:00
Glenn L McGrath 59870e89ae Prevent a segfault if no argument, by Geoffrey Lee <glee@bluesat.unsw.edu.au> 2002-11-10 21:52:59 +00:00
Glenn L McGrath f57674e9a9 Rewrite of xargs by Vladimir N. Oleynik 2002-11-10 21:47:17 +00:00
Glenn L McGrath 907a240b1c last_patch57 from Vladimir N. Oleynik 2002-11-10 21:33:28 +00:00
Glenn L McGrath 5a7ec22c49 last_patch64 from Vladimir N. Oleynik <dzo@simtreas.ru> 2002-11-10 21:28:13 +00:00
Glenn L McGrath eebe31d997 Fixup a previous define 2002-11-10 13:20:35 +00:00
Glenn L McGrath 49a28b3b5e Make mapping support a definable feature, saves 1.6kB 2002-11-10 13:17:08 +00:00
Glenn L McGrath 8ae75013c8 Only compile the files in this dir if the IP applet is enabled 2002-11-10 10:20:45 +00:00
Glenn L McGrath 9a2d27249c IP applet by Bastian Blank <waldi@debian.org> 2002-11-10 01:33:55 +00:00
Glenn L McGrath 021fa7db91 debian compatable ifup and ifdown commands 2002-11-09 09:34:15 +00:00
Eric Andersen 7ab93d9980 Teach lash to get $1 $2 $3 etc correct
-Erik
2002-11-08 09:40:02 +00:00
Glenn L McGrath 5703341123 #ifdef, not just #if... grrr 2002-11-08 08:07:38 +00:00
Glenn L McGrath f6bf7a03fe Fix reading from stdin (me), Fix tar segfault when no arguments specified (Geoffrey Lee) 2002-11-08 07:09:42 +00:00
Eric Andersen b26674b2f8 Remove gratuitous and unnecessary "BusyBox" refernece in login prompt
-Erik
2002-11-07 02:45:55 +00:00
Eric Andersen 1713a11a26 Fix a stupid typo 2002-11-07 02:26:59 +00:00
Eric Andersen ef5e8f8de0 Implement a small strings applet 2002-11-07 02:09:37 +00:00
Eric Andersen f9496d4e44 Fix broken tabs 2002-11-07 02:06:58 +00:00
Glenn L McGrath 62d28828d6 Use a switch instead of successive if (strcmp()) statments. 2002-11-06 23:35:28 +00:00
Glenn L McGrath 747381c602 Split deb_extract() into more generic functions 2002-11-06 22:54:41 +00:00
Glenn L McGrath ea12202288 Terminate the buffer with a '\0' 2002-11-06 22:31:45 +00:00
Russ Dill 0288c8e543 typo in udhcpc help 2002-11-05 20:13:41 +00:00
Russ Dill da970859da version number oops 2002-11-05 20:10:21 +00:00
Glenn L McGrath d8d1191505 Support for bziped debs, i.e. use .tar.bz2 instead .tar.gz internally 2002-11-05 13:56:04 +00:00
Glenn L McGrath 7f2a95319b Fail silently if a partial tar header is read as tar.bz2 is leaving trailing junk (not sure why), add some missing files 2002-11-05 02:56:57 +00:00
Glenn L McGrath 18bbca18ac enable .tar.bz2 for dpkg-deb 2002-11-05 01:52:23 +00:00
Glenn L McGrath 8e94098423 Change filter paramaters, filters can be more powefull now 2002-11-04 23:47:31 +00:00
Glenn L McGrath f92caa7619 Call lseek directly rather than via data_align() 2002-11-03 14:14:53 +00:00
Glenn L McGrath 237ae42fc9 Abstract read and seek in unarchiving code, convert bunzip to file descriptors, support tar -j 2002-11-03 14:05:15 +00:00
Glenn L McGrath 2fc54a9258 Fix #define syntax 2002-11-03 12:50:33 +00:00
Glenn L McGrath 6ab32eb34c Move data_extract_all_prefix to dpkg, its only used there. 2002-11-03 11:57:10 +00:00
Glenn L McGrath b8e556e5f5 Add copyright notice and license, use strcat+strcpy instead of sprintf 2002-11-03 11:46:49 +00:00
Glenn L McGrath 9c60b29071 Use xread_char to save a few bytes, fix indenting of comments 2002-11-03 10:57:25 +00:00
Glenn L McGrath 60bce4905c Move bunzip2 idecompression code to libunarchive 2002-11-03 07:28:38 +00:00
Eric Andersen 97b141ac69 Test for holes in swapfiles
-Erik
2002-11-03 00:25:23 +00:00
Glenn L McGrath bf1cc8b1b7 Make uncompress a seperate applet so it doesnt pull in all the gunzip code 2002-11-01 23:38:54 +00:00
Glenn L McGrath d6aec8619d Allow short reads when filling compress buffer 2002-11-01 22:28:13 +00:00
Glenn L McGrath 9ef0944456 Allow the .Z prefix if compress support enabled 2002-11-01 22:11:53 +00:00
Glenn L McGrath b2f67b4068 Make it a fatal error if bad chksum or crc, if not we should return an error code 2002-11-01 22:08:59 +00:00
Glenn L McGrath 563ac6e789 Report errror if the first magic character doesnt match 2002-11-01 21:40:52 +00:00
Russ Dill f5ecd43473 sync to udhcp 0.9.8 2002-10-31 19:21:27 +00:00
Eric Andersen 1b6eb9b6eb Use a nifty macro to make testing gcc features simpler
and much easier to read.
 -Erik
2002-10-30 06:55:37 +00:00
Eric Andersen df5b8679a2 Formatting 2002-10-27 06:14:44 +00:00
Eric Andersen 69051e817c Update the webpage
-Erik
2002-10-27 06:08:30 +00:00
Eric Andersen db1df5ebeb last_patch64 from vodz:
The following usage from original user:
    $ ./busybox swapon -a
    Have typo problem:
    swapon: swapon: Operation not permitted

    But regular version:
    swapon: /dev/hda5: Operation not permitted

    Patch attached, reduced 9 bytes and advanced
    exit code also.
2002-10-26 10:27:42 +00:00
Eric Andersen fda2b7ff47 A patch from Jouni Malinen to avoid some buffer overflows in vi,
closing bug #1270
2002-10-26 10:19:19 +00:00
Eric Andersen 12f834ccfc Ivan Popov noticed that handling of PREFIX was bad.
-Erik
2002-10-26 10:17:24 +00:00
Eric Andersen 18921bd00d A bugfix from Danny Lepage:
It seems that under busybox unstable, "tar -c -f - blabla" create
    a tar file named "-" instead of writing to stdout.

    The included patch should fix this.
2002-10-26 10:05:37 +00:00
Eric Andersen 5ad22c933c This patch from Magnus Damm fixed a long standing problem
with freeing memory.
2002-10-25 12:14:02 +00:00
Eric Andersen 09da627a23 Fix warning 2002-10-22 22:15:33 +00:00
Eric Andersen 080ddc1c19 mjn3 noticed that crond and crontab had #include <pwd.h> and #include <grp.h>
but this conflicted with the internal pwd_.h and grp_.h.  Removing these
headers is correct, since the correct pwd/grp headers will be included via
busybox.h
 -Erik
2002-10-22 20:08:51 +00:00
Eric Andersen 5e02c67331 vodz forgot to include the suid field 2002-10-22 20:01:08 +00:00
Eric Andersen fe5b1a9f3c Apply patch from bug #1278 -- fix usage message for the
start_stop_daemon applet.
2002-10-22 19:21:48 +00:00
Eric Andersen 72e1212ad8 vodz writes:
Oops... Last patch 63 have small typo (stable/devel) mixing.
    Attached patch removing lines from TODO also :)
2002-10-22 19:19:13 +00:00
Eric Andersen f02c26f1ef I committed the fflush in the wrong spot. I should go to bed
earlier so I don't screw up such easy stuff.
 -Erik
2002-10-22 19:15:43 +00:00
Eric Andersen f6f7bfb8e0 last_patch63 from vodz: add in crond and crontab applets 2002-10-22 12:24:59 +00:00
Eric Andersen 44608e9693 Patch last_pach62 from vodz. This patch moves all the /proc parsing
code into libbb so it can be shared by ps, top, etc, saving over 1.5k.
2002-10-22 12:21:15 +00:00
Eric Andersen 1887b0478f Apply last_patch51_3 from vodz 2002-10-22 11:58:59 +00:00
Eric Andersen 5956028f6f Be absurdly careful about flushing stdout. 2002-10-22 11:45:20 +00:00
Glenn L McGrath 9ffd5776eb Move unzip.c uncompress.c from libbb to archiveal/libunarchive 2002-10-22 01:07:32 +00:00
Glenn L McGrath 0d53ebdc52 gz_open is used anymore, use inflate directly, see how its done in get_header_tar_gz 2002-10-21 06:29:55 +00:00
Glenn L McGrath 4298e87fa5 Dont try and make the "/" directory 2002-10-19 23:56:41 +00:00
Glenn L McGrath 61b7904afd Update dpkg to use new unarchive code 2002-10-19 10:40:55 +00:00
Glenn L McGrath c5c1a8a112 Fix exclude/include problem 2002-10-19 06:19:22 +00:00
Glenn L McGrath 05fa661123 Find a string in a list 2002-10-19 05:10:51 +00:00
Glenn L McGrath 25bca9566d Remove entries from the accept list as they are matched so we can determine if any files that were specified in the list wernt found. 2002-10-19 02:18:51 +00:00
Glenn L McGrath 98f824aa22 Dont use absolute pathname (dunno why i did that), fix tar filename/stdin problems 2002-10-19 00:46:35 +00:00
Glenn L McGrath 934805aec1 Put bac kthe code that handles cases where a '-' wasnt specified prior to the options. 2002-10-18 23:59:40 +00:00
Eric Andersen 2a2ab1479c Fix an obvious thinko
-Erik
2002-10-18 22:31:02 +00:00
Eric Andersen 431a18497d disambiguate a test 2002-10-18 22:18:10 +00:00
Eric Andersen 31f9747a23 Fix needless formatting differences vs modutils 2002-10-18 22:14:07 +00:00
Eric Andersen d69e31fb93 Fix needless difference vs GNU 2002-10-18 22:13:23 +00:00
Russ Dill 1977a60de4 missed add for udhcp 2002-10-14 21:47:07 +00:00
Russ Dill 61fb48930f added full udhcp integration 2002-10-14 21:41:28 +00:00
Eric Andersen 9060a73159 Doh! I screwed up applying vodz' patch.
-Erik
2002-10-12 04:16:08 +00:00
Eric Andersen e8a90fb2bc After thinking about it, I think this patch from Matt Kraai is probably the
best way to go.  Sysvinit does not provide a controlling tty since it doesn't
even try to open ttys for apps.  We do.  So we should _try_ to provide a
controlling tty if possible, but we needn't freak out if it doesn't work.  This
way we won't need to use openvt or similar, we'll just have init do the Right
Thing(tm).
2002-10-12 04:05:48 +00:00
Eric Andersen 71ae64bdc6 last_patch61 from vodz:
New complex patch for decrease size devel version. Requires previous patch.
    Also removed small problems from dutmp and tar applets.
Also includes vodz' last_patch61_2:
    Last patch correcting comment for #endif and more integrated
    with libbb (very reduce size if used "cat" applet also).
    Requires last_patch61 for modutils/config.in.
2002-10-10 04:20:21 +00:00
Eric Andersen fdfe298a96 last_patch60 from vodz:
login and getty applets writes utmp/wtmp but init do clearing not.
    I think, in current time deny wtmp/utmp writes as undefault features.
2002-10-10 03:55:09 +00:00
Eric Andersen d274b53c1d last_patch59 from vodz to cleanup chmod and correctly parse '-rwxgoa' 2002-10-10 03:47:01 +00:00
Eric Andersen 1bb1e83454 last_patch58_2 from vodz -- add FEATURE_CPU_USAGE_PERCENTAGE option 2002-10-10 03:44:12 +00:00
"Steven J. Hill" adb058b0de Fixed the script. It always put output to 'stdout' and never to
the 'modules.dep' file.
2002-10-08 21:33:51 +00:00
Eric Andersen a39342b131 Remember to delete docs/busybox.pod 2002-10-08 19:31:04 +00:00
Eric Andersen 528649463f Fix missing \n noticed by Robert Schwebel 2002-10-08 09:38:07 +00:00
Glenn L McGrath 2983330512 Fix segfault when testing if reaidng from stdin "-" 2002-10-06 23:25:23 +00:00
Eric Andersen e0f5500bb5 Fix init docs 2002-09-30 20:59:33 +00:00
Eric Andersen 506177df7f Bugfix from Claudio Fleiner <claudio@fleiner.com> 2002-09-30 20:53:38 +00:00
Eric Andersen 08a72209c9 last_patch58 from vodz:
Ok. I generate patch for include to busybox-devel my work with
    top (original author give me maintaining) and telnetd (my
    support and unofficial maintaining) applets.  Docs changes
    also: added awk, netstat, time applets to list ;)
2002-09-30 20:52:10 +00:00
Eric Andersen 02e6ba91e8 Vodz' last_patch57:
Hi, Erik.

    my_getpw(uid/gid) and applets used it have problem:
    if username for uid not found, applets can`t detect it
    (but code pessent). Also "%8ld " format is bad:
    spaces not required (applets have self format
    or spec format (tar applet) and overflow for "id" applet...)
    This problem also pressent in stable version.
    Patch for unstable in attach.

    --w
    vodz
2002-09-30 20:39:56 +00:00
Eric Andersen a6f6e06107 Fix dependancy so we rebuild busybox.o, usage.o and busybox.o
whenever the config changes.
 -Erik
2002-09-30 20:39:12 +00:00
Eric Andersen ad082987d0 Use %m, not strerror, and strerror(err) was broken anyways and should have been
strerror(errno).  Problem noted by Alexey V. Neyman <alex.neyman@auriga.ru>
2002-09-30 20:20:20 +00:00
Eric Andersen d9d47c3078 Patch from Konstantin Isakov <ikm@pisem.net>:
In most cases, dirname returns the same argument it was given, so this code
    works nice, but there's one special case: when the name contains no
    dirname, it returns "." (stored statically in the body of itself), and we
    get a segfault in attempt to free() it.
This patch fixes this problem.
2002-09-30 20:14:57 +00:00
Eric Andersen aa1d6ccbfb Don't even try to run ash on uClinux. It won't work.
-Erik
2002-09-30 20:12:32 +00:00
Eric Andersen 6a9799020b Set the close-on-exec flag, just to be saf 2002-09-30 20:08:53 +00:00
Eric Andersen e4d2a43951 Doh. We divide microseconds by 60? 2002-09-30 19:37:48 +00:00
Glenn L McGrath 5c99581880 Save status so we know if to delete compressed file 2002-09-30 05:30:29 +00:00
Glenn L McGrath 924f93e848 make_directory() will fail instantly so we dont need to test for failure here 2002-09-28 08:32:14 +00:00
Glenn L McGrath 891ee641cb Fail straight away rather than recursively printing error messages :) 2002-09-28 08:30:47 +00:00
Glenn L McGrath 8132e933e6 Fix for using '-' as the filename when reading from stdin 2002-09-28 02:06:39 +00:00
Eric Andersen 92052e3945 Bug fix from Nitin Gupta <gupta@equator.com> 2002-09-27 23:34:53 +00:00
Glenn L McGrath 2e41d0cb77 Fix compress support and prevent a segfault 2002-09-27 06:46:02 +00:00
Glenn L McGrath a47a3eada6 Fix simple define problem 2002-09-26 16:01:21 +00:00
Eric Andersen 6f2ebcaa01 Avoid calling exit() from within fork/vfork'ed processes.
-Erik
2002-09-26 13:59:40 +00:00
Eric Andersen a920871c3a Ignoring SIGCHLD causes a race leading to the occasional hang of init
when init will wait() on itself in waitfor() when the child exits before
init is scheduled to run.  Letting init hang is very seriously bad.
 -Erik
2002-09-25 15:08:40 +00:00
Glenn L McGrath 5a66b640f9 Reverse some minor changes that got caught up in my big unarchive patch 2002-09-25 06:08:19 +00:00
Glenn L McGrath 69eab26401 Remove files made obsolete by new unarchiving code 2002-09-25 03:04:03 +00:00
Glenn L McGrath 7ca04f328e New common unarchive code. 2002-09-25 02:47:48 +00:00
Eric Andersen ecfa290cfd Fixup largefile settings
-Erik
2002-09-22 12:09:44 +00:00
Glenn L McGrath b3f7261ffe Fix error messages conditions, and make them the same as GNU mkdir. 2002-09-22 02:12:30 +00:00
Eric Andersen 3a1d8377ab don't leak FILEs 2002-09-20 07:33:18 +00:00
Eric Andersen 19feada06f update the noise a tiny bit 2002-09-18 20:52:26 +00:00
Eric Andersen 7695b7b5f4 Update webpage 2002-09-18 20:48:20 +00:00
Manuel Novoa III d499330e9e Commit vodz's patch, plus a tweak to change TracePid to TracerPid. Now
works on i386 (2.4.19) and arm (2.4.6).
2002-09-18 19:27:10 +00:00
Eric Andersen 06c35da6af patch from John Hall <john.hall@optionexist.co.uk> to change the
klogd specific messages to facility LOG_SYSLOG and tidies up some
of the priorities.
2002-09-18 14:23:06 +00:00
Eric Andersen 420b208a45 Add a new top applet
-Erik
2002-09-17 22:14:58 +00:00
Eric Andersen 793c3b4a7d Clear screen too. 2002-09-17 21:21:27 +00:00
Eric Andersen dc180d1442 re-enable the cursor, in case it got disabled
-Erik
2002-09-17 21:17:35 +00:00
Manuel Novoa III 6c32a8add4 Modified so that it "works" for archs other than i386... arm in particular.
Also tried to clean up the logic a little, and ensure that read errors
or invalid archives resulted in error returns.  This could use a lot more
work... Volunteers?
2002-09-17 21:02:16 +00:00
Eric Andersen 60943c5d5c Sane-ify the screen clearing stuff.
-Erik
2002-09-17 20:53:41 +00:00
Eric Andersen 39ad2833c0 hehe. 2002-09-17 20:35:58 +00:00
Eric Andersen 871d93c462 Vodz' last_patch57:
Ok. Patch with reduce size ready.
    Notes: syslogd imposible close logsocket,
    the real programm write logmessages (hmm, cycle loop?)

    (Excuse me - this have small tab-formats rewroting also)

       text    data     bss     dec     hex filename
       2913     332   12388   15633    3d11 syslogd.o
       3109     332    9252   12693    3195 syslogd_old.o
2002-09-17 20:06:29 +00:00
Eric Andersen 927c3bdc18 Support setting depth 2002-09-17 08:44:56 +00:00
Eric Andersen a9a220b92a last_patch56 from vodz to simplify copy_file logic 2002-09-17 08:42:21 +00:00
Eric Andersen bf8bf105fb Patch from "Joe.C" <joe@numa.com.tw> 2002-09-17 08:41:08 +00:00
Eric Andersen 34fd00af5f Patch from David McCullough <davidm@snapgear.com> 2002-09-17 08:40:12 +00:00
Eric Andersen 7365c58783 Use "MiB" not "Mb"
-Erik
2002-09-17 06:36:56 +00:00
Eric Andersen bdff6a4c59 Typo fix from Steven Merrifield 2002-09-17 05:43:26 +00:00
Eric Andersen d4ee98940b last_patch55 from vodz:
I found overflow problem in xargs applet
    (allocated not space for trailing '\0').
    Last patch also reduce 22 bytes size. ;)
2002-09-16 10:44:24 +00:00
Eric Andersen 02b8dfc524 Let people force overwrite links
-Erik
2002-09-16 10:23:38 +00:00
Eric Andersen 403a73a351 Properly honor FILEUTILS_INTERACTIVE and FILEUTILS_FORCE for
file all file types (not just regular files and dirs).  Unlink
destination files when needed.
 -Erik
2002-09-16 09:23:22 +00:00
Glenn L McGrath 18b76e6f80 Watch applet by Michael Habermann 2002-09-16 09:10:04 +00:00
Eric Andersen 8fede28c74 Patch from Matthias Lang <matthias@corelatus.se> to fix gunzip
error handling and prevent gunzip from hanging.
2002-09-16 07:25:41 +00:00
Eric Andersen a9cc8961ed Let people run SHUTDOWN actions prior to killing everything
-Erik
2002-09-16 06:49:06 +00:00
Eric Andersen e18cb71e0c Fix stupid typo noticed by John Mullin <john.mullin@homenetcomm.com> 2002-09-16 06:32:16 +00:00
Eric Andersen c38678d14b Apply vodz' last_patch52 2002-09-16 06:22:25 +00:00
Eric Andersen 166fa4684f Support module tainting
-Erik
2002-09-16 05:30:24 +00:00
Glenn L McGrath 061c900176 mesg applet by Manuel Novoa III 2002-09-16 04:21:46 +00:00
Glenn L McGrath ebdc8b48a5 Put in GPL v2 or later copyright notice 2002-09-16 03:47:48 +00:00
Glenn L McGrath ec0c48cb29 openvt applet by Quy Tonthat 2002-09-16 03:16:06 +00:00
Glenn L McGrath 6714862bdd Use busybox's show_usage function for help 2002-09-15 17:20:45 +00:00
Glenn L McGrath 7a32aaacd0 Awk applet written from scratch by Dmitry Zakharov 2002-09-15 17:03:48 +00:00
Glenn L McGrath b3c4e9add5 Support for GNU style long filename and linknames 2002-09-15 16:54:49 +00:00
Eric Andersen 186685d46f Patch from Thomas Gleixner <tglx@linutronix.de> to do
automatic child reaping to avoid zombies
2002-09-12 15:44:53 +00:00
Manuel Novoa III 4d0884a1ea Apply vodz's last_patch53.gz (bb_asprintf.c) and last_patch54.gz
(arith.c).
2002-09-12 14:52:26 +00:00
Eric Andersen 7829b8d067 Fix for handling of "tftp -l -" from Jean Wolter <jw5@os.inf.tu-dresden.de> 2002-09-10 06:03:31 +00:00
Eric Andersen 2a1eb31f18 Yipe. uid and gid were reversed.
-Erik
2002-09-10 05:23:29 +00:00
Eric Andersen 2bec97c076 Some CML1 grammar fixes
-Erik
2002-09-01 06:45:55 +00:00
Eric Andersen 1130976f8e Eliminate use of obsolete sys_errlist[]
-Erik
2002-08-26 21:36:32 +00:00
Glenn L McGrath c3b7f7d6e7 chmod on the NEW file 2002-08-26 17:17:27 +00:00
Glenn L McGrath 193697db4e Dont return an error if the directory already existed 2002-08-24 20:11:38 +00:00
Glenn L McGrath 210aa14916 Fix warning 2002-08-24 20:00:52 +00:00
Glenn L McGrath abac53b33c Reorganise, make it just one function, remove -v option it didnt work properly anyway, dont setvbuf it doesnt make any difference in performance. 2002-08-24 14:32:17 +00:00
Glenn L McGrath 1ee52e8b14 Run through indent, use braces 2002-08-24 10:30:36 +00:00
Aaron Lehmann 933d10d308 Remove extrangeous backslashes that were probably introduced by
someone joining lines and forgetting to remove the backslash escaping
the newline.
2002-08-23 22:09:50 +00:00
Glenn L McGrath fbef225c4b Rewrite, its smaller 2002-08-23 17:19:26 +00:00
Glenn L McGrath 192ff35d9c Remove empty loops 2002-08-23 14:36:59 +00:00
Glenn L McGrath 0be933b505 Use static instead of extern, braces around if's, run through indent 2002-08-23 14:31:28 +00:00
Glenn L McGrath 50812fff21 Apply vodz last_path_51-2 2002-08-23 13:14:48 +00:00
Glenn L McGrath de9e803149 Apply vodz last_patch51_2 and run through indent 2002-08-23 12:04:23 +00:00
Aaron Lehmann e599b6d96e Don't #ifdef __linux__. this is linux. 2002-08-23 07:56:21 +00:00
Aaron Lehmann 7dd2cec2fd ansify 2002-08-23 07:52:58 +00:00
Aaron Lehmann 84878fe20e remove duplicate definition of G
caught by tinycc
2002-08-23 07:51:01 +00:00
Aaron Lehmann 0df910af49 for some baffling reason tinycc insists that i change this 0 to NULL 2002-08-23 07:45:26 +00:00
Aaron Lehmann 5d3cb7cc1f move some globals to bss 2002-08-23 07:28:45 +00:00
Glenn L McGrath 8042f65398 Run through indent, style 2002-08-23 06:17:46 +00:00
Glenn L McGrath acfc0d872e Run through indent, fix comments 2002-08-23 06:05:11 +00:00
Glenn L McGrath 03195fc16f Run through indent, fix comments 2002-08-23 05:58:38 +00:00
Glenn L McGrath a199b17253 Run through indent, specify cast 2002-08-23 03:37:07 +00:00
Glenn L McGrath 14dad7028b Run through indent 2002-08-23 03:25:22 +00:00
Glenn L McGrath 1ed9dd9d06 Remove duplicate definitions, run through indent 2002-08-22 19:35:36 +00:00
Glenn L McGrath 4534af2763 replace some global const ints with defines 2002-08-22 19:31:35 +00:00
Glenn L McGrath 0775a07d87 Specify cast 2002-08-22 19:22:32 +00:00
Glenn L McGrath 4cc2e5e944 Remove duplicate variable definition 2002-08-22 19:15:26 +00:00
Glenn L McGrath 9fef17dec3 Run through indent, fix comments 2002-08-22 18:41:20 +00:00
Glenn L McGrath 7c58e9be69 Run through indent, fix comment 2002-08-22 18:24:43 +00:00
Glenn L McGrath baf55a85fc Run through indent, fix comments 2002-08-22 18:22:10 +00:00
Glenn L McGrath e3906fcd94 Run through indent, fix BB_ define 2002-08-22 18:13:54 +00:00
Glenn L McGrath 99b12543cf Run through ident, fix comments 2002-08-22 17:47:09 +00:00
Glenn L McGrath 242e3b6bde define inline if needed for ANSI C compatability 2002-08-22 15:59:18 +00:00
Glenn L McGrath 60a22addea Remove unwanted comments, run through indent 2002-08-22 15:54:22 +00:00
Glenn L McGrath a0ee881ba4 Run through indent, use /* */ style comments, change extern to static 2002-08-22 13:44:08 +00:00
Glenn L McGrath 4176972db5 Run through indent, use /* */ style comments 2002-08-22 13:25:12 +00:00
Glenn L McGrath d827e8b665 Run through indent 2002-08-22 13:21:26 +00:00
Glenn L McGrath b37367aa77 Run through indent, use /* */ style comments instead of // 2002-08-22 13:12:40 +00:00
Glenn L McGrath f853db54f9 Remove definition of is_octal and is_decimal, they arent used 2002-08-22 12:55:26 +00:00
Glenn L McGrath 75762705a3 Honour the USTAR prefix field, this enables a 155 byte path length plus the normal 100 byte filename.
The catch is gnu tar cannot create archives that use the prefix field, you need to use s-tar.
2002-08-22 11:50:31 +00:00
Glenn L McGrath 419eed7501 udhcpc sample scripts 2002-08-21 14:24:38 +00:00
Aaron Lehmann 5f8f32a41c Inline functions with only one reference in mkfs_minix. I don't know
why these efforts aren't making the binary smaller.
2002-08-21 13:21:20 +00:00
Aaron Lehmann 8fc5d6d2da Tar inlining, #if 0 out unused function 2002-08-21 13:11:34 +00:00
Aaron Lehmann 6fdacc74f0 vi inlining 2002-08-21 13:02:24 +00:00
Aaron Lehmann a95e99e6f3 Cleanups. These SHOULD make the binary a lot smaller. But they don't.
CURSE GCC
2002-08-21 12:44:54 +00:00
Glenn L McGrath d9768d7cb9 Disable debugging 2002-08-21 11:44:31 +00:00
Aaron Lehmann 1ff58b6570 Clean up udhcpd a bit. Constify. Staticize. Remove these functions and
inline their contents: print_usage, pidfile_delete, and background.
2002-08-21 11:21:19 +00:00
Glenn L McGrath 8eb0dc1d10 New applet, udhcp client 2002-08-21 10:27:58 +00:00
Glenn L McGrath 3d184586a7 Fix dietlibc test condition 2002-08-15 03:29:56 +00:00
Eric Andersen 938e982c4d Try to be a bit more dietlibc friendly 2002-08-13 09:57:44 +00:00
Glenn L McGrath 1d23f3a492 Enable support for the old tar header format, enable via menu's 2002-08-13 05:06:43 +00:00
Aaron Lehmann 6069441bd2 minor fixes for fbset bloat
<mjn3>         printf("\tgeometry %u %u %u %u %u\n", v->xres, v->yres,
<mjn3>                    v->xres_virtual, v->yres_virtual, v->bits_per_pixel);
<mjn3>         printf("\ttimings %u %u %u %u %u %u %u\n", v->pixclock, v->left_margin,
<mjn3>                    v->right_margin, v->upper_margin, v->lower_margin, v->hsync_l
<mjn3> en,
<mjn3>                    v->vsync_len);
<mjn3>         printf("\taccel %s\n", (v->accel_flags > 0 ? "true" : "false"));
<mjn3>         printf("\trgba %u/%u,%u/%u,%u/%u,%u/%u\n", v->red.length,
<mjn3>                    v->red.offset, v->green.length, v->green.offset, v->blue.leng
<mjn3> th,
<mjn3>                    v->blue.offset, v->transp.length, v->transp.offset);
<mjn3>         printf("endmode\n\n");
<mjn3> whay have multiple printf calls when one would do?

<mjn3> and this:
<mjn3> static struct cmdoptions_t {
<mjn3>         char *name;
<mjn3>         unsigned char param_count;
<mjn3>         unsigned char code;
<mjn3> } g_cmdoptions[] = {
<mjn3>         {
<mjn3>         "-fb", 1, CMD_FB}, {
<mjn3> (repeated entries)
<mjn3> why isn't this constant?  what about struct packing?

inline the helper functions that are only referenced once.
2002-08-13 04:19:23 +00:00
Robert Griebl 91a0aac110 Added Familiar Linux to the projects list 2002-08-09 22:54:39 +00:00
Robert Griebl 2ab6ff95e0 Patch from Rusell Nelson to document the -C switch for syslogd 2002-08-07 21:24:33 +00:00
Robert Griebl 65d415d847 Added a help text for the -C option to syslogd 2002-08-07 21:10:19 +00:00
Robert Griebl 00f5ecb141 Somehow I applied an old patch for the last commit - this one works now:
- Added \CregexC support to sed (sed testsuite reported no errors, btw)
2002-08-06 23:13:31 +00:00
Robert Griebl 7940147e25 Added the \CregexpC syntax as an alternative for /regexp/ (like GNU sed) 2002-08-06 21:07:17 +00:00
Manuel Novoa III edcac5572f Fix silly typo. addgroup was using /etc/shadow for /etc/gshadow. 2002-08-06 20:39:23 +00:00
Manuel Novoa III f8277ca992 Move #define MAXLINE so this compiles without circ buffers. 2002-08-06 20:12:56 +00:00
Eric Andersen 74b007f7cc Oops. Code things so it actually works this time around...
-Erik
2002-08-05 11:56:25 +00:00
Eric Andersen c59716ff4c Joel Coltoff <joel@wmi.com> noticed that following a recent
change in uClibc that changed opening the /dev/log socket as
SOCK_STREAM to SOCK_DGRAM, busybox syslogd no longer worked
since it needed a matching change.  This fixes it so it
works once again.
2002-08-05 11:14:30 +00:00
Robert Griebl 6859d761d3 - updated a few copyright/left file headers
- documented most of my 0.61 changes in the ChangeLog
2002-08-05 02:57:12 +00:00
Robert Griebl 0d833ca7fd Fixed a bug in xarg: string data was strcat'ed to a malloc'ed buffer - and
malloc does not clear memory by default (somehow this worked on x86, but
not on arm)
2002-08-03 14:49:03 +00:00
Aaron Lehmann 49c024addd Remove ckfree, and replace all references with free. Remove freefunc,
which is also equivilent to free. Remove some if(x)free(x)
redundancies.
2002-08-02 06:39:47 +00:00
Eric Andersen e85dbfdd80 Joseph Chiu <josephc@idealab.com> found an off-by-one bug. oops! 2002-08-01 01:31:17 +00:00
Robert Griebl a71389bfe8 Applied a patch from Philip Blundell <pb@nexus.co.uk>:
Added support for ":x" as an alias for ":wq" to vi
2002-07-31 21:22:21 +00:00
Eric Andersen 7373e485d3 A couple of small bugfixes from Marshall M. Midden <m4@brecis.com> 2002-07-31 04:04:47 +00:00
Eric Andersen 87715170cc Be more portable with 'find' for those that prefer programming
on *BSD, etc.  Formatting fixes, etc.
2002-07-31 03:45:05 +00:00
Robert Griebl b230159958 Fixed a timing bug which occured when bb ash is run in a rxvt on the
HP iPAQ. Sometimes we get a SIGWINCH and want to print the prompt, although
the prompt is not yet initialised (0) .. so just don't print a prompt
as long as the prompt string is 0
2002-07-30 23:13:51 +00:00
Robert Griebl df03932b7e Added the -I (isofmt) options to date, which comes in handy for scripts
(this is a confiureable option)
2002-07-30 23:11:00 +00:00
Robert Griebl 70112da81a Fixed a bug that I had introduced with the new "options" handling. 2002-07-29 20:28:38 +00:00
Eric Andersen e707806894 Kill a silly warning 2002-07-29 08:00:16 +00:00
Eric Andersen 3bc2b206b0 Patch from Tim Riker to allow tty* in inittab if the tty
actually exists -- serial console is not the issue...
2002-07-29 06:39:58 +00:00
Robert Griebl aead70b4d1 modprobe now also uses "options" from /etc/modules.conf 2002-07-26 15:54:20 +00:00
Robert Griebl d0dd3d31e2 Fix for bug #1255 -- support for mount -t <type> 2002-07-25 14:17:19 +00:00
Robert Griebl 2a4a8d8ffb Add support for /etc/filesystem when searching for an "auto" filesystem
This is bug #1246
2002-07-24 01:41:30 +00:00
Robert Griebl 31a2e20bd3 Commited patch from bug #1182
Although ssrat@mailbag.com says this is not GNU behaviour, it really *is*
(man nslookup)
2002-07-24 00:56:56 +00:00
Robert Griebl 41369af3f2 Patch for bug #1183: Added a -xdev option to find (configurable) 2002-07-24 00:34:48 +00:00
Eric Andersen 80cd3cfdbc Fix indentation. Support killall -q, for pcmcia-cs
-Erik
2002-07-23 23:45:11 +00:00
Robert Griebl f2f26e7fdd Added tar -cz support (creating gzipped tar files without a gzip pipe) 2002-07-23 22:05:47 +00:00
Robert Griebl 967c3d4406 Fixed two compiler warnings 2002-07-21 17:33:27 +00:00
Robert Griebl 1cd0445495 Initial checkin of a very primitive hwclock replacement 2002-07-21 16:50:49 +00:00
Robert Griebl fc78b79575 Applied syslogd fix submitted by Bart Visscher:
I am using BB 0.60.2 in a floppy distro, and the syslog (and logger) is
unable to log the "<" char.  This shows up in ppp logfiles.  [...]
#logger "<pcomp>" results in "comp>" arriving at the log.
2002-07-19 20:52:21 +00:00
Robert Griebl efd4983eb1 - Forgot to cvs add bb_asprintf.c (from vodz' patch #50)
- Applied Joel Coltoff's xconnect patch:
On both my host system and with mipsel-linux for my embedded systems
the function getservbyname() gives the port number already in host order.
In fact, this is how it was used by rdate in version 0.60.3. The snapshot
I have of the development tree from July 12, 2002 takes the port number
and stuffs it into htons() before it uses it. This causes bugs in rdate,
telnet and wget. This patch fixes that.
2002-07-19 20:27:11 +00:00
Robert Griebl d378c3149c Applied vodz' patches #49 and #50 (with a small correction in runshell.c)
#49: I found one memory overflow and memory leak in "ln" applet.
Last patch reduced also 54 bytes. ;)

#50: I found bug in loginutils/Makefile.in.
New patch have also new function to libbb and
aplied this to applets and other cosmetic changes.
2002-07-19 00:05:54 +00:00
Robert Griebl 88947dd05e Added a compile time option to suppress the "Using fallback.." message
if no busybox.conf file is existant.
2002-07-18 23:59:17 +00:00
Robert Griebl 2c0d0f0051 Fix for the totally broken adduser applet (parts/ideas from vodz and tito) 2002-07-16 23:50:05 +00:00
Robert Griebl e4f9f3a960 Don't treat a non-existant/-readable config file as an empty config, but
use the compiled in _BB_SUID_* flags (same as for parse errors)
2002-07-16 21:53:59 +00:00
Eric Andersen 0fe3e62e2c Doh! 2002-07-14 15:39:05 +00:00
Eric Andersen d2fd0d5869 Better clarify the CVS tree situation
-Erik
2002-07-13 06:24:58 +00:00
Eric Andersen acc257e994 Try to be more clear about the current two-CVS-trees
situation.
 -Erik
2002-07-13 06:08:39 +00:00
Robert Griebl e8fcf4bd69 Accept the --passive-ftp cmd.line option. We always use passive ftp mode,
so it doesn't hurt (adds compatibility though)
2002-07-12 00:04:46 +00:00
Eric Andersen 2276d83639 Fixup warnings and undefined operations that show up in gcc-3.1
-Erik
2002-07-11 11:11:56 +00:00
Eric Andersen cafc103230 Brad Campbell <brad@seme.com.au> notes that
xconnect.c needs #include <netinet/in.h>
to compile if CONFIG_FEATURE_IPV6 is not defined
2002-07-11 10:40:43 +00:00
Eric Andersen 1785ddcae2 Some minor bits of scrubbing 2002-07-08 01:40:02 +00:00
Eric Andersen 8e139871fe Patch from Stewart Brodie <stewart.brodie@pace.co.uk> to fix ash:
When alias support is not configured, ash believes that command parameters
that look like dd's "if=/dev/zero" are requests to set a temporary
environment variable whilst dd is running, even though it appears after the
command name.  This is caused by the re-use of the checkalias global variable
to indicate when both alias checking and environment variable checking.  The
failure to reset this flag is due to the reset action being performed only
inside the feature check CHECK_ASH_ALIAS.  Hence ash works as expected when
aliases are configured in, and fails when not.

Example script using 'date' with different settings of TZ:

# TZ=Europe/London
# export TZ
# date
Thu May 30 17:18:49 BST 2002
# TZ=America/New_York date
Thu May 30 12:19:10 EDT 2002
# date
Thu May 30 17:19:12 BST 2002
# date TZ=America/New_York
Thu May 30 12:19:30 EDT 2002    <----- wrong, should be BST time (or error!)
# date
Thu May 30 17:19:35 BST 2002

Attached is a patch against revision 1.52 of ash.c which moves the checks so
that checkalias is updated regardless of whether CONFIG_ASH_ALIAS is set.
With this patch applied, the command shown above which should generate an
error does generate an error.

I have tested this patch with the 'dd' command too and that now works
correctly.
2002-07-04 00:19:46 +00:00
Eric Andersen 0826b6b0b3 This is last_patch48 from vodz. More cleanups, kills a bit
of dead code, fixes one blatent bug.
2002-07-03 23:50:16 +00:00
Eric Andersen 887ca79f04 Scrub pwd.h and grp.h handling so we don't have to play any
silly games.
 -Erik
2002-07-03 23:19:26 +00:00
Eric Andersen 360e254954 tito <farmatito@tiscali.it> noticed that delgroup was actually
setting CONFIG_DELUSER.  Oops.
2002-07-03 19:50:23 +00:00
Eric Andersen 0b31586c71 A patch from Bart Visscher <magick@linux-fan.com> to add an
xconnect helper routine which does:
        -address and port resolving
	-tries to connect to all resolved addresses until connected
	-uses getaddrinfo, so works for IPv6 too
This patch also ports rdate, telnet, and wget to use the new
xconnect function.  Thanks Bart!
2002-07-03 11:51:44 +00:00
Eric Andersen 51b8bd68bb This patch from Bart Visscher <magick@linux-fan.com> adds
IPV6 support to busybox.  This patch does the following:
    * Add IPv6 support to libbb
    * Enable IPv6 interface address display
    * Add IPv6 config option
    * Adds ping6, an adaptation of the ping applet for IPv6
    * Adds support routines for ping6:
	- xgethostbyname2
	- create_icmp6_socket
    * Adds ifconfig support for IPv6
    * Add support IPv6 to netstat
    * Add IPv6 support to route
Thanks Bart!
2002-07-03 11:46:38 +00:00
Eric Andersen 599e3ce163 Apply last_patch47 from vodz to fix several problems, such as the ash "job
control turned off" bug, console_setup() was called with a closed file
descriptor, setsid() inconsistancy, and silly string handling bugs.   I have
modified his patch to allow the askfirst init actions to have a controlling
terminal.
2002-07-03 11:08:10 +00:00
Eric Andersen 935daf2d0d hide shadow using stuff when CONFIG_FEATURE_SHADOWPASSWDS
is not set
 -Erik
2002-07-03 09:13:21 +00:00
Eric Andersen 7f90ed4460 Patch from Martin Volf <volf@dragon.cz> to fix where I had
screwed up the usage messages
2002-07-03 05:55:14 +00:00
Eric Andersen 796446718d Fix from vodz so that complex init commands actually work 2002-07-03 05:44:18 +00:00
Eric Andersen 8c4025e708 Patch from Danny Lepage <danny.lepage@cognicase.com> to fix
dutmp for uClibc.
2002-07-03 05:32:02 +00:00
Eric Andersen 5222d31a15 Patch from till busch <buti@gmx.at> -- unblock all signals
in exec_signal() before calling exec()
2002-07-03 05:15:23 +00:00
Eric Andersen 549df2ebc3 Fix text alignment, thanks to Sander Klein <s.klein@quicknet.nl> 2002-07-03 04:54:52 +00:00
Eric Andersen 7234c3a0b6 Cleanup shadow.h stuff so it behaves as intended
-Erik
2002-07-03 04:47:43 +00:00
Eric Andersen 009ae1f17d Little fix to avoid overflow 2002-07-03 04:24:08 +00:00
Eric Andersen abc9568690 Silly spelling fix
-Erik
2002-07-03 02:52:35 +00:00
Eric Andersen b493dec91e David Frascone <dave@frascone.com> noticed two problems. First, modprobe was
trying to call 'insmod -q', which wasn't supported.  Secondly, when modprobe
was fed blank lines from modules.dep, we ended up calling xstrndup(ptr, -1),
which with suitably bad results.  David provided a patch to catch the blank
lines, and I have added insmod -q support.  So modprobe should work again.
 -Erik
2002-07-02 19:14:23 +00:00
Aaron Lehmann 69d4178708 Remove advertising clauses in accordance with
ftp://ftp.cs.berkeley.edu/ucb/4bsd/README.Impt.License.Change
2002-06-23 22:25:24 +00:00
Aaron Lehmann 9031481ac3 inline many functions that are only called once. saves about 300 bytes
on i386. also staticify most functions.
2002-06-23 22:13:22 +00:00
Aaron Lehmann ed11993900 Needs shadow.h; otherwise wont compile without CONFIG_USE_BB_SHADOW 2002-06-23 22:00:41 +00:00
Aaron Lehmann 8c26fbe537 remove cleanUpAndFail, and replace it with exit(). because that's what
it does unless srcMode was set, and srcMode is never set.
2002-06-23 21:56:13 +00:00
Eric Andersen 5b0f9e417e Rework optimization code. Be more compiler aware.
-Erik
2002-06-23 04:50:49 +00:00
Eric Andersen 27f64e1f4e Port over the last of the tinylogin applets
-Erik
2002-06-23 04:24:25 +00:00
Eric Andersen 0fbff134f4 Several login cleanups from vodz 2002-06-22 17:49:29 +00:00
Eric Andersen b0c39a8a8d Apply vodz' last_patch44 -- cleanup several chars to be const, fix
rotten error handling, kill spare \n's, etc
2002-06-22 17:32:58 +00:00
Eric Andersen 3ece93ba0f Kill dead email address
-Erik
2002-06-22 17:23:45 +00:00
Eric Andersen 8b1aa4d749 Apply last_patch46 from vodz, to fix buffer overflows noted by
Gerardo Puga, and to optimize for size a little bit.  Thanks vodz
2002-06-22 17:20:50 +00:00
Eric Andersen 61f83059c1 Apply vodz' cleanup for insmod buffer overflows, which was cleaner
than my first effort.
2002-06-22 17:15:42 +00:00
Aaron Lehmann 9f92d5f2a2 Major revamp. I've been trying to clean up the code. the bzerror stuff
still needs major attention (i.e. removal).

Removed references to uninitialized variables like progName,
smallMode, noisy, etc. Remove functions and code for handling "small"
decompression mode, since it is all unreachable. Remove
total_{in,out}* counters - they are never used. Remove panic()
function and assert_h and their uses because they are all for "should
never happen" circumstances. Replace internal malloc/free wrappers
with xmalloc and free. Remove conditional in if(foo)free(foo);
situations. Remove bogus
	if (sizeof(int) != 4) {
		return BZ_CONFIG_ERROR;
	}
(...etc...) code and code for handling BZ_CONFIG_ERROR. Someone should
go through and change the applet to use well-defined types when
appropriate - it expects sizeof(short)==2 && sizeof(int)==4. Until
this commit these were explicitly checked for, and the applet would
exit if these types were not the right size. (I think this is wrong
even as an interim solution.)

With gcc 3.1 reduces size of binary on i386-linux by about 700 bytes.

Lightly tested.
2002-06-22 06:35:29 +00:00
Eric Andersen 2d34215456 As noted by Yves Lavoie ing. <yves.lavoie.ing@sympatico.ca>, don't
lose the last letter of the module name.
2002-06-18 05:16:25 +00:00
Eric Andersen b0fd2b06a3 Fix a potential macro expansion problem... isspace can be
a macro causing a double decrement...
2002-06-15 14:37:46 +00:00
Eric Andersen a7d0b41c08 Don't use pointless GNU-isms 2002-06-15 14:33:06 +00:00
Robert Griebl 47abc49c4a Patch from Simon Krahnke:
I wrote a patch for busybox for our company's (www.lisa.de)
private use. [...] To sed it adds the '!'-inversion of addresses.
2002-06-11 23:43:27 +00:00
Matt Kraai 3ad88ccf2d * testsuite/sed/sed-recurses-properly: Mark XFAIL. 2002-06-11 13:29:08 +00:00
Matt Kraai 9ef2ea27d4 * libbb/copy_file.c (copy_file): Check st_dev instead of st_rdev. 2002-06-11 13:25:26 +00:00
Eric Andersen 360060252a vodz' last_patch42_2, which is an updated fix for buffer overflows
noted by Gerardo Puga
2002-06-08 12:44:17 +00:00
Robert Griebl 0c789a4255 If config file can not be parsed, use compiled in BB_SUID_... values as a
fallback method
2002-06-06 17:30:16 +00:00
Eric Andersen fe1ef2bc62 Fix buffer overflows noted by Gerardo Puga
-Erik
2002-06-06 14:36:07 +00:00
Eric Andersen 6fb4e4877a Fix buffer overflows noted by Gerardo Puga
-Erik
2002-06-06 14:24:57 +00:00
Eric Andersen 0d2d1eb599 Fix a buffer overflow found by Gerardo Puga <gpuga@gioia.ing.unlp.edu.ar>
-Erik
2002-06-06 13:33:01 +00:00
Eric Andersen 8610f91ebf Lets give this a try... 2002-06-06 13:00:47 +00:00
Eric Andersen 27d3766e0d Email addr fix 2002-06-06 12:59:13 +00:00
Eric Andersen ad79c0b629 Patch from Gyepi SAM <gyepi@praxis-sw.com>:
Fixed up domain removal for local domains. GNU traceroute does not do this. I
don't know why we do.  Fixed incorrect argument for reverse resolution.  Clean
up cruft that appears when CONFIG_FEATURE_TRACEROUTE_VERBOSE is defined
2002-06-06 12:24:51 +00:00
Eric Andersen 77d22c4abd Patch from Gyepi SAM <gyepi@praxis-sw.com>:
When DEBUG is defined
    1. need to include resolv.h (for _resinit())
    2. remove _() call around string. It appears to be a remnant of i18n or some such notion
2002-06-06 12:11:55 +00:00
Eric Andersen 1a92376f00 Patch from vodz to only setenv PATH when PATH changes, which is much
smarter than my quick fix.
2002-06-06 12:07:28 +00:00
Eric Andersen e90e741b1e Per discussion with vodz, Tim's changes do not seem to make sense.
Revert them.
 -Erik
2002-06-06 11:47:00 +00:00
Eric Andersen fc059090b6 last_patch41 from vodz to fix stty -F and similar 2002-06-06 11:35:29 +00:00
Eric Andersen ff7661d9de plug fd leak noticed by Russ Dill
-Erik
2002-06-05 07:11:32 +00:00
Robert Griebl 1fca558799 Bigger patch for (partial) tinylogin integration
- Made a new dir loginutils
- Moved all applets from pwd_grp to loginutils
- Added new applets su.c login.c to loginutils
- Made a new dir libpwdgrp
- Moved everything from pwd_grp/libpwd_grp there
- Added shadow.c to libpwdgrp
- Removed dir pwd_grp
- Added usage strings for login and su to usage.h
- Changed main Makefile to reflect the dir rearrangements
[Parts of this patch may overlap with my other two patches]
2002-06-04 20:45:46 +00:00
Robert Griebl ea1a63a201 Fix for broken handling off BusyBox's own pwd/grp implementations
[Parts of this patch may overlap with my other two patches]
2002-06-04 20:10:23 +00:00
Robert Griebl c9aca4561d Implement two types of suid/sgid support for BusyBox:
1) tinylogin like with compile time selection and a chown root.root
2) Runtime configurable via /etc/busybox.conf (docu is in the works)
[Parts of this patch may overlap with my other two patches]
2002-06-04 20:06:25 +00:00
Robert Griebl bc28f7a1e1 Cleaned up Erik's fgets -> read patch and fixed a buffer overflow 2002-06-04 19:33:58 +00:00
Eric Andersen c06391be0d Avoid stack munching stdio implementations.
-Erik
2002-06-04 13:28:43 +00:00
Robert Griebl 3b79370a7d Fixed a realloc bug found by Martin Volf 2002-06-02 09:36:12 +00:00
Manuel Novoa III b99cb64b80 Include busybox.h before testing CONFIG_LOCALE_SUPPORT. 2002-05-29 19:08:41 +00:00
Glenn L McGrath a94a06a38e Patch from Randolfe Averty to fixup package conflict checks, cleanup some memory leaks and reorganise dependency checking.
Some further memory leaks fixed by me.
2002-05-29 13:45:34 +00:00
Robert Griebl 1d4ef2a9e9 Added support for /etc/modules.conf parsing
for now only the 'alias' entries are evaluated
2002-05-28 21:32:10 +00:00
Robert Griebl 53146cc9ec Added include for isdigit(); simplified -<num> detection 2002-05-27 22:24:53 +00:00
Eric Andersen 8302c43265 Ensure that insmod supports at least one MODULE_INTERFACE
-Erik
2002-05-24 06:59:22 +00:00
Eric Andersen cffd5022c5 Patch from Magnus Damm <damm@opensource.se> to rework things
greatly, and keep the arch specific relocations together,
fixes R_PPC_ADDR32 handling so powerpc can work, and changes the
tlb tables to be linked lists (again so powerpc can work).
2002-05-24 06:50:15 +00:00
Robert Griebl d11edf9809 Made exit code SysV compliant. Also added -s (single pid) flag. 2002-05-22 23:38:12 +00:00
Robert Griebl 236abbfd71 Some cleanups, some size reductions and some buffer overflow checks
Most of it based on ideas from vodz
2002-05-22 23:34:35 +00:00
Robert Griebl 94a6a956f0 Support old-style compress (.Z) files via libbb / unzip( ) calls
(configurable) - When enabled an applet "uncompress" is also made
available (oddname to gunzip)
[the cvs add for this file got lost somehow...]
2002-05-19 19:00:14 +00:00
Tim Riker c6def44cfc ping return 1 if can't ping 2002-05-18 09:16:04 +00:00
Robert Griebl 13c26fc1a5 SUpport old style -[::digit::] options for head and tail
Also make head behave like GNU head (-0/-n 0 is valid)
2002-05-17 22:18:04 +00:00
Robert Griebl c30c5e89cf Reduced code size for new -e flag (suggested by vodz) 2002-05-16 19:14:15 +00:00
Eric Andersen d8636cad4d Doh! Remember to close /etc/inittab 2002-05-15 22:19:09 +00:00
Robert Griebl f6495eb767 Support old-style compress (.Z) files via libbb / unzip( ) calls
(configurable) - When enabled an applet "uncompress" is also made
available (oddname to gunzip)
2002-05-15 22:13:47 +00:00
Robert Griebl 7ac868460a gunzip'ing many files to stdout works now
Fixed a missing initialisation and made a for loop more readable.
2002-05-15 21:57:42 +00:00
Robert Griebl 081df62b92 Don't delete source file when decompressing to stdout
This is the normal GNU gunzip behaviour
2002-05-15 21:45:52 +00:00
Robert Griebl 52e8d060a9 Complete rewrite to support stack loading/unloading with proper
handling of duplicates in the dependencies list.
2002-05-14 23:42:08 +00:00
Robert Griebl d77601178d Added support for -Y|--proxy=on/off to wget 2002-05-14 23:36:45 +00:00
Robert Griebl 64f70cc755 Add --login support. This is the bash way of starting a shell that should
parse the profile files.
2002-05-14 23:22:06 +00:00
Robert Griebl 8187bb4394 This patch adds -e (extended information) to route and -r/-e (show routing
tables/extended information) to netstat.
This makes them behave (more) like their GNU counterparts.
2002-05-14 23:10:58 +00:00
Robert Griebl 820098fd61 This patch adds -e (extended information) to route and -r/-e (show routing
tables/extended information) to netstat.
This makes them behave (more) like their GNU counterparts.
2002-05-14 23:03:23 +00:00
Robert Griebl aa385d4015 Entries with "noauto" options are ignored correctly when mounting all
("mount -a"), but mount fails when these entries are specified explicitly
In these cases the "noauto" option has to be simply ignored.
2002-05-14 22:56:29 +00:00
Eric Andersen f63a20ad7b Tom Oehser noticed that we were lacking the SO_REUSEADDR flag. 2002-05-05 03:40:14 +00:00
Eric Andersen 864b79791a Patch from Robert Griebl <griebl@gmx.de> to support modprobe -r properly,
merged in with the latest and greatest.
2002-05-03 15:48:26 +00:00
Eric Andersen 26920c6c94 Make verbose and show_only work as expected
-Erik
2002-05-03 15:22:42 +00:00
Eric Andersen c088c582bf Patch from Robert Griebl <griebl@gmx.de> to ignore the -s flag 2002-05-03 10:34:35 +00:00
Tim Riker 95bf6da637 fix and shrink uuencode 2002-05-01 05:57:16 +00:00
Matt Kraai a4a65e7f99 * archival/gunzip.c (gunzip_file): New.
(gunzip_main): Handle no arguments correctly.
2002-04-29 15:32:32 +00:00
Eric Andersen 051e4c15db Update website 2002-04-27 12:16:48 +00:00
Eric Andersen d598d41110 Fix silly combinitorial oversight 2002-04-27 09:19:39 +00:00
Eric Andersen 1372780662 Patch from Cliff L. Biffle <cbiffle@safety.net> to display memory
usage in the ps listing
2002-04-27 06:06:11 +00:00
Eric Andersen 3a01f8cae2 uClibc supports struct _res these days... 2002-04-27 04:06:55 +00:00
Eric Andersen ef38b39262 Support noerror option 2002-04-27 01:31:43 +00:00
Eric Andersen aba75460e4 When the .config file is missing, supply a default one
and run menuconfig
2002-04-27 00:06:47 +00:00
Eric Andersen 1323c940fd Add netcat -i option, per patch from Cristian Ionescu-Idbohrn
<cristian.ionescu-idbohrn@axis.com>
2002-04-26 23:59:12 +00:00
Eric Andersen 00a6a75035 Add the who applet, supplied by Da Chen <dchen@ayrnetworks.com> 2002-04-26 23:53:10 +00:00
Eric Andersen 1c31501b1b Ensure that getenv("PATH") stays current, since otherwise cmdedit
(which calls getenv("PATH")) would not operate upon the current
PATH settings, which was really quite iritating.
 -Erik
2002-04-26 23:40:09 +00:00
Eric Andersen 416340642d Fix bugs 2002-04-26 08:44:17 +00:00
Eric Andersen 8db361b3e5 Minor formatting 2002-04-26 08:00:33 +00:00
Tim Riker ed8e036360 add missing void, still has issues though 2002-04-26 07:53:39 +00:00
Tim Riker 86c76a9c2a fix from kergoth 2002-04-26 07:41:22 +00:00
Eric Andersen 0e28e1fa05 Forward port patch from Przemyslaw Czerpak <druzus@polbox.com>:
1. busybox-telnet dosn't inform server about the size of terminal screen.
    In the world of xterminals and frame buffers it's rather horrible
    to use fixed 80x24 region in upper-left corner of screen/window.

 2. If client sends character 0x0d to the server then sends character 0x0a
   the server eat the second byte (0x0a) - it's described in telnet RFC.
    Client should send two bytes ( 0x0d + 0x0a or 0x0d + 0x00 ) insted of
    one 0x0d byte.

 3. busybox telnet implementation wasn't 8bit clean (look at 0xff byte).
    I need it because I have to use binray transfer like rz/sz. So when
    I resloved the problem (2) I corrected this one two.

This also contains a small cleanup patch from vodz, and some minor editing
by me.
2002-04-26 07:20:47 +00:00
Eric Andersen 60e56f5292 Reworked by Robert Griebl <griebl@gmx.de> to support proper
module dependancies.
2002-04-26 06:04:01 +00:00
Eric Andersen 54c14d7850 vodz noted this line (as imported from Debian) is wrong, and has since
been fixed upstream.
2002-04-24 23:14:06 +00:00
Eric Andersen ae1036185e Apply last_patch37 from vodz 2002-04-24 23:08:23 +00:00
Eric Andersen 5f6873621d ls could mis-color certain entries when previous commands
had failed.  Explicitly 0 out errno to prevent that.
2002-04-17 20:21:45 +00:00
Matt Kraai 272a95524f * networking/wget.c (wget_main): Check return value of safe_fwrite. 2002-04-17 15:33:24 +00:00
Matt Kraai a0782684fd * archival/bunzip2.c (bunzip2_main): Do not remove files if writing to standard
output.
* testsuite/bunzip2/bzcat-does-not-remove-compressed-file: New.
2002-04-15 15:01:37 +00:00
Eric Andersen 744ec1d549 Patch from Ben Low <ben@titr.uow.edu.au> to allow tftp to work
with stdin as well as stdout.
2002-04-15 07:40:27 +00:00
Eric Andersen 9fe5f98de4 Patch from Jim Treadway -- fix a missing "\" in usage.h 2002-04-13 14:48:51 +00:00
Eric Andersen c8459a5a8f Silly me 2002-04-13 14:44:42 +00:00
Eric Andersen 19732c6226 Teach makedevs to not segfault quite so much 2002-04-13 14:26:44 +00:00
Eric Andersen 4e116823f4 Patch from Larry Doolittle to teach syslogd to not give up when errno is EINTR 2002-04-13 14:07:32 +00:00
Eric Andersen fb24eb4f47 Cleanup make clean 2002-04-13 13:52:13 +00:00
Eric Andersen defd998c42 Patch from Kevin Hilman <khilman@equator.com> to fix potential
memory corruption from long pathnames in /etc/fstab.
2002-04-13 13:47:39 +00:00
Eric Andersen 1f30a41abe Add a 'make uninstall' target 2002-04-13 13:39:48 +00:00
Eric Andersen 5d8d4a674b Patch from Jim Treadway <jim@stardot-tech.com> to teach
pidof to not add trailing spaces when not needed.
2002-04-13 13:32:30 +00:00
Eric Andersen 65a0730c9f Patch from Jim Treadway and Vladimir Oleynik to Add CTRL-K
and fix CTRL-L support for cmdedit.c
2002-04-13 13:26:49 +00:00
Eric Andersen 3e6908b586 Sed can go into an infinite loop 2002-04-13 13:18:15 +00:00
Eric Andersen db7d5fca5f Stupid gcc always includes its own builtin strlen()... 2002-04-13 13:02:03 +00:00
Eric Andersen 4c9b68f0e0 Nice patch from Wolfgang Denk <wd@denx.de> to provide hush with
shell loops (for, while, until) and control operators (||, &&)
2002-04-13 12:33:41 +00:00
Eric Andersen a66a43e8ef Teach tftp to direct the fetched file to stdout when the
user specifies "-l -"
 -Erik
2002-04-13 09:30:25 +00:00
Eric Andersen d75ac02a4f Rework per how I did things in version in 0.60.3 so it can
properly uncompress multiple files now.
 -Erik
2002-04-13 09:10:34 +00:00
Eric Andersen 114de55668 Patch from Laurence Anderson <L.D.Anderson@warwick.ac.uk> for
better tape drive support in tar/cpio by using an intervening
pipe...
2002-04-13 08:43:01 +00:00
Eric Andersen 1d1d2f9b18 Update some missing copyright notices 2002-04-13 08:31:59 +00:00
Tim Riker 497a88506e make ash prompt the same as other shells if cmdedit and fancyprompt 2002-04-13 05:37:10 +00:00
Eric Andersen 85208e2ab9 Completely rework the config system so that it no longer annoys me to work on
the busybox development tree.  This eliminates the use of recursive make, and
once again allows us to run 'make' in a subdirectory with the expected result.
And things are now much faster too.  Greatly improved IMHO...
 -Erik
2002-04-12 12:05:57 +00:00
Eric Andersen b1591d1f8b Fix handling of endianness.
-Erik
2002-04-12 00:28:59 +00:00
Eric Andersen a3603e845e Oldnews 2002-04-11 20:40:00 +00:00
Eric Andersen 265d229427 Patch from Edward Betts <edward@debian.org> to add -x switch to du.c 2002-04-06 23:16:44 +00:00
Eric Andersen fcffa2cc1a Apply lash_patch35 from vodz, which brings several nice size_optimizations. 2002-04-06 05:17:57 +00:00
Eric Andersen 50e4d660ac Fix email addr 2002-04-06 05:15:46 +00:00
Eric Andersen 45673d2cc0 Add fli4l 2002-04-03 14:30:58 +00:00
Matt Kraai 5c69cd84ff * editors/sed.c (process_file): Stop processing deleted lines.
* testsuite/sed/sed-does-not-substitute-in-delete-line: New.
2002-04-01 16:17:37 +00:00
Miles Bader 75ce8d7c88 Tweak my credit (ah, vanity...) 2002-04-01 14:25:51 +00:00
Miles Bader 130bec5ad8 Add insmod support for the NEC v850e processor. 2002-04-01 09:37:27 +00:00
Miles Bader ae28b04ff2 Add support for the NEC v850e processor. 2002-04-01 09:34:25 +00:00
Eric Andersen c57e42b8f0 Provide a controlling tty to askfirst processes as well
-Erik
2002-03-29 00:59:44 +00:00
Matt Kraai 8a8308f129 * testsuite/which/which-uses-default-path: Remove extra echo. 2002-03-27 23:19:17 +00:00
Matt Kraai 66388f89a5 * testsuite/grep/egrep-supports-extended-regexps: Check exit status instead
of output.
2002-03-27 22:56:19 +00:00
Matt Kraai 50aec98e1c * testsuite/bunzip2/bunzip2-reads-from-standard-input: Remove -c flags.
* testsuite/gunzip/gunzip-reads-from-standard-input: Likewise.
2002-03-27 22:48:39 +00:00
Matt Kraai 6feaeace86 * testsuite/COPYING: Remove. 2002-03-27 22:43:47 +00:00
Matt Kraai cf32ac543c * archival/bunzip2.c (bunzip2_main): Remove compressed file.
* testsuite/bunzip2/bunzip2-removes-compressed-file: New.
2002-03-27 17:46:44 +00:00
Matt Kraai 35d60421b4 * testsuite/runtest (run_applet_testcase): Return test case status, not
process ID.
2002-03-27 17:33:31 +00:00
Matt Kraai 9cdb0601eb * archival/bunzip2.c: Include <unistd.h>.
(bunzip2_main): Read data from standard input if FILE argument is `-' or
  omitted.
* include/usage.h (bunzip2_trivial_usage, bunzip2_full_usage): Rewrite.
* testsuite/bunzip2/bunzip2-reads-from-standard-input: New.
2002-03-27 17:31:01 +00:00
Manuel Novoa III fa15f702d2 Work around compiler/assembler problem and reduce code size at the same time. 2002-03-25 02:37:20 +00:00
Matt Kraai ef8b112d77 * archival/gzip.c (gzip_main): Ensure that the output is a terminal and use
error_msg to display the error message.
2002-03-22 22:55:51 +00:00
Eric Andersen b88868276c Doh! I broke ping when removing the nested function.
This patch from vodz fixes it again.
2002-03-21 14:04:43 +00:00
Matt Kraai 83788da250 * include/applets.h (CONFIG_LOSETUP): New.
* include/usage.h (losetup_trivial_usage, losetup_full_usage): New.
* util-linux/Makefile: Add losetup.o.
* util-linux/config.in: Add losetup prompt.
* util-linux/losetup.c: New.
2002-03-20 17:38:37 +00:00
Eric Andersen 27eff033d2 Eliminate extra trailing space 2002-03-20 16:10:54 +00:00
Eric Andersen c7a3fb96d0 Fix devfs loop device support 2002-03-20 15:25:25 +00:00
Eric Andersen b0cc0a6ca8 Rewind messages to avoid weird formatting, and fix a bug with
CONFIG_FEATURE_EXTRA_QUIET, which was broken
2002-03-20 14:57:50 +00:00
Eric Andersen 889a301a0c Patch from vodz to fix a potential segfault 2002-03-20 14:31:15 +00:00
Eric Andersen 900c24dc4e Patch from Jeff Studer <jstuder@aquilagroup.com> to supply a defaults for
localfilename from remotefilename, and for remotefilename from localfilename
when the other one is not supplied.
2002-03-20 14:25:27 +00:00
Eric Andersen 5a40651046 Update dmalloc options per suggestion from Glenn 2002-03-20 14:16:31 +00:00
Eric Andersen 89de1e7930 Reinitialize initial shift register value for on each pass.
-Erik
2002-03-20 13:30:40 +00:00
Eric Andersen b5474c48b1 Cave to pressure (2 months later). Eliminate using a
nested function, which is a purely unremovable gcc-ism...
 -Erik
2002-03-20 11:59:28 +00:00
Eric Andersen b159146fa6 Add missing " " after the word on, as reported by Jason Luther
back in mid-december.
 -Erik
2002-03-20 09:52:45 +00:00
Eric Andersen 3ad0bd9563 Patch from J.W.Janssen <JanWillem.Janssen@lxtreme.nl> to provide
color ls support, modifed by me to behave properly when not running
output to a terminal (i.e. 'ls | more')
 -Erik
2002-03-20 09:13:48 +00:00
Eric Andersen 3ec5c692ec Bart Visscher noticed some spurious search and replace silliness
-Erik
2002-03-20 01:32:25 +00:00
Matt Kraai aee53f4604 * testsuite/grep/egrep-is-not-case-insensitive: Require
CONFIG_FEATURE_GREP_EGREP_ALIAS.
2002-03-19 23:47:49 +00:00
Matt Kraai b3de66869b * testsuite/grep/grep-handles-binary-files: Read input from a pipe.
* testsuite/grep/grep-matches-NUL: Likewise.
2002-03-19 23:46:16 +00:00
Matt Kraai 0efab3319d * networking/wget.c (parse_url): Allocate a string for the empty path.
* testsuite/wget/wget-handles-empty-path: New.
2002-03-19 15:22:42 +00:00
Matt Kraai 3b1cbd7bec Thomas Lundquist
* docs/new-applet-HOWTO.txt: Update for new directory structure.
2002-03-18 16:03:00 +00:00
Eric Andersen 38ddbed4c1 Try to pull in PATH_MAX properly 2002-03-16 02:12:30 +00:00
Eric Andersen 08ed1a73f1 Don't mention ldconfig 2002-03-13 17:26:39 +00:00
Eric Andersen 806c74fe19 Cleanup a libc5 compatibility hack 2002-03-12 00:35:40 +00:00
Eric Andersen f64c1cd26d Fix broken link 2002-03-10 22:01:51 +00:00
Matt Kraai a1bbde71bf list_single: Declare scratch iff CONFIG_FEATURE_LS_USERNAME is defined. 2002-03-08 16:25:33 +00:00
Matt Kraai 3bd31ebc9a * fileutils/ls.c (showfiles): Display multiple short names on a line. 2002-03-08 16:16:38 +00:00
Eric Andersen 372f91f07c Update 2002-03-06 11:13:51 +00:00
Eric Andersen bc12fb79fd Update webpage to note new mirrors 2002-03-06 10:28:55 +00:00
Eric Andersen 1b17b01584 Now that we are mirrored, remove absolute links 2002-03-05 15:55:59 +00:00
Eric Andersen 0298be88ae Update init.c per my changes in the stable branch
-Erik
2002-03-05 15:12:19 +00:00
Eric Andersen 684d745bf3 Update robots.txt 2002-03-02 16:43:30 +00:00
Eric Andersen 02a4ed9264 A few more little cleanups to simplify mirroring 2002-03-02 16:42:46 +00:00
Eric Andersen 49da8a83ad Update the cvs commit info. Remove the old busybox.lineo.com stuff. 2002-03-02 15:39:06 +00:00
Matt Kraai a99b194336 * libbb/xfuncs.c (xmalloc, xcalloc): Do not exit if a zero-length buffer is
requested.
  (xrealloc): Simplify.
2002-02-26 15:28:22 +00:00
Matt Kraai eed9451cf6 * findutils/grep.c (grep_main): Remove unnecessary use of junk. 2002-02-22 22:08:16 +00:00
Matt Kraai fa144713b8 * testsuite/runtest (show_result): Change UPASS to XPASS.
(run_applet_testcase): Likewise.
2002-02-19 23:54:42 +00:00
Matt Kraai 6b140ea5a9 * testsuite/README: Change "UNSUPPORTED" tag to "FEATURE".
* testsuite/runtest (run_applet_testcase): Likewise.
* testsuite/cp/cp-preserves-hard-links: Likewise.
* testsuite/grep/egrep-supports-extended-regexps: Likewise.
* testsuite/grep/grep-is-also-egrep: Likewise.
* testsuite/tar/tar-archives-multiple-files: Likewise.
* testsuite/tar/tar-handles-empty-include-and-non-empty-exclude-list:
  Likewise.
* testsuite/tar/tar-handles-exclude-and-extract-lists: Likewise.
* testsuite/tar/tar-handles-nested-exclude: Likewise.
2002-02-19 23:43:08 +00:00
Matt Kraai 7c71822809 * testsuite/runtest (run_applet_testcase): Return UNTESTED instead of
UNSUPPORTED for missing applets and features.
2002-02-19 23:38:08 +00:00
Matt Kraai b5b757eb8d * testsuite/README: Fill to 80 columns. 2002-02-19 23:20:52 +00:00
Matt Kraai 6be2319873 * testsuite/README: Update copyright date. 2002-02-19 23:19:46 +00:00
Matt Kraai ad6faf6497 * testsuite/tar/tar-archives-multiple-files: Require
CONFIG_FEATURE_TAR_CREATE.
2002-02-19 23:15:41 +00:00
Matt Kraai 4271d438e2 * docs/busybox.net/index.html (Products/Projects Using BusyBox): Added
Tinfoil Hat Linux.
2002-02-19 22:58:26 +00:00
Eric Andersen d4574f1b61 fix name 2002-02-17 22:42:30 +00:00
Matt Kraai c00e4ff8e5 * testsuite/tar/tar-archives-multiple-files: New. 2002-02-17 18:42:52 +00:00
Eric Andersen 3b7767abe6 Add in tuxscreen 2002-02-16 22:17:33 +00:00
Eric Andersen 796245b554 Update sponsor section 2002-02-16 22:08:28 +00:00
Eric Andersen 8fd6e1fb0f Add in a sponsors link, and update the screenshot. 2002-02-16 21:50:34 +00:00
Eric Andersen d7f7bd0445 Add Partition Image 2002-02-16 18:48:55 +00:00
Glenn L McGrath 02a415606c Parse the include list to writeTarFile rather than argv, fixes a bug where tar files wernt being created. 2002-02-15 05:15:03 +00:00
Glenn L McGrath 8833a51781 Fix condition that prevented creation of compressed files 2002-02-13 03:32:11 +00:00
Matt Kraai 9bd49d6a22 * archival/gzip.c (ifname, ofname): Delete.
(gzip_main): Handle multiple files.
* include/usage.h (gzip_trivial_usage): Allow multiple FILEs.
  (gzip_full_usage): Ditto.
* testsuite/gzip/gzip-accepts-multiple-files: New.
* testsuite/gzip/gzip-removes-original-file: New.
2002-02-05 22:31:48 +00:00
Matt Kraai 592a3e63ee * archival/gzip.c (gzip_main): Display usage if given multiple files. 2002-02-05 19:34:53 +00:00
Matt Kraai 273af73317 * include/usage.h (gzip_trivial_usage): Make FILE optional.
(gzip_full_usage): Note behavior when FILE is unspecified.
2002-02-05 19:25:29 +00:00
Matt Kraai eb83478528 * fileutils/dd.c (dd_main): Ignore ftruncate error if the output is not a
file or directory.
2002-02-05 15:28:54 +00:00
Matt Kraai 369da77d5e 2002-01-30 Neal H Walfield <neal@cs.uml.edu>
* networking/ping.c (hostname): Removed.

        [CONFIG_FEATURE_FANCY_PING] (noresp): Moved from here . . .
        [CONFIG_FEATURE_FANCY_PING] (ping:noresp): . . . to here.
        Use H->h_name, not hostname.
        [CONFIG_FEATURE_FANCY_PING] (ping): Do not copy H->h_name into
        hostname.
        Use H->h_name directly.

        [!CONFIG_FEATURE_FANCY_PING] (hostent): New global variable.
        [!CONFIG_FEATURE_FANCY_PING] (pingstats): Use hostent in favor
        of the now obsolete hostname global variable.
        [!CONFIG_FEATURE_FANCY_PING] (ping): Likewise.
        No need to copy H; use hostent instead.

        [!CONFIG_FEATURE_FANCY_PING] (ntransmitted, nreceived,
        nrepeats, pingcount, myid, options, tmax, tsum): Removed
        superfluous zero initializers.
2002-02-01 16:54:00 +00:00
Eric Andersen 20d739adf7 If PATH_MAX isn't defined, define it outselves 2002-01-26 23:58:22 +00:00
Eric Andersen 53a2299230 Patch from Russ Dill <Russ.Dill@asu.edu>. From the
start-stop-daemon man page:

-b|--background
        Typically used with programs that don't detach on their own.
        This option will force start-stop-daemon to fork before starting
        the process, and force it into the background. WARNING:
        start-stop-daemon cannot check the exit status if the process
        fails to execute for any reason. This is a last resort, and is
        only meant for programs that either make no sense forking on
        their own, or where it's not feasible to add the code for it to
        do this itself.

This is usefull for applets like watchdog
2002-01-26 09:04:45 +00:00
Eric Andersen 467a18b1d9 Teach 'init -q' that init's pid may not equal 1 2002-01-25 23:13:06 +00:00
Matt Kraai a3181dd833 Do not segfault if PATH is unset. 2002-01-14 18:30:10 +00:00
Eric Andersen ba552523fa Remove broken "Other cool embedded software" link 2002-01-13 03:01:02 +00:00
Eric Andersen d35c5df08c Make private ash config options be public 2002-01-09 15:37:36 +00:00
Matt Kraai b75b6e2c35 * archival/tar.c (tar_main): Remove unused variable. 2002-01-08 16:03:41 +00:00
Eric Andersen 038cbc7442 Oops. 2002-01-06 01:10:25 +00:00
Eric Andersen c94e89d81f Do not depend on PATH or getopt arg reordering 2002-01-06 01:08:28 +00:00
Eric Andersen db2b9f37d4 Somehow ttylinux got lost. Put it back.
-Erik
2002-01-05 16:56:43 +00:00
Eric Andersen 8ec99dfa05 Update links to avoid possible lingering DNS problems
(and thereby test if I have the Reply-to thing really
fixed this time)...
 -Erik
2002-01-05 05:34:31 +00:00
Matt Kraai d402f971a5 * docs/busybox.net/index.html: Fix misspelling of `Unfortunately'. 2002-01-04 16:54:39 +00:00
Eric Andersen eeba178d3a More updates 2002-01-04 05:12:14 +00:00
Eric Andersen 7d957c6573 More pics 2002-01-04 05:11:49 +00:00
Eric Andersen 665b4e69ed Update text once again 2002-01-04 05:04:15 +00:00
Eric Andersen 7875f5b72a Fix grammar (thanks to my wife for proof reading) 2002-01-04 04:24:27 +00:00
Eric Andersen 55ed17747f Fix link 2002-01-04 00:34:22 +00:00
Eric Andersen 4fa2bb5e95 Update busybox.net info and donation noise 2002-01-04 00:32:15 +00:00
Matt Kraai 9eaf059d28 * editors/sed.c (parse_cmd_str): Remove redundant code to skip initial
whitespace.
2002-01-03 21:19:19 +00:00
Matt Kraai 5ed78adca5 * editors/sed.c (parse_edit_cmd): Rewrite.
* testsuite/sed/sed-splits-edit-commands-on-command-line: New.
2002-01-03 21:12:34 +00:00
Matt Kraai d299563257 * AUTHORS (Matt Kraai): Update e-mail address. 2002-01-03 18:29:37 +00:00
Matt Kraai 9758e7d58d * include/usage.h: Fix route and unzip usage messages (patch from
Laurence Anderson).
2002-01-03 17:32:29 +00:00
Matt Kraai f3fbe20c35 * cmp/cmp-detects-difference: Simplify return code negation.
* false/false-returns-failure: Likewise.
* tar/tar-demands-at-least-one-ctx: Likewise.
* tar/tar-demands-at-most-one-ctx: Likewise.
2002-01-02 20:45:42 +00:00
Matt Kraai 01d2ea908b * testsuite/README: Document -v option.
* testsuite/runtest: Handle -v option.
  (show_result): New.
  (run_applet_testcase): Call it.
2002-01-02 20:37:59 +00:00
Matt Kraai 39fcb5a750 * archival/dpkg.c (create_list): Use chomp.
* archival/tar.c (append_file_list_to_list): Likewise.
2002-01-02 19:01:41 +00:00
Matt Kraai 0733e840bd chomp should only remove the newline if it occurs at the end of the input.
This was caught by the test suite (in sed/sed-aic-commands).

* libbb/chomp.c: Revert to revision 1.5.
2002-01-02 18:51:23 +00:00
Matt Kraai d21735de2d * editors/sed.c (parse_edit_command): Require a newline after the backslash
after an edit command.
* testsuite/sed/sed-requires-newline-after-edit-command: New.
2002-01-02 17:56:38 +00:00
Glenn L McGrath 87ac7028e0 unzip applet by Laurence Anderson
----------------------------------------------------------------------
2002-01-02 13:52:26 +00:00
Aaron Lehmann 438803311b ash patch: errname-diff 2001-12-31 06:16:54 +00:00
Aaron Lehmann 9a218bf979 ash patch: initvar-diff 2001-12-31 06:13:38 +00:00
Aaron Lehmann 1a6986699f ash patch: forkshell-diff 2001-12-31 06:12:48 +00:00
Aaron Lehmann eec2bbb9bf ash patch: fgcmd-diff 2001-12-31 06:07:57 +00:00
Aaron Lehmann 2aef3a6bb9 ash patch: breakcmd-diff 2001-12-31 06:03:12 +00:00
Aaron Lehmann 95877b6756 ash patch: addfname-diff 2001-12-31 06:00:57 +00:00
Eric Andersen 79a466f128 optimize this a little bit. 2001-12-29 07:26:33 +00:00
Eric Andersen 6d13964714 Silence some silly warnings
-Erik
2001-12-29 04:15:13 +00:00
Eric Andersen e7dd383f67 Link to udhcp 2001-12-22 19:28:24 +00:00
Eric Andersen b9c0b99e51 Update URLs and email addresses 2001-12-22 00:37:54 +00:00
Matt Kraai 70624846fd Ignore blanks before the first address and before the command. 2001-12-21 16:04:12 +00:00
Matt Kraai 1fcc66e685 New. 2001-12-21 15:54:25 +00:00
Eric Andersen ceef50b280 Patch from vodz to fix broken function prototype 2001-12-21 11:22:26 +00:00
Eric Andersen f1f2bd0b0a Patch from vodz to implement ^L (clear screen) 2001-12-21 11:20:15 +00:00
Eric Andersen 9910cd2869 Update TODO. vodz has implemented ^L. Reverse policy on tinylogin.
-Erik
2001-12-21 11:18:36 +00:00
Matt Kraai 1f0c43668a Remove == TRUE' tests and convert != TRUE' and `== FALSE' tests to use !. 2001-12-20 23:13:26 +00:00
Matt Kraai 31c73af656 Perform clean up only if CONFIG_FEATURE_CLEAN_UP is defined. 2001-12-20 22:30:14 +00:00
Matt Kraai 2b1effdbbc Write files when extracting an archive from standard input. 2001-12-20 22:09:31 +00:00
Matt Kraai c5b5cab37d Remove dependence on CONFIG_FEATURE_CLEAN_UP. 2001-12-20 21:13:18 +00:00
Matt Kraai 38c15becf6 Avoid printing a trailing blank character. 2001-12-20 21:11:59 +00:00
Eric Andersen 5a841adf5d Switch from FTP to HTTP for downloads 2001-12-20 08:04:56 +00:00
Eric Andersen fb74a45088 Vodz' last_patch31
Very minimal last corrections:

    1) busybox.c: fix warining
    2) docs/: add applets for list from pwd_grp
    3) usage.h: add -n option for route
    4) run_parts.c: many todo fix for busybox style
    5) addgroup.c: add #ifdef CONFIG_FEATURE_SHADOWPASSWDS, reduce one
    perror_msg
    6) adduser.c: fix bug "variable i not initialize" and
       add #ifdef CONFIG_FEATURE_SHADOWPASSWDS
2001-12-18 14:06:03 +00:00
Eric Andersen f3f9062ecf Things like 'tar -c /tmp/*' and 'tar -cO /tmp/*' where the output
filename was not explicitly specified were segfaulting.
 -Erik
2001-12-18 00:57:55 +00:00
Eric Andersen 730f826f25 Add in a new restart init target, triggered by SIGHUP. Patch from
Russ Dill, with adjustments by me.
 -Erik
2001-12-17 23:13:08 +00:00
Matt Kraai ace02dc9cd Make cp and mv optionally preserve hard links. 2001-12-17 15:26:36 +00:00
Eric Andersen 46ea0e4696 * Add ^L clear to shell 2001-12-16 09:25:57 +00:00
Eric Andersen 6925d50176 Some minor usage cleanups from David Douthitt <ssrat@mailbag.com> 2001-12-16 09:23:09 +00:00
Eric Andersen de2a342289 Add a more verbose non-strip command. 2001-12-16 09:20:08 +00:00
Matt Kraai e62dc86bc7 Add support for big-endian ARM (initial patch by Mike Voytovich). 2001-12-14 16:08:17 +00:00
Matt Kraai 04ae328851 Update uClibc URL. 2001-12-12 19:09:51 +00:00
Matt Kraai 14b7c5d12b Open the source before creating the destination. 2001-12-11 16:43:48 +00:00
Matt Kraai 741f40b58e Use an int to hold the result of fgetc (bug noted by David Kimdon). 2001-12-11 16:06:02 +00:00
Eric Andersen 72812d3143 And a bit more 2001-12-08 02:14:02 +00:00
Eric Andersen a2e6908165 More polish 2001-12-08 02:13:05 +00:00
Eric Andersen 90c2abd212 Oops 2001-12-08 02:10:37 +00:00
Eric Andersen dec43433e5 Add in cvs info 2001-12-08 02:08:31 +00:00
Eric Andersen 2423b12dae Begin moving things to busybox.net
-Erik
2001-12-08 01:56:15 +00:00
Eric Andersen 05b5addcaa Use a local image, not an offsite one. 2001-12-08 00:18:20 +00:00
Matt Kraai 07a37aebf5 New. 2001-12-07 21:27:57 +00:00
Matt Kraai dba11452cb Continue processing files if we are asked to touch, but not create, a file
which doesn't exist.
2001-12-07 21:27:38 +00:00
Matt Kraai 1a781a499f Enable test only if CONFIG_FEATURE_GREP_EGREP_ALIAS is defined. 2001-12-07 21:24:25 +00:00
Eric Andersen 603557b466 Fix link name 2001-12-07 19:01:31 +00:00
Eric Andersen 089db51fbe Fix broken link 2001-12-07 19:00:30 +00:00
Matt Kraai 3eeab3b23f Update copyright and close file descriptors (noted by Axel Kittenberger). 2001-12-07 16:27:37 +00:00
Eric Andersen 6834ee941a Avoid NULL pointer problems. Patch from "Frank P. MacLachlan"
<fpm-plutus@tgs.indyme.com>
2001-12-06 21:33:55 +00:00
Matt Kraai 54805af092 Remove documentation for the --file option to hostname (noted by
David Douthitt).
2001-12-06 17:37:51 +00:00
Eric Andersen c98c06233e Merge in the cal applet from Steve Merrifield <steve@labyrinth.net.au> 2001-12-06 15:16:43 +00:00
Eric Andersen b24d65659f If find_pid_by_name() had an error, it was returning -1, but storing
that into a pid_t, which is unsigned on a number archs.  Furthermore,
find_pid_by_name() would _never_ return an error if the intended proces
was "init", but instead would return 1, meaning we would fail to work
on 2.4.x kernels running an initrd...
 -Erik
2001-12-06 14:52:32 +00:00
Eric Andersen 06656f363d Minor adjustment to the strip command 2001-12-06 14:44:11 +00:00
Eric Andersen db930948a9 More copyright and email addr cleanups 2001-12-06 08:20:14 +00:00
Eric Andersen 463304edfd Silly cosmetic problem in the comment 2001-12-06 08:04:45 +00:00
Eric Andersen 356b6dbf86 Patch from Steve Merrifield <steve@labyrinth.net.au> to
fixup the merge of the time applet, which I messed up.
 -Erik
2001-12-06 07:42:04 +00:00
Eric Andersen 0ee0a8d539 Fix running more on files in the (broken) procfs that claim 0 length
when that isn't actually true.
 -Erik
2001-12-06 07:24:29 +00:00
Aaron Lehmann b6ecbdc07d The ash ansification diff!
Please tell me if you notice any problems resulting from this.
2001-12-06 03:37:38 +00:00
Aaron Lehmann ebd8065f38 Trying to commit Changelog and TODO. cvs is being weird :/ 2001-12-06 03:32:12 +00:00
Aaron Lehmann 2dd2d7a37d Patch to avoid warnings 2001-12-06 03:29:37 +00:00
Aaron Lehmann b9df470c4d Commit my improvement on Rodney Brown's patch to g(un)zip, decreasing
binary size.
2001-12-06 03:22:43 +00:00
Glenn L McGrath 249f39a265 Simplify unzip(), remove unused checks and unneccessary variables 2001-12-05 16:01:02 +00:00
Glenn L McGrath ef03dbcd4d Simplify CRC table generation 2001-12-05 13:08:03 +00:00
Glenn L McGrath aad44fb37a Fix some fegfaults and picket fence 2001-12-05 04:40:52 +00:00
Manuel Novoa III 3280f9a3fc New version to cut size. Includes optional basename() compatibility, but
enabling that would break the basename applet at least for one corner case.
2001-12-05 04:35:32 +00:00
Manuel Novoa III 6509f92a3b Combined size reduction changes by Glenn and myself. Added back in "unknown"
for -p to match normal uname behavior (at a cost of 30-40 bytes).
2001-12-05 04:21:30 +00:00
Glenn L McGrath 1dbbd2fe34 Fail gracefully if package depends on a virtual package. 2001-12-05 04:10:14 +00:00
Eric Andersen ed8a9be287 Patch from Dan Langlois <dan@somanetworks.com> Support SIGSTOP/SIGCONT
for wierd situations when people want init to actualy stop doing
anything for a while...
2001-11-30 19:10:58 +00:00
Eric Andersen c3657428d3 Add in a 'time' applet. Adds 4.5k.
-Erik
2001-11-30 07:54:32 +00:00
Glenn L McGrath 38288bbf4c gunzip was incorrectly reporting a failed crc and length (discovered by
Chang, Shu-Hao).  The bitbuffer needs to be unwound after decompression,
as it was eating into the crc/size field.
2001-11-29 06:36:56 +00:00
Matt Kraai 8a35c9a557 Add space before module name (noted by Ron Yorston). 2001-11-27 17:28:01 +00:00
Glenn L McGrath 9e6c9f7311 Minor space saving improvments 2001-11-21 12:46:36 +00:00
Glenn L McGrath 74afa9aed1 When just counting chars of a file stat file instead of reading the whole file (Fixes Debian bug #103302) 2001-11-21 10:26:28 +00:00
Glenn L McGrath c29ab97094 woops. dotn pass NULL 2001-11-21 10:01:29 +00:00
Glenn L McGrath 1477ad8e83 Simplify print function, prints an extra space if no filename, but saves 4 bytes 2001-11-21 09:58:29 +00:00
Glenn L McGrath 02d090d3d2 Use enums for selected functionality, Reduce the size by nearly 100 Bytes 2001-11-21 09:17:00 +00:00
Eric Andersen 2480e3a30a Fix dangling comma 2001-11-21 09:05:31 +00:00
Matt Kraai 1dbd6ff80f New. 2001-11-20 16:04:22 +00:00
Matt Kraai 585f657e2d Fix undeclared variable error. 2001-11-20 16:00:44 +00:00
Matt Kraai 0c390a76fe Eliminate warning. 2001-11-20 16:00:19 +00:00
Matt Kraai fd3f1be57f New. 2001-11-20 15:49:55 +00:00
Matt Kraai 355a61b56f Treat NUL as the end-of-line. 2001-11-20 15:49:50 +00:00
Eric Andersen 66c22051f9 More grammar fixes 2001-11-20 12:40:37 +00:00
Eric Andersen dbdc0d5da9 grammer error 2001-11-20 12:36:28 +00:00
Eric Andersen 4d7f9c3d99 Update the website 2001-11-20 11:56:51 +00:00
Eric Andersen 4b8a1e89a5 Fix email addr 2001-11-20 11:41:37 +00:00
Eric Andersen f435a918fa S390 wierdness 2001-11-20 05:42:57 +00:00
Eric Andersen 81ee96fe62 Usr get_last_path_component() name basename() 2001-11-20 00:23:48 +00:00
Eric Andersen c36642195c Include time.h 2001-11-20 00:15:27 +00:00
Eric Andersen edc6e0248c Oops. doubled myself 2001-11-19 23:50:18 +00:00
Eric Andersen 372f12678e Note tinylogin TODO items 2001-11-19 22:51:41 +00:00
Matt Kraai efd7f03657 Fix opt type in dpkg (closes: #118975). 2001-11-19 21:07:15 +00:00
Matt Kraai 4e05da89f3 Add a check target. 2001-11-19 19:47:56 +00:00
Matt Kraai 36c613a443 Update usage instructions, and document test case format. 2001-11-19 19:28:56 +00:00
Matt Kraai 9dfe508a3f New. 2001-11-19 19:00:13 +00:00
Matt Kraai c2d6ca0922 Fix misspelling. 2001-11-19 18:44:58 +00:00
Matt Kraai 03bb3088b0 New. 2001-11-19 15:13:12 +00:00
Eric Andersen 6f8b7ea452 oops 2001-11-19 11:45:39 +00:00
Eric Andersen 55805bcba4 More scrubbing 2001-11-19 10:59:37 +00:00
Eric Andersen d81891a2e6 Call xmalloc before realloc 2001-11-19 10:49:30 +00:00
Eric Andersen 43626d7671 Fixup CLEANUP behavior 2001-11-19 10:36:20 +00:00
Eric Andersen cc05ce64e9 Update webpage 2001-11-18 15:49:26 +00:00
Glenn L McGrath fff11f1ab7 bzcat and bunzip -c support from Thomas Lundquist 2001-11-18 14:20:25 +00:00
Eric Andersen fedce06b7f Hide some ifdefs to make it more readible 2001-11-17 07:27:14 +00:00
Eric Andersen 9c6b5fcb0a Minor warning cleanups 2001-11-17 07:23:46 +00:00
Eric Andersen bff7a60f63 Patch from "Andrew Tipton" <andrew@cadre5.com> to enable vi cursor
keys while editing.
2001-11-17 07:15:43 +00:00
Eric Andersen 80f5ac7016 Patch from Steve Merrifield <steve@labyrinth.net.au> to make vi
use xmalloc
2001-11-17 06:57:42 +00:00
Eric Andersen 26f8e95d2d David Kimdon <dwhedon@instant802.com> noticed a thinko
in md5sum where only binary sums were verified.  He also
sent in this patch,
 -Erik
2001-11-17 04:16:15 +00:00
Matt Kraai 5c2bbb55d7 Remove unnecessary errno handling. 2001-11-12 18:44:26 +00:00
Matt Kraai 6c5fdfaf56 New. 2001-11-12 18:42:57 +00:00
Matt Kraai a21c24bf03 Convert strdup call to xstrdup, and calloc calls to xcalloc (patch from
Steve Merrifield).
2001-11-12 16:58:07 +00:00
Matt Kraai c8227639db Change strdup calls to xstrdup (patch from Steve Merrifield). 2001-11-12 16:57:27 +00:00
Matt Kraai 357cfc739e Brag. 2001-11-12 16:45:43 +00:00
Matt Kraai 9fb38f600c Eliminate unused variable warnings. 2001-11-12 16:45:23 +00:00
Matt Kraai a5f09c668e Use fopen wrapper. 2001-11-12 16:44:55 +00:00
Eric Andersen c5f9a9dd0c Add redhat and slackware 2001-11-10 13:38:36 +00:00
Eric Andersen 31ac3b7764 Add in Redhat 2001-11-10 13:35:27 +00:00
Eric Andersen 45784febaf Some more minor build cleanups 2001-11-10 13:08:02 +00:00
Eric Andersen dba4e6f046 Add in grep -E support 2001-11-10 12:54:00 +00:00
Eric Andersen c223ced0ea I forgot to add these. Part of the patch from vodz 2001-11-10 12:18:42 +00:00
Eric Andersen 282671bf76 Cleanup some config problems. Add a sane default config that basically
matches the default old Config.h
2001-11-10 12:07:24 +00:00
Eric Andersen 30fcef430c Only use -mpreferred-stack-boundary with gcc versions that support it 2001-11-10 11:23:47 +00:00
Eric Andersen cd8c436d81 Latest patch from vodz:
-- reverse resolve network name and cache in route and ifconfig
	applets, fix print nslookup server name if compile without
	uClibc, fix route crashe 'route add', fix warnings compile
	networking and pwd_grp applets
2001-11-10 11:22:46 +00:00
Eric Andersen 94f19a8385 oops 2001-11-10 11:17:17 +00:00
Eric Andersen 744a194f53 Can't use RESERVE_CONFIG_BUFFER here since the allocation
size varies meaning BUFFERS_GO_ON_STACK will fail
2001-11-10 11:16:39 +00:00
Eric Andersen c52a6b0f10 |2001-10-08 Rodney Brown <rbrown64@csc.com.au>
|
|       * editors/sed.c: Fix multiline [aic] commands. Make # an endline
|       comment for compatibility. Codespace reduction.
|       * tests/testcases: Cope with move to subdirectories.
|       * testsuite/sed/sed-aic-commands: Add.
|
|   text           data     bss     dec     hex filename
|   3772             16       0    3788     ecc editors/sed.o
|   4516             16       0    4532    11b4 editors/sed.o.bu
2001-11-10 10:49:42 +00:00
Eric Andersen e5d58c3dcc Mention that glibc-2.2 is supported 2001-11-10 10:46:42 +00:00
Eric Andersen 882cbcdfa1 more config.in entries from Giulio Orsero <giulioo@pobox.com>
with some minor edits by me.
2001-11-10 10:43:09 +00:00
Eric Andersen 7131213460 config.in features patch from Giulio Orsero <giulioo@pobox.com>
with some minor edits from me
2001-11-10 09:53:23 +00:00
Eric Andersen df23302cb5 Remove comments about 'make bzImage' 2001-11-07 07:50:08 +00:00
Eric Andersen 5abdaa9a16 Force main to always be included 2001-11-06 18:45:56 +00:00
Eric Andersen 3c513e3858 Fix spelling 2001-11-05 23:10:48 +00:00
Glenn L McGrath 0a25b35c66 Fix create list segfault 2001-11-03 08:29:35 +00:00
Glenn L McGrath 55b2deda08 Required for od and hexdump applets 2001-11-02 11:40:44 +00:00
Glenn L McGrath 60281118d0 Introduce od and hexdump applets 2001-11-02 11:39:46 +00:00
Matt Kraai b89637a037 New. 2001-10-31 16:36:23 +00:00
Matt Kraai 5447f17ef9 Remove completed task. 2001-10-31 16:36:02 +00:00
Matt Kraai f419855300 Mark as unsupported unless CONFIG_FEATURE_TAR_EXCLUDE is defined. 2001-10-31 16:18:48 +00:00
Matt Kraai bb0088e980 Make egrep only set REG_EXTENDED flag. 2001-10-31 16:16:31 +00:00
Eric Andersen 8fc0589777 *** empty log message *** 2001-10-31 11:45:10 +00:00
Eric Andersen f46999f8bc Fix location of Configure.help 2001-10-31 11:12:25 +00:00
Eric Andersen 1552ff7efb Move usage.h to include/usage.h 2001-10-31 11:07:12 +00:00
Eric Andersen ec07469a3e Patch from Aaron Lehmann <aaronl@vitelus.com>;
This diff does 2 things:

    1) removes an unnecessary function. saves 64 bytes on i386

    2) allows you to disable checking of mail (actually, it's now disabled
    by default). this would be a nice CML1 option, but for now it's a
    #(define|undef) in the C file like the other internal ash options.
    this saves an additional 352 bytes if you leave mail disabled.
2001-10-31 11:05:49 +00:00
Eric Andersen 31a0ece3a7 Add netstat applet, submitted by Bart Visscher <magick@linux-fan.com> 2001-10-31 11:00:46 +00:00
Eric Andersen 7d6829096d Add the run-parts applet submitted by Emanuele Aina
<emanuele.aina@tiscali.it>
2001-10-31 10:59:29 +00:00
Eric Andersen eaecbf33f7 Fixup some silly prototype warnings 2001-10-31 10:41:31 +00:00
Eric Andersen 69a20f0aca Patch from ASA <llb@udm.net.ru> to that source files
are properly passed their arguments.
2001-10-31 10:40:37 +00:00
Eric Andersen 6cf47a79ac Run parts applet by Emanuele Aina <faina.mail@tiscalinet.it> 2001-10-31 10:24:36 +00:00
Eric Andersen 2bc4dec7a1 Document CONFIG_RUN_PARTS, patch from Emanuele Aina <faina.mail@tiscalinet.it> 2001-10-31 10:21:17 +00:00
Eric Andersen a58f040a37 Add Gennady Feldman 2001-10-31 10:04:44 +00:00
Eric Andersen 85dd4b3b27 start-stop-deamon is done 2001-10-31 10:04:04 +00:00
Eric Andersen ccd96f1972 Patch from Charles Steinkuehler <charles@steinkuehler.net>
to properly handle extended regexps for egrep
2001-10-31 10:02:46 +00:00
Eric Andersen 3d61b10595 Major cleanup from Charles Steinkuehler <charles@steinkuehler.net>:
- Switched to getopt argument parsing
    - Added -f option to get fully qualified domain name
    - Fixed the -s (short) and -d (domain) options, which were not
      doing a gethostbyname lookup to get the FQDN before trying to
      separate the local and domain portions of the hostname.
    - Fixed probem with 'agressive setting' of the hostname...the
      previous busybox version would try to set the hostname if called
      with a non-option argument, or the -F option, even if another
      option (like -i or -s) was given.  This behavior does not match
      the net-tools hostname, which does not attempt to set anything if
      given a 'display' option, regardless of the presence/absence of
      the -F option or additional command line arguments.
    - When using a file to set the hostname, behavior now matches
      net-tools version...previous busybox version did not handle
      comments, and simply grabbed the first line from the file.
2001-10-31 09:59:57 +00:00
Eric Andersen 950d8b496f patch from vodz:
I reduce 148 bytes from start_stop_daemon.c code. Also reduced
    memory allocated.
2001-10-31 09:55:39 +00:00
Eric Andersen 2c669dd108 patch from Giulio Orsero <giulioo@pobox.com> 2001-10-31 09:54:29 +00:00
John Beppu ce22feea01 - fixed typos
- thinking about how to generate Configure.help...
2001-10-31 04:29:18 +00:00
Matt Kraai 3889078dbe Merge test suite. 2001-10-30 23:11:20 +00:00
Matt Kraai 999623e973 Use extended regular expressions when invoked as egrep (noted and initial
patch by Charles Steinkuehler).
2001-10-29 15:49:03 +00:00
Matt Kraai b5f2516e3f Add killall (noted by Giulio Orsero). 2001-10-29 15:22:42 +00:00
Eric Andersen 813d88cf78 As Aaron Lehmann just pointed out, I forgot a line... 2001-10-28 22:49:48 +00:00
Eric Andersen 4acf8f8481 Use error_msg() instead of fprintf(stderr, ...) 2001-10-28 09:36:48 +00:00
Eric Andersen 72f9a4277f Add in some (theoretical) uClinux support. Some init cleanups 2001-10-28 05:12:20 +00:00
Glenn L McGrath 9af363fe20 include unistd which provides off_t for the header and hence unarchive applets 2001-10-27 14:10:37 +00:00
Glenn L McGrath 7134d6581b Attempt to fix libc compiling error regarding off_t 2001-10-27 13:14:52 +00:00
Eric Andersen 8e392922b0 Be extra pedantic about printing the correct type for an address 2001-10-27 03:28:53 +00:00
Eric Andersen c265b17550 Wrap exclude_file() inside a #ifdef CONFIG_FEATURE_TAR_EXCLUDE block 2001-10-27 03:20:00 +00:00
Gennady Feldman 087bc82bb0 Fix up the configuration rules and update Libc5 piece for Syslogd. (copied code from logread.c) 2001-10-26 16:09:09 +00:00
Glenn L McGrath ee28362597 Menu entry for tar creation support 2001-10-25 18:37:41 +00:00
Glenn L McGrath 107c796e79 Recovery from previous commit 2001-10-25 15:01:10 +00:00
Glenn L McGrath 9f2f8540c5 rEcover from my previous commit 2001-10-25 14:59:48 +00:00
Glenn L McGrath e9fc781570 libunarchive, and recovery from my previous commit 2001-10-25 14:57:14 +00:00
Glenn L McGrath 633f153808 Move libbb/unarchive functions to ./archival/libunarchive 2001-10-25 14:53:50 +00:00
Glenn L McGrath ef0eab514d Recovering from my previous commit 2001-10-25 14:49:48 +00:00
Glenn L McGrath 0d2fb76c11 Modify applets to use libunarchive 2001-10-25 14:26:05 +00:00
Glenn L McGrath 95ebf618b7 *** empty log message *** 2001-10-25 14:18:08 +00:00
Eric Andersen 8eaa7b3698 Oops. I forgot pwd_group/config.in 2001-10-25 05:56:51 +00:00
Eric Andersen 2293b96f42 ignore .menuconfig.log 2001-10-24 20:01:04 +00:00
Eric Andersen 9ae7ebd0fd Ignore lxdialog 2001-10-24 19:59:38 +00:00
Matt Kraai 258bd3d971 Split true and false into separate applets. 2001-10-24 19:00:20 +00:00
Matt Kraai 3c2f27d9f1 Add CONFIG_FEATURE_TAR_EXCLUDE support. 2001-10-24 18:51:27 +00:00
Eric Andersen 99702ab221 Fix variable name -- was stuck at the old RPMUNPACK value. Doh! 2001-10-24 17:37:07 +00:00
Eric Andersen b78d9b56eb Oops. Fix capililization 2001-10-24 17:35:52 +00:00
Eric Andersen 1a10eec178 Fixup the location of pwd.h and grp.h 2001-10-24 17:19:38 +00:00
Eric Andersen bfebd35bea Fix missing BB_VER defines 2001-10-24 16:51:39 +00:00
Eric Andersen a49b025b19 Oops. As Aaron Lehmann <aaronl@vitelus.com> just noticed,
I forgot to add procps to the SUBDIR list
2001-10-24 08:24:41 +00:00
Eric Andersen a3483db55f Patch from vodz:
1) complete true: $ > /tmp/tmpfile
    2) the builtin pwd now does not unwrap symlinks
    3) reduce 680 bytes
2001-10-24 08:01:06 +00:00
Eric Andersen 3cd2760ba1 Fixup the new buildsystem a bit. 2001-10-24 07:58:02 +00:00
Eric Andersen b36e684fd7 Ignore generated files 2001-10-24 06:53:33 +00:00
Eric Andersen 28593a085b ignore generated files 2001-10-24 06:50:42 +00:00
Eric Andersen ca38a29c81 A couple of leftovers 2001-10-24 06:48:42 +00:00
Eric Andersen 9b5a953a98 Add in a mostly content free config help file 2001-10-24 06:33:31 +00:00
Eric Andersen 4bcdd72142 Oops. Forgot these.... 2001-10-24 05:26:42 +00:00
Eric Andersen bdfd0d78bc Major rework of the directory structure and the entire build system.
-Erik
2001-10-24 05:00:29 +00:00
Eric Andersen 9260fc5552 Accomodate older glibc, which also lacks the module syscalls 2001-10-24 00:44:11 +00:00
Matt Kraai 1c9cebc8df Fix empty line substitutions (noted by Joshua Hudson). 2001-10-23 21:18:59 +00:00
Matt Kraai 8470b9a85c Fix empty line substitutions (noted by Joshua Hudson). 2001-10-23 21:12:07 +00:00
Glenn L McGrath 6ccdd8c122 Abort if scripts return value != 0 2001-10-23 17:52:28 +00:00
Matt Kraai c2e5b977ab Add ttylinux. 2001-10-19 15:33:45 +00:00
Eric Andersen 68ca35c90f Add slackware 8 to list 2001-10-19 06:32:15 +00:00
Eric Andersen 9c93721ea5 Add mindi linux 2001-10-19 00:46:06 +00:00
Eric Andersen d63dee4019 Add an option to make the shells not advertise their busybox nature 2001-10-19 00:22:23 +00:00
Eric Andersen f4c208937c Remove the now unused ARITH_* defines
-Erik
2001-10-19 00:08:17 +00:00
Eric Andersen c2af1ee036 Commit the start-stop-daemon applet. This was contributed by David
Kimdon <dwhedon@gordian.com> on october 7th -- the day I was fired from
Lineo.  So it seems I totally forgot about this patch until now.
Sorry about that David!
2001-10-18 19:33:06 +00:00
Matt Kraai bcca3317b5 Return NULL if EOF is encountered before terminating_string. 2001-10-18 17:04:22 +00:00
Matt Kraai a7512d74fa Process extra empty lines correctly. 2001-10-18 17:03:59 +00:00
Matt Kraai 3dd4f5ed69 Remove xmalloc calls. 2001-10-18 15:08:30 +00:00
Eric Andersen a0f0ae5a7a Revert that change. As Matt Kraai rightly points out,
this is not a bug.  What I was I thinking when I committed
this.  Doh!
2001-10-18 06:04:23 +00:00
Eric Andersen 74400ccfd0 Scrub up some function prototypes.
-Erik
2001-10-18 04:11:39 +00:00
Eric Andersen 8acbf1d307 Make mount default to using /proc/filesystems to avoid
ever trying to mount a nodev filesystem.
 -Erik
2001-10-18 04:10:22 +00:00
Eric Andersen 11fdb8a4c7 Fix a nasty bug with variable name shadowing 2001-10-18 04:04:34 +00:00
Eric Andersen 1bf25f0307 Patch from Stefan Soucek <ssoucek@coactive.com> to
ignore extra empty lines in fgets_str
2001-10-18 03:20:41 +00:00
Glenn L McGrath 4bef7b4186 unarchive function changed to support both exclude and include lists, applets that use unarchive changed to match. 2001-10-13 19:43:46 +00:00
Glenn L McGrath 051eee6ed3 Reverse part of previous change.... i think it was the wrong approach... im lost 2001-10-13 07:11:03 +00:00
Glenn L McGrath d642a67928 Match subdirectories of included/excluded files 2001-10-13 06:54:45 +00:00
Glenn L McGrath 527880e5cf match exclude/include names with trailing '/' 2001-10-13 06:53:34 +00:00
Glenn L McGrath b5937d3eea Use fnmatch() to compare excluded/included files 2001-10-13 06:21:32 +00:00
Glenn L McGrath 0e766183ee Superficial changes to make the exclude/include code easier to understand 2001-10-13 05:03:29 +00:00
Matt Kraai f86bbfaddd Fix tar segfault when include list is empty and exclude list is not. 2001-10-12 19:00:15 +00:00
Glenn L McGrath 9b2589dafd Cleanup memory usage properly 2001-10-08 13:10:12 +00:00
Glenn L McGrath dfa7b0eff6 Free some variables after use 2001-10-08 08:22:48 +00:00
Glenn L McGrath 30f68908ef Another part of Stafan's latest patch, when replacing a pre-existing package set its status correctly. 2001-10-06 02:40:20 +00:00
Glenn L McGrath f28d819554 status_package_num should refer to package not status.
Only initialise a new entry in the status hashtable if it really is a new entry.
2001-10-06 02:27:36 +00:00
Glenn L McGrath 3550753445 Remove duplicate tftp -l option help 2001-10-05 10:11:28 +00:00
Glenn L McGrath 1d098cefe2 Use wfopen instead of fopen & error_msg, saves 64 bytes 2001-10-05 05:24:19 +00:00
Glenn L McGrath bf265daa47 Use xfopen, saves 32 bytes ! 2001-10-05 05:03:14 +00:00
Glenn L McGrath ad117d8a21 Apply Magnus Damm's patch, adds tftp blocksize support, and some cleanups. 2001-10-05 04:40:37 +00:00
Glenn L McGrath 24e2833cdf Initial support for for bunzip2....
This code could be improvemed by
 1) supporting more options,
 2) Creating a shared crc table with gunzip, or perhaps generated on the fly.
 3) Removing any remaining unneccessary code (e.g. if (noisy))
2001-10-05 03:48:57 +00:00
Glenn L McGrath 2e772edacf Change extraction/list code to use common unarchive code. 2001-10-05 02:58:48 +00:00
Matt Kraai 4c557bf576 Invert FILEUTILS_PRESERVE_SYMLINKS into FILEUTILS_DEREFERENCE. 2001-10-05 01:35:10 +00:00
Matt Kraai 54a992d81e Fix BB_FEATURE_MTAB_SUPPORT test (report and patch by Magnus Damm). 2001-10-04 15:23:34 +00:00
Eric Andersen b0a0fc8944 Add Magnus Damm and fix alpha sorting 2001-10-04 09:33:40 +00:00
Glenn L McGrath a8412dbf39 Fixes with help from Stefan, Typo in prerm script, and when reinstall a package the old packages status was getting overwritten. 2001-10-04 05:22:42 +00:00
Eric Andersen fd35de564e Always enable BB_TEST when BB_ASH, BB_LASH, or BB_MSH is enabled 2001-10-03 23:37:24 +00:00
Eric Andersen 371ca19f53 Look for either "init" or "linuxrc" processes 2001-10-03 21:26:12 +00:00
Eric Andersen f0a4ac8216 Patch from Magnus Damm <damm@opensource.se> to avoid lash hanging
on serial ports
2001-10-03 11:23:42 +00:00
Glenn L McGrath 35636540ea Extract control.tar.gz and data.tar.gz unconditionally, another one picked up by Stefan 2001-10-03 03:10:35 +00:00
Eric Andersen 5c72104a85 Fix large file support -- 2+ gig files should now actually
work this time...
 -Erik
2001-10-02 07:58:23 +00:00
Matt Kraai c9fc633f9e Use port 37 by default. 2001-10-01 17:52:14 +00:00
Matt Kraai 524fcb9e01 Use xgethostbyname instead of gethostbyname (found by Erik Andersen). 2001-10-01 17:50:25 +00:00
Glenn L McGrath 95bfe631a4 Fix return status, picked up by Stefan 2001-09-29 03:34:38 +00:00
Eric Andersen 63ae66198d use the pedantically correct compiler for preprocessing 2001-09-26 06:20:54 +00:00
Matt Kraai b67adb0d83 Add Cachier. 2001-09-24 22:44:52 +00:00
Glenn L McGrath c5bd149261 List full path instead of relative path if prefix is specified (this was supposed to be in last patch) 2001-09-24 18:34:06 +00:00
Glenn L McGrath dece3c5684 The <package>.list file was prepending "./" to the files, fixed that.
Also fixed a very silly error by me when running postinst (remember to use the variable BEFORE its freed)
2001-09-22 04:16:55 +00:00
Glenn L McGrath b8f5adb64f Dont free everytime getline() is used, fix from Stefan Soucek 2001-09-22 03:24:07 +00:00
Matt Kraai 3be34309e3 Fix tftp usage information (closes: #1216). 2001-09-21 14:42:30 +00:00
Eric Andersen f8f6e624bb Eliminate ldconfig which is no longer built by
default (or needed) with uClibc.
2001-09-21 06:05:35 +00:00
Glenn L McGrath 48cc89b738 Fix to make preinst run when required, from Stefan Soucek 2001-09-21 05:07:47 +00:00
Glenn L McGrath e73866181f Implement dpkg -l option, from Stefan Soucek (slightly modified) 2001-09-21 04:30:51 +00:00
Tim Riker 4c67c596d1 closes bug#1215? 2001-09-16 02:00:09 +00:00
Manuel Novoa III 8d0afde412 Commit my changes to xxreadtoken() to reduce code size. Also set defines
so that the table implementations of copynode, calcsize, and cmdtxt are
used.  Hopefully this will result in wider testing.  ;-)  If it breaks,
just unset the appropriate defines.
2001-09-11 01:14:02 +00:00
Manuel Novoa III 6a9d1f652b Commit my changes to arith.c which fixed a couple of bugs and decreased
code size.  Please read the TODO comments regarding accessing shell
variables from the arith() funciton.
2001-09-11 01:11:31 +00:00
Eric Andersen f6ecaccf92 Fix my email address. 2001-09-08 20:52:33 +00:00
Eric Andersen 886b84211e Lineo is no longer sponsoring busybox 2001-09-08 20:47:19 +00:00
Eric Andersen 5bb1677f1d define IFS_BROKEN 2001-09-06 18:00:41 +00:00
Eric Andersen 88cec25e99 Patch from vodz to make ash cope with leading redirections
(i.e. '2>/dev/null ls rubbish') will now work.
2001-09-06 17:35:20 +00:00
Eric Andersen 1644db9a2b Two patches from Magick <magick@linux-fan.com>:
1st makes init smaller, and fixes a bug with AskFirst. Reading from
    /dev/null gives EOF.
    2nd makes init run the command's in the order of inittab, as in
    FIFO instead of LIFO.
2001-09-05 20:18:15 +00:00
Eric Andersen b9408504f5 Another fix from vodz 2001-09-05 19:32:00 +00:00
Eric Andersen 3b1525e444 Don't automount things as "usbdevfs" -- patch from
Ethan Benson <erbenson@alaska.net>
2001-09-03 16:49:25 +00:00
Matt Kraai 1350666498 Add -p support. 2001-08-29 21:18:47 +00:00
Matt Kraai 5171bf6d40 SUSv2 specifies that if the extension is identical to the basename, it
should not be removed.
2001-08-29 20:19:29 +00:00
Eric Andersen dcbca62e89 Standard typing (u_int16_t instead of u16, u_int32_t instead
of u32, etc) cleanups from Laurence Anderson <laurence@zxmail.com>
2001-08-29 19:02:26 +00:00
Matt Kraai 5078919981 Use the correct buffer when calling dirname, improve an error message, and
plug some memory leaks.  Patch by Laurence Anderson.
2001-08-28 22:57:38 +00:00
Eric Andersen 28d0ac13d1 Add "DutNux" 2001-08-27 19:22:44 +00:00
Matt Kraai 91631011cc Remove traces of rpmunpack (patch by Laurence Anderson). 2001-08-27 18:55:10 +00:00
Eric Andersen 863a3e15d6 patch from vodz -- route cleanup to display all route entries 2001-08-27 17:57:27 +00:00
Matt Kraai ab3d839ef4 Add support for `busybox --help APPLET' by Vladimir Oleynik. 2001-08-27 17:19:38 +00:00
Matt Kraai 861e624e15 Fix ash exec (noted by Arne Bernin). 2001-08-27 15:08:57 +00:00
Matt Kraai 449377aa6a Fix invocation of `-/bin/sh' (bug #1209). 2001-08-27 15:02:32 +00:00
Matt Kraai 80f6d55836 Eliminate improper consts and allow standard version to override. 2001-08-24 20:35:45 +00:00
Matt Kraai ac20ce1924 Canonicalize dirname(3) behavior. 2001-08-24 19:51:54 +00:00
Matt Kraai 2a953aed38 Fix a memory leak if parent directory creation failed. 2001-08-24 19:07:31 +00:00
Matt Kraai a0065d5955 Fix s/[/]// handling (noted by Dumas Patrice). 2001-08-24 14:45:50 +00:00
Eric Andersen 31b35a16e0 Merge with the stable branch 2001-08-23 22:05:55 +00:00
Eric Andersen a3c8481a33 A patch from Jaspreet Singh <jsingh@somanetworks.com>
fixing both a segfault and cosmetic bug in route
2001-08-23 22:05:33 +00:00
Eric Andersen b76cb68979 A patch from Shu-Hao Chang <shuhao_chang@trend.com.tw> to
fixed sed handling of multiple -e commands
2001-08-22 05:58:16 +00:00
Eric Andersen 1071ccfd25 Force BB_FEATURE_NEW_MODULE_INTERFACE and BB_FEATURE_OLD_MODULE_INTERFACE
to be mutually exclusive
2001-08-22 05:41:57 +00:00
Eric Andersen c0f9d0dce7 Add #include <sys/param.h> to ensure PATH_MAX is defined 2001-08-22 05:35:39 +00:00
Eric Andersen 5d60a46269 Fix a warning and potential segfault in lash when BB_FEATURE_CLEAN_UP
is enabled
2001-08-22 05:32:24 +00:00
Eric Andersen ac5dbd193b Fix an _old_ interface problem with a never-used feature. 2001-08-22 05:26:08 +00:00
Eric Andersen 59443965ad Scrub things and ditch uint64_t and use a custom type name
to avoid C lib compatibility problems.
2001-08-22 05:06:29 +00:00
Eric Andersen d36cdd25a5 Bump version to 0.61.pre 2001-08-22 04:16:36 +00:00
Eric Andersen 39eb040757 Patch from Rodney Brown <RDBrown@mira.net>, shrinking 1.5k
from gzip by careful optimization.  Appears to work just fine
(I've tested the changes on x86, ARM, and powerpc).
2001-08-22 04:15:47 +00:00
Eric Andersen a07c902648 Make it compile with uClibc 2001-08-22 00:10:00 +00:00
Eric Andersen 75220b55ff dfp might be used uninitialized. NULL it. 2001-08-21 23:36:32 +00:00
Eric Andersen 994c6ffd3b Disable the tinylogin apps by default. 2001-08-21 23:34:10 +00:00
Eric Andersen c61804ed59 Fix dos2unix compile problem with certain glibc versions 2001-08-21 22:34:05 +00:00
Eric Andersen f349e978c4 Initial merge of all tinylogin applets that do not require crypt.
There is some optimization that can be done to better use libbb in
these applets.  There is also redundancy between stty and getty which
could be eliminated.
 -Erik
2001-08-21 16:18:59 +00:00
Matt Kraai a3e4f455ac Fix a problem with unsatisfied backrefs (noted by Martin Bene). 2001-08-20 21:21:06 +00:00
Eric Andersen 54eceffcae some minor wording changes 2001-08-20 17:48:17 +00:00
Eric Andersen 76fa8ea790 Apply Glenn's tftp rewrite 2001-08-20 17:47:49 +00:00
Glenn L McGrath bac490fe53 Fix version comparision bug 2001-08-15 11:25:01 +00:00
Matt Kraai b6ec78161d Log all messages from a single connection, not just the first. Patch from
matthias@corelatus.com, approved by Gennady Feldman <gena01@cachier.com>.
2001-08-14 17:32:23 +00:00
Matt Kraai 0a68590314 Rewritten by Manuel Novoa III. 2001-08-14 17:10:08 +00:00
Manuel Novoa III c639a35f50 I stupidly forgot one level of pointer indirection in the cmdtxt(), calcsize(),
and copynode() table implementations.  Commit the fix but keep them disabled
until others check them out.  Uncomment "//#define CMDTXT_TABLE",
"//#define CALCSIZE_TABLE", and "//#define COPYNODE_TABLE" to try them out.
Saves over 600 bytes on i386.
2001-08-12 17:32:56 +00:00
Eric Andersen dd9173c07f Fix a merging error 2001-08-10 21:11:56 +00:00
Manuel Novoa III 16815d4b45 A few bug fixes and significant size savings. Combined effort of
Vladimir N. Oleynik dzo@simtreas.ru, Aaron Lehmann aaronl@vitelus.com,
and myself.
2001-08-10 19:36:07 +00:00
Eric Andersen 80dd0863e2 Small size optimization from Aaron Lehmann 2001-08-10 18:42:04 +00:00
Eric Andersen e20b7d844a Fix stupid grammar error. 2001-08-10 15:22:35 +00:00
Matt Kraai a7cecbc917 Commit Vladimir's simplify_path. 2001-08-10 15:05:27 +00:00
Manuel Novoa III 4fb0b51703 This corrects the _really_poor_ implementation of "broadcast +" handling
by ifconfig that someone had submitted.  It fixes 1 bug, gets rid of the
excessive bloating of a structure that is used in a static const array,
and removes the implicit struct copys by keeping only the int type needed.
It also turns this into a configurable feature (off by default).
2001-08-10 06:02:23 +00:00
Matt Kraai 6c4250c0dc Remind people to enable RPC support when using NFS mount and uClibc (thanks
to David Douthitt).
2001-08-09 21:07:10 +00:00
Matt Kraai d0b5be6da8 Remove BB_SH define entirely. 2001-08-09 21:00:15 +00:00
Matt Kraai 2338d3176b Use ferror(3) to check for errors, rather than inspecting errno. Thanks to
David Douthitt for reporting, and shame on me for writing such crappy code.
2001-08-06 16:09:09 +00:00
Matt Kraai 063c1f54ea Simplified version checking. 2001-08-06 14:18:08 +00:00
Matt Kraai 69edfecfb9 Add support for underscores in variable names. 2001-08-06 14:14:18 +00:00
Glenn L McGrath b373a8d0ca Fix exclude list handling 2001-08-04 05:28:29 +00:00
Eric Andersen 0b7d70c822 Fix up some silly messups with the debian packaging, and a dumb
bug with chroot.  I've had the package uploaded but perms set to
000, so I am going to re-tag things and re-cut the release.  Folks
who pulled from CVS in the last 30 minutes with just have to cope.
 -Erik
2001-08-02 20:56:16 +00:00
Matt Kraai 8aa0b62a88 Fix misspelling of `stabilize'. 2001-08-02 20:34:24 +00:00
Eric Andersen 9e6089ee0f Ok, here we go... 2001-08-02 19:31:08 +00:00
Matt Kraai c9dd5f945b Commit NMU changelog. 2001-08-02 15:12:16 +00:00
Eric Andersen be0c36009a More libc5 fixups
-Erik
2001-08-02 10:55:32 +00:00
Eric Andersen 23b1e5c7df Some libc5 cleanups 2001-08-02 09:58:41 +00:00
Eric Andersen 879d6c85af make_directory used mode as if it were an signed entity, but in fact
it was a mode_t which is unsigned.  Fix it to be signed...
 -Erik
2001-08-02 09:58:19 +00:00
Eric Andersen 8a915880e7 Teach libc5 about realpath
-Erik
2001-08-02 09:55:58 +00:00
Eric Andersen 95b520110d Teach libc5 what a sighandler_t is
-Erik
2001-08-02 09:52:40 +00:00
Eric Andersen deba6dea03 multibuild.pl saves us again. unix2dos requires that dos2unix
be enabled.
 -Erik
2001-08-02 09:21:17 +00:00
Eric Andersen 46bf7de5f6 Ok, if no shell is enabled, don't include any of the SH_IS_<name>
options or the build will fail
 -Erik
2001-08-02 08:48:03 +00:00
Eric Andersen ff9b4a8981 Scrub away the last leftovers from BB_FEATURE_<shell>. Good thing
for multibuild.pl -- I would have missed this stupid mess otherwise.
 -Erik
2001-08-02 08:42:58 +00:00
Eric Andersen fdbac35b33 Patch from Robert J. Osborne <rj@resourceinternational.com> that fixes
a bug in vi where the beginning of the text space was not checked
before dot is decremented for delete and escape sequences on an empty
file.
2001-08-02 05:26:41 +00:00
Eric Andersen 842757dc96 Oops. I forgot to commit this part of vodz' patch. 2001-08-02 05:18:55 +00:00
Eric Andersen 3450636169 Latest patch from vodz. Adds a check for divide by zero in the posix
math suport, cleaner math syntax error checking, moves redundant signal
string tables (from kill and ash) into libbb and provides a few
cleanups elsewhere.
2001-08-02 05:02:46 +00:00
Matt Kraai 2d91deba45 Allow multiple shells to be enabled. 2001-08-01 17:21:35 +00:00
Eric Andersen 0034443140 Fix behavior of grep -lc to match GNU grep. SuS2 is ambiguous
on the correct behavior, so acting like GNU grep seems best
 -Erik
2001-07-31 23:18:49 +00:00
Eric Andersen af6b40a1ea Silence some silly warnings 2001-07-31 22:53:36 +00:00
Eric Andersen f672c9e62f Silence a silly warning 2001-07-31 22:51:49 +00:00
Eric Andersen bb9579ffc3 Make formatting match GNU ls (we were including a spare ' ')
-Erik
2001-07-31 22:43:50 +00:00
Eric Andersen fa1c5aac51 Fix the let builtin (so we can close bug #1196) and remove the
nonstandard exp builtin.
 -Erik
2001-07-31 21:38:23 +00:00
Matt Kraai 73f6a1b058 Always write record counts to stderr. 2001-07-31 21:02:19 +00:00
Eric Andersen 221b2ea6c4 I just wrote up a simple pidof applet, closing bug #1197
-Erik
2001-07-31 19:06:07 +00:00
Matt Kraai 9a53feaa76 Give credit to Adam Slattery. 2001-07-31 16:44:16 +00:00
Eric Andersen 57c82fe7c4 I think this should be the final changelog update...
-Erik
2001-07-31 16:11:41 +00:00
Matt Kraai 51038a3f42 Don't save and restore readonly flag if BB_FEATURE_VI_READONLY isn't enabled. 2001-07-31 15:01:12 +00:00
Eric Andersen 74bcd16425 This incorporates Posix math support into ash. The Posix math support
was written by Aaron Lehmann <aaronl@vitelus.com> for busybox.  This
patch makes a few trivial changes to Aaron's code so that it can be
used (in theory) by the other shells as well...
 -Erik
2001-07-30 21:41:37 +00:00
Eric Andersen dc6647201d Simplify/clarify the shell dependant bit of Config.h 2001-07-30 19:33:00 +00:00
Eric Andersen c126f8ffb6 This depmod script will create a modules.dep file, just like the depmod
binary from modutils.  This one, however, can be run on the _host_
system (need not be run on the target) and is fully cross platform, so
even if your target is ARM or powerpc or whatever, this will still
work.  When used to support the new modprobe applet, this allows
busybox to fully supplant modutils for architectures supported by
busybox insmod.
 -Erik
2001-07-30 19:32:03 +00:00
Eric Andersen 3555fd006e Fix up the sample inittab entry per what is current.
-Erik
2001-07-30 19:28:33 +00:00
Matt Kraai 13cb842773 Rework option handling to save space. 2001-07-30 14:43:20 +00:00
Matt Kraai 547e102082 Preserve whether or not the line was previously altered when running a
subst command (discovery and patch by Jim Gleason).
2001-07-30 14:05:58 +00:00
Glenn L McGrath 7499918f30 If filename is a '-' then read from stdin to stdout 2001-07-30 04:48:50 +00:00
Glenn L McGrath 14d7ea460f Note my uuencode work 2001-07-29 06:07:35 +00:00
Glenn L McGrath b6071b6341 Fix permisions when reading from stdin 2001-07-29 06:04:26 +00:00
Glenn L McGrath eba260587a Fix broken logic when wraping encoded data into rows, also simplifies it a bit 2001-07-29 05:47:33 +00:00
Glenn L McGrath 4e664ac51d The src buffer size has to be a multiple of 3 (as i noted, but didnt do). 2001-07-28 21:34:25 +00:00
Glenn L McGrath 089decab65 Rewrite based on wget uuencode function.
Saves aprox. 200 Bytes and in future can use common code between
this and wget if BB_FEATURE_WGET_AUTHENTICATION is defined.
2001-07-28 21:06:13 +00:00
Eric Andersen 220238305f PArtial Changelog update. I'm still on vacation (I'm at a campground
near the Grand Teton Mountains in Montana at the moment and my
connection is terribly slow) so this is a partial update only,
 -Erik
2001-07-28 16:35:51 +00:00
Matt Kraai 26eeb0c9da Shorten static package description. 2001-07-26 14:45:21 +00:00
Matt Kraai f9d6aa0a86 Rename dirname variable to pathname to eliminate namespace conflict. 2001-07-26 14:26:53 +00:00
Russ Dill 4db35647dd char renamed can never be negative on ARM (rp->renamed[i] != EMPTY) 2001-07-26 05:58:40 +00:00
Eric Andersen 2835efe3da Note that m68k is supported 2001-07-25 16:58:58 +00:00
Eric Andersen 1b06419e60 Cleanup some warnings and a really obvious bug.
-Erik
2001-07-25 07:23:38 +00:00
Eric Andersen 655584b07a This fixes dos2unix and unix2dos so they behave as expected. dos2unix
was broken in the 0.52 release, and unix2dos was pretty lame...
 -Erik
2001-07-25 07:22:55 +00:00
Glenn L McGrath 6c7ac21f3a Update my email address and applets 2001-07-24 02:46:35 +00:00
Glenn L McGrath 096b151f76 note dpkg rewrite 2001-07-24 02:41:06 +00:00
Matt Kraai 439e3df653 Add support for devfs device names. 2001-07-23 14:52:08 +00:00
Eric Andersen 0139ca92ff An initial modproble implementation. Quite suboptimal still,
but it does work...
2001-07-22 23:01:03 +00:00
Eric Andersen 8d79ce8320 Some patches to make dietlibc work... 2001-07-22 23:00:15 +00:00
Eric Andersen 20aab260e2 Some adjustments, mostly from David McCullough <davidm@lineo.com> to
make busybox be more uClinux friendly.  I also adjusted Config.h for
uClinux so it will automagically disable apps the arn't going to
work without fork() and such.
 -Erik
2001-07-19 22:28:02 +00:00
Matt Kraai 0382eb8865 The -P prefix should only be prepended to filenames which are not explicitly
specified.
2001-07-19 19:13:55 +00:00
Matt Kraai e92895c038 Note that wget fix is important. 2001-07-19 17:46:17 +00:00
Matt Kraai c8eae6684b The directory name should only be prepended if one was specified. 2001-07-19 17:29:38 +00:00
Matt Kraai c1cda4a609 Add a RELEASE_BB_BUFFER macro and use it to fix a memory leak in syslogd.c
(noted by Adam Slattery).
2001-07-19 15:00:14 +00:00
Glenn L McGrath 81108e7653 Cleanup (most) memory leaks 2001-07-19 12:15:13 +00:00
Glenn L McGrath c3fbec73fb Change read_package_field interface, and rewrite using low level functions
Fixes for a few bugs that have crept into dpkg in the last few days
2001-07-18 15:47:21 +00:00
Glenn L McGrath 8d3b0497a4 Fix extract_archive so it doesnt mangle filenames, dont try and extract "./" and strip leading "./" on other files 2001-07-18 13:22:44 +00:00
Glenn L McGrath 778041f8d1 Use the unofficial -C instead of -c to --configure a package, -c conflicts with another dpkg command 2001-07-18 05:17:39 +00:00
Glenn L McGrath b9e4ce99d8 Update dpkg usage 2001-07-18 05:16:31 +00:00
Glenn L McGrath ed4492a697 More feedback to user 2001-07-18 05:03:49 +00:00
Glenn L McGrath 7b0241579c Be more verbose when configureing package, minor changes 2001-07-18 04:33:31 +00:00
Glenn L McGrath 6fc92a506a Fail silently on failure to read tar header, its unfortunate that many tar implementations must be adding unwanted crap to the end of their archives.
It makes error reporting here more trouble than its worth
2001-07-18 03:23:10 +00:00
Glenn L McGrath 4cdc607f72 Use xfopen to abort on error to prevent segfaulting later. 2001-07-18 03:13:49 +00:00
Eric Andersen bc4c030023 Cleanup from vodz 2001-07-17 01:14:06 +00:00
Eric Andersen 044228d5ec This is vodz' latest patch. Sorry it took so long...
1) ping cleanup (compile fix from this patch already applied).
    2) traceroute call not spare ntohl() now (and reduce size);
    3) Fix for functions not declared static in insmod, ash, vi and mount.
    4) a more simple API cmdedit :))
    5) adds "stopped jobs" warning to ash on Ctrl-D and fixes "ignoreeof" option
    6) reduce exporting library function index->strchr (traceroute), bzero->memset (syslogd)
2001-07-17 01:12:36 +00:00
Glenn L McGrath 51ded05b3b enum entry for unarchive to be used by tar 2001-07-14 12:38:55 +00:00
Glenn L McGrath a868ec89e8 Allow the unarchive() extract_list variable to be NULL, meaning extract all 2001-07-14 08:49:53 +00:00
Glenn L McGrath 58a5bd187d Tolerate fields with no data, e.g. "Depends: " 2001-07-14 06:25:54 +00:00
Matt Kraai 06ef16563b Allow featureless ping to compile, and featureful ping to shrink
(by Adam Slattery).
2001-07-13 20:56:27 +00:00
Glenn L McGrath ccd65c9be6 Total rewrite, uses hash tables for speed and low memory use. 2001-07-13 18:35:24 +00:00
Glenn L McGrath 3d46224b78 Return NULL if file doesnt open in deb_extract 2001-07-13 18:16:57 +00:00
Glenn L McGrath cfeb08a193 Make sure there is a trailing '\0' when extracting to buffer. 2001-07-13 17:59:48 +00:00
Glenn L McGrath 5e66a26eaa Dont setvbuff in here, must be called just after stream is initialised, glibc tolerates using it later, uclibc doesnt 2001-07-13 06:51:56 +00:00
Glenn L McGrath 26a0d9a945 Call setvbuf from here isntead of gz_open for compatability with uclibc 2001-07-13 06:49:18 +00:00
Glenn L McGrath b028e08d35 Move setvbuf calls from gz_open() to calling functions, setvbuf is only supposed to be called prior to opening the stream, glibc tolerates later use, uclibc doesnt. 2001-07-13 06:43:03 +00:00
Eric Andersen 7467c8d3b6 Patch from vodz:
Changed email address
    cmdedit API change
    optimizations for traceroute and md5sum
    added a new shared create_icmp_socket() function
2001-07-12 20:26:32 +00:00
Matt Kraai f69bfc76fa Allow assignments in the export and readonly commands. 2001-07-12 19:39:59 +00:00
Matt Kraai ab6526c8b3 Remove debugging statement. 2001-07-12 18:44:34 +00:00
Glenn L McGrath 3e94f729a5 Quiet mode, sometimes error messages arent wanted 2001-07-12 10:24:57 +00:00
Glenn L McGrath c127008840 Allow unarchive to redirect stdout (tobe used by dpkg applet) 2001-07-11 17:32:14 +00:00
Glenn L McGrath 481d19b38e Fix bug where it wasnt returning the last line of a multiline field 2001-07-11 15:43:03 +00:00
Glenn L McGrath daf0b78e1a Reverse part of my previous changes 2001-07-11 15:32:52 +00:00
Glenn L McGrath 93febe672a free coniditionally, just to make it play nice with dmalloc which is incompatable with standard free() 2001-07-11 07:25:01 +00:00
Eric Andersen c59fa37d40 Make the obj's generated from libbb/unarchive.c depend on the
Makefile, so things like setting DODMALLOC will cause them to
be recompiled
 -Erik
2001-07-11 07:24:05 +00:00
Glenn L McGrath 248c57ca43 minor dmalloc inspired cleanups 2001-07-11 07:22:17 +00:00
Glenn L McGrath 59e50f634a Unpack the filename not the package name 2001-07-11 03:30:11 +00:00
Eric Andersen 8c145dc31b Fix a stupid search and replace bug... 2001-07-10 16:57:09 +00:00
Eric Andersen 55522080c6 Patch for md5sum from Aaron Lehmann <aaronl@vitelus.com> to slim
it down a little bit.
2001-07-10 16:31:29 +00:00
Eric Andersen 5c58d283bb A traceroute applet from vodz. This could probably be slimmed down,
but will do for now...
2001-07-10 16:29:00 +00:00
Eric Andersen 91b84603d3 Cleanup from vodz 2001-07-10 16:25:34 +00:00
Eric Andersen 2a46634617 Make the rev be 0.53pre... 2001-07-10 15:24:16 +00:00
Matt Kraai 5710f9f690 Read 20 512-byte blocks at a time (like GNU tar). 2001-07-10 15:05:39 +00:00
Glenn L McGrath 654944fc36 Reverse my previous change, still cant compile with dmalloc 2001-07-10 14:33:22 +00:00
Glenn L McGrath c3d2f1287e When compiling unarchive objects link to $(LIBRARIES) incase using dmalloc 2001-07-10 14:04:30 +00:00
Matt Kraai 6199fa90e5 Update version number to 0.53pre. 2001-07-10 13:57:30 +00:00
Eric Andersen 6248355c6f vodz' latest update to ash.c 2001-07-10 06:09:16 +00:00
Eric Andersen 5a4a46a251 Patch from vodz to support 'tr a-z A-Z' syntax. 2001-07-09 21:32:29 +00:00
Eric Andersen f52947ba71 Fix the spec file so it works on redhat systems. At least I think
it will work on redhat.  At least it now works on my Debian box...
 -Erik
2001-07-09 18:34:12 +00:00
Eric Andersen aa64ba459f Minor working update 2001-07-07 16:36:29 +00:00
Eric Andersen ceece81414 Move a bit more to the old news section 2001-07-07 09:38:30 +00:00
Eric Andersen d0e5f86a10 Enable APPLETS_ALWAYS_WIN 2001-07-07 09:37:28 +00:00
Eric Andersen d0b4d3dabf Typo fix. 2001-07-07 08:47:21 +00:00
Eric Andersen 7b2dfc623b Move some stuff to the oldnews area 2001-07-07 08:44:25 +00:00
Eric Andersen 40ecf7da88 Update web page... 2001-07-07 08:25:03 +00:00
Eric Andersen 5c3070b29c Update changelogs 2001-07-07 08:13:27 +00:00
Eric Andersen 807bda4a24 Minor update to include file ordering 2001-07-07 08:13:02 +00:00
Eric Andersen 7cd5075908 This is out of date, and Glenn tells me this can be safely deleted.
To be useful on Hurd will really require the new build system...
 -Erik
2001-07-07 05:25:12 +00:00
Eric Andersen 48dfc56b4a This patch from Fabio Ferrari <fabio.ferrari@digitro.com.br> enables
"broadcast +" for deriving the broadcast address automagically.
2001-07-07 05:19:52 +00:00
Eric Andersen d9d75555ba Remove rpmunpack 2001-07-07 04:43:56 +00:00
Eric Andersen 9137f2a2d1 This is obsolete -- replaced by rpm2cpio 2001-07-07 04:33:16 +00:00
Eric Andersen 5a071bcbf2 Avoid a segfault (detected by Fabio Ferrari
<fabio.ferrari@digitro.com.br> in the wget applet) when
concat_path_file() or last_char_is() were fed a NULL.
 -Erik
2001-07-07 04:27:35 +00:00
Eric Andersen 934c8ecb88 Fix sh.c so it works with DMALLOC 2001-07-07 04:24:28 +00:00
Eric Andersen 1c03923b0b Add in a shell tagline (per lash/hush behavior) to make it easier
to know which shell is in use.  Add in 'help' to list available
builtins, and fixup msh so it can do STANDALONE_SHELL.
 -Erik
2001-07-07 00:05:55 +00:00
Eric Andersen b7e6f13b3c Some minor updates. Bump version number in preparation for release.
-Erik
2001-07-07 00:03:00 +00:00
Eric Andersen 0279505e8c Update the debian packaging stuff 2001-07-06 20:36:57 +00:00
Eric Andersen d28cb03819 Forgot this 2001-07-06 19:28:49 +00:00
Matt Kraai c308847274 Remove redundant initialization of lfile to reduce executable size by
8192 bytes (noted by Mike Castle).
2001-07-06 19:28:07 +00:00
Eric Andersen 00e56ada9c Let people select their shell at compile time. 2001-07-06 19:24:27 +00:00
Eric Andersen 3bbcc95ac9 update the ignore list 2001-07-06 19:19:21 +00:00
Eric Andersen d22b78ff05 Fix a stupid bug revealed by multibuild.pl 2001-07-06 18:33:04 +00:00
Eric Andersen 77b68e6f42 Add woukaround for missing struct _res in uClibc 2001-07-06 17:51:29 +00:00
Eric Andersen 3102ac4b58 This is vodz' latest ash update. 2001-07-06 04:26:23 +00:00
Matt Kraai 5009f90ea2 Removed obsolete function, strdup_substr. 2001-07-05 19:00:47 +00:00
Matt Kraai 44edeff025 Note my activities (how immodest of me). 2001-07-05 18:32:01 +00:00
Eric Andersen 8e75f6daa6 Fix a stupid thinko, and fix killall to cope with the updated
find_pid_by_name() interface
 -Erik
2001-07-05 16:27:34 +00:00
Eric Andersen 332394b577 Be extra extra careful about what we dereference. 2001-07-05 16:09:32 +00:00
Eric Andersen d50a61956c Implement suggestion from Adam Slattery, (don't default to killing closing bug #1190. 2001-07-05 15:56:36 +00:00
Matt Kraai 94f3a570e1 Fix a thinko (the symptoms of which were reported by
David Douthitt in bug #1111).
2001-07-05 14:46:07 +00:00
Eric Andersen 8df319b213 A bit of testing today showed that ASH_BBAPPS_AS_BUILTINS was
totally breaking the shell.  Simple thinge like 'FOO=100' caused
it to segfault.  It turns out that disabling "bltincmd" is a very
bad idea.
 -Erik
2001-07-05 05:24:12 +00:00
Glenn L McGrath ed8495990a gunzip, zcat were fixed just after 0.51 was released 2001-07-05 03:46:23 +00:00
Glenn L McGrath bbac261402 ash, hush and msh are new applets to 0.52 2001-07-05 03:42:17 +00:00
Glenn L McGrath 7f3cbdd7fd Added entries for my commits 2001-07-05 03:28:28 +00:00
Matt Kraai 623cfa99e5 Remove a redundant call to mkdir. 2001-07-03 20:55:30 +00:00
Eric Andersen dd8500bce7 Cleanups and sinze reduction for the vi applet from Aaron Lehmann
<aaronl@vitelus.com>
2001-07-02 18:06:14 +00:00
Eric Andersen 3073dfbf30 Patch from Aaron Lehmann <aaronl@vitelus.com> to scrub a ton of
portability junk from gzip.c, making it a zillion times more readable.
2001-07-02 17:57:32 +00:00
Eric Andersen 22ecf049b6 Per patch from vodz, change a couple of consts to defines, since
apparently gcc 2.95.4, at least, is too stupid to realize that a
"static const int" is in fact a constant.
2001-07-02 17:32:40 +00:00
Eric Andersen 2870d964f8 Some updates to ash from vodz. Makes ash smaller. I made a few
changes, esp describing all the current ash configuration options.
Now ash adds 66k in the default configuration.
2001-07-02 17:27:21 +00:00
Eric Andersen 8f6978405d Patch from vodz to fix freeing a static in cmdedit. 2001-07-02 15:36:57 +00:00
Eric Andersen 10175a43ee Simplify a comment 2001-06-30 18:11:52 +00:00
Eric Andersen 0159597bd6 Generalize comment -- no longer ls specific 2001-06-30 18:08:36 +00:00
Eric Andersen 7e516797f9 Pad the human readable output for 'ls -sh' to 6 chars, since we will
have numbers printed as XXX.YU, so we need 6 digits not 4.
 -Erik
2001-06-30 18:00:26 +00:00
Eric Andersen 8fa1bf7cd6 Fix a silly logic error which caused symlinks to be printed twice, and
wrongly caused the return code to be an error.
 -Erik
2001-06-30 17:54:20 +00:00
Manuel Novoa III 8f01839386 Fixed scaling problems involving make_human_readable_str. 2001-06-30 07:48:01 +00:00
Manuel Novoa III a77cfbfd0c ls -s was reporting bytes instead of blocks. 2001-06-30 07:46:50 +00:00
Manuel Novoa III d877d44d12 All-integer version (but it does use an unsigned long long) which fixes
the problems of the previous version (used floating point, overflowed, didn't
round properly).  The comments at the top of the file are worth reading;
especially note 2 concerning "ls -sh".
2001-06-30 07:40:44 +00:00
Eric Andersen db15cb72e2 A really nice patch from Manuel Novoa III for compile time
configurable size/speed tradeoffs.
2001-06-29 20:44:51 +00:00
Manuel Novoa III a2949aa217 Add some missing includes to kill warnings when building with the default
Config.h and using gcc's -fno-builtin.  There are probably other files
with the similar problems.
Also, if building against uClibc, don't include asm/unistd.h in syscalls.c
and module_syscalls.c.
2001-06-29 18:59:32 +00:00
Eric Andersen ff9eee475f This is a busybox port of the Minix shell. It is reasonably capable,
handles all the basic stuff (for, case/esac, while, if/then/else), and
is very small (adds just 38k on x86).  It is not as rigorously correct
about Bourne semantics as bash, but for most things it is quite
workable.  There is still some work to be done to further shrink it (it
has its own globbing functions instead of using the libc ones, for
example), but it is quite usable as is.
 -Erik
2001-06-29 04:57:14 +00:00
Eric Andersen 66ca9480c8 Fix a nasty hard to spot bug found by Ralph Siemsen <ralphs@netwinder.org>.
This would cause it to obliterates the end of the strtab section, so
symbol lookups would fail and then it would crash.  Ugh.  This should
fix things for people having trouble with insmod.
2001-06-28 21:36:06 +00:00
Eric Andersen 029b4a0422 Allow xrealloc to act as a free() when size=0, per SuS2.
-Erik
2001-06-28 21:22:19 +00:00
Eric Andersen ec23c4920f Remove vodz from credits, per his request 2001-06-28 16:43:57 +00:00
Eric Andersen df82f611c8 Scrub up the licensing block
-Erik
2001-06-28 07:46:40 +00:00
Eric Andersen cb57d551a2 This a an ash applet I put together. It is similar to the one put
together by vodz, but uses newer sources, has the removed features
commented out instead of simply deleted (so they could be re-enabled)
and the builtins all work.  This adds 72k.
 -Erik
2001-06-28 07:25:16 +00:00
Eric Andersen 184d73636d Remove unneeded stuff. 2001-06-28 03:22:19 +00:00
Eric Andersen 028b65b060 More thrashing about trying to make hush behave itself wrt job
control...
2001-06-28 01:10:11 +00:00
Eric Andersen 07abfe2092 don't whine if all we need to do is remove a bg job 2001-06-27 17:29:11 +00:00
Eric Andersen 0d8cc1670c Fix a type promotion bug discivered and analyzed by Alan Modra
<amodra@bigpond.net.au>, which caused false checksum errors
2001-06-27 06:15:50 +00:00
Eric Andersen 4b6b5e4314 Re-enable globbing (I'd accidentaly removed it) and finish off the last
of the job control polishing.  Works fine now.
 -Erik
2001-06-27 04:30:11 +00:00
Eric Andersen 5c66d06104 Explicitly call setsid() 2001-06-26 23:16:31 +00:00
Eric Andersen 0392b8638e Minor formatting change 2001-06-26 23:11:44 +00:00
Eric Andersen a90f20b1c3 Don't choke if /etc/profile is not available 2001-06-26 23:00:21 +00:00
Eric Andersen d98337a7b4 Fix ps so it doesn't waste space showing group, as it is pretty much
meaningless anyways.
 -Erik
2001-06-26 22:55:45 +00:00
Eric Andersen 91a6318d55 Make it so we don't segfault when /proc isn't mounted -- guess pid 1...
-Erik
2001-06-26 22:44:09 +00:00
Eric Andersen 5ef5614c31 Don't use void * to pass pointers of known type 2001-06-26 16:36:26 +00:00
Eric Andersen ce98c19dfe A patch from Erik Meusel <erik@wh58-709.st.uni-magdeburg.de>
to fix the behavior of 'tail -f -n 0 FILE'
2001-06-26 15:07:08 +00:00
Glenn L McGrath 78b0e379d7 Vladimir's last_patch_15 2001-06-26 02:06:08 +00:00
Glenn L McGrath addabd6f16 Patch from Gennady Feldman
This should fix "circular buffer" error message shown when running "syslogd -C"
2001-06-26 01:41:59 +00:00
Glenn L McGrath f8736d251e rpm2cpio applet by Laurence Anderson 2001-06-26 01:19:34 +00:00
Eric Andersen 6c947d289f Fix the code for establishing a controlling terminal.
-Erik
2001-06-25 22:24:38 +00:00
Eric Andersen 24982c589b Fix up some warnings that show up on ppc 2001-06-25 19:31:48 +00:00
Eric Andersen 2d848a476a This should finish off the job control issues with lash. Make certain
we have a controlling terminal...
 -Erik
2001-06-25 17:11:54 +00:00
Glenn L McGrath 2e6d3cfa82 Nore unarchive (and doc) fixes from Laurence Anderson 2001-06-24 12:36:54 +00:00
Eric Andersen 1557626897 Make the extern NUM_APPLETS be a extern const NUM_APPLETS, to match
the actual definition.
 -Erik
2001-06-24 06:09:14 +00:00
Eric Andersen e0c0757d09 These were broken when using dmalloc due to include file ordering
problems.  busybox.h must be last.
 -Erik
2001-06-23 13:49:14 +00:00
Eric Andersen d9c8acec37 Leave BB_FEATURE_NFSMOUNT disabled by default.
-Erik
2001-06-22 15:48:19 +00:00
Glenn L McGrath 8f5b63edea cpio applet, and changes to associated code 2001-06-22 09:22:06 +00:00
Eric Andersen 52a97ca00c Some more cleanups. Of special importance, never free a pipe
that still has running jobs.  Instead, we ignore it and expect
it to be cleaned by the background job stuff.
 -Erik
2001-06-22 06:49:26 +00:00
Eric Andersen c798b07762 Some cleanups for hush. Saves about 350bytes.
-Erik
2001-06-22 06:23:03 +00:00
Matt Kraai a0105713e8 Remove obsolete function declaration. 2001-06-22 04:20:24 +00:00
Eric Andersen 764303f980 stdlib.h defined free(), which this needs 2001-06-22 03:07:19 +00:00
Eric Andersen 30f1eafaaa Fix the build process so it does not do the evil #ifdef BB_FOO stuff.
Build exactly one .o file per function, and let the linker throw away
the junk it doesn't want.
 -Erik
2001-06-22 03:00:21 +00:00
Eric Andersen 6b03504441 Add in a missing header file 2001-06-22 02:58:45 +00:00
Glenn L McGrath 76ce7549ce Dont change date or chmod on symlinks, lchown on symlinks if lchown available 2001-06-22 02:55:16 +00:00
Glenn L McGrath 9f832deecf remove defines around unarchive, its always used 2001-06-22 02:27:55 +00:00
Tim Riker 7387240ef0 heh 2001-06-22 00:27:21 +00:00
Tim Riker 837097648e comment cleanup 2001-06-22 00:27:11 +00:00
Tim Riker fbbd360b3c create_path -> make_directory 2001-06-22 00:14:20 +00:00
Eric Andersen 8071c02131 Add wget -P support, finishing off bug #1176
-Erik
2001-06-21 19:45:06 +00:00
Matt Kraai ceeff73819 Rewrote mkdir (and touched lots of things in the process). 2001-06-21 19:41:37 +00:00
Eric Andersen 091781e20e Support tar -C, per bug #1176
-Erik
2001-06-21 19:30:10 +00:00
Eric Andersen 8a646dd293 This commit guts lash, restoring it to what it was originally intended to do,
just be a simple command line interpreter with basic pipe, redirect, and job
control.  For all the more fancy things, people should use hush or ash.
 -Erik
2001-06-21 16:38:11 +00:00
Eric Andersen ea4abff595 Add in (and ignore) tar -p, since we preserver permissions automatically.
closes bug #1185
 -Erik
2001-06-21 15:17:59 +00:00
Matt Kraai 075228a461 Remove documentation of unsupported sed options. 2001-06-21 14:40:55 +00:00
Matt Kraai 02c40a72b8 Always apply commands with no specified range. 2001-06-21 13:57:51 +00:00
Eric Andersen fa2661f2e5 Per a suggestion from Tom Oehser, fix up the leading-hyphen hack to
make it general.  Now all leading single hyphens are ignored for
purposed of applet name matching, while argv[0] is still passed
unaltered to applets, so leading-hyphen sensitive applets (such as sh)
can react accordingly.
 -Erik
2001-06-21 04:56:24 +00:00
Eric Andersen aff5e2eaef it turs out, there was a nasty tar bug where bb tar would create leading dirs
with mode 0777 in all cases due to usask issues.  Thanks to Matt Kraai for
noticing and spotting the culprit.  This makes bb tar behave just like GNU
tar once again.
 -Erik
2001-06-20 20:47:31 +00:00
Glenn L McGrath 06a71cced2 Initialise in_file to stdin, so it wont crash if no source specified 2001-06-20 08:07:34 +00:00
Glenn L McGrath 8e74bf94f3 Changed gz_open to ruturn a stream 2001-06-20 07:54:15 +00:00
Glenn L McGrath eb1c94078f Reorganise unarchiving functions, more code re-use, only does single pass(no more linked lists), basis for supporting a cpio (and cheaper untar) applet, but cpio applet isnt included in this.
It effects ar, dpkg-deb applets only
2001-06-20 07:48:00 +00:00
Eric Andersen b4a26e6fc0 For m68k, use __mc68000__ (not __m68k__ ), since that is what the
various m68k compilers seem to actually use...
 -Erik
2001-06-19 15:00:52 +00:00
Mark Whitley 74c97cdba6 Changed a hard-coded path to a variable defined path. 2001-06-18 16:52:56 +00:00
Eric Andersen 32574a41b4 With a bit of care I was able to save about 100 bytes.
-Erik
2001-06-15 20:10:39 +00:00
Mark Whitley bd4b621e91 Applied patch from Jim Gleason that makes it so busybox will still work even
if you rename it.
2001-06-15 16:54:25 +00:00
Glenn L McGrath 6bad1fa1fd This isnt used anymore, replaced by seek_sub_file() in ./libbb/deb_extract.c 2001-06-15 03:13:00 +00:00
Eric Andersen f429baca86 I reworked make_human_readable_str so it now has a sane interface,
and then fixed up df, du, and ls to use the new interface.  I also
fixed up some formatting issues in ls while I was in there.
 -Erik
2001-06-13 08:02:45 +00:00
Glenn L McGrath 17822cd60a Reorganise unarchive functions, new files, removed some 2001-06-13 07:34:03 +00:00
Glenn L McGrath 9aff903603 Reorganise archive extraction code 2001-06-13 07:26:39 +00:00
Eric Andersen dab3d46b9d A patch from Benjamin Zeckel <bzeckel@cisco.com> to allow
nslookup.c to display the correct default nameservers.
2001-06-12 22:21:24 +00:00
Eric Andersen 583e3ca456 Add in Devil-Linux 2001-06-12 22:04:40 +00:00
Matt Kraai 7bd773c9fe Only use a login shell when it will run on a console. 2001-06-12 20:55:02 +00:00
Mark Whitley 0915c4b985 - Fixed bug where you couldn't mix line number and regexes in two-address cmds
- Fixed bug where you couldn't use two addresses for a 'c' cmd
 - Moved the do_sed_cmd function into process_file to simplify some things
 - Reduced a buncha lines of code in the process
2001-06-11 23:50:06 +00:00
Matt Kraai bf0a010cf7 Copy files until EOF, not the reported file size, to deal with bad sizes in
the proc filesystem.
2001-06-11 13:58:02 +00:00
Matt Kraai 5246225596 Add padding to struct sysinfo needed by m68k (note and patch by Richard
Hirst).
2001-06-08 13:57:27 +00:00
Eric Andersen 04407e522b Another hush update from Larry:
Fixes the interaction between if/then/else/fi syntax and variables.
    I planned to do it right from the beginning, but my implementation
    was buggy.  Also adds the relevant test cases.  Also adds some old
    Matt Kraai variable test cases that got left out somehow.
2001-06-07 16:42:05 +00:00
Eric Andersen 4f3e24979b Add the Linux Terminal Server Project 2001-06-06 18:21:25 +00:00
Eric Andersen 817e73cb63 A patch from Larry to fix pathological things like '>""' 2001-06-06 17:56:09 +00:00
Matt Kraai 12422ffe3e Added a new testcase from Larry Doolittle (inspired by a note from Vadim
Berkgaut).
2001-06-05 17:48:47 +00:00
Matt Kraai c616e53ca2 Don't close file descriptors when we are duplicating them. 2001-06-05 16:50:08 +00:00
Eric Andersen f4dd6e3d1a Do not purge the .cvsignore files on 'make release' so that
people can properly import into their own CVS trees.
 -Erik
2001-06-04 17:26:38 +00:00
Eric Andersen cb2a372c9f Revert the patch from Konstantin Boldyshev <konst@linuxassembly.org> to never
change permissions on existing directories.  This behavior is contrary to SUSv2
and contrary to GNU tar.  Thanks to Matt Kraai for pointing this out.  I should
have been much more careful about accepting such a patch.
 -Erik
2001-06-04 16:54:39 +00:00
Matt Kraai 67a4640333 Loop forever instead of exiting. 2001-06-03 05:55:52 +00:00
Glenn L McGrath 62ebe2e443 Remove space between ar options 2001-06-03 05:41:59 +00:00
Glenn L McGrath cda5cf1c2f Correct ar options 2001-06-03 05:15:04 +00:00
Matt Kraai 9344f7575e Don't whine about already mounted filesystems when invoked with -a. 2001-06-03 02:21:38 +00:00
Eric Andersen 8b113f93b9 Vladimir's last_patch13, containing several bugfixes. 2001-06-01 21:47:15 +00:00
Eric Andersen 4f6753e586 Cope gracefully when people type something, then hit ^C.
-Erik
2001-05-31 17:17:12 +00:00
Eric Andersen 4f990533e3 Patch from Vladimir to fix up autocompletion on a files/dirs with spaces in
them in the presence of a quoting.  Also revert my signal handling patch,
which seems to not solve the problem I thought it solved.
2001-05-31 17:15:57 +00:00
Eric Andersen f12cc4ee68 Make hush the default shell. Ensure the applets_list gets
the axe on a distclean.
2001-05-30 19:09:40 +00:00
Eric Andersen 86f0167e39 grep failed to compile when BB_FEATURE_CLEAN_UP was defined -- types were wrong. 2001-05-29 22:36:39 +00:00
Matt Kraai 6e9e136fcb Use safe_strncpy. 2001-05-27 14:11:52 +00:00
Mark Whitley 4f6aea807b More shell / quoting testcases from Larry. 2001-05-24 23:05:13 +00:00
Mark Whitley 8b7a0d807a Some more patchelttes from Larry Doolittle. 2001-05-24 21:31:09 +00:00
Mark Whitley 0a4f578fdc 'Nother patch from Larry to fix a buglet in how the line gets sed-ified.
Also, more testcases and comments on bugs and formatting differences in some
of the testcases.
2001-05-24 21:24:39 +00:00
Mark Whitley fa43e54b6f Added support for grep -e and grep -f, closes bug #1164. Also added some
testcases for these new features.
2001-05-24 18:36:18 +00:00
Mark Whitley 04052f96e1 Numerous new testcases from Larry Doolittle and a patch to tester.sh to avoid
a bash2-ism and quote variables that contain strings.
2001-05-24 17:15:33 +00:00
Eric Andersen a813afc24f Plug another memory leak 2001-05-24 16:19:36 +00:00
Eric Andersen 5a9d441b2c Fix up some signed char vs int issues that show up on powerpc. 2001-05-24 14:16:28 +00:00
Eric Andersen 1c1f5d3047 Get BB_LASH out of the list... 2001-05-24 14:11:09 +00:00
Eric Andersen a15dc15f12 Plug another memory leak in hush. This one showed up when backticked
commands were run.  This one was sure a bugger to find.
 -Erik
2001-05-23 23:46:09 +00:00
Eric Andersen bf7df04ec1 Fix a massive memory leak in the run_list_test() function.
Rename run_list_test() as free_pipe_list().
Rename run_pipe_test() as free_pipe().
 -Erik
2001-05-23 22:18:35 +00:00
Eric Andersen 77d9268892 Patch from larry to fix some grammar errors. 2001-05-23 20:32:09 +00:00
Matt Kraai bdd4eced84 Commit a patch by Larry Doolittle which fixes recursive calls to file_peek,
and improves some debugging messages.
2001-05-23 17:43:00 +00:00
Matt Kraai 774d135b66 Make more robust (patch by Larry Doolittle). 2001-05-23 14:45:09 +00:00
Eric Andersen 3200f5ac68 It turns out the descriptions of both dos2unix and unix2dos
were broken.  This fixes.
 -Erik
2001-05-22 22:39:10 +00:00
Eric Andersen 57e6a49e5b Excellent. This patch from Larry fixes the behavior of hush
when builtins are included in pipes.
2001-05-22 22:34:51 +00:00
Eric Andersen 9978576f15 Fix this case. No, really this time.
unset FOO
    export FOO=bar
    FOO=baz
    echo "global env: " `env | grep ^FOO`
    echo "local env:  " `set | grep ^FOO`
 -Erik
2001-05-22 21:37:48 +00:00
Eric Andersen aeb44c4da6 Fix a race. Sometimes by the time we got to checkjobs(), the
pipe struct had already been freed.  Return immediately if the
pipe is NULL.
2001-05-22 20:29:00 +00:00
Eric Andersen 816867858b Oops. Remove some debug noise I left in. 2001-05-22 19:23:35 +00:00
Eric Andersen 94ac244dea Updates from both Vladimir and Larry 2001-05-22 19:05:18 +00:00
Matt Kraai 1eb4acfc23 Fixed misnamed rewind command (noted by Tom Oehser). 2001-05-22 14:32:35 +00:00
Matt Kraai edc806507c Fixed extra -- lines (noted by Christophe Boyanique). 2001-05-22 14:29:27 +00:00
Matt Kraai 117231c44f Make - read compressed data from stdin (thanks to Marius Groeger). 2001-05-22 14:23:02 +00:00
Matt Kraai 7f7348b7b2 Correctly remove leading slashes upon extraction (thanks to Marius Groeger). 2001-05-22 14:18:03 +00:00
Mark Whitley 1d9d41150b Fixed mishandling of -c & -l options and accounted for case when we're
grepping only one file.
2001-05-21 21:13:00 +00:00
Eric Andersen 004015e9c4 Patch from Lars Kellogg-Stedman <lars@larsshack.org> to fix bug
#1130 (i.e. When you turn on features it should always ADD features)
2001-05-21 20:30:51 +00:00
Eric Andersen abec344ab7 A couple more minor touchups 2001-05-21 17:58:01 +00:00
Eric Andersen 317827d9e5 Several cleanups for usage messages 2001-05-21 17:50:53 +00:00
Matt Kraai 73991ff925 Fix tell support. 2001-05-21 17:01:32 +00:00
Eric Andersen ada18ff0f5 The latest patch from Larry 2001-05-21 16:18:22 +00:00
Eric Andersen 8ae319a322 This patch from Bernhard Kuhn <kuhn@lpr.e-technik.tu-muenchen.de> is based on
the work of Jinux Kim on his "babobox" (derived from busybox-0.42), and enables
kernel module loading and unloading for uClinux/m68k.
2001-05-21 16:09:18 +00:00
Eric Andersen 2f6e1f880b Patch from Gernot Poerner <gp@it-netservice.de>. Adds in
mount bind support.
2001-05-21 15:59:34 +00:00
Matt Kraai 13a70ac2ab Fix open mode for IOCTLs which write to the tape. 2001-05-21 15:00:39 +00:00
Eric Andersen 9ffb7dd9a4 This is a patch from Vladimir:
> I rewrite *local_variable* function in hush.c with:
    > 1) remove many memory leaks
    > 2) add support read_only protect (require write builtin function for set this,
    > I write this special for variable HUSH_VERION=0.01)
    > 3) commad read set only local variable now
    > 4) remove many error messages if "set unset export" not defined variable
    > (bash syntax not put and set error code). Hmm, if I set result to -1, you hush
    > called waitpid and returned with error "no waitpid" ( i not found place this
    > error).
    > 5) destroy error in new version check xgetcwd()==NULL and set "(unknow)" -
    > this have error: crashe in next call `pwd`, but xgetcwd(not null) called
    > free(arg).
    > 6) next add integraion with libbb

Valdimir's patch missed two cases of local variable handling
    FOO=bar
    export FOO=baz
    unset FOO
and
    export FOO=bar
    FOO=baz
which were working before, so I fixed those two cases.
2001-05-19 03:00:46 +00:00
Eric Andersen 6197c51834 Fix an escape problem in the docs. Some \n's didn't have the '\'
escaped, and so were messsing the out output.
 -Erik
2001-05-18 23:14:53 +00:00
Mark Whitley b6967635eb (Almost) brand-new version of cut that supports muitiple lists of positions,
per feature request from Tom Oehser.
2001-05-18 23:04:51 +00:00
Matt Kraai 1844770fec Changed snprintf copies to use strncpy at the suggestion of Aaron Lehmann. 2001-05-18 21:24:58 +00:00
Matt Kraai d6ef07406d Rewrote copyfd to use library functions, terminate, and copy correct data. 2001-05-18 14:14:55 +00:00
Matt Kraai 6943815400 Fix applet_name. 2001-05-17 20:40:21 +00:00
Matt Kraai 231f998aba Switch from hstrerror to herror for libc5 systems. 2001-05-17 14:19:05 +00:00
Matt Kraai 7cedac567c Remove unused function. If necessary, we can use remove_file instead. 2001-05-17 04:03:22 +00:00
Matt Kraai bc0f783a5f Fix invocation of builtin shell to have proper argc and argv. 2001-05-17 03:54:37 +00:00
Matt Kraai 233817437d Always print a newline after a matching substitution. 2001-05-17 01:02:58 +00:00
Eric Andersen bfae2529b8 It turns out job control in both hush and lash was broken by the
signal handling in cmdedit.c.  Disabling it makes the shells behave
themselves again.  hush isn't quite there, but is getting close...
 -Erik
2001-05-17 00:14:27 +00:00
Eric Andersen 2439a59828 Remove/replace the "div" call. 2001-05-16 18:53:34 +00:00
Matt Kraai 8f7a4ad442 Add missing include, noted by Larry Doolittle. 2001-05-16 17:05:03 +00:00
Matt Kraai bf381a0ad8 Whoops. Forgot the x. 2001-05-16 15:52:23 +00:00
Matt Kraai c55b8d41c1 Add xgethostbyname and herror_msg* functions. 2001-05-16 15:40:51 +00:00
Matt Kraai 59df6f7398 Change 'printf("%s\n", ...)' into 'puts(...)'. Noted and patched in hostname.c
by Larry Doolittle.
2001-05-16 14:21:09 +00:00
Eric Andersen bc604a2f41 Move init of a bunch of globals into main so we are at least
a bit more reentrant.
 -Erik
2001-05-16 05:24:03 +00:00
Eric Andersen f72f562b2f Fix the behavior of local shell variables to match that of bash and ash.
-Erik
2001-05-15 23:21:41 +00:00
Eric Andersen 9abfe85e96 Suggestion from Larry: no format string, use fputs instead. 2001-05-15 20:11:49 +00:00
Eric Andersen 50ae3102fb Patch from Adam Heath <doogie@debian.org> to add arbitrary header support
to wget, so it can now do funky interactive things with cgi scripts.
2001-05-15 17:51:37 +00:00
Eric Andersen 55f9872616 This patch from Adam Heath <doogie@debian.org>, makes print_file
(used by cat, grep, sed, etc) quite a bit faster.
2001-05-15 17:48:09 +00:00
Eric Andersen c911a4389b Patch from Vladimir:
1) fixed a bug that could crash df, mount, and umount applets if the root
    device name was longer then the word "root" (/dev/loop1 vs /dev/root) -
    2) severl functions needed static declaration in the umount applet
    3) update declaration for function in last_char_is() in libbb
2001-05-15 17:42:16 +00:00
Eric Andersen 15649c11f3 Oops. I left in some debug noise. 2001-05-15 17:28:26 +00:00
Eric Andersen 20a69a77d2 Write set_local_var() and fixup lookup_param() so you can now use
shell local variables.
 -Erik
2001-05-15 17:24:44 +00:00
Eric Andersen 78a7c99f7f This patch covers one big part of variable handling.
$ a=b foo
should be handled correctly.
$ a=b
is parsed OK, but the actual variable setting is not
yet written.  Except for some weird exceptions related
to quoting rules, this code passes (matches ash behavior)
all the tests I threw at it.

If someone now writes set_local_var(), and updates lookup_param()
to match, we can claim success!

       - Larry
2001-05-15 16:30:25 +00:00
Matt Kraai be9f44a7df Fix incorrect length passed to accept noted by Larry Doolittle. 2001-05-15 03:05:39 +00:00
Mark Whitley 336480fe6f Added some testcases for grep and sed (many more could still be added) 2001-05-14 21:18:54 +00:00
Mark Whitley d928accbbd ...Need to print just a few more newlines. 2001-05-14 20:44:26 +00:00
Eric Andersen 2416dfc3c9 A compromise solution for insmod 2001-05-14 20:03:04 +00:00
Mark Whitley dd527d3c62 ...And now that we're chomping lines, we need to re-add the newline later... 2001-05-14 19:53:08 +00:00
Mark Whitley 9de2659264 We will chomp() lines so REG_NEWLINE does not break stuff. Thanks, Matt. 2001-05-14 19:44:44 +00:00
Mark Whitley 35e59bed97 Fixed a subtle bug in the handling of -l and -c flags. 2001-05-14 19:40:32 +00:00
Mark Whitley 452cc1f293 Added REG_NEWLINE as cflags to xregcomp for normal addresses so EOL $ will work 2001-05-14 19:23:02 +00:00
Matt Kraai 9496466044 Follow symbolic links when searching for modules. 2001-05-14 18:27:25 +00:00
Eric Andersen 14d354312a Per suggestion from Vladimir, eliminate check_wildcard_match(), which
was only being used by insmod these days.

Also, I spent a minute adjusting insmod so that it first searches
/lib/modules/`uname -r` and then (if that fails) searches /lib/modules,
which makes bb insmod behave much more like the real insmod, and should
avoid nasty surprises (such as the recent "Modutils vs. Busybox..."
thread).
 -Erik
2001-05-14 17:07:32 +00:00
Matt Kraai cb378a5267 Add missing periods and delete superfluous whitespace. 2001-05-14 06:35:15 +00:00
Eric Andersen a17b3631fe Do not ever change permissions on existing directories, only
on directories we created while extracting a tarball.  Fix
based on bug report and patch from Konstantin Boldyshev
<konst@linuxassembly.org>
 -Erik
2001-05-13 15:39:30 +00:00
Eric Andersen 95a349f427 When doing a 'wget -O -' turn on the quiet flag, lest the status bar
noise get mingled with the retrieved webpage.
 -Erik
2001-05-13 00:55:54 +00:00
Eric Andersen ddb00545b7 A patch from Aaron Lehmann <aaronl@vitelus.com> to fix a
crash on a broken regexp.
2001-05-13 00:48:09 +00:00
Eric Andersen 4819c3d477 Make the locale stuff only do the getpid==1 check if BB_INIT is defined 2001-05-13 00:33:16 +00:00
Mark Whitley 1f3b9f297e Added support for 'r' command in sed. 2001-05-11 22:27:13 +00:00
Eric Andersen cfa88ecb72 Fix up some silly warnings 2001-05-11 18:08:16 +00:00
Eric Andersen 5f265b755a Fix a segfault in lash, hush, and cmdedit. Each of these used
xgetcwd, but did not check the return for a NULL, and then continued
to call strlen on the NULL when the cwd had been removed from under it.
 -Erik
2001-05-11 16:58:46 +00:00
Eric Andersen 9d94deabd3 Use xgetcwd 2001-05-11 16:36:03 +00:00
Eric Andersen 238da24620 Fix the chown usage text, also thanks to Lars Kellogg-Stedman <lars@larsshack.org> 2001-05-11 16:31:46 +00:00
Eric Andersen 2b02ab9606 This patch from Lars Kellogg-Stedman, fixes the behavior of
chown to be consistant with GNU chown, so that it follows
symlinks (who cares about the perms on a link anyways?) unless
the -h option is supplied.
 -Erik
2001-05-11 15:55:41 +00:00
Matt Kraai eb5f433736 Check that putenv succeeded, suggested by Jonas Holmberg. 2001-05-11 15:16:28 +00:00
Matt Kraai c96381be40 Fix env usage information. 2001-05-11 14:28:17 +00:00
Matt Kraai 5b44f48afc Fix handling of '-' option and way that variables are added to the
environment from Jonas Holmberg <jonas.holmberg@axis.com>.  Fix
handling of command options by adding + to getopt string.
2001-05-11 14:26:29 +00:00
Matt Kraai f3e79ba6e3 Fix symlink removal problem noted by Erik Andersen. 2001-05-11 02:35:36 +00:00
Matt Kraai 6e91f69a0d Add installation instructions from Tomas Pospisek <tpo_hp@sourcepole.ch>. 2001-05-10 14:12:20 +00:00
Matt Kraai 854125f6e6 Make stdio functions which can be interrupted by the progressmeter timer
recover gracefully from EINTR.
2001-05-09 19:15:46 +00:00
Eric Andersen d283e1cfe9 Bump version to 0.52pre 2001-05-09 17:31:27 +00:00
Eric Andersen 1a6d39b259 A few more structural updates for job control.
-Erik
2001-05-08 05:11:54 +00:00
Eric Andersen 0a36de0580 Fix a stupid segfault caused by dereferencing a NULL ptr.
-Erik
2001-05-08 04:25:46 +00:00
Eric Andersen 45e92ba2ce This patch from Evin Robertson <nitfol@my-deja.com> fixes export so it works.
This way leaks memory, but oh well.  We will probably fix that when we get
around to doing local variables.
2001-05-07 23:53:09 +00:00
Eric Andersen 8cd16d8fd3 This syncs things with Vladimir's latest patches. Also gets
rid of useless 'const int' declarations.
 -Erik
2001-05-07 23:11:23 +00:00
Eric Andersen 186bf1defc This is Vladimir's update to last_char_is(). Since 'char *' is
the least common denominator, I modified it to use that (not const),
which will minimize the need for casting elsewhere.
2001-05-07 23:10:16 +00:00
Eric Andersen de0ca0cd9e Silence cut so it doesn't whine during compilation 2001-05-07 23:07:17 +00:00
Eric Andersen f3f9f3efa7 A patch from Vladimir to simplify chomp() 2001-05-07 23:02:39 +00:00
Eric Andersen 4ad13e5d95 A patch from Vladimir to simplify concat_path_file() and
make it less likely to break.
2001-05-07 23:01:32 +00:00
Eric Andersen c33ebc9741 A patch from Vladimir to use last_char_is(), and a patch from
Larry to fix a silly bug when BB_FEATURE_VI_OPTIMIZE_CURSOR
is not defined.
2001-05-07 22:57:47 +00:00
Eric Andersen 04b0354d8e Patch from Vladimir to use last_char_is to simplify du.c 2001-05-07 22:49:43 +00:00
Eric Andersen 8f3e51b4ad Patch from Vladimir to remove testing stuff from stty 2001-05-07 22:47:45 +00:00
Eric Andersen 8d35134ad8 A bug fix from Vladimir for a memory leak I stupidly
added to which.c.
2001-05-07 22:45:06 +00:00
Eric Andersen 83a2ae2184 More hush updates from Larry:
Update some comments.  Generate partial placeholders for the missing
    builtins.  Write builtin_umask.  Properly treat exec without arguments
    as a means to open/close files within the running script.  Implement
    "4<&-" that encodes for file descriptor closure.
2001-05-07 17:59:25 +00:00
Eric Andersen 7e1273edf7 Patch from Jim McQuillan to pass the terminal type to the remote host. 2001-05-07 17:57:45 +00:00
Eric Andersen 238bc4090d Per comment from Jim McQuillan <jam@mcquil.com>, don't log
syslogd startup/shutdown messages as KERN.EMERG, but use
SYSLOG.INFO instead.
2001-05-07 17:55:05 +00:00
Eric Andersen da7f095c12 Update comment re USE_SYSTEM_PWD_GRP
-Erik
2001-05-07 17:51:34 +00:00
Eric Andersen 28355a36da Per some comments from Lars Kellogg-Stedman <lars@larsshack.org>,
make xreadlink() return NULL on failure, and make sure everyone
uses the interface correctly.
 -Erik
2001-05-07 17:48:28 +00:00
Eric Andersen 822c3837f9 Another vi update from Sterling Huxley:
- All of the ESC sequences are now in variables.  This should make
  re-targeting for other terminals easier.

- The initial screen draw does not force out every single column.
  Should be faster.

- The place_cursor() routine trys to be smarter about moving the
  cursor.  This is optional based on BB_FEATURE_VI_OPTIMIZE_CURSOR.

- The 't' and 'f' intra-line positioning commands were added.
  They can now be used as targets in 'c' and 'd' commands, i.e.,
   dfx - delete from dot to next 'x'
   dtx - delete from dot to the char before next 'x'

- show_status_line() uses a static int checksum to remember what
  is currently displayed on the screen and not re-draw the status
  line unless it has changed.

- Some of the code in refresh() was moved out to format_line().
  refresh() trys to send out the smallest segment containing
  the changed chars rather than the whole line.

- Added "flash" to the :set command to specify if error indication
  should be by flashing the screen or ringing the bell.

- Changed the rawmode() routine so that it turns off the
  NL -> CR NL translation. On output of a NL, the OS will not add
  a CR.

- If vi was started as "view", with global read-only mode,
  and another file is opened, the file is opened read-only
  rather than read+write.
2001-05-07 17:37:43 +00:00
Glenn L McGrath 713b398700 woops, forgot the break statment 2001-05-07 12:06:37 +00:00
Glenn L McGrath 5bcfc9ba1a Tolerate -q argument, if -q is passed give a warning and continue rather than just fail 2001-05-07 12:01:58 +00:00
Glenn L McGrath cc0aa0f2d7 Actually we dont need to check if the device is nfs as it wont be stat'ed 2001-05-07 01:51:24 +00:00
Glenn L McGrath 1b62619446 woops, i shouldnt be so presumtuous? about what the error will be 2001-05-07 01:40:59 +00:00
Glenn L McGrath 3aae10014c Device may not be a real filename 2001-05-07 01:38:03 +00:00
Matt Kraai 2e6c878763 Rewrite -c and -b processing to shrink code and eliminate buffer overrun. 2001-05-05 16:19:13 +00:00
Glenn L McGrath 6b8c550d88 include libbb.h after other includes 2001-05-05 03:19:12 +00:00
Eric Andersen 2dcfba7117 Larry's variant on Evin Robertson's fix to what I messed up
trying to make job control work.  This fix makes it so that
hush doesn't error out when init hasn't set up job control,
as in when init=/bin/sh
2001-05-04 22:13:37 +00:00
Eric Andersen 044a72d0d5 Larry suggested using concat_path_file() would be an even safer bet
for 'which'.  I ageed, so I whipped this up -- which revealed a bug in
concat_path_file.  It turns out that that a '/' can be appended from
either the path _or_ the filename, but only the former was checked.
 -Erik
2001-05-04 22:04:24 +00:00
Mark Whitley a0ba9f45fb Wrote documentation and scripts for creating a busybox boot floppy. Initial revision. 2001-05-04 21:46:00 +00:00
Matt Kraai d24f878546 Don't reset parents context when we encounter an terminator. Fixes
if true; then if true; then true; fi; fi
2001-05-04 21:20:20 +00:00
Eric Andersen 7526f035f4 Fix a buffer overflow. Which accounted for the size of the path, plus the the
'/', plus the size of the test command.  It did not account for the terminating
NULL, which overwrote the end of the string.
 -Erik
2001-05-04 20:47:33 +00:00
Eric Andersen e5ffb911e8 If it fails to run a builtin, let it fall through to
exec the real thing.
 -Erik
2001-05-04 16:30:29 +00:00
Matt Kraai e6bf66eada Fix two bugs reported by Ralph Jones. 2001-05-04 14:49:58 +00:00
Eric Andersen b0aca921be A todo update from larry to acknowledge the existance of hush 2001-05-03 17:35:48 +00:00
Eric Andersen 87d893c04b devfs does not support creation of regular files. So change the
test a bit so as to not possibly create a regular file.
 -Erik
2001-05-03 07:01:41 +00:00
Matt Kraai 6689140597 Remove summary header. Not present in GNU or SUSv2. 2001-05-03 04:45:40 +00:00
Matt Kraai 80abc45182 Move up waitpid error check so that errno isn't clobbered by tcsetpgrp. 2001-05-02 21:48:17 +00:00
Matt Kraai adcbc12d85 Canonicalize path before trying to unmount it. 2001-05-02 21:24:51 +00:00
Matt Kraai 3425111bb9 Fix bug #1108 by always canonicalizing arguments. 2001-05-02 21:17:38 +00:00
Eric Andersen 0fcd447d59 Some more job control updates. It will now sucessfully background
stuff.  Good luck getting things back into the foreground though...
 -Erik
2001-05-02 20:12:03 +00:00
Matt Kraai 20a3069ec0 Don't treat newline as pipe separator when processing substitutions. 2001-05-02 17:52:49 +00:00
Eric Andersen 19ec9ee91e Use .png for images (removing all .gifs) and make them all 90x36
-Erik
2001-05-02 17:19:25 +00:00
Matt Kraai 9f8caf134f Fix $(...) construction. Noted and patched by Larry Doolittle
<ldoolitt@recycle.lbl.gov>.  I'm just a patch whore.  :)
2001-05-02 16:26:12 +00:00
Eric Andersen bafd94f154 First pass at getting job control working. This gets the infrastructure
in place, but something is still missing/wrong in there.  Testing with
'grep foo &' seems to put _hush_ into the background.  Pondering...
 -Erik
2001-05-02 16:11:59 +00:00
Matt Kraai 1c8a59ab95 Use the current pgrp, not pid, when resetting the foreground process group.
Fixes bizarre suspension when executing `echo`.
2001-05-02 15:37:09 +00:00
Matt Kraai f162e7d09d Don't segfault if the first word is the empty string. 2001-05-02 14:48:48 +00:00
Eric Andersen e67c3ce327 Another update from Larry:
Makes hush return code equal to that of the last command executed.
    Fixes the mode where input comes from a file.
2001-05-02 02:09:36 +00:00
Matt Kraai e0244b0642 Skip headers with empty filenames, rather than stopping. 2001-05-01 21:12:31 +00:00
Eric Andersen b9f5b82339 Another refinement, this time from Larry. 2001-05-01 16:24:32 +00:00
Eric Andersen 6d553ef200 Argh. Now we break non-pristine builds. Check a bit more carefully.
-Erik
2001-05-01 14:54:35 +00:00
Eric Andersen abde065935 Oops. The dangers of applying patches by hand... 2001-05-01 14:37:03 +00:00
Eric Andersen 4ed5e37d4b Another hush update from Larry:
Minor improvements.  Something is still broken with running
    scripts via "hush filename".  All the following are now handled
    acceptably (matches ash, not bash).

    if true; then echo foo1; fi
    if
     true; then echo foo2; fi
    if true; false; then echo bar; else echo foo3; fi
    if true || false; then echo foo4; fi

	  - Larry
2001-05-01 01:49:50 +00:00
Eric Andersen 3f99b567b8 A patch from Larry to fix pristine source builds (again).
I just can't seem to _not_ break it.  Sigh.
2001-05-01 01:40:34 +00:00
Eric Andersen aac75e5a78 Some more hush.c updates from Larry Doolittle. 2001-04-30 18:18:45 +00:00
Eric Andersen 0e9aef36fa Oops. I was a bit too hasty and also changed applet_name. 2001-04-30 18:18:02 +00:00
Mark Whitley 8a633268ef Made new xreadlink function for libbb and changed applets to use it instead of
readlink(2).
2001-04-30 18:17:00 +00:00
Eric Andersen 6f34394454 These messages can be .rodata, so make them even more const.
-Erik
2001-04-30 18:08:03 +00:00
Eric Andersen 65504ac12c These do not need initial values. Let them live in the bss.
-Erik
2001-04-30 18:07:24 +00:00
Eric Andersen defa4f93c2 Per suggestion by Matt, make sh.c a real target. There is no
need for the useless sh_link dummy target -- use the real thing.
 -Erik
2001-04-30 17:52:36 +00:00
Matt Kraai 218aa370b4 Fix user permissions of copied directories. 2001-04-30 17:32:43 +00:00
Matt Kraai 43ca13714b Simplify permission handling for FIFOs. 2001-04-30 16:43:21 +00:00
Matt Kraai 24abecc349 Fix exit status when there is an error copying a file. 2001-04-30 16:37:04 +00:00
Glenn L McGrath af166e7ce0 Logic reversal for last_char_is 2001-04-29 00:50:33 +00:00
David Kimdon 2bf4dad7ec fix to applet_source_list rule so Debian package continues to build 2001-04-28 16:37:23 +00:00
Eric Andersen 07e462fd6d Matt was complaining. Hopefully this helps the sh.c link situation 2001-04-27 18:36:43 +00:00
Matt Kraai 72ab975a6b Terminate source correctly when copying symlink. Report and patch by
Brian Webb <webbb@desertscenes.net>.
2001-04-27 15:40:27 +00:00
Eric Andersen 088875fec4 Use BUFSIZ for the_command to match size used in cmdedit 2001-04-27 07:49:41 +00:00
Eric Andersen af44a0e8f4 An update to hush from Larry:
It should recover more smoothly from syntax errors, and it now
    has a decent guess when the reserved word construct is over
    (or not) to control execution and prompting.  I took out all the
    redundant standalone test copies of libbb routines, but left in a
    hook so I can include those for my testing.  I'll post that include
    file on my web site.

	    - Larry
2001-04-27 07:26:12 +00:00
Eric Andersen 0081466925 Be a bit more sneaky about the sh.c symlink so you don't need to
do a mke clean for it to happen.
 -Erik
2001-04-26 23:29:10 +00:00
Eric Andersen 0f9426edb0 Ignore some generated files 2001-04-26 23:23:04 +00:00
Eric Andersen 25f2703015 This is the initial checkin of Larry Doolittle's hush.c, using his
April 25, 2001 snapshot, adjusted a bit by me so it has cmdedit support.

This checkin also removes sh.c.  In the future sh.c will be a symlink to
your shell of choice.  For now, this symlink will default to pointing to
lash.c (as in the past).  If you change the symlink to point to hush.c,
then thats what you will get.  This symlink business is a temporary situation,
which will be cleaned up Real Soon Now(tm).

 -Erik
2001-04-26 23:22:31 +00:00
Eric Andersen a1dbc22469 Disable lash
-Erik
2001-04-26 23:10:22 +00:00
Eric Andersen 924ab5b7d3 These days busybox.pod is autogenerated, so it should be removed
from CVS.
2001-04-26 23:06:39 +00:00
Eric Andersen 7f3b86e7bf A fix from Larry for a corner case where insmod could end up
doing an xrealloc(0).
2001-04-26 19:29:58 +00:00
Matt Kraai 6aabfd5e30 Fix handling of permission addition and removal (e.g., o-r). 2001-04-26 18:55:29 +00:00
Eric Andersen ca85cdbe4c Doh. I never allocated storate for the struct stat I am using.
There was just a never initialized pointer.
 -Erik
2001-04-26 18:43:36 +00:00
Matt Kraai 468f504fd7 Fix handling of -R flag. 2001-04-26 18:27:47 +00:00
Eric Andersen c1bdffe99b Another nice cleanup from Larry. This adds a new last_char_is() function and
uses it to avoid possible buffer underruns whn strlen is zero, and avoid the
possible space-hogging inline of strlen() in several cases.
 -Erik
2001-04-26 15:56:47 +00:00
Eric Andersen 3c3277f0bd As Larry pointed out, this the off by one canbe fixed much more elegantly. 2001-04-26 15:41:51 +00:00
Eric Andersen 30592a5451 Fix a silly off-by-one error noticed by Santiago Garcia Mantinan <manty@debian.org>
-Erik
2001-04-26 14:56:45 +00:00
Mark Whitley e55987896a Applied patch from Larry Doolittle to fix pristine build breakage. 2001-04-25 23:49:43 +00:00
Mark Whitley 2789906aad Removed obsoleted BB_FEATURE_RM_INTERACTIVE 2001-04-25 22:08:56 +00:00
Mark Whitley 207587a9b4 Applied patch from I.Q. to add -s to cmp. 2001-04-25 20:41:02 +00:00
Mark Whitley c29c44c00e libbb.h now includes ../busybox.h. This way, files in libbb that have
BB_[FEATURE] #defines won't be ignored. Credit to Magnus Damm for spotting
this.
2001-04-25 18:06:21 +00:00
Eric Andersen 4f4bcfcd1a Some more cleanups for insmod from Larry.
-Erik
2001-04-25 17:22:32 +00:00
Eric Andersen c57a75d896 Larry noticed that chown and chgrp has the version numbers off a bit
for glibc's lchown support.  Thanks Larry.
2001-04-25 17:12:33 +00:00
Mark Whitley 4b541a8817 Moved some #ifdefs down below #include "busybox.h" where they belong. 2001-04-25 17:10:30 +00:00
Mark Whitley 67d7fe66e7 Sync'ed up the olympus section between this and stock Config.h 2001-04-25 17:05:51 +00:00
Mark Whitley 4f3558af17 Fixed a BB_MTAB #define buglet reported by Magnus Damm. 2001-04-25 17:03:40 +00:00
Eric Andersen 04095e58fb Move messages.c to libbb. Make each string in messages.c be its own .o file.
This way, we can new get rid of all that tedious #define rubbish we used to
need to enable specific messages.  This way is enormously simpler, and as a
bonus also ends up saving us 96 bytes.
 -Erik
2001-04-25 05:39:18 +00:00
Eric Andersen 3676374915 Cleanup more carefully after pod2html 2001-04-24 21:46:07 +00:00
Eric Andersen f227815c3a Several cleanups from Larry. 2001-04-24 21:41:41 +00:00
Matt Kraai 8810bdbba3 Rewrote rm. 2001-04-24 20:04:18 +00:00
Eric Andersen 9f0fedb8f6 Split up chmod_chown_chgrp.c into 3 separate apps. This unfortunately
adds 384 bytes to the overall size.  But having each app be standalone
is the Right Thing(tm) so we will just have to live with it.
 -Erik
2001-04-24 18:07:19 +00:00
Matt Kraai 3a4aef5a4c Update applet define from BB_CP_MV to BB_CP and BB_MV. 2001-04-24 15:19:04 +00:00
Matt Kraai 01441036e9 Use generic flag names. 2001-04-24 01:30:02 +00:00
Matt Kraai 9ff9325e60 Move applet_name declaration from busybox.h to libbb.h. 2001-04-24 01:12:33 +00:00
Mark Whitley af030496fa Applied patch from Larry Doolittle to remove some strlen calls, and add one
paranoia check to avoid  buffer underrun. Saves 120 text bytes.
2001-04-23 23:16:20 +00:00
Matt Kraai de1b262942 Remove file obsoleted by cp/mv rewrite. 2001-04-23 19:48:26 +00:00
Matt Kraai 91b2855ba8 Rewrite cp and mv to be SUSv2 compliant. 2001-04-23 18:53:07 +00:00
Mark Whitley 4e9267d76c Reversed last patch; unnecessary. 2001-04-23 17:56:27 +00:00
Mark Whitley 4b66dabc76 Added a sanity check to fix weird bug exposed when sourcing in commands from a
file with lash. Based on report from Heinz Walter.
2001-04-23 17:04:41 +00:00
Matt Kraai 8a24a65d2f Change link order so that libbb functions use libpwd.a when appropriate. 2001-04-23 16:11:57 +00:00
Eric Andersen ed424dbf1d Some patches from Gennady Feldman. Fixed a glob problem such that
'ls *.h Config.h' works.  Fixed a silly typo with fg/bg process control.
Made cmdedit exit sanely when it cannot read input.
2001-04-23 15:28:28 +00:00
Eric Andersen d8862928c2 A patch from Marc Karasek and Kanoj (kernel serial.c maintainer)
so init will work on serial consoles with 2.4.3+ kernels, thanks
to Fabrice Gautier <gautier@email.enst.fr> for finding this one.
 -Erik
2001-04-23 15:14:11 +00:00
Glenn L McGrath f5c358bc98 Simplify file_prefix handling, and use of *dir variable. 2001-04-23 13:52:02 +00:00
Matt Kraai 782ab3ccf8 Simplify pathname building, in which a bug was noted by Larry Doolittle,
a patch was provided by Vladimir Oleynik, and am improved patch commited
by me.
2001-04-23 01:07:00 +00:00
Glenn L McGrath ee0d93ed04 Fix horrible, horrible memmory leak. I wondered why processes were dying ! 2001-04-21 10:26:15 +00:00
Glenn L McGrath 89dc02d944 Clearly define out exclude list code, as recommended by Larry Doolittle 2001-04-21 02:12:13 +00:00
Mark Whitley 56c14a6473 Fixed a buglet where an extra newline was being added after an insert command
in some cases.
2001-04-20 23:41:44 +00:00
Mark Whitley 497ef46587 Made a correction to a bad test expression. Props to Larry Doolittle for
spotting this one.
2001-04-20 23:27:17 +00:00
Mark Whitley 3e310ac309 Applied patch from Larry Doolittle to give users the third option of putting
buffers in BSS (in addition to stack and heap).
2001-04-20 17:40:33 +00:00
Glenn L McGrath 6ebd633829 Set permissions of created file 2001-04-20 05:16:38 +00:00
Eric Andersen 46cd74b9e3 This has two patches. First it moves interface.c to libbb (it is
support code after all).  It also contains a patch from Larry Doolittle
that removes two instances of "strlen([^)]*) *- *1", un-shadows two
variables, relaxes requirement for a sprintf(3) that returns number of
bytes written, and eliminates a duplicate subroutine.
2001-04-19 16:55:27 +00:00
Matt Kraai 3ce79338e6 Fix buffer underrun noted and solved by Larry Doolittle. 2001-04-19 14:56:23 +00:00
Eric Andersen 0a3bda2c53 Move real_loop.h to libbb, where it belongs.
-Erik
2001-04-18 22:23:22 +00:00
Eric Andersen b5ec61e4f5 Add types for the inline funcs, thanks to Ralph Siemsen <ralphs@netwinder.org> 2001-04-18 20:17:05 +00:00
Matt Kraai 53265546a6 Eliminate spurious warning, convert to getopt, and eliminate redundant check. 2001-04-18 16:05:34 +00:00
Matt Kraai 96dcd19b8a Fix a number of problems with argument handling. 2001-04-18 15:54:09 +00:00
Matt Kraai 54652230d4 Eliminate a segfault when called on an existing file with out an extension:
touch foo && gunzip foo
2001-04-18 15:51:45 +00:00
Matt Kraai b181056e06 Eliminated seeks so that we work correctly on pipes, and removed reliance on
undefined evaluation ordering.  Thanks to Anthony Towns for explanation and
solution.
2001-04-18 14:49:55 +00:00
Glenn L McGrath bcfeb2ac44 Fix zcat/gunzip when reading from stdin 2001-04-18 13:34:09 +00:00
John Beppu 2771d1a574 - updated busybox_header.pod by adding adjtimex to the list.
- a new busybox.pod that reflects my fixes, and todays patches
  to usage.h
2001-04-17 23:57:23 +00:00
Mark Whitley fccaa3629b Applied patch from I.Q. to add sort -u as a feature. 2001-04-17 18:56:18 +00:00
Mark Whitley 6e808ca354 Changed line[strlen(line) - 1] = '\0'; to chomp(line); 2001-04-17 18:26:11 +00:00
Mark Whitley 30ac01cca7 Applied a patch from Laurence Anderson to fix the wget statusbar and a patch
to usage.h to document the -q option.
2001-04-17 18:13:16 +00:00
Mark Whitley 3828dbed57 Applied patch from I.Q. to fix problem with sort -n. 2001-04-17 17:47:33 +00:00
Mark Whitley 31868b85be Added some help messages. 2001-04-17 17:37:47 +00:00
Mark Whitley 59a86cad67 The tiniest of bracket-placement fixes. 2001-04-17 17:30:44 +00:00
John Beppu 5d81768cf1 - usage.h
o echo_example_usage
    needed to escape some backslashes in an inner quote
  o find_full_usage
    missing a \n at the end of the -name line
  ? getopt_full_usage
    the -o line has tab issues, but I didn't fix them.
  o length_example_usage
    removed some double-quotes that were within an inner quotes
  o printf_example_usage
    needed to escape a backslash in an inner quote
  o sort_example_usage
    needed to escape some backslashes and double quotes in an inner quote
  o tftp_full_usage
    s/nameing/naming/;
  o umount_full_usage
    remove colons after options for consistency w/ other full_usage messages
  o uniq_example_usage
    needed to escape some backslashes and double quotes in an inner quote

- TODO                          xargs -l ?
- docs/autodocifier.pl          POD && comment updates
- docs/busybox_footer.pod       added Larry Doolittle and Sterling Huxley
2001-04-17 17:09:34 +00:00
Matt Kraai a3045dfd25 Convert mount to use getopt. 2001-04-17 04:48:51 +00:00
Matt Kraai 1240082e37 Further cleanup of mount option handling. 2001-04-17 04:32:50 +00:00
Matt Kraai 24ed3bee0c Fix -a support (broken by previous patch). 2001-04-17 04:26:05 +00:00
Matt Kraai 3d406da0c9 Fix segfault on `mount -t nfs' reported by Gratien D'haese. 2001-04-17 04:22:22 +00:00
Eric Andersen 1c0d311ff4 Several fixes from Sterling Huxley for the vi applet. 2001-04-16 15:46:44 +00:00
Glenn L McGrath ae1c704c44 Write full status file 2001-04-16 10:26:46 +00:00
Glenn L McGrath 33431ebb9a dpkg improvements, use full package struct, avoid extracting to tmp dir, rename variable.
deb_extract, untar and dpkg_deb modified to make the above possible
2001-04-16 04:52:19 +00:00
Glenn L McGrath 3136904ff6 Document new dpkg-deb funtions 2001-04-15 12:53:24 +00:00
Glenn L McGrath 685f5fd6f4 untar changed to allow deb_extract to extract to memory, allows better operation of dpkg-deb -f 2001-04-15 12:51:59 +00:00
Glenn L McGrath a529d885d2 NEw functions read_package_field and read_text_file_to_buffer 2001-04-15 12:50:15 +00:00
Glenn L McGrath 5faef74bae Reads a field from a debian control (status or available) file, handles multi-line fields. 2001-04-15 12:38:12 +00:00
Glenn L McGrath 65708e4cd1 Read a FILE* till an empty line or eof and return it as a char buffer.
In future maybe add char *end_str to interface to allow calling function
to specify end point.
2001-04-15 12:36:19 +00:00
Eric Andersen 4a2e463525 Handle endian-ness. Patch from Paul J.Y. Lahaie <pjlahaie@linuxcare.com>
-Erik
2001-04-14 03:33:33 +00:00
Matt Kraai 0f50bca9aa Fix infinite loop and reallocate if too many modules. 2001-04-13 14:40:15 +00:00
Glenn L McGrath 445fb952b8 dpkg-deb -f and partial -I commands, adds 600 bytes 2001-04-13 04:02:57 +00:00
Matt Kraai 1e04ea388f Fix dos2unix/tr problem noted by Larry Doolittle. 2001-04-12 21:38:06 +00:00
Matt Kraai d6cde0bcf4 Fix return code and don't output spurious newlines. 2001-04-12 20:51:01 +00:00
Matt Kraai 4ef40c02f4 Another banner consolidation from Larry Doolittle <ldoolitt@recycle.lbl.gov>. 2001-04-12 20:44:21 +00:00
Matt Kraai 8fc364ebd5 Fix comment. 2001-04-12 20:12:16 +00:00
Matt Kraai 6ba1a80c26 Use date -u instead of date --utc and consolidate version string.
Patch by Larry Doolittle <ldoolitt@recycle.lbl.gov>.
2001-04-12 20:11:55 +00:00
Glenn L McGrath 5a65413c04 Updates, fixes for handling contents, verbose extract.
More updates to come
2001-04-12 16:40:21 +00:00
Glenn L McGrath 47fd219c95 Rename variable that shadows global 2001-04-12 16:37:13 +00:00
Matt Kraai be66ad3212 Fix handling of '' and "". 2001-04-12 15:42:17 +00:00
Glenn L McGrath 3e2ab88ee2 New dpkg-deb function -t, stands for --fsys-tarfile 2001-04-12 13:49:09 +00:00
Glenn L McGrath c9cac5be23 Change size to unsinged long long, so if -1 is passed it will read as much as possible. 2001-04-12 13:47:12 +00:00
Glenn L McGrath 6785b51280 dpkg-deb -c works now 2001-04-12 11:48:02 +00:00
Glenn L McGrath 359c106871 Fix dpkg-deb, enum's are cool 2001-04-12 10:19:08 +00:00
Glenn L McGrath 46079a1d77 remove unused clearerr statements 2001-04-12 10:17:22 +00:00
Glenn L McGrath 327175137f This belongs in dos2unix.c 2001-04-12 02:29:34 +00:00
Glenn L McGrath a6ce670a87 use tmpfile() and revert my previous changes... convert() belongs here 2001-04-12 02:26:04 +00:00
Glenn L McGrath 2709297f3b dos2unix and unix2dos are now independent 2001-04-12 00:55:05 +00:00
Glenn L McGrath 50b787cac5 Move convert to libbb 2001-04-12 00:52:29 +00:00
Glenn L McGrath a283157c38 convert() is used by dos2unix and unix2dos 2001-04-12 00:49:26 +00:00
Glenn L McGrath c8d9e0604a Moved from dos2unix 2001-04-12 00:42:53 +00:00
Matt Kraai da160c0da5 Use putc, and write to stderr as the rest of the progressmeter does. 2001-04-11 20:11:51 +00:00
Matt Kraai 90d7f696d6 Only finish with a newline if we are displaying the progress indicator. 2001-04-11 20:07:27 +00:00
Matt Kraai 65317ea27f Fix behavior when extracting to stdout. Report and patch by
Evin Robertson <nitfol@my-deja.com>.
2001-04-11 20:03:01 +00:00
Glenn L McGrath ed897e5415 Vladimir's patch to reverse previous patch 2001-04-11 17:20:44 +00:00
Glenn L McGrath 2975a34f23 readTarFile changed from exter nto static 2001-04-11 16:49:07 +00:00
Glenn L McGrath b3f23d4c6a Seek to start of an entry inside an ar file 2001-04-11 16:31:20 +00:00
Glenn L McGrath 988be100e2 dpkg, dpkg_deb dont depend on any other applets now 2001-04-11 16:25:45 +00:00
Glenn L McGrath 4949faf4b2 copy_file_chunk uses streams now. 2001-04-11 16:23:35 +00:00
Glenn L McGrath 5b20d02ea9 This is primarily to allow deb_extract to be independent of the tar applet.
TODO: This function and its conterpart in tar.c should be merged
2001-04-11 16:14:24 +00:00
Glenn L McGrath 9e966ffed4 Remove unneeded printf statment 2001-04-11 15:11:48 +00:00
Glenn L McGrath f70f6cef39 Disable sigterm 2001-04-11 15:09:30 +00:00
Glenn L McGrath 48081f81bd replace getOctal with strtol( , NULL, 8)
saves 100 Bytes
2001-04-11 05:01:09 +00:00
Glenn L McGrath 7dc8d227a5 dpkg only dependeds on tar 2001-04-11 03:47:45 +00:00
Glenn L McGrath 528ef50a4a Gzip is indepenedent of gunzip 2001-04-11 03:45:37 +00:00
Glenn L McGrath a12131966c Remove dpkg-deb applet dependencies, still depends on tar 2001-04-11 03:27:06 +00:00
Glenn L McGrath 7fd92949d0 Move unzip, gz_open, gz_close to libbb 2001-04-11 03:11:33 +00:00
Glenn L McGrath d22e560ad6 Move deb_extract() to libbb, dpkg now independent of dpkg-deb 2001-04-11 02:12:08 +00:00
Glenn L McGrath 9d53c8ab74 Move get_ar_headers to libbb, make dpkg_deb.c independent of ar.c 2001-04-11 01:37:03 +00:00
Eric Andersen 93ffa950bf Put in a paragraph break 2001-04-10 22:10:42 +00:00
Mark Whitley efcfe874ea Added a chart of busybox's growth by Larry Doolittle and put a news
announcement for it on the main page.
2001-04-10 21:58:32 +00:00
Eric Andersen 0958093be6 Doc update for the 0.51 release.
-Erik
2001-04-10 20:10:55 +00:00
Eric Andersen 3c3430502a Fix up changelog for 0.51 release 2001-04-10 20:10:14 +00:00
Eric Andersen b04d744a47 Bring Debian config files into sync with the master one. 2001-04-10 20:07:19 +00:00
Eric Andersen e703f7ed42 Ha. Regression testing found a bug with uClibc support. Fixed.
-Erik
2001-04-10 19:03:03 +00:00
Eric Andersen b9af894264 Fix up the uClibc compiler name (its format was recently changed slightly) 2001-04-10 18:35:02 +00:00
Eric Andersen 6d7fa438a7 This patch from Laurence Anderson <laurence@zxmail.com> fixes
wget HTTP 1.1 support and addes chunked encoding so bb wget
is now fully RFC compliant.
2001-04-10 18:17:05 +00:00
Eric Andersen fd402941a7 Patch from Valdimir to reduce stack usage, since recursive_action
is (as the name implies) is recursive, reducing stack memory usage
is important to avoid exhausting available stack memory.
2001-04-10 17:53:49 +00:00
Matt Kraai 4e853560f5 Fix double quote handling. 2001-04-10 00:00:05 +00:00
Eric Andersen 2f2da90fd4 "I will always compile before I commit" x 100 2001-04-09 23:54:15 +00:00
Eric Andersen b6b519b416 Update how we detect if libc5 is in use.
-Erik
2001-04-09 23:52:18 +00:00
Matt Kraai d3f97f1971 Fix warning generated by pod2html about unterminated list. 2001-04-09 23:27:51 +00:00
Eric Andersen 303dd28bb0 Make 'grep -l' work 2001-04-09 23:26:31 +00:00
Mark Whitley 4391a16c92 Fixed option parsing. Grep would continue grepping, even when given a bad /
invalid option. Closes bug #1146.
2001-04-09 23:00:07 +00:00
Eric Andersen e5dfced23a Apply Vladimir's latest cleanup patch.
-Erik
2001-04-09 22:48:12 +00:00
Eric Andersen a75e286743 Bump version number to 0.51 2001-04-09 22:18:14 +00:00
Eric Andersen 59aa5703ae Enable freeramdisk and pivot_root, disable lash for the Debian .udeb
-Erik
2001-04-09 22:17:10 +00:00
Eric Andersen fc994d1cb4 make sure we auto-close debian bug #91758
-Erik
2001-04-09 22:15:27 +00:00
Eric Andersen 7cf9fed83f update the changelog, prepatory to the 0.51 release. Please review
for correctness!
 -Erik
2001-04-09 22:09:41 +00:00
Eric Andersen 3f8688b406 Update changelog 2001-04-09 19:00:29 +00:00
Eric Andersen 5d6f3440e6 use 'USE_SYSTEM_PWD_GRP=false' for the Debian packages so the boot-floppies
do not need any of the nss crap installed.  As was, things like 'id' would
fail.  Fixed now (with thanks to Matt Kraai for his help).
 -Erik
2001-04-09 18:42:52 +00:00
Glenn L McGrath 305fdfa755 Reorganise status field to use 3 chars instead of one bit shifted long int.
Generates status file properly now, not compatable with full dpkg yet.
2001-04-08 13:27:39 +00:00
Glenn L McGrath 37849f3320 Use create_path instead of mkdir 2001-04-08 07:23:53 +00:00
Glenn L McGrath 13e9c7ad82 It now correctly backs up the (still corrupt) status file 2001-04-08 07:18:08 +00:00
Glenn L McGrath 0e757a2f3f Some fixes, but still broken... (cont)
Make better use of some libbb functions
New remove dir code to avoid depending on the rm applet
dont use copy_file() it doesnt fail elegantly
Use getopt.
Generate correct /var/lib/dpkg/info/ files
Status file is broken, working on it now
2001-04-08 05:27:18 +00:00
Glenn L McGrath f608da4288 Ignore SIGTERM prior to gz_close() 2001-04-07 02:40:59 +00:00
Glenn L McGrath e5f3957665 Fix warning 2001-04-07 02:17:36 +00:00
Eric Andersen 8a9b2c6448 Note that insmod now also supports powerpc and mips. Thanks Larry. 2001-04-06 22:02:49 +00:00
Eric Andersen aa21e0f913 An optimization from Vladimir 2001-04-06 16:02:22 +00:00
Eric Andersen 250a221768 more FILE_OFFSET_BITS == 64 adjustments. 2001-04-05 23:26:44 +00:00
Eric Andersen 83f173b61e A first pass at making D_FILE_OFFSET_BITS=64 work, from
Jari Ruusu <jari.ruusu@pp.inet.fi>
2001-04-05 23:07:25 +00:00
Eric Andersen c270ec1fa2 Add support of /W prompts
-Erik
2001-04-05 23:00:47 +00:00
Eric Andersen 831ed16efc Handle glibc 2.0.7 as well 2001-04-05 22:38:32 +00:00
Eric Andersen 79757c9c37 A patch from Dmitry Zakharov <dmit@crp.bank.gov.ua> which adds
- support for ftp downloads
- HTTP basic authentication support (as an optional feature)
- handling of http redirections
- protocol version changed to 1.0 (to stop servers from requesting
chunked encoding)
- bugfix: in the case when content-length not given, wget didn't
download anything
- when attempting to continue an aborted download but server doesn't
support restarts, reopen output file in write mode
- changed assumption that existing file should restart an aborted
    download.  Now the user must explicitly specify this with -c
2001-04-05 21:45:54 +00:00
Eric Andersen ea9065072c Some cleanups/fixes for the syslogd circular buffer code
from Gennady Feldman.
2001-04-05 20:55:17 +00:00
John Beppu 79359d87e8 - autodocifier.pl :: continuation() was modified such that '#'
is handled correctly.
2001-04-05 20:03:33 +00:00
John Beppu 94e505485e - use docs/autodocifier.pl to merge POD together 2001-04-05 19:42:03 +00:00
John Beppu 5bca0afb31 - split busybox.pod into a header and footer.
the body will be generated by docs/autodocifier.pl
2001-04-05 19:41:23 +00:00
John Beppu 9a1395b9fd - documentation updates and a minor tweak to POD generation 2001-04-05 19:35:17 +00:00
Eric Andersen 4e2439ad27 It seems all the stdout munging was useless anyways, since
deb_extract and all its called functions do nothing with
stdout anyways.  Axe that stuff.
 -Erik
2001-04-05 18:30:38 +00:00
Eric Andersen 911af57ff8 Be more generic for libc5. We don't need to know struct definitions
to make the syscall finction -- use a generic pointer instead.
2001-04-05 07:41:51 +00:00
Eric Andersen 64c8b1762c Another iteration -- adjust the init_module syscall a bit.
-Erik
2001-04-05 07:33:10 +00:00
Eric Andersen acc7757312 *** empty log message *** 2001-04-05 06:24:28 +00:00
Eric Andersen a2a978ae23 Some further syscall adjustments. Split the module syscalls out of
insmod and into libbb. Only enable them for libc5.  glibc and
uClibc don't need them.
 -Erik
2001-04-05 06:08:14 +00:00
Eric Andersen fdefbbbe85 dpkg_deb had not been updated for the new gunzip interface. Fix it.
-Erik
2001-04-05 06:04:11 +00:00
Eric Andersen e76c3b08e1 A number of cleanups. Now compiles with libc5, glibc, and uClibc. Fix a few
shadowed variables.  Move (almost) all syscalls to libbb/syscalls.c, so I can
handle them sanely and all at once.
 -Erik
2001-04-05 03:14:39 +00:00
Eric Andersen 3c0364f391 Patch from Larry Doolittle to eliminate needless thrashing
about when trimming long strings with lots of trailing white
space.
2001-04-04 22:49:01 +00:00
Eric Andersen 4fd382ea29 Remove unused optarg variable 2001-04-04 19:33:32 +00:00
Eric Andersen 06070532ba Failed to name "Electric-fence" explicitly 2001-04-04 19:32:00 +00:00
Eric Andersen d402edfd63 Some cleanups for libc5 support 2001-04-04 19:29:48 +00:00
Eric Andersen 14fe392dde Fix a warning with libc5.
-Erik
2001-04-04 19:26:22 +00:00
Eric Andersen b2e3e9b0c9 Seems that stupid libc5 doesn't implement daemon(), so conditionally
inclde that here.
 -Erik
2001-04-04 19:25:57 +00:00
Matt Kraai 2129f97cd9 Avoid segfault when export is invoked with no arguments. Thanks to
Gennady Feldman.
2001-04-04 17:50:04 +00:00
Eric Andersen 3f98040554 I said no new features till after the 0.51 release. Well, I lied. This is a
vi editor for busybox, contributed by Sterling Huxley <sterling@europa.com>.
It adds 22k to the busybox binary when enabled.  Quite impressive!
2001-04-04 17:31:15 +00:00
Eric Andersen 91c9388715 Place a temporary bandaid on the ls/du/df human-readable issue. This method is
not going to scale up as well as I would like, and Matt Kraai and I have
discussed a better long term solution.  But for now this will at least make all
the human-readable apps give correct answers.

Please test the human readable/non-human readable options on your systems!!!
 -Erik
2001-04-03 23:14:29 +00:00
Eric Andersen 24073c7665 Add in easy-to-use electric-fence support.
-Erik
2001-04-03 22:53:19 +00:00
Eric Andersen 60b2d8d2c8 if strlen(s) was 0, it would then end up using s[-1] as an array index. Bad,
bad, bad.  This was crashing the shell on powerpc boxes, though all other archs
seem to have a much more forgiving malloc implementations.  I finally found
this bug using electric-fence on a powerpc box.
 -Erik
2001-04-03 22:50:52 +00:00
Eric Andersen c97ec34370 A patch from Matt Kraai that adds a new 'shutdown' action to busybox init. Now
you can specify an arbitrary behavior for 'ctrlaltdel' without that behavior
needing to be a reboot.
2001-04-03 18:01:51 +00:00
Eric Andersen 0f0c0b41ce Make 'busybox --help' work as expected, closing bug #1139
-Erik
2001-04-03 17:05:01 +00:00
Eric Andersen c0c502e172 Fix for bug 1143 from Larry Doolittle
-Erik
2001-04-03 16:38:37 +00:00
Eric Andersen c4cef5ab06 Move the mtab support stuff into libbb
-Erik
2001-04-01 16:01:11 +00:00
Eric Andersen f77d88641d Formatting change 2001-04-01 04:49:41 +00:00
Glenn L McGrath 1e117b4752 Dont try and automount devfs, rename some variables 2001-03-30 01:28:13 +00:00
Eric Andersen 84e229cfbe Add in a new standalone env applet for fixing up app's environments
-Erik
2001-03-29 22:48:33 +00:00
Eric Andersen e5c24dfd01 Use daemon() to spawn syslogd and klogd daemons.
-Erik
2001-03-29 21:58:33 +00:00
Eric Andersen 3a6da8c183 gz_open and gz_close were left in, even when BB_FEATURE_TAR_GZIP was disabled.
Fix that.
2001-03-29 14:22:45 +00:00
Glenn L McGrath 5f2ef46d6d Fix zcat 2001-03-29 01:07:54 +00:00
Glenn L McGrath ed7a776538 gunzip -c works again 2001-03-29 00:57:20 +00:00
Glenn L McGrath ae8ad35590 Fixes from Robert Kaiser 2001-03-28 23:57:51 +00:00
Mark Whitley e0a7f917c2 Applied patch from David Douthitt to re-add -print option to find.
Closes bug #1144.
2001-03-28 22:04:42 +00:00
Eric Andersen c835567914 Fix ls so it uses make_human_readable_str() the same way already
used by 'du' and 'df'.  Now we just need to fix make_human_readable_str
so it behaves they way it used to before Matt fixed it.
2001-03-28 20:26:51 +00:00
Matt Kraai d98e574d41 Patch bass ackwards behavior of hr flag. 2001-03-28 20:10:25 +00:00
Matt Kraai 7cd0cfeab6 Rewrite to fix bug #1140 and make it slightly smaller. 2001-03-28 16:42:27 +00:00
Glenn L McGrath f957c77910 Enable tar -z support again by default 2001-03-28 07:48:10 +00:00
Glenn L McGrath 02cebebc3b Remove cruft 2001-03-28 07:37:48 +00:00
Glenn L McGrath 9233959940 Remove tar_unzip_init() not needed any more, uses gz_open instead 2001-03-28 07:31:37 +00:00
Glenn L McGrath 018e9e6799 Fix tar -z, calls gz_open now 2001-03-28 07:27:26 +00:00
Glenn L McGrath ee79ca1ba6 Disable tar -z for now 2001-03-28 06:13:15 +00:00
Glenn L McGrath 0cbc8cf4c9 Gunzip changes broke tar -z support (woops) 2001-03-28 05:47:26 +00:00
Glenn L McGrath 58e42d5356 Major cleanup to better adhere to style guide and use standard busybox functions 2001-03-28 05:38:24 +00:00
Glenn L McGrath f58efb57d1 Add functions that were shared with gunzip.c, gunzip about to change. 2001-03-28 05:35:16 +00:00
Matt Kraai a2e68fc233 Change BB_FEATURE_TRIVIAL_HELP to BB_FEATURE_VERBOSE_USAGE (per bug #1130). 2001-03-27 21:57:29 +00:00
Mark Whitley 5b8939b147 Some more words on sending patches to the bug-tracker. 2001-03-27 21:20:05 +00:00
Mark Whitley 9a2144663a Applied patch from David Douthitt to fix problem where ls reports half the
file size. Should close bug #1140.
2001-03-27 20:59:14 +00:00
Mark Whitley cc7b4f39fc Some more tests for cut. Craig Matsuura said he saw some problems along these
lines. "Works for me", but we'll keep these tests around for regression.
2001-03-27 20:48:01 +00:00
Mark Whitley bff6b18bf9 Applied patch from Gennady Feldman to fix a single-threaded syslogd bug that
turned up. This code needs to be tested on an embedded system, since that's
where the bug turned up in the first place.
2001-03-27 20:17:58 +00:00
Mark Whitley 2b549c3be0 Fixed the Makefile so busybox can link against libc5 again. Putting libbb.a at
the end broke it.
2001-03-27 18:22:41 +00:00
Mark Whitley 5cd2a2d53e In fact, socklen_t *is* defined by libc5. 2001-03-27 18:22:00 +00:00
Mark Whitley a82a00397f Fix to last patch: locale code should be 9, not 7. 2001-03-27 17:07:15 +00:00
Mark Whitley 1c6581a865 Applied patch from Vladimir N. Oleynik to add locale support to the shell per
bug report from Ralph Jones.
2001-03-27 16:35:16 +00:00
Mark Whitley af633757d3 Applied patch from Anthony Towns that he posted to Debian bug tracking. 2001-03-26 16:47:57 +00:00
Manuel Novoa III 049dc25fe7 Fix in_ether bug regarding hex digits reported by Jonas Holmberg <jonas.holmberg@axis.com>. 2001-03-26 16:26:16 +00:00
Eric Andersen 36eff9ac55 Bump version number to 0.51pre 2001-03-24 06:34:59 +00:00
Eric Andersen 6f3240abf9 xstrdup xargs cleanup from Jeff Garzik 2001-03-23 17:11:22 +00:00
Eric Andersen 6b2c23d847 xstrdup tftp cleanup from Jeff Garzik 2001-03-23 17:10:19 +00:00
Eric Andersen 21af752b04 Patch to use xfopen from Jeff Garzik 2001-03-23 17:09:15 +00:00
Eric Andersen f6aa13d403 -Wshadow tr fix from Jeff Garzik 2001-03-23 17:08:21 +00:00
Eric Andersen 82ab8da245 -Wshadow sh fix from Jeff Garzik 2001-03-23 17:06:01 +00:00
Eric Andersen 8ffaf8d139 -Wshadow logread fix from Jeff Garzik 2001-03-23 17:04:47 +00:00
Eric Andersen c54f9530ee -Wshadow loadacm fix from Jeff Garzik 2001-03-23 17:03:28 +00:00
Eric Andersen 08ff8a49ba includes cleanup from Jeff Garzik 2001-03-23 17:02:05 +00:00
Mark Whitley 0b4d73a53c Some minor wordsmithing, an extra item in the list of "things Busybox doesn't
need", example of a testcase, more janitorial items, and a whole new section
with guidelines on committing changes to CVS.
2001-03-22 22:59:33 +00:00
Eric Andersen 82bb8a2bf8 Patch from Dirk Behme <dirk.behme@de.bosch.com> to
add EM_MIPS_RS3_LE for mips
 -Erik
2001-03-22 19:01:16 +00:00
Eric Andersen 851895ab80 Clean up more local vars which shadow globals
-Erik
2001-03-21 21:52:25 +00:00
Eric Andersen 1ca20a7747 A nice patch from Larry Doolittle that adds -Wshadow and
cleans up most of the now-revealed problems.
2001-03-21 07:34:27 +00:00
Mark Whitley 7447642a47 Added a section on the available Busybox boot-floppy image. Also provided some
linkes to a Wired article on Midori Linux.
2001-03-20 19:57:30 +00:00
Mark Whitley 6f93277f56 Added adjtimex applet from Larry Doolittle. 2001-03-20 19:18:10 +00:00
Eric Andersen ba372620c2 Force applet_name to be "sh" when command prefaced by "-" 2001-03-20 17:39:53 +00:00
Eric Andersen 7ef1a5beb2 Fix up command line munging in init. Postpone the askfirst thing till
a bit later in run().
2001-03-20 17:39:08 +00:00
Eric Andersen 4ef37d0c17 chown was missing a ] in its usage msg 2001-03-20 01:06:14 +00:00
Eric Andersen 92d23245c9 Another cleanup patch from Jeff Garzik <jgarzik@mandrakesoft.com> 2001-03-19 23:49:41 +00:00
Eric Andersen 40eaa9f0bb Size optimization for rdate from Vladimir 2001-03-19 19:41:54 +00:00
Eric Andersen 8269396491 Simpify detection of no options. 2001-03-19 19:40:43 +00:00
Eric Andersen 2ccfef2004 Patch from Vladimir to move struct applet from busybox.c to applets.c,
which looks like the right place for such things to live.
2001-03-19 19:30:24 +00:00
Eric Andersen 23c1a18126 Per suggestion from Vladimir, no need to initialize these -- let the bss
do it.
 -Erik
2001-03-19 19:28:24 +00:00
Eric Andersen 7ef54de672 locale correction patch from Vladimir 2001-03-19 19:25:49 +00:00
Eric Andersen b183dfad2d Split error messages into separate files.
Update libbb.h, per suggestion from Vladimir, to include __attribute__((format
(printf ...))) stuff
 -Erik
2001-03-19 19:24:06 +00:00
Eric Andersen cc165b9083 Should exclude "i" option when not enabled. 2001-03-19 18:59:01 +00:00
Eric Andersen 00b0496e69 Doesn't need a "-" option -- getopt does that for us. 2001-03-19 18:57:08 +00:00
Eric Andersen 16f7015722 Patch from Vladimir to force interactiveFlag=FALSE when forceFlag=TRUE 2001-03-19 18:54:38 +00:00
Eric Andersen 7c25441792 getopt-ify rm so that BB_FEATURE_RM_INTERACTIVE will work 2001-03-19 18:52:37 +00:00
Eric Andersen c75586e06d Split libbb/pwd_grp_wrappers.c into 5 different libbb/my_* files.
-Erik
2001-03-19 18:37:42 +00:00
Eric Andersen 61173a5371 Fix to cmdedit.c from Vladimir 2001-03-19 17:48:55 +00:00
Eric Andersen fa513aab48 Some configuration adjustments from Vladimir 2001-03-19 17:25:21 +00:00
Eric Andersen 8b96032139 Fix a bug pointed out by Rob Landley <rlandley@austin.rr.com>, where
setup_sockaddr_in was zeroing the sizeof a pointer, not the sizeof the struct,
which was obviously what was intended.  Thanks Rob,
 -Erik
2001-03-17 05:43:39 +00:00
Eric Andersen 341744781a Patch from Larry and Vladimir to clean up sh.c and fix
shell expansion to work in non POSIX locales.
2001-03-17 00:20:10 +00:00
Eric Andersen 1a6f8cfadf update .cvsignore files to note new location of loop.h 2001-03-17 00:15:02 +00:00
Eric Andersen 8a6dbf6709 Patch from Pierre PEIFFER <pierre.peiffer@sxb.bsf.alcatel.fr>
that copes with the fact that processes may have been swapped
out.
2001-03-17 00:05:42 +00:00
Eric Andersen e2a3cd15a8 Stupid thinko. egrep tried to call init. Sigh. Fix from Christophe Boyanique 2001-03-16 23:49:20 +00:00
Eric Andersen aad1a88c76 Convert utility.c into libbb.a. It is now a whole pile of .c
files.  Clean up the resulting damage and fix up the makefile.
 -Erik
2001-03-16 22:47:14 +00:00
Eric Andersen dfba13d199 A few minor touchups. 2001-03-16 08:30:00 +00:00
Eric Andersen 704b2c2122 There was an unwanted extra newline, which prevented building
uudecode.  How did this sneak through the testing until now?
 -Erik
2001-03-16 08:06:30 +00:00
Eric Andersen 53b55ac08d Fix the make release target. 2001-03-16 07:43:53 +00:00
Eric Andersen c36c2ba598 Update webpage noting 0.50 release. 2001-03-16 07:16:12 +00:00
Eric Andersen 7f1978570f A patch from Andreas Neuhaus to be especially careful to not dup
any env variables when spawning child processes.
2001-03-16 01:14:04 +00:00
Eric Andersen 4aaefc2a50 Fix from Larry for glob problems.
-Erik
2001-03-15 23:01:19 +00:00
Eric Andersen c5b3242d3d Remove the "GPL2" bit, since it hung over the end of the line. 2001-03-15 22:58:11 +00:00
Mark Whitley 056960d8dc Applied patch from Larry Doolittle to fix problem where multibuild.pl would
build the wrong files. Made the same changes to multifeat.pl.
2001-03-15 22:14:26 +00:00
Eric Andersen 0d5051def0 Update files and version number prepratory to cutting a release.
-Erik
2001-03-15 22:12:43 +00:00
Eric Andersen 3a0057e2c5 Fix egrep 2001-03-15 21:33:33 +00:00
Mark Whitley f71378c4ad One tiny little missing newline that confused pod. 2001-03-15 21:20:25 +00:00
Mark Whitley 0a6f1d31e7 One tinly, little, missing newline that confused Pod. 2001-03-15 21:19:09 +00:00
John Beppu e708cb5f9a - generated middle section of busybox.pod w/ autodocifier.pl
- updated autodocifier.pl to use tab to indent example section
2001-03-15 21:08:01 +00:00
Eric Andersen a4edd0e946 A better fix. Read nextPtr before mem gets freed.
-Erik
2001-03-15 21:04:18 +00:00
Eric Andersen f9ff8a7d90 cmdedit.c bugfix patch from Vladimir.
-Erik
2001-03-15 20:51:09 +00:00
John Beppu af9e533a54 - properly indent Examples section in pod generator 2001-03-15 20:49:25 +00:00
Eric Andersen 48dcc16548 Don't confuse people. If the run 'ifconfig' and they didn't
compile with BB_FEATURE_IFCONFIG_STATUS turned on, it will
now print a message telling them as much.
 -Erik
2001-03-15 20:48:45 +00:00
Mark Whitley 730cdb1904 Reversed previous patch. The right way is to fix uClibc. 2001-03-15 19:39:40 +00:00
Eric Andersen 0d4e51d390 Prevent init from potentially using already freed memory when
deleting an initAction, fixing a bug pointed out by Andreas Neuhaus
 -Erik
2001-03-15 19:18:21 +00:00
Mark Whitley 0b57e28373 Applied patch from Andreas Neuhaus to fix namespace conflict that made busybox
not compile with uClibc.
2001-03-15 19:12:06 +00:00
Mark Whitley b0c2b7dfe3 dos2unix logread.c 2001-03-15 19:05:59 +00:00
Eric Andersen 2825ee8c2c Fix linuxrc define 2001-03-15 18:58:06 +00:00
Eric Andersen a8035a51be Move the warning msg after features.h gets pulled in.
-Erik
2001-03-15 18:20:23 +00:00
Mark Whitley 7384d7dce0 Added some tests for some recently found / fixed bugs in the shell. 2001-03-15 18:19:13 +00:00
Eric Andersen 0d3a02eba7 Update the documentation so examples are autoincluded in the output text.
Fix up docs/busybox.pod with the latest autogenerated output.
 -Erik
2001-03-15 18:14:25 +00:00
Eric Andersen 670bea210e Update the changelog, in preparation for making the 0.50 release 2001-03-15 17:56:44 +00:00
Eric Andersen d8adaa279e Update the olympus sections 2001-03-15 17:54:56 +00:00
Mark Whitley 3bf60aa723 If only BB_DPKG was enabled in Config.h, busybox would not build; it'd say:
dpkg.c:18: #error It looks like you are using libc5, which does not support
  dpkg.c:19: #error tfind().  tfind() is used by busybox dpkg.
  dpkg.c:20: #error Please disable BB_DPKG.  Sorry.
This was fixed by changing the || to an && in the preprocessor.
(We've changed the logic in there too many times.)
Found using multibuild.pl.
2001-03-15 17:39:29 +00:00
Mark Whitley e110ccb672 Removed leftover BB_FEATURE_KLOGD per report from Giulio Orsero 2001-03-15 17:30:07 +00:00
Manuel Novoa III 0e0883e0e9 Fix stupid cut-and-paste bug... output RX/TX bytes instead of RX/RX bytes. 2001-03-15 15:37:48 +00:00
Mark Whitley 038c8eb5a9 Applied patch from Erik Habbinga to fix a problem with an uninitialized
substitution delimiter.
2001-03-14 21:11:49 +00:00
Mark Whitley 7ddaf7caae Added a section to describe how to convert variables to K&R style using the
mk2knr.pl script. Also some minor cleanups.
2001-03-14 21:04:53 +00:00
Mark Whitley bac75ac2d5 Script that generates a script that will convert oddball variable names to K&R
style.
2001-03-14 21:04:07 +00:00
Eric Andersen 1ef92685cf Yesterday I make strsep_space include post-token whitespace,
so we should not be adding another " " between tokens.
 -Erik
2001-03-14 19:33:45 +00:00
Eric Andersen ce4a586edb I forgot to malloc space for the NULL.
-Erik
2001-03-14 18:57:54 +00:00
Mark Whitley 40e5e7c7ea Applied patch from Christophe Boyanique to add an egrep alias for grep. 2001-03-14 17:45:45 +00:00
Mark Whitley 20f61d35de The patch I previously applied from Brian Webb was 2 lines off. Oops. 2001-03-14 17:30:44 +00:00
Mark Whitley 44a9914709 Applied patch from Larry Doolittle to fix '>\na\n' bug. Should close bug #1132 2001-03-14 17:26:37 +00:00
Mark Whitley 2892c35bdb Applied patch from Giulio Orsero to fix some preprocessor bugs. 2001-03-14 17:18:52 +00:00
Eric Andersen 82d8502409 Fix from Manuel for a silly thinko on my part. 2001-03-14 17:15:45 +00:00
Eric Andersen 53f5061c7e Fix init so that checking for terminal devices is delayed until the
devices are actually used, thereby allowing devfsd based systems to
work.  This should fix bug #1133
 -Erik
2001-03-14 09:01:11 +00:00
Eric Andersen bdc8db9685 Use the system passwd and group stuff by default 2001-03-14 01:49:10 +00:00
Eric Andersen 741f2c9898 Fix mtab so it works on libc5 2001-03-14 01:48:10 +00:00
Eric Andersen b9a1e56a80 No reason to include fstab. It breaks libc5, does nothing for glibc.
-Erik
2001-03-14 01:43:29 +00:00
Eric Andersen 2b1c367a98 Amazing the difference between an "and" and an "or". 2001-03-14 01:36:52 +00:00
Eric Andersen 3c0b425cde dpkg used tfind, which doesn't work with libc5. Print a friendy error
should someone try to use it...
 -Erik
2001-03-14 01:31:11 +00:00
Eric Andersen 14e9e9d1ca Fix socklen_t for libc5 2001-03-14 01:23:07 +00:00
Eric Andersen 9c09e0eeaa The IPC_SYSLOG stuff should be off by default.
-Erik
2001-03-14 01:16:41 +00:00
Eric Andersen c319601db5 Some updates for libc5 2001-03-14 01:15:06 +00:00
Eric Andersen 4e7244e6b2 libc5 glob is pretty stupid and doesn't do GLOB_BRACE or GLOB_TILDE
-Erik
2001-03-14 00:49:52 +00:00
Mark Whitley 8658816f71 Added a dependency on BB_MKFS_MINIX to xfopen(). 2001-03-14 00:43:16 +00:00
Mark Whitley f594986b37 - Changed name of BB_FEATURE_SIMPLE_PROMPT to BB_FEATURE_SH_SIMPLE_PROMPT
- Set BB_FEATURE_SH_STANDALONE_SHELL and BB_FEATURE_SH_APPLETS_ALWAYS_WIN to
   be off by default
 - Set BB_FEATURE_SH_SIMPLE_PROMPT to be on by default
 - Added some more magic to the Olympus section to make all the dependencies
   on the shell, cmdline editing, tab completion and friend work properly.
 - Tidied up the Olympus section with some whitespace. Checked the various
   scrips that parse through there and the extra whitespace shouldn't break
   anything.
2001-03-14 00:29:14 +00:00
Mark Whitley c75f83d874 Some new testcases, some improvements to the tester.sh script. 2001-03-13 23:30:18 +00:00
Eric Andersen b3d6e2df95 Update the lash shell (hopefully the last time...) so things like
echo "foo   bar" and echo -n "foo\t\\\\\tbar" work as expected.
Merge prompt printing work from Vladimir.
 -Erik
2001-03-13 22:57:56 +00:00
Mark Whitley 798ab301c7 Added Midori Linux to the list of known projects that use Busybox. 2001-03-13 17:08:54 +00:00
Mark Whitley f6ba2da29f Credited Christophe Boyaniqu for interactive patch to rm. 2001-03-13 16:35:55 +00:00
Mark Whitley e0bf91d7c6 Applied patch from Christophe Boyanique to add -i support to rm. 2001-03-13 00:40:19 +00:00
Mark Whitley 53737c5421 Some fixlets that didn't get added in the last 'syslogd split' patch:
- BB_LOGREAD should not be in the applet section
	- BB_FEATURE_IPC_SYSLOG added to the feature section
	- Some voodoo added to the Olympus section
2001-03-12 23:55:56 +00:00
Mark Whitley 6bff9cc487 Added some comment lines in the header indicating that Gennady Feldman is the
maintainer of these three applets.
2001-03-12 23:41:34 +00:00
Mark Whitley bd2e42f162 Applied a patch from Brian Webb to fix a problem with mount on the Agenda PDA.
Apparently, the mount() call does not like taking a stack allocated pointer.
2001-03-12 23:17:26 +00:00
Mark Whitley 94fd480bab Applied patch from John Lombardo to fix OOM in insmod. 2001-03-12 23:08:34 +00:00
Mark Whitley 6317c4baf7 Applied patch from Gennady Feldman to split up syslogd.c into syslogd and
klogd (as it should be).
2001-03-12 22:51:50 +00:00
Eric Andersen 4987bbf979 A fix from Larry Doolittle for some nasty segfaults when sh.c tried to free a
corrupted cmd pointer, and where it would truncate a command line at the first
double space.
 -Erik
2001-03-12 21:36:49 +00:00
Mark Whitley 5ec5415402 Program for testing concurrent access to syslogd. 2001-03-12 20:00:00 +00:00
Mark Whitley 1a49fc5e92 Applied patch from Gennady Feldman to use single-thread instead of forking. 2001-03-12 19:51:09 +00:00
Manuel Novoa III fe4e13fb97 Add missing dependency -- interface.c needs get_kernel_revision. 2001-03-12 10:00:17 +00:00
Manuel Novoa III 22b889a998 Adjust ifconfig usage message for selected options and current functionality. 2001-03-12 09:58:51 +00:00
Manuel Novoa III 68ea1d0325 Reduced code size of interface. Support ifconfig -a and ifconfig interface
display.  Change %llu to %Lu in ifconfig for hacked unsigned long long support
in uClibc scanf.
2001-03-12 09:57:59 +00:00
Eric Andersen 1365bb7861 When using wordexp, only try to use the expand command
when something actually got expanded.  Skip it otherwise.
 -Erik
2001-03-10 07:12:12 +00:00
Manuel Novoa III 78f57460f2 Quick mod to enable option -a for ifconfig. 2001-03-10 02:00:54 +00:00
Mark Whitley d2117e9c82 Created new regression testing framework with a number of testcases (many more
can be added). Also changed 'test' target in makefile to run the new
tester.sh. (Hopefully, we should be able to remove all the tests/*.mk files
soon.)
2001-03-10 00:51:29 +00:00
Mark Whitley 09f4af5afd /* getopt not needed */ 2001-03-10 00:13:20 +00:00
Mark Whitley 827e45c518 Added some more '/* getopt not needed */' lines. 2001-03-09 23:59:51 +00:00
Manuel Novoa III fa45f22e50 Use perror_msg_and_die function where appropriate. 2001-03-09 23:06:15 +00:00
Eric Andersen d92168486b Fixed df.c so that nfs volumes will display properly (fixing bug #1113).
Problem was 512/1024 = 0 if you use longs, so I cast KILOBYTE to a double, then
cast the result back to an int after the math is done, letting C's type
promotion do its magic for the rest.
 -Erik
2001-03-09 22:42:26 +00:00
Eric Andersen 4aaf89f49f Silence a silly warning 2001-03-09 22:17:59 +00:00
Mark Whitley f90c28dd1e Applied patch from Jeff Garzik to getopt-ify rmmod. 2001-03-09 21:49:12 +00:00
Eric Andersen 8d4c397d9d Patch from Jeff Garzik marking a few 'getopt not needed' apps. 2001-03-09 21:28:09 +00:00
Eric Andersen 3e6ff9017f A cleanup patch from Jeff Garzik to static-ify a number of
namespace polluting things that really should be static.
2001-03-09 21:24:12 +00:00
Eric Andersen dd91724aa0 patch from Larry to fix pristine source builds 2001-03-09 20:47:27 +00:00
Eric Andersen 74e056bfc8 Fixed a couple more cases. $FOO/bar ${FOO} and such now work
without wordexp.  Of course for stuff like ${1:-foo} you still
need wordexp for them to work.
 -Erik
2001-03-09 20:34:46 +00:00
Eric Andersen 3c7361f53a Allow wordexp to be used if available 2001-03-09 19:45:26 +00:00
Eric Andersen ce89871ff7 Urg. Remove the debug noise 2001-03-09 19:43:57 +00:00
Eric Andersen 195743f195 Ok, sh.c should be working now. Many thanks to Larry Doolittle
for his timely help -- nearly all of the work in this patch is
his.
 -Erik
2001-03-09 19:21:37 +00:00
Eric Andersen eba8ed71f0 Patchs from Jeff Garzik <jgarzik@mandrakesoft.com> to cleanup
warnings with glibc 2.2 and use always use xfopen
 -Erik
2001-03-09 14:36:42 +00:00
Mark Whitley 9ba5bce06f Added script that tests turning on features in busybox one at a time and
compiling to see if things break. Initial revision.
2001-03-09 01:46:45 +00:00
Eric Andersen 01658a3eec Fix sh.c for the glab case. I was messing things up for
single argument commands.  It should now work as expected...
 -Erik
2001-03-09 01:24:02 +00:00
Eric Andersen 3dbf1e877a A '.' is a legal seperator. 2001-03-09 01:08:06 +00:00
Mark Whitley afffbfe8c4 Fix to trim to make it trim properly. 2001-03-09 00:55:34 +00:00
Eric Andersen b180dd9e50 Cleanup patch from Larry 2001-03-09 00:42:46 +00:00
Eric Andersen 13d1fa1d01 Add in 'trim' routine. Fix up sh.c so it works when wordexp
is not available.
 -Erik
2001-03-08 23:59:45 +00:00
Manuel Novoa III df351d6109 Improved port of ifconfig... smaller and with more features. 2001-03-08 22:57:00 +00:00
Eric Andersen 39eea898c4 Per Vladimir's suggestion, force the locale to POSIX for all
the scripts so busybox will install properly.
2001-03-08 21:42:11 +00:00
Mark Whitley 7e5291f111 Whitespace / formatting / bracket cleanup. 2001-03-08 19:31:12 +00:00
Eric Andersen 32f8c170b0 Remember to delete un-expandable variables, and do a better job of expanding
shell-specific things in case the wordexp implementation is broken (ie. the
stubbed out wordexp in uClibc).
 -Erik
2001-03-08 17:44:37 +00:00
Eric Andersen ca6045955d Rework environment variable handling to use wordexp, per a suggestion from
Larry Doolittle a couple of months ago.  This makes the stuff-expansion in lash
be ever so standards compliant.   This change needs testing by everyone, but
appears to be solid enough to let us close bug #1090.

It works for me; however, please test this change!
 -Erik
2001-03-08 17:17:13 +00:00
Mark Whitley e2c44fc966 Applied patch from Vladimir to fix bug where find would stop as soon as it hit
a perms error. Closes bug 1124.
2001-03-08 16:54:44 +00:00
Matt Kraai 5de909873a Eliminate superfluous test. 2001-03-07 21:45:13 +00:00
Mark Whitley 4cc8f31ffe Changed KILOBYTE, MEGABYTE, and GIGABYTE from #define to enum. 2001-03-07 18:00:44 +00:00
Mark Whitley ae5612ca6e Some minor cleanups to df.c. Also, with Erik's blessing, changed name of
'format' function to 'make_human_readable_str'.
2001-03-07 17:42:07 +00:00
Mark Whitley ae20128e9f Applied patch from Christophe Boyaniqu to remove double-slashes printed in
recursive_action.
2001-03-07 17:27:04 +00:00
Eric Andersen 26d53eb197 This patch by Vladimir and Larry saves a few bytes. 2001-03-07 06:33:01 +00:00
Eric Andersen ec9fad9a49 Static-ify a variable. make du work with all the human-readable variants
since my last pass only fixed 'du -h' but left the others broken.
2001-03-07 06:04:08 +00:00
Eric Andersen a7db19bb81 Fix up du so it behaves itself also.
-Erik
2001-03-07 03:53:40 +00:00
Eric Andersen 11ae573320 remove an unused variable 2001-03-07 03:51:27 +00:00
Eric Andersen 7850f1e2ac Rewrite of format so it behaves itself
-Erik
2001-03-07 03:50:57 +00:00
Eric Andersen 5986f8d1c6 Fix up df so it works properly
-Erik
2001-03-07 03:50:03 +00:00
Eric Andersen 651f8c04ef Fix up ls.c to ensure human readable works properly in all cases 2001-03-07 03:48:02 +00:00
Mark Whitley 6c563bc1a1 Thought of another janitorial item for the list. 2001-03-06 23:16:13 +00:00
Eric Andersen 8b728a25a3 I made these little simplifications a while back, bug forgot to
check this stuff in.
 -Erik
2001-03-06 23:14:43 +00:00
Eric Andersen 702ec5926f Fix the memory leak. No really this time.
-Erik
2001-03-06 22:17:29 +00:00
Mark Whitley 8bb7df49c2 Applied patch from Vladimir Oleynik via Magnus Damm that removes newlines from
error_msg() calls and uses 'return EXIT_SUCCESS' instead of return 0.
2001-03-06 20:58:48 +00:00
Eric Andersen 0f430e34af Fix up some silly macros and use xmalloc and friends exclusively. 2001-03-06 20:54:43 +00:00
Eric Andersen 36278b9576 Fix func prototype 2001-03-06 20:47:31 +00:00
Eric Andersen 54851d3c65 Fixed a memory leak in lash. It seems that close_all was calling close()
directly instead of calling mark_closed(), which allowed the memory allocated
by mark_open() to never be freed.
 -Erik
2001-03-06 20:44:39 +00:00
Eric Andersen 07f2f3917a Close open files before calling builtin_exec(). I've tested this
and it fixes bug #1121.
 -Erik
2001-03-06 20:28:22 +00:00
Eric Andersen 1a046d5f9d Bug 1110 reported that the LOOP_GET_STATUS ioctl apparently returnes non-zero
error messages, contrary to the documentation.  Whatever.  This patch from
zhaoway <zw@debian.org> looks safe enough.
 -Erik
2001-03-06 19:35:58 +00:00
John Beppu 138ece09b5 minor cleanup 2001-03-06 19:25:25 +00:00
Eric Andersen e6c4de03c6 First pass at trying to retrofit a changelog for 0.50. Please everyone
look over this and if I forgot something, misattributed your work, or
spelled something badly, please let me know.
 -Erik
2001-03-06 18:46:10 +00:00
Eric Andersen f15d4dad66 Add in a first pass at ifconfig status reporting. It took a long while
hacking on the mess in net-tools-1.59, but it currently adds 12k and
supports ethernet, loop, ppp, and treats everything else as a generic
interface.  Works ok for me.
 -Erik
2001-03-06 00:48:59 +00:00
Eric Andersen 5efa2291aa Fix up the freshmeat appindex record. 2001-03-05 18:26:50 +00:00
Eric Andersen c27b9544b6 Make sure libpwd.a is linked _last_ so it overrides the system pwd/grp
implementation.  It wasn't doing that as expected...
2001-03-05 17:57:34 +00:00
Eric Andersen 47cdcdd359 Try to do a little better at documenting how to use
alternate C libraries, thanks to David Douthitt.
2001-03-05 17:08:52 +00:00
David Kimdon 21b7459add add wget, tr, telnet, ping, md5sum and loadkmap to .deb 2001-03-05 08:43:26 +00:00
Eric Andersen afbff22e6e Enable INSTALLER for the deb 2001-03-05 04:00:06 +00:00
Eric Andersen 452fd33ffa Patch from Vladimir to make sure PATH is set correctly. 2001-03-04 06:47:33 +00:00
Eric Andersen 076cdc24fc If umount2 is not available, stub it out. 2001-03-04 06:07:34 +00:00
Mark Whitley 9ead68975c Added some words on use of getopt in applets. 2001-03-03 00:44:55 +00:00
Glenn L McGrath 323434be42 Dont try to automount some specific filesystem types 2001-03-02 22:21:34 +00:00
Mark Whitley 446dd27843 Applied patch from Vladimir N. Oleynik that fixes incorrect behaviour in
recovery_mode and changed option processing.
2001-03-02 20:00:54 +00:00
Mark Whitley 42ab250709 Removed section on testing that is now in contributing.txt. 2001-03-02 19:15:01 +00:00
Mark Whitley 3b565cdf91 Added 'How to contribute to Busybox' doc. 2001-03-02 19:14:25 +00:00
Mark Whitley 85adecb668 Whoops! BB_TFTP should prolly be off by default. 2001-03-02 19:11:26 +00:00
Mark Whitley 450736cd3c Added Magnus Damm's tftp applet to Busybox. 2001-03-02 19:08:50 +00:00
Mark Whitley 016771834a Changed exit code from -1 to 0 when busybox is invoked with no args.
(Closes bug #1114.)
2001-03-02 17:47:17 +00:00
Mark Whitley 39842defda Applied patch from David Douthitt to fix build error in df.c when
BB_FEATURE_HUMAN_READABLE was disabled.
2001-03-01 18:51:33 +00:00
Eric Andersen de4406747b Bah. I missed a header file. 2001-03-01 07:55:49 +00:00
Eric Andersen 7b91f02021 Reduce the size of mount (and bypass /proc/filesystems) by using the sysfs
system call, based on work done by Glenn McGrath in December.
 -Erik
2001-03-01 07:50:04 +00:00
Matt Kraai 93ba60f01d Keep trying if an NFS mount fails, and eliminate a call to exit(3). 2001-02-28 15:33:12 +00:00
Eric Andersen 1b6cff3df4 libpwd was getting added twice. 2001-02-27 22:24:45 +00:00
Mark Whitley 4f76bb6f3e Little patchlet to make linking against libc5 work a little better 2001-02-27 19:53:48 +00:00
Eric Andersen 4142d4dc66 Patch from Vladimir N. Oleynik to save 128 bytes by moving error
checking for some my_* functions to utility.c
2001-02-27 18:22:03 +00:00
Mark Whitley e677dfedd1 Applied patch from Magnus Damm <damm@opensource.se> to fix a 'inner scope var
masking outer scope var with same name' bug that was preventing the loopback
device from being unmounted if mount() fails.
2001-02-26 17:45:58 +00:00
John Beppu d11578f916 - changed the way POD is generated such that the dashed
line appears at the bottom instead of the top.  The
  indentation semantics of POD make the first item in
  the (=over,=back) block look weird the other way.
- implemented a way to encode example usage into usage.h
  One would define a macro called "${applet}_example_usage"
  which would expand to the example text.
- The example usage is considered optional, but trivial and
  full usage are not.

  Here's an example using chown.

---- before

#define chown_trivial_usage \
	"[OPTION]...  OWNER[<.|:>[GROUP] FILE..."
#define chown_full_usage \
	"Change the owner and/or group of each FILE to OWNER and/or GROUP.\n" \
	"\nOptions:\n" \
	"\t-R\tChanges files and directories recursively."
#define chown_example_usage \
	"\t$ ls -l /tmp/foo\n" \
	"\t-r--r--r--    1 andersen andersen        0 Apr 12 18:25 /tmp/foo\n" \
	"\t$ chown root /tmp/foo\n" \
	"\t$ ls -l /tmp/foo\n" \
	"\t-r--r--r--    1 root     andersen        0 Apr 12 18:25 /tmp/foo\n" \
	"\t$ chown root.root /tmp/foo\n" \
	"\tls -l /tmp/foo\n" \
	"\t-r--r--r--    1 root     root            0 Apr 12 18:25 /tmp/foo\n"

---- after

=item I<chown>

chown [OPTION]...  OWNER[<.|:>[GROUP] FILE...

Change the owner and/or group of each FILE to OWNER and/or GROUP.

Options:

	-R	Changes files and directories recursively.

Example:

	$ ls -l /tmp/foo
	-r--r--r--    1 andersen andersen        0 Apr 12 18:25 /tmp/foo
	$ chown root /tmp/foo
	$ ls -l /tmp/foo
	-r--r--r--    1 root     andersen        0 Apr 12 18:25 /tmp/foo
	$ chown root.root /tmp/foo
	ls -l /tmp/foo
	-r--r--r--    1 root     root            0 Apr 12 18:25 /tmp/foo


-------------------------------
2001-02-26 02:50:11 +00:00
Eric Andersen 2bf658d5cd This patch, from Quinn Jensen <jensenq@lineo.com>, adds MIPS support
to busybox insmod.  Thanks Quinn!!!
 -Erik
2001-02-24 20:01:53 +00:00
Eric Andersen afeb96547f Make output match the real lsmod -- print (autoclean) type
stuff first not last.
 -Erik
2001-02-24 19:51:54 +00:00
Eric Andersen d160a27ec1 Stub out the syscall, not the whole application. The stubbed
out syscall sets errno properly and whines about missing kernel
support.
 -Erik
2001-02-24 19:17:07 +00:00
Eric Andersen dc12190ba2 The usage message for syslogd had stuff longer then 80 chars and wrapped. 2001-02-24 18:52:36 +00:00
John Beppu 37977622c4 ... 2001-02-24 14:44:25 +00:00
John Beppu 7d597c4833 refinement 2001-02-24 14:37:48 +00:00
John Beppu dbfff6cbde formatting ... 2001-02-23 17:55:03 +00:00
John Beppu e6967b20cb Added some documentation and made --sgml use sgml_from_usage().
pod_from_usage() is the default generator.
2001-02-23 17:51:08 +00:00
Eric Andersen 3757f98d86 Another usage cleanup from kent robotti 2001-02-23 17:47:51 +00:00
John Beppu 8373e70c55 During POD generation, it inserts a blank line before lines
that were intended to be indented.
2001-02-23 17:41:41 +00:00
Eric Andersen 7a9cc2dcdd More cleanups 2001-02-23 16:58:44 +00:00
John Beppu 15f9b92127 forgot to remove some debugging noise 2001-02-23 16:16:08 +00:00
John Beppu df1e9daf30 This one should be able to deal with the USAGE macros a little
more robustly.  I also blow away any USAGE_NOT_\w+ macros.
2001-02-23 16:15:34 +00:00
Eric Andersen ed0d958c3e Make HUMAN_READABLE be single argument like the others. 2001-02-23 13:23:03 +00:00
John Beppu 2498b155fd forgot a comma. 2001-02-23 13:04:39 +00:00
Eric Andersen a0cfe94c4e More usage cleanups from kent robotti. I know some of these were
applied previously but apparently lost with some of the latest changes.
2001-02-23 10:07:09 +00:00
Eric Andersen b83ffafc15 Fix up a stupid mistake caught by David Whedon <dwhedon@gordian.com> 2001-02-23 06:36:53 +00:00
David Kimdon 56082dc2ae space after \ make preprocessor sad 2001-02-23 06:03:22 +00:00
David Kimdon 68c1d8400c utility.c must include stdarg.h 2001-02-23 03:55:24 +00:00
John Beppu b249fbb1dc I can't leave it alone. 2001-02-23 03:12:45 +00:00
John Beppu 8c16bc5012 minor cleanup... all that's left to do is
* make headers and footers for both the POD and SGML content
* make an SGML generator
* finish the command-line handling

Also, some of the documentation in usage.h will have to
be adjusted.  expr needs some lines to be indented, and
ls has a stray comma.  I may have missed some things...
but it looks OK for the most part.
2001-02-23 02:54:31 +00:00
John Beppu 4a25d8c9c3 This is the remixed autodocufier.pl. 2001-02-23 02:33:28 +00:00
Eric Andersen 0ed9923887 Stub out pivot_root so it won't fail to compile.
-Erik
2001-02-23 02:31:03 +00:00
Eric Andersen 3574b70efc Somewhere along the line, MAKE_LINKS got broken, thereby breaking
'make install'.  Fix that.
2001-02-23 02:16:29 +00:00
Eric Andersen 8079b155c2 Argh. I should know to compile first. 2001-02-23 02:04:33 +00:00
Eric Andersen bbc8e4789f Only default to BB_FEATURE_NEW_MODULE_INTERFACE when
BB_FEATURE_OLD_MODULE_INTERFACE is not defined.
 -Erik
2001-02-23 02:00:35 +00:00
Eric Andersen 2f3105725f Make utility.c only define query_module when BB_FEATURE_NEW_MODULE_INTERFACE
is enabled.
 -Erik
2001-02-23 01:58:18 +00:00
Eric Andersen 5723934f7c Yet another fix. I think I got it this time.
-Erik
2001-02-23 01:39:26 +00:00
Eric Andersen 41492d6c23 I should be more careful... 2001-02-23 00:05:56 +00:00
Eric Andersen c163e5107f Turn off the printf attribute for the ?error_msg* functions, since it
is ok to pass them a NULL, unlike printf.  This silences a pointless
warning message.
 -Erik
2001-02-22 23:38:48 +00:00
Eric Andersen 544891dd26 Add in kent robotti's updated dos2unix.c 2001-02-22 23:37:30 +00:00
Eric Andersen adea7a6101 Fix up Makefile -- uClibc nfs works these days 2001-02-22 23:36:30 +00:00
Eric Andersen 4b2e69a1cf Commit a few updates to the usage messages. 2001-02-22 23:32:59 +00:00
Eric Andersen e13bc0bc68 First pass at making up an automagical usage message extractor, which
will be used (when it works) to autogenerate documentation.  Based on
code written by Mark Whitley.
2001-02-22 22:47:06 +00:00
Eric Andersen ffc40bf3de Account for remainder, and reset page_height for each and every page. 2001-02-22 21:49:32 +00:00
Eric Andersen b2007bffc5 Make busybox and busybox-static conflict/replace each other 2001-02-22 05:21:35 +00:00
Eric Andersen 5d9cad0253 Fix malformed build-depends. Update list of bugs to close
-Erik
2001-02-22 05:08:16 +00:00
Eric Andersen 7aa1f5c42a Make md5sum not display filename when reading stdin
-Erik
2001-02-22 04:59:16 +00:00
Eric Andersen dbcd8ce464 Make init compile when DEBUG_INIT is enabled
-Erik
2001-02-22 04:55:33 +00:00
Eric Andersen 7e9276b50a Another update to the way usage messages are done by Evin Robertson
<nitfol@my-deja.com>, which makes things just a little bit smaller, but makes
usage.h more readable/maintainable IMHO.
 -Erik
2001-02-22 01:15:47 +00:00
Eric Andersen 8fc300976f Revert my change to do extra termType checking. That is done elsewhere.
Silly me.
 -Erik
2001-02-22 00:50:20 +00:00
Eric Andersen be30a6b8b0 Adjust the terminal height for any overlap, so that no lines
get lost off the top
 -Erik
2001-02-22 00:22:46 +00:00
Eric Andersen 54006bce25 Oops! I left in my debug noise. 2001-02-21 00:27:22 +00:00
Eric Andersen 7c3e7ac940 df was totally broken. So I fixed it.
-Erik
2001-02-21 00:24:51 +00:00
Mark Whitley 8d7bdc9deb Small patch from Kent Robotti to show megabytes in human-readable output. 2001-02-20 21:57:55 +00:00
Eric Andersen 9e37007edb Minor cleanup. 2001-02-20 21:52:49 +00:00
Eric Andersen 90fe7fea10 Apply a patch from Magnus Damm <damm@opensource.se> to support
powerpc with busybox insmod
 -Erik
2001-02-20 20:47:08 +00:00
Eric Andersen 477aedd77f Commit a patch from Erik Gustavsson <cyrano@algonet.se>, to allow
environment variables set from the kernel command line to be inherited
bu application programs.  Slightly changed to special case handling of
TERM, so that it has sane defaults when on a serial console.
 -Erik
2001-02-20 18:01:50 +00:00
Eric Andersen 5165fbed63 Oops. Since dirent.h depends on BB_FEATURE_SH_TAB_COMPLETION, put it
after busybox.h is included.
2001-02-20 06:42:29 +00:00
Eric Andersen caeeb36784 This fixes lash so it handles environment variable expansion, regardless
of where the environment variables are located in an argument.  This allows
things like 'echo foo$1$SHELL' to expand the same way bash would expand it.
Of course, to make this work I introduced a memory leak, and I am too tired
to find a way to fix it.
 -Erik
2001-02-20 06:38:44 +00:00
Eric Andersen a183f05825 Cleanup the use of 'find' to prevent error msgs.
-Erik
2001-02-20 06:22:54 +00:00
Eric Andersen f1142c5b11 Oops. Put time.h after busybox.h, so we can check for BB_FEATURE_LS_TIMESTAMPS
-Erik
2001-02-20 06:16:29 +00:00
Eric Andersen cbe31dace5 It turns out that DODMALLOC was broken when I reorganized busybox.h
header file usage before the 0.49 release.  To fix it, I had to move
the '#include "busybox.h"' to the end of the list of #include files.
 -Erik
2001-02-20 06:14:08 +00:00
Eric Andersen 94456f5984 Put back Vladimir's testing defines, which I mistakenly removed. 2001-02-18 20:26:48 +00:00
Eric Andersen 12dceb1147 A few more cleanups from Vladimir. 2001-02-18 20:15:36 +00:00
Eric Andersen 963791a9e9 Another patch from Vladimir to eliminate obsolete junk. 2001-02-18 20:13:18 +00:00
Eric Andersen f1bbb22dca A small cleanup by Vladimir 2001-02-18 20:12:25 +00:00
Eric Andersen f57a832063 Remove leftover junk 2001-02-18 20:11:38 +00:00
Eric Andersen b50da53e0c Get rid of long stale usage message code.
-Erik
2001-02-17 16:52:35 +00:00
Eric Andersen 3d20f772c2 A bunch of usage clenups from kent robotti <robotti@metconnect.com>
-Erik
2001-02-17 16:49:00 +00:00
Eric Andersen 966b3a6f79 More updates from Larry Doolittle. Don't use basedir, Don't assume
random makefiles are going to work with busybox.
2001-02-17 15:56:52 +00:00
Eric Andersen 1cf8166329 More updates. 2001-02-17 15:55:15 +00:00
Eric Andersen 47aea4ee71 Ignore applet_source_list 2001-02-17 03:08:32 +00:00
Eric Andersen 19f86207f5 Update the build system for pristine source directory builds. This
update is primarily work done by Larry Doolittle, but I did some
touchups of my own to make it work for me,
 -Erik
2001-02-17 00:42:47 +00:00
Eric Andersen 69c8572f29 Update the debian build stuff
-Erik
2001-02-17 00:41:05 +00:00
Eric Andersen f6a7227fd6 Throw out the obsolete INIT_CHROOT junk 2001-02-17 00:40:32 +00:00
Eric Andersen 28a78ab62c Several features were hard coded on. Stop that. List tab completion
as working (thanks Vladimir!) and taking 4k.
 -Erik
2001-02-16 20:26:50 +00:00
Eric Andersen 6faae7deb4 Commit Vladimir's latest cmdedit. I modified it slightly to ensure
parse_prompt() would be called before cmdedit_init(), since cmdedit_init()
calls cmdedit_setwidth() which uses cmdedit_prmt_len, which is set by
parse_prompt().  Also, added a mod, so very narrow terminals should now wrap
properly...  This is working very nicely for me -- Vladimir has done some
very good work.
2001-02-16 20:09:17 +00:00
Eric Andersen 361ee514c6 Revert multibuild.pl change. 2001-02-16 19:07:21 +00:00
Eric Andersen ca0f458ada Regression testing bugfixes from Larry Doolittle. As an aside,
can I just say how much I am looking forward to having 0.50
released, so we can address this #define stupidness properly
by building a static libbusybox, and then letting the linker
sort out the dependancies....  Ahh, that will be much nicer.
 -Erik
2001-02-16 18:43:54 +00:00
Eric Andersen 733c4ad6eb Do usage messages the same way all other apps fo them.
Skip printing of available options (can't do this easily).
Based on a patch by Larry Doolittle.
 -Erik
2001-02-16 18:41:12 +00:00
Eric Andersen fa4f146d7d Patch from Larry Doolittle to cross things in multibuild.pl 2001-02-16 18:37:00 +00:00
Eric Andersen 5f2c79d8c7 Make ar be crossed. 2001-02-16 18:36:04 +00:00
Eric Andersen af12bc6de4 Make dpkg require dpkg-deb 2001-02-16 18:35:06 +00:00
Glenn L McGrath 3f5bcbfa3c Fix warning for implicit declaration of time() 2001-02-16 10:33:30 +00:00
Glenn L McGrath a9c69762ba Fix compile error, sync() always returns 0 anyway. 2001-02-16 10:21:35 +00:00
Mark Whitley 825ae5a166 Another small formatting change from Larry Doolittle. 2001-02-15 23:31:40 +00:00
Mark Whitley 99806ad2bd Applied patch from Larry Doolittle that does the following:
- style changes
 - It actually returns the code computed by INET_setroute (wasn't being done
   properly before)
 - The displayroute() format string now matches net-tools
2001-02-15 23:00:48 +00:00
Eric Andersen 11b7a1deb7 Acknowledge Kenneth Chalmers ln fix. 2001-02-15 20:13:59 +00:00
Eric Andersen d69d2da165 use perror_msg instead of perror to print the applet name.
-Erik
2001-02-15 20:12:05 +00:00
Eric Andersen b50d707633 fix a few mallocs to be xmallocs.
-Erik
2001-02-15 19:50:11 +00:00
Eric Andersen 02b9f42a27 Patch from Matt Kraai to fix bug #1103. I've tested it,
and it indeed seems to fix things.
 -Erik
2001-02-15 19:07:43 +00:00
Eric Andersen 81bcc92c32 Fixed 'ls -s' so it actually displays block sizes again.
-Erik
2001-02-15 18:59:02 +00:00
Eric Andersen 8305006f7c Make usage.c depend on usage.h
-Erik
2001-02-14 21:52:18 +00:00
Eric Andersen c1c43113b4 Fins find message. 2001-02-14 21:51:54 +00:00
Eric Andersen 3ec8ffb121 I forgot to add usage.h, so here it is, with a few extra cleanups.
Also update show_usage to handle the updated usage.h.  Again,
nearly all the work to get usage.h into shape was done by
Manuel Novoa III.
 -Erik
2001-02-14 21:46:30 +00:00
Eric Andersen 67991cf824 This patch, put together by Manuel Novoa III, is a merge of work
done by Evin Robertson (bug#1105) and work from Manuel to make
usage messages occupy less space and simplify how usage messages
are displayed.
2001-02-14 21:23:06 +00:00
Eric Andersen 68be2ab914 implemented displayroute() based on a patch from Vladimir N. Oleynik,
so now route behaves as expected w/o any arguments.
2001-02-14 19:26:39 +00:00
Eric Andersen 98e599ca06 Commit Vladimir's latest version of stty.c. Nice work.
-Erik
2001-02-14 18:47:33 +00:00
Eric Andersen ec45595300 Add in ifconfig and route 2001-02-14 08:11:27 +00:00
Eric Andersen 88a5ceb450 Bump rev to 0.50pre. 2001-02-14 07:55:19 +00:00
Eric Andersen fc83c4c353 Several cleanups from Manuel Novoa III.
get_kernel_revision --  size reduction
        NOTE: may want to combine with get_kernel_version in insmod???

parse_mode -- size reduction, multiple settings with "," now work correctly,
        sticky-bit setting now implemented

process_escape_sequence -- size reduction, octal code to big for char bug fixed

format -- size reduction, val > LONG_MAX and hr = 1 printing bug fixed (was %ld),
2001-02-14 07:15:30 +00:00
Eric Andersen 6fd8c664c1 Apply a patch from Evin Robertson -- new pivot_root applet.
-Erik
2001-02-13 20:04:30 +00:00
Glenn L McGrath 3af1f88725 Closer integration with dpkg-deb and other busybox functions.
Hopefully simplified some code (works for me).
2001-02-12 11:33:09 +00:00
Glenn L McGrath dadf9c6dcd New dpkg-deb option, warning about dpkg usage 2001-02-12 11:27:45 +00:00
Glenn L McGrath 821fbf0f42 New option 'list' produces output that can be used for the packages .list file.
Will be used be bb dpkg
2001-02-12 11:16:26 +00:00
Glenn L McGrath bc9afadecd New function, deb-extract to be used by dpkg, code cleanups. saves some bytes 2001-02-11 03:32:41 +00:00
Glenn L McGrath 728875f340 Consmetic changes 2001-02-11 03:15:57 +00:00
Glenn L McGrath 631064613f More style changes 2001-02-11 01:40:23 +00:00
Glenn L McGrath 0c9d77ccfd Style changes; use get_line_from_file from utilities 2001-02-11 00:17:22 +00:00
Glenn L McGrath de556615dc BB_DPKG uses copy_file 2001-02-10 14:53:44 +00:00
Glenn L McGrath 510f0ddafa Use copy_file from utilty.c, remove some char defines 2001-02-10 14:53:08 +00:00
Glenn L McGrath 649968ceb1 Bug fix, rename status file, cleanups 2001-02-10 14:26:48 +00:00
Glenn L McGrath af8c65deaa Replace status defines with const int to conform to sytle guide, adds 32 bytes 2001-02-10 03:19:51 +00:00
Glenn L McGrath c900575dc4 Initial import 2001-02-10 02:05:24 +00:00
Glenn L McGrath c30ab0f4a8 New applet: dpkg 2001-02-10 02:04:40 +00:00
Matt Kraai e78fd0f721 Fix typo. 2001-02-09 18:10:53 +00:00
Mark Whitley 2fd52989f7 Implemented -A, -B, and -C flags with BB_FEATURE_GREP_CONTEXT option set. 2001-02-09 00:41:10 +00:00
Mark Whitley d238a7bcc8 Minor cleanups and clarifications. 2001-02-09 00:28:59 +00:00
Matt Kraai 1d70267450 Add listening support. 2001-02-07 04:09:23 +00:00
Matt Kraai df8ccb6350 Added documentation for new find options. 2001-02-07 04:05:35 +00:00
Matt Kraai 096370d349 Reworked find with David Douthitt to support -type, -perm, -mtime, and
other improvements.
2001-02-07 03:52:38 +00:00
Matt Kraai a164c647ac Make suffix_mult structures const. Thanks to Vladimir N. Oleynik. 2001-02-05 17:50:03 +00:00
Mark Whitley 925edb828d Added some more on paren spacing and a section on testing guidelines. 2001-02-03 00:20:14 +00:00
Eric Andersen c3fc3c5e7a It seems I stupidly checked in a silly test I was making.
-Erik
2001-02-02 15:15:36 +00:00
Eric Andersen 29cff26f32 After testing multi-build, I stupidly committed Config.h
with nearly everything turned off.  Doh!
 -Erik
2001-02-02 01:08:22 +00:00
Mark Whitley 76c5e60d54 Patch from Chris Jaeger that makes turning on and off options in the makefile
a bit less error prone by calling 'strip' on makefile vars before performing
truth tests against them.
2001-02-02 01:07:17 +00:00
Eric Andersen af4ac77d9d Apply a patch from Larry Doolittle to add "-all" and "-none" switches
to multibuild.pl.  I did a little formatting adjustments to make it
_very_ obvious when things stop working.  I also removed the USE_PROCFS
config option -- just do the right thing when USE_DEVPS_PATCH is enabled.
 -Erik
2001-02-01 22:43:49 +00:00
Mark Whitley b5c29850e3 Tightened things up a bit, saved 20 bytes, and made the code a bit clearer in
the process.
2001-02-01 21:02:41 +00:00
Mark Whitley 065c7e779a Applied patch from Chris Jaeger <cjaeger@ensim.com> to do better checking for
NFS_MOUNT_VERSION, depending on which kernel you're running.
2001-02-01 19:51:13 +00:00
Mark Whitley 9b300d0b1f Buglet: 'tabstops' is unused if BB_FEATURE_AUTOWIDTH is not defined. 2001-02-01 19:39:43 +00:00
Matt Kraai f2cc2762bb Create find_applet_by_name function. Save 32 bytes. 2001-02-01 19:21:20 +00:00
Matt Kraai 05e782ddd3 Fix wget error message and add (and use) chomp library function. 2001-02-01 16:49:30 +00:00
Eric Andersen bd018b1bab Make old compilers not choke -- define the attribute in the func prototype. 2001-01-31 23:00:46 +00:00
Matt Kraai dd19c69904 Removed trailing \n from error_msg{,_and_die} messages. 2001-01-31 19:00:21 +00:00
Mark Whitley 63ec273245 Added floppyfw to list of known projects using BusyBox. 2001-01-31 18:33:20 +00:00
Eric Andersen 82d5e59ea2 xfopen now used by wget
-Erik
2001-01-31 17:50:35 +00:00
Eric Andersen 79e898ac0e Patch from Vladimir N. Oleynik to simplify wget file opening
using xfopen (which is what everything should be using).
2001-01-31 17:49:47 +00:00
Eric Andersen 65225df2dc Cleanup patch from Vladimir N. Oleynik.
* mkdir: remove 3 lines in source code.
    * mkfs_minix: save 32 bytes, remove 4 bugs.
    * mkswap: save 64 bytes, remove 1 bug.
2001-01-31 17:35:02 +00:00
Eric Andersen 53cfb7e231 Patch from Vladimir N. Oleynik to simplify/cleanup a few things in init.c 2001-01-31 17:29:47 +00:00
Eric Andersen 704d2a6c43 Patch from Vladimir N. Oleynik to simplify how it decides which
app was invoked.  This removes several strcmp calls.
2001-01-31 17:29:12 +00:00
Eric Andersen 39573f7130 Wrap a table (bg set to black, width=80%) around the screenshot
so it doesn't look like crap in Netscape.  Should look fine in
Mozilla either way.  I think.
 -Erik
2001-01-31 17:14:17 +00:00
Matt Kraai 18d5064c47 Make it validate. 2001-01-31 02:13:05 +00:00
Matt Kraai 9ba0daf4ba Close IMG tag. 2001-01-31 01:59:46 +00:00
Eric Andersen 93a8e2e64b Patch from Larry Doolittle to reduce the chance that fussing with VPATH will
break cross-compilation.
 -Erik
2001-01-31 01:38:05 +00:00
Eric Andersen 306f4fe480 If the ioctl fails to tell us the winsize, default to 79.
-Erik
2001-01-31 00:30:45 +00:00
Eric Andersen 22332fd26f Patch from Bryan Rittmeyer -- be more conservative by default
with the lash prompt.
 -Erik
2001-01-30 23:40:39 +00:00
Mark Whitley ac21e93a3f Added a new screenshot of Busybox. :-) 2001-01-30 23:37:15 +00:00
Eric Andersen 4bbdd788e0 Fix the pwd and group functions. The bb_ stuff was a leftover from
a brief past that mercifully (except for this) never made it into CVS.
 -Erik
2001-01-30 22:23:17 +00:00
Eric Andersen 30f64c3aa2 Fix a stupid typo -- bug found by Larry Doolittle. 2001-01-30 19:23:46 +00:00
Mark Whitley 8526067336 Applied patch from Larry Doolittle to use preprocessor for defining
NFS_MOUNT_VERSION.
2001-01-30 18:53:42 +00:00
Eric Andersen e57d54b456 Fix ls behavior for broken or very narrow terminals. Fix my_*
functions so they comply with the original interface (i.e. don't
exit on error, stringify uids and gids when no amtching name found).
 -Erik
2001-01-30 18:03:11 +00:00
Matt Kraai 201dc0d5a9 Test applets containing numbers in their name. Thanks to Larry Doolittle. 2001-01-29 19:00:48 +00:00
Matt Kraai ceade5c856 Fix missing header file. 2001-01-29 18:41:12 +00:00
1097 changed files with 213747 additions and 79827 deletions

No files matched your search

-4
View File
@@ -1,4 +0,0 @@
busybox
busybox.links
_install
loop.h
+118 -20
View File
@@ -2,55 +2,134 @@ List of the authors of code contained in BusyBox.
If you have code in BusyBox, you should be listed here. If you should be
listed, or the description of what you have done needs more detail, or is
incorect, _please_ let me know.
incorrect, _please_ let me know.
-Erik
-----------
Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
Peter Willis <psyphreak@phreaker.net>
eject
Emanuele Aina <emanuele.aina@tiscali.it>
run-parts
Erik Andersen <andersen@codepoet.org>
Tons of new stuff, major rewrite of most of the
core apps, tons of new apps as noted in header files.
Lots of tedious effort writing these boring docs that
nobody is going to actually read.
Laurence Anderson <l.d.anderson@warwick.ac.uk>
rpm2cpio, unzip, get_header_cpio, read_gz interface, rpm
Jeff Angielski <jeff@theptrgroup.com>
ftpput, ftpget
Enrik Berkhan <Enrik.Berkhan@inka.de>
setconsole
Jim Bauer <jfbauer@nfr.com>
modprobe shell dependency
Edward Betts <edward@debian.org>
expr, hostid, logname, tty, wc, whoami, yes
John Beppu <beppu@lineo.com>
du, head, nslookup, sort, tee, uniq
expr, hostid, logname, whoami
John Beppu <beppu@codepoet.org>
du, nslookup, sort
David Brownell <dbrownell@users.sourceforge.net>
zcip
Brian Candler <B.Candler@pobox.com>
tiny-ls(ls)
Randolph Chung <tausq@debian.org>
fbset, ping, hostname, and mkfifo
fbset, ping, hostname
Dave Cinege <dcinege@psychosis.com>
more(v2), makedevs, dutmp, modularization, auto links file,
Dave Cinege <dcinege@psychosis.com>
more(v2), makedevs, dutmp, modularization, auto links file,
various fixes, Linux Router Project maintenance
Jordan Crouse <jordan@cosmicpenguin.net>
ipcalc
Magnus Damm <damm@opensource.se>
tftp client
insmod powerpc support
Larry Doolittle <ldoolitt@recycle.lbl.gov>
pristine source directory compilation, lots of patches and fixes.
Glenn Engel <glenne@engel.org>
httpd
Gennady Feldman <gfeldman@gena01.com>
Sysklogd (single threaded syslogd, IPC Circular buffer support,
logread), various fixes.
Robert Griebl <sandman@handhelds.org>
modprobe, hwclock, suid/sgid handling, tinylogin integration
many bugfixes and enhancements
Karl M. Hegbloom <karlheg@debian.org>
cp_mv.c, the test suite, various fixes to utility.c, &c.
Daniel Jacobowitz <dan@debian.org>
mktemp.c
Matt Kraai <kraai@alumni.carnegiemellon.edu>
documentation, bugfixes
Matt Kraai <kraai@alumni.cmu.edu>
documentation, bugfixes, test suite
John Lombardo <john@deltanet.com>
dirname, tr
Rob Landley <rob@landley.net>
Became busybox maintainer in 2006.
Glenn McGrath <bug1@netconnect.com.au>
ar.c
sed (major rewrite in 2003, and I now maintain the thing)
bunzip2 (complete from-scratch rewrite, then mjn3 optimized the result)
sort (more or less from scratch rewrite in 2004, I now maintain it)
mount (rewrite in 2005, I maintain the new one)
Stephan Linz <linz@li-pro.net>
ipcalc, Red Hat equivalence
John Lombardo <john@deltanet.com>
tr
Glenn McGrath <bug1@iinet.net.au>
Common unarchiving code and unarchiving applets, ifupdown, ftpgetput,
nameif, sed, patch, fold, install, uudecode.
Various bugfixes, review and apply numerous patches.
Manuel Novoa III <mjn3@codepoet.org>
cat, head, mkfifo, mknod, rmdir, sleep, tee, tty, uniq, usleep, wc, yes,
mesg, vconfig, nice, renice,
make_directory, parse_mode, dirname, mode_string,
get_last_path_component, simplify_path, and a number trivial libbb routines
also bug fixes, partial rewrites, and size optimizations in
ash, basename, cal, cmp, cp, df, du, echo, env, ln, logname, md5sum, mkdir,
mv, realpath, rm, sort, tail, touch, uname, watch, arith, human_readable,
interface, dutmp, ifconfig, route
Vladimir Oleynik <dzo@simtreas.ru>
cmdedit; bb_mkdep, xargs(current), httpd(current);
ports: ash, crond, fdisk (initial, unmaintained now), inetd, stty, traceroute,
top;
locale, various fixes
and irreconcilable critic of everything not perfect.
Bruce Perens <bruce@pixar.com>
Original author of BusyBox. His code is still in many apps.
Original author of BusyBox in 1995, 1996. Some of his code can
still be found hiding here and there...
Rodney Radford <rradford@mindspring.com>
ipcs, ipcrm
Tim Riker <Tim@Rikers.org>
bug fixes, member of fan club
Kent Robotti <robotti@metconnect.com>
reset, tons and tons of bug reports and patchs.
reset, tons and tons of bug reports and patches.
Chip Rosenthal <chip@unicom.com>, <crosenth@covad.com>
wget - Contributed by permission of Covad Communications
@@ -61,11 +140,15 @@ Pavel Roskin <proski@gnu.org>
Gyepi Sam <gyepi@praxis-sw.com>
Remote logging feature for syslogd
Linus Torvalds <torvalds@transmeta.com>
Rob Sullivan <cogito.ergo.cogito@gmail.com>
comm
Linus Torvalds
mkswap, fsck.minix, mkfs.minix
Mark Whitley <markw@lineo.com> <markw@codepoet.org>
grep, sed, cut, xargs, style-guide, new-applet-HOWTO, bug fixes, etc.
Mark Whitley <markw@codepoet.org>
grep, sed, cut, xargs(previous),
style-guide, new-applet-HOWTO, bug fixes, etc.
Charles P. Wright <cpwright@villagenet.com>
gzip, mini-netcat(nc)
@@ -73,3 +156,18 @@ Charles P. Wright <cpwright@villagenet.com>
Enrique Zanardi <ezanardi@ull.es>
tarcat (since removed), loadkmap, various fixes, Debian maintenance
Tito Ragusa <farmatito@tiscali.it>
devfsd and size optimizations in strings, openvt, chvt, deallocvt, hdparm,
fdformat, lsattr, chattr, id and eject.
Paul Fox <pgf@foxharp.boston.ma.us>
vi editing mode for ash, various other patches/fixes
Roberto A. Foglietta <me@roberto.foglietta.name>
port: dnsd
Bernhard Fischer <rep.nop@aon.at>
misc
Mike Frysinger <vapier@gentoo.org>
initial e2fsprogs, printenv, setarch, sum, misc
-878
View File
@@ -1,878 +0,0 @@
0.49
* Matt Kraai -- new sort.c
* Matt Kraai -- new tail.c
* Glenn McGrath -- new 'dpkg-deb' applet
* Glenn McGrath -- new ar code
* spoon -- new watchdog applet
* Vladimir N. Oleynik <dzo@simtreas.ru> -- fixed cmdedit.c so now
scrolling and tab completion in lash work properly. Also several
byte saving optimizations.
* Erik Andersen -- disabled many less commonly used applets by default
* Mark Whitley -- more thrashing about to get clean perror_msg usage
* Matt Kraai -- new command line munging
* Larry Doolittle -- keep some locales from messing up busybox.sh
* Matt Kraai -- cleaned up dd and tail with new parse_number routine
* Mark Whitley -- remove debugging messages from deallocvt
* Matt Kraai and Mark Whitley -- new document "How to Add a New Applet
to BusyBox"
* David Douthitt -- fixed "grep -qv" bug
* Larry Doolittle -- fixed insmod bug with old kernels
* Matt Kraai -- logger remixed to use getopt, selection of stdin made
util-linux compatible
* Erik Andersen -- many more internal symbols classified static to
avoid namespace pollution
* Matt Kraai -- nc listening support
* Erik Andersen -- made sed understand arbitrary regexp delimiters
* Matt Kraai et al. -- more tar improvements and bug fixes, now
handles regexp file exclusion
* Larry Doolittle -- new script (multibuild.pl) to automate build rule
checking
* Matt Kraai -- update/cleanup of the docs on how to use init
* Erik Andersen -- renamed all sh.c symbols per the style guide,
better if-then-else-fi handling
* Erik Andersen -- cleaner division of labor between cmdedit.c and sh.c
* Larry Doolittle -- shell data structure cleanup, fixed buglets
in read, exec, and piped builtins
* Erik Andersen -- md5sum was broken in 0.48. Now fixed (and doesn't
use getline, shrinking static compiles (since nothing else used it).
* ?? -- squashed memory leak in shell prompt handling
* Mark Whitley -- Updates to style guide
* Mark Whitley -- Big cleanup in utility.c: style guide compliance,
de-macro-ifying some variables and functions
* Erik Andersen -- ls now honors BB_FEATURE_AUTOWIDTH so it can find
the width and height of the console.
* Erik Andersen -- insmod now ignores -L and accepts the -o option.
* Erik Andersen -- updates so you can now select from the Makefile
whether or not to use the system's passwd and group functions.
Since most systems use GNU libc, this can save you from having to
install the /etc/nsswitch.conf configuration file and the required
libnss_* libraries. Adds 1.5k. You can now, also, disable this,
causing busybox to use the system's pwd.h and grp.h functions.
-Erik Andersen, 27 January 2001
0.48
* Glenn McGrath -- tar now supports uncompressing tar files,
define BB_FEATURE_TAR_GZIP to use the -z option.
* Matt Kraai -- fix all usage of TRUE and FALSE so all apps now
return EXIT_SUCCESS or EXIT_FAILURE to the system.
Now TRUE and FALSE are set to the C standard where TRUE=1.
* me -- Fixed uname problem causing the kernel version to be
mis-detected (causing problems with poweroff, init,
and other things).
* Alcove, Julien Gaulmin <julien.gaulmin@alcove.fr> and
Nicolas Ferre <nicolas.ferre@alcove.fr> -- insmod support on ARM
and StrongArm, and suport for lsmod on older 2.0.x kernels.
* Kent Robotti -- Renamed unrpm to original rpmunpack, so you can use
an included shell script called unrpm as a front end to it. There's
also a shell script called undeb included for debian packages.
* Matt Kraai -- fix an infinite loop with ls -aR
* Larry Doolittle -- Shaved off about 100 bytes and 200 bytes heap
from date.c. Also document the "-d" option in the usage message.
* Gennady Feldman -- fixed dd to use blocksize when reading/writing,
(it was reading the whole thing and then writing it out). Also
updated usage information (was missing conv=notrunc) and added
conv=sync feature.
* Larry Doolittle (in collaboration with Matt Kraai) -- allow for a
pristine source directory -- where all the .o files and such are
not placed into the source tree. Thanks Larry!
* Larry Doolittle -- use the applet definitions in applets.h
to autogenerate the applet function and usage prototypes.
* Sebastien Huet, Arne Bernin, and Kent Robotti -- Add in tar -X and
fixed a bug breaking tar --exclude.
* Jonas Holmberg -- echo option handling made GNU-echo compatible
* Aleksey Demidov <asd@ixcelerator.com> -- date option handling made
GNU-date compatible
* me -- Progress meter (optional) in wget
* Doolittle/me -- programs invoked by full path name take
precedence over applets unless BB_FEATURE_SH_BUILTINS_ALWAYS_WIN
* Gaute B Strokkenes <gs234@cam.ac.uk> -- applets found using a
binary search instead of linear search. Much faster!
* new applets: cmp readlink
* Mark Whitley -- Removed advertising clause of Berkeley license
according to decision by the Regents of the University of
California; included reference
* tail's confusing special treatment of single digit options removed;
people should use -n instead
* Larry Doolittle -- \r handled now in echo and tr
* Matt Kraai -- rewrite of uniq
* Mark Whitley -- remix of xargs
* Jim Gleason <jimg@lineo.com> -- fixed tar so it no longer breaks
hard links.
* Matt Kraai -- logger now logs all arguments, not just the first
* Gennady Feldman -- syslogd no longer logs to localhost if compiled
for remote logging...
* Richard June <rjune@ims1.imagestream-is.com> -- support for 'gzip -d'
* various artists -- Other good stuff that I forgot to document.
-Erik Andersen, 13 December 2000
0.47
* A bug in syslogd was fixed that allowed it to potentially fork-bomb
your system. Anyone using 0.46 syslogd should upgrade.
* Renamed busybox.defs.h to the more sensible "Config.h"
* Improved portability between different libcs.
* Many apps ported to use getopt()
* Common handling of '--help'
* All usage messages centralized.
* Added a bunch of new commands:
* 'rdate' contributed by Sterling Huxley <sterling@europa.com>
* 'wget' contributed by Chip Rosenthal <chip@unicom.com>,
<crosenth@covad.com> and Covad Communications
* 'getopt' from "Alfred M. Szmidt" <ams@trillian.itslinux.org>
* dos2unix, unix2dos, reset, and unrpm.c (and lots of help
debugging) thanks to Kent Robotti <robotti@metconnect.com>.
* 'renice' command, thanks to Dave Cinege <dcinege@psychosis.com>
* 'xargs' (written by me)
* 'expr' contributed by Edward Betts <edward@debian.org>, based
on GNY expr
* lsmod now uses the query_module syscall, rather then /proc (me)
* syslogd can now log messages to remote hosts -- patch thanks
to Gyepi Sam <gyepi@praxis-sw.com>
* chroot can now call the builtin shell - Pavel Roskin <proski@gnu.org>
* 'make install' now creates relative symlinks, and added a new
'make install-hardlinks' target to (tada) install hardlinks.
* Rewrite of 'tail' to make it simpler, smaller, and more robust.
It now weighs only 2.25k (3k when full featured). The code is
cleaner too, thanks to Allen Soard <esp-software@mail.hypermart.net>
* Add optional ls file sorting, thanks to a patch from
Sterling Huxley <sterling@europa.com>
* Fixed chmod option parsing so things like 'chmod -r /tmp/file'
now work (previously it thought -r was an option). Doh!
* Fixed tar handling of stdin and stdout
* Renamed "internal.h" to the more sensible "busybox.h"
* Preliminary support for GNU HURD.
* Updated my devps and devmtab kernel patches for the latest 2.2.x
kernel, for those wanting to go proc-less.
* Tons of other bugfixes.
-Erik Andersen, 25 September 2000
0.46
* Better portability. Now should compile cleanly with libc5,
GNU libc 2.0 and 2.1, and various Linux kernels including
2.0.x, 2.2.x, and to 2.4.0-test*. (patch for 2.4.x kernels
to make /proc/mounts behave included in the kernel-patches dir).
* Fixed a _horrible_ bug where 'tar -tvf' could unlink
local files that matched tarball contents!!! Fix thanks
to Marius Groeger <mgroeger@sysgo.de>
* Fixed a nasty bug in tar when could mess up saved symlinks.
* Fixed tar creation support when reading from stdin ('tar -cf - . ')
thanks to Daniel Quinlan <quinlan@transmeta.com>
* Updates to handle Linux 2.4.0 kernels (kludged around the
"none" entries in /proc/mounts, added a hack to make sysinfo
work with both old and new kernels).
* Fixed insmod module option parsing for options lacking an '='.
Fix thanks to Marc Nijdam <marc_nijdam@hp.com>
* Fixed segfault with 'cut -f 1 -d:' and added 'cut -s' suport.
Fix thanks to Arne Bernin <arne@matrix.loopback.org>
* Several fixes from Marius Groeger <mag@sysgo.de>
- Added support for "sh -c command args..."
- Fixed globbing, i.e. 'echo * *' and 'echo "******"' now work.
- Added shell environment variable substitution
- Added the "read" shell builtin.
* Fixed cursor editing in cmdedit.c. The following keyboard sequence
used to create an infinite loop: ls, cursor up, left, down.
* Added support for being a login shell, so things like
'-su' or '-sh' (stuff where argv[0][0]=='-') will now always
invoke the shell. Now you can use BusyBox as a login shell.
* ls.c now ignores '-g', since some ftp clients like that sort
of thing. Patch thanks to David Vrabel <dvrabel@arcom.co.uk>
* Fix to init.c from Stuart Menefy <Stuart.Menefy@st.com> so that
it always sets the controlling terminal before running any programs
* Several fixes from Matt Kraai <kraai@alumni.carnegiemellon.edu>
- Fixed tr so it recognizes standard escape sequences.
Merged common escape seq. code from tr and echo into utility.c.
- Major work in updating/cleaning up the docs, and getting the
new SGML based docs into shape.
- cleanup of ar.c
- BusyBox should now poweroff when asked to do so.
- Fixed 'ln -n' and 'ln -s' so they both work properly.
* Reorganized signal names in kill.c for better architecture support
-- patch thanks to simon wood <simon@mungewell.uklinux.net>
* In 0.43, backspace and delete worked properly, but with 0.45,
it just echoed a ^? for backspace, and ^H for control-h. This
was due to a broken macro in init.c, that is now fixed.
* Removed sfdisk from BusyBox. It was buggy, fat, and we really
couldn't maintain it very well, so including it was not really
very appropriate. Those wanting an fdisk are invited to
grab a copy from util-linux.
* Added 'dumpkmap' to allow people to dump a binary keymap, which can
then be loaded in by 'loadkmap' -- submitted by
Arne Bernin <arne@matrix.loopback.org>
* Fixed NFS so it supports 2.4.x kernels and NFSv3.
* Brand, new versions of grep and sed which use libc regex routines,
thanks to Mark Whitley <markw@lineo.com>. The hand-tooled
"regexp.[ch]" files have been removed. Much help on these from
Matt Kraai as well.
-Erik Andersen, 11 July 2000
0.45
* Now compiles vs libc5 (which can save lots of space for
embedded systems).
* Added BB_FEATURE_TRIVIAL_HELP which compiles out most all of the
help messages (i.e --help). Saves 17k over a full compile.
* Added cut and tr from minix, since due to the license change,
we can now use minix code. Minix tr saves 4k.
* insmod now works. It costs 29k, but imagine an initrd with a
staticly linked busybox containing only insmod and sh, a few /dev
entries, and a kernel module or two... It doesn't get smaller
then this folks (I pity the fool that writes insmod in asm ;-).
Many kudos go to Ron Alder <alder@lineo.com> for finishing this off!
* Added a mini ar archive utility, especially written for BusyBox by
Glenn McGrath <bug1@netconnect.com.au>
* Added mktemp, contributed by Daniel Jacobowitz <dan@debian.org>
* Added setkeycodes, for those that have wierd keyboard buttons.
* Added md5sum, uuencode and uudecode -- thanks to Alfred M. Szmidt
<ams@trillian.itslinux.org> for contributing these.
* Added 'grep -v' option (inverted search) and updated
docs accordingly. -beppu
* Wrote which
* Replaced the telnet implementation with one written by
Tomi Ollila <too@iki.fi> It works great and costs 3k.
* BusyBox sh (lash) now supports being used as a standalone shell. When
BB_FEATURE_SH_STANDALONE_SHELL is defined, all the busybox commands may
be invoked as shell internals. Best used when compiling staticly
(i.e. DOSTATIC=true)
* BusyBox sh (lash) internals now behave as expected wrt pipes
and redirects.
* Fixed ping warnings -- fix from Sascha Ziemann <szi@aibon.ping.de>
* Fixed update segfault
* Fixed mknod -- minor number was always 0
* Fixed tar option parsing, so both "tar xvf foo.tar" and
"tar -xvf foo.tar" now work (i.e. no "-" before options)
(this was very broken in 0.43).
* Several contributions from Randolph Chung <tausq@debian.org>.
* cp/mv now accepts the -f flag
* tail can now accept -<num> commands (e.g. -10) for better
compatibility with the standard tail command
* added a simple id implementation; doesn't support sup. groups yet
* logname used getlogin(3) which uses utmp. Now it doesn't.
* whoami used getpwuid(3) which uses libc NSS. Now it behaves.
* Add support for "noatime" and "nodiratime" mount flags to mount.
* Changed 'umount -f' to mean force, and actually use umount2.
* Changed 'umount -l' to mean "Do not free loop device".
* Fixed basename to support stripping of suffixes. Patch thanks
to xiong jianxin <jxiong@uiuc.edu>
* cp -fa now works as expected for symlinks (it didn't before)
* zcat now works (wasn't working since option parsing was broken)
* Renamed "mnc" to the more correct "nc" (for netcat).
* Makefile intelligence updates
* Changed the way init parses /etc/inittab entries to avoid problems
with commands that contain colons in them. Fix thanks to
Pavel Roskin <proski@gnu.org>
* Fixed a warning in utility.c due to char being unsigned on Linux/PPC,
Fix thanks to Pavel Roskin <proski@gnu.org>
* Made "killall" complain (not error and exit) about processes that it
cannot find by name -- Pavel Roskin <proski@gnu.org>
* Fixed more and ps to have sensible terminal width defaults, thanks
to Pavel Roskin.
* Fixed all fatalError() calls lacking a "\n", thanks to Pavel Roskin.
* Fixed a segfault in yes when no args were given -- Pavel Roskin.
* Simplified freeramdisk and added argument checking -- Pavel Roskin.
* Fixed segfault caused by "touch -c"
* Fixed segfault caused by "rm -f"
* Fixed segfault caused by "ln -s -s" and similar abuses. Further fixes
and "--" support from Pavel Roskin.
* Fixed segfault caused by "cp -a -a" and similar abuses.
* Implemented "rm -- <foo>". Implementation fixed by Pavel Roskin.
* "which" rewritten to use stat(). Fixes to improve its compatability
with traditional implementations -- Pavel Roskin.
* "mount" now reports errors from nfsmount() and assumes NFS mount
if ':' is present in the device name - Pavel Roskin
* Fixed exit status for killall - Pavel Roskin
* Fixed 'swapon -a' and 'swapoff -a', which were broken.
* Fixed 'mount -a' so it works as expected.
* Implemented 'ls -R' (enabled by enabling BB_FEATURE_LS_RECURSIVE)
* Implemented "ping -s", fixed error messages and argument parsing -
Pavel Roskin
* Syslogd will not go to background if "-n" is given. Better help
and argument checking -- Pavel Roskin
* Fixed a small bug that could cause tar to emit warning messages
and not extract the first file in a directory in some cases
of nested directories. Thanks to Kevin Traas <kevin@netmaster.com>
for helping track this one down.
* More doc updates
* Fixed grep "Line too long" problem -- John Beppu
* Fixed 'grep -q -i B some_file' so it works
* math takes input from stdin if no args are given. -- John Beppu
* math was renamed to dc. Although it deviates from dc's behaviour,
this will probably be remedied in the future. -- John Beppu
-Erik Andersen, June 21, 2000
0.44
Previously, an erronous announcement of BusyBox 0.44 was made, so to
avoid possible confusion, we are skipping straight to 0.45, and calling
it good.
-Erik Andersen
0.43
* Major update to the provided documentation.
* Busybox now includes a shell! It currently costs 7.5 k (plus an
additional 2.5 k if you compile in command line editing). Handles
job control, has the usual set of builtins, and does everything
except for handling programming statements (if, while, etc...)
* Busybox can now work perfectly when /proc is disabled, thereby
saving a bunch of memory (kernel /proc support is not thin). This
is done by making use of some nice kernel patches I wrote up to
support the features that busybox requires and that /proc usually
provides. To enable this, turn on BB_FEATURE_USE_DEVPS_PATCH and
patch your kernel with the devps patch in the kernel-patches/
directory.
* Wrote basename, dirname, killall, and uptime.
* tar has been completely rewritten by me. Both tar creation and
extraction are now well behaved. Costs 7.6k with all optional
tar features enabled, and 5k for just tar extraction support.
* Added freeramdisk, which will free up all memory associated
with a ram disk. Contributed by Emanuele Caratti <wiz@iol.it>
and then adjusted a bit by me.
* Added tr from John Lombardo <john@deltanet.com>
* Added echo and test (from me).
* Added usleep contributed by Nicolas Pitre <nico@cam.org>
* BusyBox's bss size has been majorly reduced (was 384668, is now 28740).
* Several fixes from Pavel Roskin <proski@gnu.org>:
- When `tail' fails to open a file it now exits.
- When `syslogd' is given the `-n' option it should still use
fork() for running klogd.
* nslookup types are now changed to u_int32_t (instead of uint32_t)
changed per a patch from Pascal Bellard <pascal.bellard@ascend.com>
* Fixed "du" so it gives the same answers as GNU "du" (busybox du used
to count hard-linked files more then once). Many thanks to
Friedrich Vedder <fwv@myrtle.lahn.de> for the fix.
* Removed /proc dependancies for init and free (while maintaining
exactly the same functionality). /proc takes up 90k of kernel
space, so it is nice to avoid using it at all costs.
* init no longer tries to mount /proc (unless there is less the 1 meg
free). Use of /proc (or not) is policy that should be set up in
/etc/fstab (or in hardcoded scripts), not in init.
* Fixed rebooting when init runs as an initrd.
* Fixes and updates from Karl M. Hegbloom <karlheg@debian.org>
- update.c rewritten to look more like update-2.11
- moveed the inode hash out of du.c and into utility.c to make
it a common resource that can be used by other apps.
- cp_mv.c now checks inodes to see if a source and dest are
the same, and prints an error (instead of endlessly looping).
- mv now attempts to do a rename, and will fall back to doing
a copy only if the rename fails.
- Syslogd now supports multiple concurrent connections
* Several fixes from Pavel Roskin <proski@gnu.org>:
- Fixes to sort. Removed "-g", fixed and added "-r"
- Fixes to the makefile for handling "strip"
* An initial telnet implementation was added by
Randolph Chung <tausq@debian.org>.
* Fixed a bug where "sed 's/foo/bar/g'" (i.e. a script w/o a "-e")
* ps now supports BB_FEATURE_AUTOWIDTH, and can adjust its width
to match the terminal (defaults to width=79 when this is off).
* ps now accepts (and ignores) all options except for "--help" (which
as would be expected displays help).
* Fixed mount'ing loop devices when the filesystem type was not
specified. It used to revert to non-loop after the first try.
* all mallocs now use xmalloc (and so are OOM error safe), and
the common error handling saves a few bytes. Thanks to
Bob Tinsley <bob@earthrise.demon.co.uk> for the patch.
* Fix "+" parsing bug in date, from "Merle F. McClelland" <mfm@cts.com>.
* Fix symlink following bug in chmod -R and friends.
* Now allows SYSV style 'chown foo:bar' in addition to 'chown foo.bar'
* Fixed a bug in the busybox globbing routine such that 'find /dir -name [i]'
no longer segfaults.
-Erik Andersen
0.42
* Fairly massive restructuring of umount.c to deal with remounting
busy devices read-only. Adds a -r option to control that; it is
optionally compiled in with BB_FEATURE_REMOUNT
* Added a bunch of functions to mtab.c to interact with the
{get,set,end}mntent interface; as it turns out, those functions do
not appear to be re-entrant, and that causes a lot of problems with
the way umount was originally written.
* Makes init send TERM and KILL (instead of HUP and KILL) on reboot
to be more consistent with sysvinit
* Changes to init.c to use the new -r option to umount. Also increased
the sleep time between the time the TERM and KILL signals are sent
- Randolph Chung
* cp.c, mv.c: removed, replaced by cp_mv.c which has been
extensively rewritten from the original cp.c.
* Fixed cp and mv so if the source and destination are a the
same directory it will print an error and continue.
* Also added a warning message to the `mv' usage string saying that
this is not GNU mv, and it will break hard links. cp also breaks
hard links.
* ln.c: implemented `-n' switch, no-deref symlinks.
* include<sys/param.h>: and use PATH_MAX everywhere. busybox: File
* name buffer overrun guards to prevent future crashes.
- Always check exit status.
- Purge all use of `creat()', replace with `open()'.
* utility.c
- recursiveAction was overriding the value of followLinks thus
ignoring it.
- isDirectory now takes a followLinks boolean, updated all callers
- copyFile had the followLinks logic reversed.
* messages.c: New file. Put common error message strings all in
one place in an attempt to shrink the binary a little.
-Karl M. Hegbloom
* changed fsck_minix.c to reduce its .bss size significantly
-beppu -piptigger
* Made tar creation support in busybox tar optional. You no longer
* _have_ to put a "-" in front of tar options. Tar could inadvertently
* change permissions and ownership on
certain directories pointed to by symlinks.
* Made grep and grep -h do the right thing wrt printing
the file name (it failed to print files names in many cases).
* Fix a namespace aliasing problem wereby if du was built in, the
symlink for both du and dutmp would be installed, or then rm was
built in, the symlinks for both rm and rmmod would be installed.
* Added a closelog() to init.c after loging -- fix thanks to
Taketoshi Sano <kgh12351@nifty.ne.jp>
* Rewrote and simplified logger. Added the "-t" option, and made it
behave itself a bit better.
* Optional support contributed by Ben Collins <bcollins@debian.org>
for the kernel init chroot patch by Werner Almesberger, which
allows init to chroot to a new device, and umount the old one.
* Fixed bug that wouldn't let one chown a symlink -- it would
always dereference before. -beppu
* Fixed a bug where init could have reference already freed memory.
Found and fixed by Taketoshi Sano <kgh12351@nifty.ne.jp>
* Several contributions from Friedrich Vedder <fwv@myrtle.lahn.de>
* Added (and documented) "-n" option for head
* Cleanup for a number of usage messages -- also
contributed Friedrich Vedder <fwv@myrtle.lahn.de>
* Cosmetic fix to busybox.c (Don't print a comma at the
end of line if there are no more application names).
* Fixed a stupid bug in "head" option handling ("head -n"
would segfault).
* Moved commonly used functions "xmalloc()" and "exit()"
to utility.c (with proper #ifdef's).
* Created a tiny tail implementation, removing -c, -q, -v, and making
tail -f work only with a single file. This reduced tail from 6k to
2.4k. The bigger/more featured tail can still be had by disabling
BB_FEATURE_SIMPLE_TAIL in busybox.defs.h
* Ping now falls back to doing the right thing if /etc/protocols
turns up missing.
* Fixed mount and umount. Previously they could leak loop device
allocations, causing the system to quickly run out. Fix for umount
by Ben Collins <bcollins@debian.org>, and mount was fixed by me.
* ls formatting on eight charactor user names fixed by
Randolph Chung <tausq@debian.org>.
* cp could, when copying symlinks, change permissions of the
files pointed to by the symlinks.
* Several fixes from Pavel Roskin <proski@gnu.org>:
- `chown' with 1 argument displayed the error incorrectly
- `fdflush', `length' and `printf' crashed if run without arguments
- `fdflush' tried to flush itself using *argv
- added "skip" and "seek" to dd.
- ls no longer messus up output when combining files and
directories on the command line
* swapoff -a was not working. Now it is.
* init did not cleanly unmount filesystems on reboot. Now it does.
* "sed -ne s/foo/bar/" worked but "sed -n -e s/foo/bar/" didn't.
Now both work.
* Some architectures (PowerPc) assume chars are unsigned, so they could
not distinguish between EOF and '\0xFF' in sed. Sed now uses ints.
* Began converting error handling to use some common routines
in utility.c
* syslogd now has better message handling and ignores SIGHUP.
* install.sh had a bug preventing installation to the specified
target directory. Fix from Gilbert Coville <gilbert@mvista.com>
* You can now spefify alternative strip commands -- change
also from Gilbert Coville.
-Erik Andersen
0.41
* New Apps: wc, hostid, logname, tty, whoami, yes -- all contributed
by Edward Betts <edward@debian.org>
* Fixed a bug in both cp and mv preventing 'cp foo/README bar'
type commands (file in a directory to another directory) from
working.
* Fixed a logger bug that caused garbage to be written to the syslog
(unless you used busybox syslog, which hid the bug). Thanks to
Alex Holden <alex@linuxhacker.org> for the fix.
* /bin/true and /bin/false were echoing a blank line when run.
Now fixed.
* mkdir -p would print an error when asked to mkdir an existing dir
with no interveining subdirectories.
* Fixed "syslogd -O" so that it works. Added -o loop option for mount,
* and support in umount for loop
devices. Support is toggled by MOUNT_LOOP feature -- Ben Collins
<bcollins@debian.org>
* Several fixes from Marco Pantaleoni <panta@prosa.it> compile in
* fullWrite() not only if BB_TAR is defined, but also
if BB_CP or BB_MV are (fullWrite() is referenced by copyFile())
* add some compiler optimizations to further reduce executable size
(as a side note, on my machines the largest code is generated
by gcc 2.95.2 with -Os ! The smallest by plain gcc 2.7.2.3 with
-O2 -m386 ...)
* Compile now won't fail if busybox.def.h defines
BB_FEATURE_LINUXRC but not BB_INIT. (init_main used to be
referenced, but not compiled)
* Fixed a bug in setting TERM for serial console support. TERM now
defaults to "ansi" for serial consoles.
* Fixed a bug in handling the CONSOLE env. variable for serial
* consoles.
-Erik Andersen, Jan 15, 2000
0.40
* New Apps: sort, uniq. -beppu New Apps: lsmod, rmmod -erik New Apps:
* fbset contributed by Randolph Chung <tausq@debian.org>. New App::
* loadacm contributed by Peter Novodvorsky <petya@logic.ru>
for loading application character maps for Unicode fonts.
* Major init re-work. init now supports inittab (slightly different
but similar to sysvinit), allowing me to get all the policy out of
init and into the conf file. It works just fine without inittab
being present, but if you dont like the default behavior you can
now do something about it. Init is much cleaner as a result.
* Fixed an bug in syslogd causing it to stop after 20 minutes. -erik
* Fixed an embarrasing segfault in head -beppu Fixed the embarrasing
* failure of 'logger -p'. -erik Added the -s option to du -beppu
* Re-worked the source tree a bit so it will compile under glibc 2.0.7
with the 2.0.x Linux kernel.
* Added 'grep -q' thanks to a patch from "Konstantin Boldyshev"
<konst@voshod.com>.
* Grep -i previously failed on UPPER CASE patterns due to a silly
regexp implementation bug that is now fixed.
* Fixed a bug where tar would set, and then clear SGID and SUID bits.
* Fixed a bug where tar would not set the user and group on device
special files.
* Fixed a bug where tar would not restore the time to files. Fixed a
* major security problem with tar -- it changed ownership
of any file pointed to by a symlink to 777 (like say libc....)
Ouch!!!
* cp and mv were very broken when moving directories. I have rewritten
them so they should now work as expected.
* sed now supports addresses (numeric or regexp, with negation) and
has an append command, thanks to Marco Pantaleoni <panta@prosa.it>
* Fixed dmesg. It wasn't parsing its options (-n or -s) properly.
* Some cosmetic fixes to ls output formatting to make it behave more
like GNU ls.
* Fixed a stupid segfault in kill. Several fixes from Friedrich Vedder
* <fwv@myrtle.lahn.de>:
- Added gunzip -t, removed gunzip.c dead code,
- fixed several typos
- Glibc 2.0.7 and libc5 compile fixes
* Fixed a bug where 'mknod --help' would segfault.
-Erik Andersen, Jan 07, 2000
0.39
* New Apps: ping, hostname, and mkfifo contributed by Randolph Chung
<tausq@debian.org>. 3 items off the TODO list!
* I wrote free (just calls "cat /proc/meminfo"). Added tail, based on
* tail from GNU textutils-1.19, but adjusted
to suit my evil purposes. Costs 6k. I'll make it smaller
sometime.
* on reboot, init called 'umount -a -n', which caused errors
when BB_MTAB was not enabled. Changed to 'umount -a', which does
the right thing.
* init will now try to run /sbin/getty if it is present (for easy
integration with the about-to-be-released tinylogin.)
* kill now behaves itself properly, added 'kill -l' to list signals 'ls
* -l' was failing on long directories, since my_getid was leaking
one file descriptor per file. Oops.
* Fixed rebooting from init. I'd accidently left some debugging code
* in
which blocked reboots.
* Fixed reboot, halt (and added poweroff) such that they handle it when
init is not at PID 1 (like when running in an initrd).
* Added a prelinary du implementation. Some parameter parsing
stuff still needs to be added. -beppu (John Beppu
<beppu@lineo.com>)
* Implemented tee. -beppu Implemented head. -beppu
-Erik Andersen, Dec 10, 1999
0.38
* Fixed a segfault in 'umount -a' when a badly formed /etc/fstab
file existed.
* df will not exit on error, but will stat all mounted filesystems.
* Fixed tar so uid/gid/permissions on extracted tarballs will be
correct.
* Fixed find -name so it properly uses shell wildcard patterns
(i.e. `*', `?', and `[]') instead of regular expressions, which
was causing some confusing and unexpected behavior.
* Added klogd to syslogd, so now the log will contain both system and
kernel messages.
* syslogd now creates the /dev/log socket to make sure it is there, and
is actually a socket with the right permissions.
* I've taken a first step to making busybox not need the /proc
filesystem. Most apps don't need it. Those that _require_ it,
will complain if you enable them when you disable
BB_FEATURE_USE_PROCFS.
-Erik Andersen, Dec 5, 1999
0.37
* Wrote a micro syslogd, and a logger util (to log things to the syslog
from the command line or scripts) With both compiled in, costs 4k.
* Fixed 'make install' so symlinks are installed in their proper
* locations. Changed the build system slightly so that features can
* now be enabled
or disabled from the busybox.defs.h header file, without trying to
compile in a source file named after that featue (unless that file
exists).
* Several options are now moved into busybox.defs.h Now 'rm -R' and 'rm
* -r' both work. dd now properly handles input beyond 1 block from
* stdin. Fixed a bug where tar unpacked everything a directories.
* Moved some code
from createPath into mkdir where it belonged, thereby making tar
work properly.
* Fixed an off-by-one bug in cat. Given a list of file it wouldn't cat
* out the
last file in the list.
* Fixed 'ls -ln' so numeric group/uid are presented properly, and fixed
* 'ls -l'
so when uid/gid is not in /etc/{passwd,group} the numeric group/uid
are presented properly.
* Also added a TODO.
-Erik Andersen, Nov 25, 1999
0.36
* fixed dd so it properly defaults to stdin and stdout when no
if= and of= are set (fix thanks to Eric Delaunay).
* Don't try to close the file descriptor of a pipein tar. (fix also
* from
Eric Delaunay).
* Made createPath be quiet (again thanks to Eric Delaunay). If
* BB_CONSOLE_CMD_IF_RC_SCRIPT_EXITS is defined, then whatever
command you define it as will be run if the init script exits.
* Updated install.sh to make it more robust (thanks to Adam Di Carlo)
* NFS support added to mount by Eric Delaunay. It costs 10k when
* compiled
in, but that is still a big win for those that use NFS.
* Made 'rm -f' be silent for non-existant files (thanks to Eric
* Delaunay). changed zcat.c to gunzip.c. It now obeys the principle
* of least surprise
and acts as god intended gunzip and zcat to act. They answer
--help and obey the '-c' flag.
* Fixed a bug in mv which caused it to not move files when the
* destination
was a directory.
* Fixed a decimal-instead-of-octal bug causing mkdir to make
* directories
with very wrong permissions.
* chmod would overwrite file permissions instead of modifying them.
Now it properly modifies permissions.
* Init now sends warnings destined for the console to /dev/console to
* ensure
they show up on whatever the active console it. Otherwise
important messages (for example that the system is rebooting) were
not seen when switched to a different VT.
-Erik Andersen, Nov 17, 1999
0.35
* gzip now obeys the principle of least surprise and acts like god
* intended
(i.e. it accepts a file name, answers --help, and obeys the '-c'
flag and only then outputs to stdout).
* Fixed more.c to compile autowidth on sparc and set initial winsize
to 0,0 in case the TIOCGWINSZ ioctl fails. Fix thanks to Eric
Delaunay.
* Fixed tar so it now works as expected (it had TRUE/FALSE backwards)
* tar now accepts --help chmod, chown, and chgrp usage now works
* General usage (i.e. --help) cleanups for most apps umount now parses
* options correctly tar can now unpack tarballs containing device
* special files,
sockets, and fifos (though it can't pack them up) thanks to Matt
Porter. Creating archives containing these is still left to the
interested student.
* fixed up the license in more.c to properly point to Bruce Perens.
-Erik Andersen, Nov 11, 1999
0.34
* ls -l now displays link names outside the current directory,
Patch thanks to Eric Delaunay
* init now properly handles sparc serial consoles and does a
better job of finding the real console device rather than using
/dev/console which doesn't support job control. Patch also thanks
to Eric Delaunay.
* more started to read from stdin after the last file was finished, and
options were not parsed correctly (fix thanks to Eric Delaunay).
* more will now use the terminal size if BB_FEATURE_AUTOWIDTH is on.
* rm wouldn't remove a symlink unless the symlink was valid. This was
a side effect of the busybox 0.32 recursiveAction() fix. Things
should now work correctly.
* grep wouldn't grep stdin. Now it does. sed wouldn't sed stdin. Now
* it does. sed was appending a \n to the end of lines with
* replacements.
Now it doesn't do that.
* ls -l now bypasses libc6 nss when displaying user/group names.
Now uses my_getpwuid and my_getgrgid.
-Erik Andersen, Nov 8, 1999
0.33
* Fixed a bug where init could hang instead of rebooting.
* Removed some debugging noise from init.c
* Fixed ln so it works now (it was very broken).
* Fixed df so it won't segfault when there is no /etc/fstab,
* If BB_MTAB is not defined, df and mount will whine if /etc/fstab
is not installed (since they cannot fixup "/dev/root" to
state the real root device name)
* merged some redundant code from mtab.c/df.c into utility.c
-Erik Andersen, Nov 5, 1999
0.32
* More changes -- many thanks to Lineo for paying me to work on
busybox. If you have any problems please let me know ASAP at
andersen@lineo.com or andersee@debian.org
* usage() now prints the BusyBox version. This will help folks
realize that they are not in Kansas anymore.
* Fixed mkdir -m option so that it works. kill segfaulted w/o any
* arguments. Now it doesn't do that. kill wasn't properly accepting
* signal names. It does now. Added new apps chvt and deallocvt (I
* should probably add open) Major rewrite of init.c. Code is now
* readable by mere mortals IMHO. Wrote sed -- weighs only 1.8k (5.8k
* with full regular expressions!). Fixed a stupid seg-fault in sync
* Fixed mount -- mount -a failed to parse and apply mount options Fixed
* umount -n (patch thanks to Matthew Grant <grantma@anathoth.gen.nz>)
* umount -a no longer umounts /proc Added BB_MTAB, allowing (at the
* cost of ~1.5k and the need for a rw /etc)
folks to use a real /etc/mtab file instead of a symlink to
/proc/mounts. mount, and umount will add/remove entries and df
will now use /etc/mtab if BB_MTAB is defined.
* Fixed a nice bug in recursiveAction() which caused it to infinitely
hunt through /proc/../fd/* creating new file descriptors if it
followed the /dev/fd link over to /proc. recursiveAction() now
lstat's the file when followLinks==FALSE so it won't follow links
as the name suggests. Fix thanks to Matt Porter
<porter@debian.org>.
-Erik Andersen, Nov 4, 1999
0.31
* I added a changelog for version 0.30. adjusted find internals to
* make it smaller, and removed
some redundancy.
* Fixed a segfault in ps when /etc/passwd or /etc/group
are absent. Now will warn you and carry on.
* Added in optional _real_ regular expression support (to be
the basis for a future sed utility). When compiled in it adds
3.9k, but makes grep much more capable.
* Checked out using nftw(3) for recursive stuff, but unfortunatly
it wasn't supported before GNU libc 2.1, and some folks use glibc
2.0.7 since it is much smaller than that latest and greatest.
-Erik Andersen, Oct 21, 1999
0.30
Major changes -- lots of stuff rewritten. Many thanks to Lineo for
paying me to make these updates. If you have any problems with busybox,
or notice any bugs -- please let me know so I can fix it. These
changes include:
Core Changes:
* busybox can now invoke apps in two ways: via symlinks to the
busybox binary, and as 'busybox [function] [arguments]...'
* When invoked as busybox, the list of currently compiled in
functions is printed out (no this is not bloat -- the list has
to be there anyway to map invocation name to function).
* busybox no longer parses command lines for apps or displays their
usage info. Each app gets to handle (or not handle) this for
itself.
* Eliminated monadic, dyadic, descend, block_device, and
postprocess. It was cumbersome to have so many programs
cobbled together in this way. Without them, the app is much
more granular.
* All shared code now lives in utility.c, and is properly
ifdef'ed to be only included for those apps requiring it.
* Eliminated struct FileInfo (the basis of monadic, dyadic, etc)
so now each app has the function prototype of (da-dum): extern
int foo_main(int argc, char** argv); which speeds integration
of new apps.
* Adjusted the Makefile to make it easier to
{en|dis}able debugging.
* Changed default compiler optimization to -Os
(optimize for smaller binaries).
App Changes:
* To cope with the new app function prototype and the removal of
monadic, dyadic, etc, the following apps were re-written:
* cat - Works same as always. chgrp, chmod, chown -
* rewrite. Combined into a single
source file. Absorbed patches from Enrique Zanardi
<ezanard@debian.org> that removes the dependency on
libc6 libnss* libraries.
* cp - Can now do 'cp -a' can can copy devices,
pipes, symlinks, as well as recursive or non-recursive
dir copies.
* fdflush - adjusted to remove dependancy on struct
* FileInfo. find - Now includes some basic regexp matching
which will be the basic of a future mini-sed.
* ln - Same functionality. mkdir - Added -p flag to
* feature set. mv - rewrite. rm - Added -f flag to
* feature set. rmdir - Same functionality. swapon,
* swapoff - Combined into a single binary. No longer
uses /etc/swaps. swap{on|off} -a uses /etc/fstab
instead.
* touch - Same functionality. date - adjusted with a patch
* from Matthew Grant <grantma@anathoth.gen.nz>
to accomodate glibc timezone support. I then ripped out GNU
getopt.
* mkswap -- new version merged from util-linux. Can now make
>128Meg swaps.
* Replaced the old and star, unstar, and tarcat with the tar
implementation from sash. Now tar behaves as god intended it
to (i.e. tar -xvf <file> and tar -cf <file> <dir> work).
* dd -- rewritten. Can with with files, stdin, stdout. Added the
* following new apps: loadfont -- added from debian boot floppies
* chroot -- added based on a patch from Paolo Molaro
* <lupus@lettere.unipd.it> grep -- I just wrote it. Only matches
* simple strings ps -- I just wrote it. Has _no_ options at all,
* but works. fsck_minix, mkfs_minix -- added from util-linux, but
* I ripped out
internationalization and such to make them smaller.
* sfdisk -- Added from util-linux (minus
* internationalization and such). Probably some other
* changes that I forgot to document...
-Erik Andersen, Oct 20, 1999
0.29
This version was a messy pre-alpha. stay away or it will bite you.
-Erik Andersen, Sep 24, 1999
0.28
mini-netcat (mnc) rewritten.
0.27
Mount now supports -a, and -t auto.
Mount now updates mtab correctly for 'ro'.
More checks screen rows size, outputs bytes percentage.
Printf added as module.
0.26
Touch now creates files. -c option for no create.
-384
View File
@@ -1,384 +0,0 @@
/* vi: set sw=4 ts=4: */
// This file defines the feature set to be compiled into busybox.
// When you turn things off here, they won't be compiled in at all.
//
//// This file is parsed by sed. You MUST use single line comments.
// i.e. //#define BB_BLAH
//
//
// BusyBox Applications
//#define BB_AR
#define BB_BASENAME
#define BB_CAT
#define BB_CHMOD_CHOWN_CHGRP
#define BB_CHROOT
#define BB_CHVT
#define BB_CLEAR
//#define BB_CMP
#define BB_CP_MV
#define BB_CUT
#define BB_DATE
//#define BB_DC
#define BB_DD
//#define BB_DEALLOCVT
#define BB_DF
#define BB_DIRNAME
#define BB_DMESG
//#define BB_DOS2UNIX
//#define BB_DPKG_DEB
//#define BB_DUTMP
#define BB_DU
//#define BB_DUMPKMAP
#define BB_ECHO
//#define BB_EXPR
//#define BB_FBSET
//#define BB_FDFLUSH
#define BB_FIND
#define BB_FREE
//#define BB_FREERAMDISK
//#define BB_FSCK_MINIX
//#define BB_GETOPT
#define BB_GREP
#define BB_GUNZIP
#define BB_GZIP
#define BB_HALT
#define BB_HEAD
//#define BB_HOSTID
//#define BB_HOSTNAME
#define BB_ID
#define BB_INIT
//#define BB_INSMOD
#define BB_KILL
#define BB_KILLALL
//#define BB_LENGTH
#define BB_LN
//#define BB_LOADACM
//#define BB_LOADFONT
//#define BB_LOADKMAP
#define BB_LOGGER
//#define BB_LOGNAME
#define BB_LS
#define BB_LSMOD
//#define BB_MAKEDEVS
//#define BB_MD5SUM
#define BB_MKDIR
//#define BB_MKFIFO
//#define BB_MKFS_MINIX
#define BB_MKNOD
#define BB_MKSWAP
//#define BB_MKTEMP
//#define BB_NC
#define BB_MORE
#define BB_MOUNT
//#define BB_MT
//#define BB_NSLOOKUP
//#define BB_PING
#define BB_POWEROFF
//#define BB_PRINTF
#define BB_PS
#define BB_PWD
//#define BB_RDATE
//#define BB_READLINK
#define BB_REBOOT
//#define BB_RENICE
#define BB_RESET
#define BB_RM
#define BB_RMDIR
//#define BB_RMMOD
//#define BB_RPMUNPACK
#define BB_SED
//#define BB_SETKEYCODES
#define BB_SH
#define BB_SLEEP
#define BB_SORT
#define BB_SWAPONOFF
#define BB_SYNC
#define BB_SYSLOGD
#define BB_TAIL
#define BB_TAR
//#define BB_TEE
//#define BB_TEST
//#define BB_TELNET
#define BB_TOUCH
//#define BB_TR
#define BB_TRUE_FALSE
#define BB_TTY
//#define BB_UUENCODE
//#define BB_UUDECODE
#define BB_UMOUNT
#define BB_UNIQ
#define BB_UNAME
//#define BB_UNIX2DOS
//#define BB_UPDATE
#define BB_UPTIME
//#define BB_USLEEP
//#define BB_WATCHDOG
#define BB_WC
//#define BB_WGET
#define BB_WHICH
#define BB_WHOAMI
#define BB_XARGS
#define BB_YES
// End of Applications List
//
//
//
// ---------------------------------------------------------
// This is where feature definitions go. Generally speaking,
// turning this stuff off makes things a bit smaller (and less
// pretty/useful).
//
//
// BusyBox will, by default, malloc space for its buffers. This costs code
// size for the call to xmalloc. You can use the following feature to have
// them put on the stack. For some very small machines with limited stack
// space, this can be deadly. For most folks, this works just fine...
//#define BB_FEATURE_BUFFERS_GO_ON_STACK
//
// Turn this on to use Erik's very cool devps, and devmtab kernel drivers,
// thereby eliminating the need for the /proc filesystem and thereby saving
// lots and lots memory for more important things. You can not use this and
// USE_PROCFS at the same time... NOTE: If you enable this feature, you
// _must_ have patched the kernel to include the devps patch that is included
// in the busybox/kernel-patches directory. You will also need to create some
// device special files in /dev on your embedded system:
// mknod /dev/mtab c 10 22
// mknod /dev/ps c 10 21
// I emailed Linus and this patch will not be going into the stock kernel.
//#define BB_FEATURE_USE_DEVPS_PATCH
//
// enable features that use the /proc filesystem (apps that
// break without this will tell you on compile)...
// You can't use this and BB_FEATURE_USE_DEVPS_PATCH
// at the same time...
#define BB_FEATURE_USE_PROCFS
//
// This compiles out everything but the most
// trivial --help usage information (i.e. reduces binary size)
//#define BB_FEATURE_TRIVIAL_HELP
//
// Use termios to manipulate the screen ('more' is prettier with this on)
#define BB_FEATURE_USE_TERMIOS
//
// calculate terminal & column widths (for more and ls)
#define BB_FEATURE_AUTOWIDTH
//
// show username/groupnames (bypasses libc6 NSS) for ls
#define BB_FEATURE_LS_USERNAME
//
// show file timestamps in ls
#define BB_FEATURE_LS_TIMESTAMPS
//
// enable ls -p and -F
#define BB_FEATURE_LS_FILETYPES
//
// sort the file names
#define BB_FEATURE_LS_SORTFILES
//
// enable ls -R
#define BB_FEATURE_LS_RECURSIVE
//
// enable ls -L
#define BB_FEATURE_LS_FOLLOWLINKS
//
// Change ping implementation -- simplified, featureless, but really small.
//#define BB_FEATURE_SIMPLE_PING
//
// Make init use a simplified /etc/inittab file (recommended).
#define BB_FEATURE_USE_INITTAB
//
//Enable init being called as /linuxrc
#define BB_FEATURE_LINUXRC
//
//Have init enable core dumping for child processes (for debugging only)
//#define BB_FEATURE_INIT_COREDUMPS
//
// Allow init to permenently chroot, and umount the old root fs
// just like an initrd does. Requires a kernel patch by Werner Almesberger.
// ftp://icaftp.epfl.ch/pub/people/almesber/misc/umount-root-*.tar.gz
//#define BB_FEATURE_INIT_CHROOT
//
//Make sure nothing is printed to the console on boot
//#define BB_FEATURE_EXTRA_QUIET
//
//Should syslogd also provide klogd support?
#define BB_FEATURE_KLOGD
//
// enable syslogd -R remotehost
#define BB_FEATURE_REMOTE_LOG
//
//Simple tail implementation (2.34k vs 3k for the full one).
//Both provide 'tail -f', but this cuts out -c, -q, -s, and -v.
#define BB_FEATURE_SIMPLE_TAIL
//
// Enable support for loop devices in mount
#define BB_FEATURE_MOUNT_LOOP
//
// Enable support for a real /etc/mtab file instead of /proc/mounts
//#define BB_FEATURE_MOUNT_MTAB_SUPPORT
//
// Enable support for mounting remote NFS volumes.
// You may need to mount with "-o nolock" if you are
// not running a local portmapper daemon...
#define BB_FEATURE_NFSMOUNT
//
// Enable support forced filesystem unmounting
// (i.e. in case of an unreachable NFS system).
#define BB_FEATURE_MOUNT_FORCE
//
// Enable support for creation of tar files.
#define BB_FEATURE_TAR_CREATE
//
// Enable support for "--exclude" and "-X" for excluding files
#define BB_FEATURE_TAR_EXCLUDE
//
// Enable support for tar -z option (currently only works for inflating)
#define BB_FEATURE_TAR_GZIP
//
//// Enable reverse sort
#define BB_FEATURE_SORT_REVERSE
//
// Enable command line editing in the shell.
// Only relevant if BB_SH is enabled.
#define BB_FEATURE_SH_COMMAND_EDITING
//
//Allow the shell to invoke all the compiled in BusyBox applets as if they
//were shell builtins. Nice for staticly linking an emergency rescue shell,
//among other things.
// Only relevant if BB_SH is enabled.
#define BB_FEATURE_SH_STANDALONE_SHELL
//
//When this is enabled, busybox shell applets can be called using full path
//names. This causes applets (i.e., most busybox commands) to override
//real commands on the filesystem. For example, if you run run /bin/cat, it
//will use BusyBox cat even if /bin/cat exists on the filesystem and is _not_
//busybox. Some systems want this, others do not. Choose wisely. :-) This
//only has meaning when BB_FEATURE_SH_STANDALONE_SHELL is enabled.
// Only relevant if BB_SH is enabled.
//BB_FEATURE_SH_APPLETS_ALWAYS_WIN
//
// Enable tab completion in the shell (not yet
// working very well -- so don't turn this on)
// Only relevant if BB_SH is enabled.
#define BB_FEATURE_SH_TAB_COMPLETION
//
// Attempts to match usernames in a ~-prefixed path
// XXX: Doesn't work without NSS, off by default
//#define BB_FEATURE_USERNAME_COMPLETION /* require NSS */
//
//Turn on extra fbset options
//#define BB_FEATURE_FBSET_FANCY
//
//Turn on fbset readmode support
//#define BB_FEATURE_FBSET_READMODE
//
// Support insmod/lsmod/rmmod for post 2.1 kernels
//#define BB_FEATURE_NEW_MODULE_INTERFACE
//
// Support insmod/lsmod/rmmod for pre 2.1 kernels
//#define BB_FEATURE_OLD_MODULE_INTERFACE
//
// Support module version checking
//#define BB_FEATURE_INSMOD_VERSION_CHECKING
//
// Support for Minix filesystem, version 2
//#define BB_FEATURE_MINIX2
//
//
// Enable busybox --install [-s]
// to create links (or symlinks) for all the commands that are
// compiled into the binary. (needs /proc filesystem)
// #define BB_FEATURE_INSTALLER
//
// Enable a nifty progress meter in wget (adds just under 2k)
#define BB_FEATURE_WGET_STATUSBAR
//
// Clean up all memory before exiting -- usually not needed
// as the OS can clean up... Don't enable this unless you
// have a really good reason for cleaning things up manually.
//#define BB_FEATURE_CLEAN_UP
//
// Support for human readable output by ls, du, etc.(example 13k, 23M, 235G)
#define BB_FEATURE_HUMAN_READABLE
//
// End of Features List
//
//
//
//
//
//
//---------------------------------------------------
// Nothing beyond this point should ever be touched by
// mere mortals so leave this stuff alone.
//
#if defined BB_MOUNT || defined BB_UMOUNT || defined BB_DF
#ifdef BB_FEATURE_MOUNT_MTAB_SUPPORT
#define BB_MTAB
#endif
#else
#undef BB_MTAB
#endif
//
#if defined BB_FEATURE_SH_COMMAND_EDITING && defined BB_SH
#define BB_CMDEDIT
#endif
//
#ifdef BB_KILLALL
#ifndef BB_KILL
#define BB_KILL
#endif
#endif
//
#ifndef BB_INIT
#undef BB_LINUXRC
#undef BB_FEATURE_LINUXRC
#endif
//
#ifdef BB_GZIP
#ifndef BB_GUNZIP
#define BB_GUNZIP
#endif
#endif
//
#ifdef BB_DPKG_DEB
#ifndef BB_AR
#define BB_AR
#endif
#ifndef BB_TAR
#define BB_TAR
#endif
#ifndef BB_FEATURE_TAR_GZIP
#define BB_FEATURE_TAR_GZIP
#endif
#endif
//
#ifdef BB_TAR
#ifdef BB_FEATURE_TAR_GZIP
#ifndef BB_GUNZIP
#define BB_GUNZIP
#endif
#endif
#endif
//
#if defined BB_MOUNT && defined BB_FEATURE_NFSMOUNT
#define BB_NFSMOUNT
#endif
//
#if defined BB_FEATURE_SH_COMMAND_EDITING
#ifndef BB_FEATURE_USE_TERMIOS
#define BB_FEATURE_USE_TERMIOS
#endif
#endif
//
#if defined BB_FEATURE_AUTOWIDTH
#ifndef BB_FEATURE_USE_TERMIOS
#define BB_FEATURE_USE_TERMIOS
#endif
#endif
//
#if defined BB_INSMOD || defined BB_LSMOD
#ifndef BB_FEATURE_NEW_MODULE_INTERFACE
#define BB_FEATURE_NEW_MODULE_INTERFACE
#endif
#endif
-323
View File
@@ -1,323 +0,0 @@
/* vi: set sw=4 ts=4: */
// NOTE: This file only defines features usefull under the Hurd,
// To compile for the Hurd raname this to Config.h prior to make
// This file defines the feature set to be compiled into busybox.
// When you turn things off here, they won't be compiled in at all.
//
//// This file is parsed by sed. You MUST use single line comments.
// i.e. //#define BB_BLAH
//
//
// BusyBox Applications
#define BB_AR
#define BB_BASENAME
#define BB_CAT
#define BB_CHMOD_CHOWN_CHGRP
#define BB_CHROOT
//#define BB_CHVT /* not needed */
#define BB_CLEAR
#define BB_CP_MV
#define BB_CUT
#define BB_DATE
#define BB_DC
#define BB_DD
//#define BB_DEALLOCVT /* inot needed */
//#define BB_DF /* different implementation */
#define BB_DIRNAME
//#define BB_DMESG /* doesnt compile, different implementation */
#define BB_DUTMP
#define BB_DU
//#define BB_DUMPKMAP /* not needed */
#define BB_ECHO
#define BB_EXPR
//#define BB_FBSET /* not needed, doesnt compile */
//#define BB_FDFLUSH /* is this needed? */
#define BB_FIND
//#define BB_FREE /* doesnt compile */
#define BB_FREERAMDISK /* does hurd support ramdisks ? */
#define BB_FSCK_MINIX
#define BB_GETOPT
#define BB_GREP
#define BB_GUNZIP
#define BB_GZIP
#define BB_HALT
#define BB_HEAD
#define BB_HOSTID
#define BB_HOSTNAME
#define BB_ID
//#define BB_INIT /* not needed?, doesnt compile */
//#define BB_INSMOD /* not needed, doesnt compile */
#define BB_KILL
#define BB_KILLALL
#define BB_LENGTH
#define BB_LN
//#define BB_LOADACM /* not needed, doesnt compile */
//#define BB_LOADFONT /* not needed, doesnt compile */
//#define BB_LOADKMAP /* not needed */
#define BB_LOGGER
#define BB_LOGNAME
#define BB_LS
//#define BB_LSMOD /* not needed, doesnt compile */
//#define BB_MAKEDEVS /* different implementation */
#define BB_MD5SUM
#define BB_MKDIR
#define BB_MKFIFO
#define BB_MKFS_MINIX
#define BB_MKNOD
//#define BB_MKSWAP /* different impelementation (i think) */
#define BB_MKTEMP
#define BB_NC
#define BB_MORE
//#define BB_MOUNT /* different implementation */
#define BB_MT
#define BB_NSLOOKUP
//#define BB_PING /* doesnt compile, Hurd uses BSD style ip.h */
//#define BB_POWEROFF /* different implementation i assume */
#define BB_PRINTF
//#define BB_PS /* needs /proc */
#define BB_PWD
#define BB_RDATE
//#define BB_REBOOT /* different implementation */
#define BB_RENICE
#define BB_RESET
#define BB_RM
#define BB_RMDIR
//#define BB_RMMOD /* not needed, doesnt compile */
#define BB_SED
//#define BB_SETKEYCODES /* is this needed ? */
#define BB_SH
#define BB_SLEEP
#define BB_SORT
//#define BB_SWAPONOFF /* different implementation, doesnt compile */
#define BB_SYNC
//#define BB_SYSLOGD /* doesnt compile */
#define BB_TAIL
#define BB_TAR
#define BB_TEE
#define BB_TEST
#define BB_TELNET
#define BB_TOUCH
#define BB_TR
#define BB_TRUE_FALSE
#define BB_TTY
//#define BB_UPTIME /* doesnt compile */
#define BB_USLEEP
#define BB_WC
#define BB_WGET
#define BB_WHICH
#define BB_WHOAMI
#define BB_UUENCODE
#define BB_UUDECODE
//#define BB_UMOUNT /* different implementation */
#define BB_UNIQ
//#define BB_UNAME /* doesnt compile */
//#define BB_UPDATE /* doesnt compile */
#define BB_YES
// End of Applications List
//
//
//
// ---------------------------------------------------------
// This is where feature definitions go. Generally speaking,
// turning this stuff off makes things a bit smaller (and less
// pretty/useful).
//
//
//
// Turn this on to use Erik's very cool devps and devmtab kernel drivers,
// thereby eliminating the need for the /proc filesystem and thereby saving
// lots and lots memory for more important things. You can not use this and
// USE_PROCFS at the same time... NOTE: If you enable this feature, you
// _must_ have patched the kernel to include the devps patch that is included
// in the busybox/kernel-patches directory. You will also need to create some
// device special files in /dev on your embedded system:
// mknod /dev/mtab c 10 22
// mknod /dev/ps c 10 21
// I emailed Linus and this patch will not be going into the stock kernel.
//#define BB_FEATURE_USE_DEVPS_PATCH
//
// enable features that use the /proc filesystem (apps that
// break without this will tell you on compile)...
// You can't use this and BB_FEATURE_USE_DEVPS_PATCH
// at the same time...
#define BB_FEATURE_USE_PROCFS
//
// This compiles out everything but the most
// trivial --help usage information (i.e. reduces binary size)
//#define BB_FEATURE_TRIVIAL_HELP
//
// Use termios to manipulate the screen ('more' is prettier with this on)
#define BB_FEATURE_USE_TERMIOS
//
// calculate terminal & column widths (for more and ls)
#define BB_FEATURE_AUTOWIDTH
//
// show username/groupnames (bypasses libc6 NSS) for ls
#define BB_FEATURE_LS_USERNAME
//
// show file timestamps in ls
#define BB_FEATURE_LS_TIMESTAMPS
//
// enable ls -p and -F
#define BB_FEATURE_LS_FILETYPES
//
// sort the file names (still a bit buggy)
#define BB_FEATURE_LS_SORTFILES
//
// enable ls -R
#define BB_FEATURE_LS_RECURSIVE
//
// Change ping implementation -- simplified, featureless, but really small.
#define BB_FEATURE_SIMPLE_PING
//
// Make init use a simplified /etc/inittab file (recommended).
#define BB_FEATURE_USE_INITTAB
//
//Enable init being called as /linuxrc
//#define BB_FEATURE_LINUXRC
//
//Have init enable core dumping for child processes (for debugging only)
//#define BB_FEATURE_INIT_COREDUMPS
//
// Allow init to permenently chroot, and umount the old root fs
// just like an initrd does. Requires a kernel patch by Werner Almesberger.
// ftp://icaftp.epfl.ch/pub/people/almesber/misc/umount-root-*.tar.gz
//#define BB_FEATURE_INIT_CHROOT
//
//Make sure nothing is printed to the console on boot
#define BB_FEATURE_EXTRA_QUIET
//
//Should syslogd also provide klogd support?
#define BB_FEATURE_KLOGD
//
// enable syslogd -R remotehost
#define BB_FEATURE_REMOTE_LOG
//
//Simple tail implementation (2.34k vs 3k for the full one).
//Both provide 'tail -f' support (only one file at a time.)
#define BB_FEATURE_SIMPLE_TAIL
//
// Enable support for loop devices in mount
//#define BB_FEATURE_MOUNT_LOOP
//
// Enable support for a real /etc/mtab file instead of /proc/mounts
//#define BB_FEATURE_MOUNT_MTAB_SUPPORT
//
// Enable support for mounting remote NFS volumes
//#define BB_FEATURE_NFSMOUNT
//
// Enable support forced filesystem unmounting
// (i.e. in case of an unreachable NFS system).
#define BB_FEATURE_MOUNT_FORCE
//
// Enable support for creation of tar files.
#define BB_FEATURE_TAR_CREATE
//
// Enable support for "--exclude" for excluding files
#define BB_FEATURE_TAR_EXCLUDE
//
//// Enable reverse sort
#define BB_FEATURE_SORT_REVERSE
//
// Enable command line editing in the shell
#define BB_FEATURE_SH_COMMAND_EDITING
//
//Allow the shell to invoke all the compiled in BusyBox commands as if they
//were shell builtins. Nice for staticly linking an emergency rescue shell
//among other thing.
#define BB_FEATURE_SH_STANDALONE_SHELL
//
// Enable tab completion in the shell (not yet
// working very well -- so don't turn this on)
//#define BB_FEATURE_SH_TAB_COMPLETION
//
//Turn on extra fbset options
//#define BB_FEATURE_FBSET_FANCY
//
//Turn on fbset readmode support
//#define BB_FEATURE_FBSET_READMODE
//
// You must enable one or both of these features
// Support installing modules from pre 2.1 kernels
//#define BB_FEATURE_INSMOD_OLD_KERNEL
// Support installing modules from kernel versions after 2.1.18
#define BB_FEATURE_INSMOD_NEW_KERNEL
//
// Support module version checking
//#define BB_FEATURE_INSMOD_VERSION_CHECKING
//
// Support for Minix filesystem, version 2
//#define BB_FEATURE_MINIX2
//
//
// Enable busybox --install [-s]
// to create links (or symlinks) for all the commands that are
// compiled into the binary. (needs /proc filesystem)
// #define BB_FEATURE_INSTALLER
//
// Clean up all memory before exiting -- usually not needed
// as the OS can clean up... Don't enable this unless you
// have a really good reason for cleaning things up manually.
//#define BB_FEATURE_CLEAN_UP
//
// End of Features List
//
//
//
//
//
//
//---------------------------------------------------
// Nothing beyond this point should ever be touched by
// mere mortals so leave this stuff alone.
//
#ifdef BB_FEATURE_MOUNT_MTAB_SUPPORT
#define BB_MTAB
#endif
//
#if defined BB_FEATURE_SH_COMMAND_EDITING && defined BB_SH
#define BB_CMDEDIT
#endif
//
#ifdef BB_KILLALL
#ifndef BB_KILL
#define BB_KILL
#endif
#endif
//
#ifdef BB_FEATURE_LINUXRC
#ifndef BB_INIT
#define BB_INIT
#endif
#define BB_LINUXRC
#endif
//
#ifdef BB_GZIP
#ifndef BB_GUNZIP
#define BB_GUNZIP
#endif
#endif
//
#if defined BB_MOUNT && defined BB_FEATURE_NFSMOUNT
#define BB_NFSMOUNT
#endif
//
#if defined BB_FEATURE_SH_COMMAND_EDITING
#ifndef BB_FEATURE_USE_TERMIOS
#define BB_FEATURE_USE_TERMIOS
#endif
#endif
//
#if defined BB_FEATURE_AUTOWIDTH
#ifndef BB_FEATURE_USE_TERMIOS
#define BB_FEATURE_USE_TERMIOS
#endif
#endif
//
#if defined BB_INSMOD
#ifndef BB_FEATURE_INSMOD_OLD_KERNEL
#define BB_FEATURE_INSMOD_NEW_KERNEL
#endif
#endif
+479
View File
@@ -0,0 +1,479 @@
#
# For a description of the syntax of this configuration file,
# see scripts/kbuild/config-language.txt.
#
mainmenu "BusyBox Configuration"
config HAVE_DOT_CONFIG
bool
default y
menu "Busybox Settings"
menu "General Configuration"
config NITPICK
bool "See lots more (probably unnecessary) configuration options."
default n
help
Some BusyBox applets have more configuration options than anyone
will ever care about. To avoid drowining people in complexity, most
of the applet features that can be set to a sane default value are
hidden, unless you hit the above switch.
This is better than to telling people to edit the busybox source
code, but not by much.
See http://en.wikipedia.org/wiki/Fibber_McGee_and_Molly#The_Closet
You have been warned.
config DESKTOP
bool "Enable options for full-blown desktop systems"
default n
help
Enable options and features which are not essential.
Select this only if you plan to use busybox on full-blown
desktop machine with common Linux distro, not on an embedded box.
choice
prompt "Buffer allocation policy"
default FEATURE_BUFFERS_USE_MALLOC
depends on NITPICK
help
There are 3 ways BusyBox can handle buffer allocations:
- Use malloc. This costs code size for the call to xmalloc.
- Put them on stack. For some very small machines with limited stack
space, this can be deadly. For most folks, this works just fine.
- Put them in BSS. This works beautifully for computers with a real
MMU (and OS support), but wastes runtime RAM for uCLinux. This
behavior was the only one available for BusyBox versions 0.48 and
earlier.
config FEATURE_BUFFERS_USE_MALLOC
bool "Allocate with Malloc"
config FEATURE_BUFFERS_GO_ON_STACK
bool "Allocate on the Stack"
config FEATURE_BUFFERS_GO_IN_BSS
bool "Allocate in the .bss section"
endchoice
config SHOW_USAGE
bool "Show terse applet usage messages"
default y
help
All BusyBox applets will show help messages when invoked with
wrong arguments. You can turn off printing these terse usage
messages if you say no here.
This will save you up to 7k.
config FEATURE_VERBOSE_USAGE
bool "Show verbose applet usage messages"
default n
select SHOW_USAGE
help
All BusyBox applets will show more verbose help messages when
busybox is invoked with --help. This will add a lot of text to the
busybox binary. In the default configuration, this will add about
13k, but it can add much more depending on your configuration.
config FEATURE_COMPRESS_USAGE
bool "Store applet usage messages in compressed form"
default y
depends on SHOW_USAGE
help
Store usage messages in compressed form, uncompress them on-the-fly
when <applet> --help is called.
If you have a really tiny busybox with few applets enabled (and
bunzip2 isn't one of them), the overhead of the decompressor might
be noticeable. Also, if you run executables directly from ROM
and have very little memory, this might not be a win. Otherwise,
you probably want this.
config FEATURE_INSTALLER
bool "Support --install [-s] to install applet links at runtime"
default n
help
Enable 'busybox --install [-s]' support. This will allow you to use
busybox at runtime to create hard links or symlinks for all the
applets that are compiled into busybox. This feature requires the
/proc filesystem.
config LOCALE_SUPPORT
bool "Enable locale support (system needs locale for this to work)"
default n
help
Enable this if your system has locale support and you would like
busybox to support locale settings.
config GETOPT_LONG
bool "Enable support for --long-options"
default y
help
Enable this if you want busybox applets to use the gnu --long-option
style, in addition to single character -a -b -c style options.
config FEATURE_DEVPTS
bool "Use the devpts filesystem for Unix98 PTYs"
default y
help
Enable if you want BusyBox to use Unix98 PTY support. If enabled,
busybox will use /dev/ptmx for the master side of the pseudoterminal
and /dev/pts/<number> for the slave side. Otherwise, BSD style
/dev/ttyp<number> will be used. To use this option, you should have
devpts mounted.
config FEATURE_CLEAN_UP
bool "Clean up all memory before exiting (usually not needed)"
default n
depends on NITPICK
help
As a size optimization, busybox normally exits without explicitly
freeing dynamically allocated memory or closing files. This saves
space since the OS will clean up for us, but it can confuse debuggers
like valgrind, which report tons of memory and resource leaks.
Don't enable this unless you have a really good reason to clean
things up manually.
config FEATURE_SUID
bool "Support for SUID/SGID handling"
default n
help
With this option you can install the busybox binary belonging
to root with the suid bit set, and it'll and it'll automatically drop
priviledges for applets that don't need root access.
If you're really paranoid and don't want to do this, build two
busybox binaries with different applets in them (and the appropriate
symlinks pointing to each binary), and only set the suid bit on the
one that needs it. The applets currently marked to need the suid bit
are login, passwd, su, ping, traceroute, crontab, dnsd, ipcrm, ipcs,
and vlock.
config FEATURE_SYSLOG
bool "Support for syslog"
default n
help
This option is auto-selected when you select any applet which may
send its output to syslog. You do not need to select it manually.
config FEATURE_SUID_CONFIG
bool "Runtime SUID/SGID configuration via /etc/busybox.conf"
default n if FEATURE_SUID
depends on FEATURE_SUID
help
Allow the SUID / SGID state of an applet to be determined at runtime
by checking /etc/busybox.conf. (This is sort of a poor man's sudo.)
The format of this file is as follows:
<applet> = [Ssx-][Ssx-][x-] (<username>|<uid>).(<groupname>|<gid>)
An example might help:
[SUID]
su = ssx root.0 # applet su can be run by anyone and runs with euid=0/egid=0
su = ssx # exactly the same
mount = sx- root.disk # applet mount can be run by root and members of group disk
# and runs with euid=0
cp = --- # disable applet cp for everyone
The file has to be owned by user root, group root and has to be
writeable only by root:
(chown 0.0 /etc/busybox.conf; chmod 600 /etc/busybox.conf)
The busybox executable has to be owned by user root, group
root and has to be setuid root for this to work:
(chown 0.0 /bin/busybox; chmod 4755 /bin/busybox)
Robert 'sandman' Griebl has more information here:
<url: http://www.softforge.de/bb/suid.html >.
config FEATURE_SUID_CONFIG_QUIET
bool "Suppress warning message if /etc/busybox.conf is not readable"
default y
depends on FEATURE_SUID_CONFIG
help
/etc/busybox.conf should be readable by the user needing the SUID, check
this option to avoid users to be notified about missing permissions.
config FEATURE_HAVE_RPC
bool "RPC support"
default y
help
Select this if you have rpc support.
This automatically turns off all configuration options that rely
on RPC.
config SELINUX
bool "Support NSA Security Enhanced Linux"
default n
help
Enable support for SELinux in applets ls, ps, and id. Also provide
the option of compiling in SELinux applets.
If you do not have a complete SELinux userland installed, this stuff
will not compile. Go visit
http://www.nsa.gov/selinux/index.html
to download the necessary stuff to allow busybox to compile with
this option enabled. Specifially, libselinux 1.28 or better is
directly required by busybox. If the installation is located in a
non-standard directory, provide it by invoking make as follows:
CFLAGS=-I<libselinux-include-path> \
LDFLAGS=-L<libselinux-lib-path> \
make
Most people will leave this set to 'N'.
config BUSYBOX_EXEC_PATH
string "Path to BusyBox executable"
default "/proc/self/exe"
help
When Busybox applets need to run other busybox applets, BusyBox
sometimes needs to exec() itself. When the /proc filesystem is
mounted, /proc/self/exe always points to the currently running
executable. If you haven't got /proc, set this to wherever you
want to run BusyBox from.
endmenu
menu 'Build Options'
config STATIC
bool "Build BusyBox as a static binary (no shared libs)"
default n
help
If you want to build a static BusyBox binary, which does not
use or require any shared libraries, then enable this option.
This can cause BusyBox to be considerably larger, so you should
leave this option false unless you have a good reason (i.e.
your target platform does not support shared libraries, or
you are building an initrd which doesn't need anything but
BusyBox, etc).
Most people will leave this set to 'N'.
config BUILD_LIBBUSYBOX
bool "Build shared libbusybox"
default n
help
Build a shared library libbusybox.so which contains all
libraries used inside busybox.
This is an experimental feature intended to support the upcoming
"make standalone" mode. Enabling it against the one big busybox
binary serves no purpose (and increases the size). You should
almost certainly say "no" to this right now.
config FEATURE_FULL_LIBBUSYBOX
bool "Feature-complete libbusybox"
default n if !FEATURE_SHARED_BUSYBOX
depends on BUILD_LIBBUSYBOX
help
Build a libbusybox with the complete feature-set, disregarding
the actually selected config.
Normally, libbusybox will only contain the features which are
used by busybox itself. If you plan to write a separate
standalone application which uses libbusybox say 'Y'.
Note: libbusybox is GPL, not LGPL, and exports no stable API that
might act as a copyright barrier. We can and will modify the
exported function set between releases (even minor version number
changes), and happily break out-of-tree features.
Say 'N' if in doubt.
config FEATURE_SHARED_BUSYBOX
bool "Use shared libbusybox for busybox"
default y if BUILD_LIBBUSYBOX
depends on !STATIC && BUILD_LIBBUSYBOX
help
Use libbusybox.so also for busybox itself.
You need to have a working dynamic linker to use this variant.
config LFS
bool "Build with Large File Support (for accessing files > 2 GB)"
default n
select FDISK_SUPPORT_LARGE_DISKS
help
If you want to build BusyBox with large file support, then enable
this option. This will have no effect if your kernel or your C
library lacks large file support for large files. Some of the
programs that can benefit from large file support include dd, gzip,
cp, mount, tar, and many others. If you want to access files larger
than 2 Gigabytes, enable this option. Otherwise, leave it set to 'N'.
config BUILD_AT_ONCE
bool "Compile all sources at once"
default n
help
Normally each source-file is compiled with one invocation of
the compiler.
If you set this option, all sources are compiled at once.
This gives the compiler more opportunities to optimize which can
result in smaller and/or faster binaries.
Setting this option will consume alot of memory, e.g. if you
enable all applets with all features, gcc uses more than 300MB
RAM during compilation of busybox.
This option is most likely only beneficial for newer compilers
such as gcc-4.1 and above.
Say 'N' unless you know what you are doing.
endmenu
menu 'Debugging Options'
config DEBUG
bool "Build BusyBox with extra Debugging symbols"
default n
help
Say Y here if you wish to examine BusyBox internals while applets are
running. This increases the size of the binary considerably, and
should only be used when doing development. If you are doing
development and want to debug BusyBox, answer Y.
Most people should answer N.
config DEBUG_PESSIMIZE
bool "Disable compiler optimizations."
default n
depends on DEBUG
help
The compiler's optimization of source code can eliminate and reorder
code, resulting in an executable that's hard to understand when
stepping through it with a debugger. This switches it off, resulting
in a much bigger executable that more closely matches the source
code.
choice
prompt "Additional debugging library"
default NO_DEBUG_LIB
depends on DEBUG
help
Using an additional debugging library will make BusyBox become
considerable larger and will cause it to run more slowly. You
should always leave this option disabled for production use.
dmalloc support:
----------------
This enables compiling with dmalloc ( http://dmalloc.com/ )
which is an excellent public domain mem leak and malloc problem
detector. To enable dmalloc, before running busybox you will
want to properly set your environment, for example:
export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile
The 'debug=' value is generated using the following command
dmalloc -p log-stats -p log-non-free -p log-bad-space -p log-elapsed-time \
-p check-fence -p check-heap -p check-lists -p check-blank \
-p check-funcs -p realloc-copy -p allow-free-null
Electric-fence support:
-----------------------
This enables compiling with Electric-fence support. Electric
fence is another very useful malloc debugging library which uses
your computer's virtual memory hardware to detect illegal memory
accesses. This support will make BusyBox be considerable larger
and run slower, so you should leave this option disabled unless
you are hunting a hard to find memory problem.
config NO_DEBUG_LIB
bool "None"
config DMALLOC
bool "Dmalloc"
config EFENCE
bool "Electric-fence"
endchoice
config INCLUDE_SUSv2
bool "Enable obsolete features removed before SUSv3?"
default y
help
This option will enable backwards compatibility with SuSv2,
specifically, old-style numeric options ('command -1 <file>')
will be supported in head, tail, and fold. (Note: should
affect renice too.)
endmenu
menu 'Installation Options'
config INSTALL_NO_USR
bool "Don't use /usr"
default n
help
Disable use of /usr. Don't activate this option if you don't know
that you really want this behaviour.
choice
prompt "Applets links"
default INSTALL_APPLET_SYMLINKS
help
Choose how you install applets links.
config INSTALL_APPLET_SYMLINKS
bool "as soft-links"
help
Install applets as soft-links to the busybox binary. This needs some
free inodes on the filesystem, but might help with filesystem
generators that can't cope with hard-links.
config INSTALL_APPLET_HARDLINKS
bool "as hard-links"
help
Install applets as hard-links to the busybox binary. This might count
on a filesystem with few inodes.
config INSTALL_APPLET_DONT
bool
prompt "not installed"
depends on FEATURE_INSTALLER || FEATURE_SH_STANDALONE_SHELL
help
Do not install applet links. Useful when using the -install feature
or a standalone shell for rescue pruposes.
endchoice
config PREFIX
string "BusyBox installation prefix"
default "./_install"
help
Define your directory to install BusyBox files/subdirs in.
endmenu
source libbb/Config.in
endmenu
comment "Applets"
source archival/Config.in
source coreutils/Config.in
source console-tools/Config.in
source debianutils/Config.in
source editors/Config.in
source findutils/Config.in
source init/Config.in
source loginutils/Config.in
source e2fsprogs/Config.in
source modutils/Config.in
source util-linux/Config.in
source miscutils/Config.in
source networking/Config.in
source procps/Config.in
source shell/Config.in
source sysklogd/Config.in
source runit/Config.in
+125
View File
@@ -0,0 +1,125 @@
Building:
=========
The BusyBox build process is similar to the Linux kernel build:
make menuconfig # This creates a file called ".config"
make # This creates the "busybox" executable
make install # or make PREFIX=/path/from/root install
The full list of configuration and install options is available by typing:
make help
Quick Start:
============
The easy way to try out BusyBox for the first time, without having to install
it, is to enable all features and then use "standalone shell" mode with a
blank command $PATH.
To enable all features, use "make defconfig", which produces the largest
general-purpose configuration. (It's allyesconfig minus debugging options,
optional packaging choices, and a few special-purpose features requiring
extra configuration to use.)
make defconfig
make
PATH= ./busybox ash
Standalone shell mode causes busybox's built-in command shell to run
any built-in busybox applets directly, without looking for external
programs by that name. Supplying an empty command path (as above) means
the only commands busybox can find are the built-in ones.
Note that the standalone shell requires CONFIG_BUSYBOX_EXEC_PATH
to be set appropriately, depending on whether or not /proc/self/exe is
available or not. If you do not have /proc, then point that config option
to the location of your busybox binary, usually /bin/busybox.
Configuring Busybox:
====================
Busybox is optimized for size, but enabling the full set of functionality
still results in a fairly large executable -- more than 1 megabyte when
statically linked. To save space, busybox can be configured with only the
set of applets needed for each environment. The minimal configuration, with
all applets disabled, produces a 4k executable. (It's useless, but very small.)
The manual configurator "make menuconfig" modifies the existing configuration.
(For systems without ncurses, try "make config" instead.) The two most
interesting starting configurations are "make allnoconfig" (to start with
everything disabled and add just what you need), and "make defconfig" (to
start with everything enabled and remove what you don't need). If menuconfig
is run without an existing configuration, make defconfig will run first to
create a known starting point.
Other starting configurations (mostly used for testing purposes) include
"make allbareconfig" (enables all applets but disables all optional features),
"make allyesconfig" (enables absolutely everything including debug features),
and "make randconfig" (produce a random configuration).
Configuring BusyBox produces a file ".config", which can be saved for future
use. Run "make oldconfig" to bring a .config file from an older version of
busybox up to date.
Installing Busybox:
===================
Busybox is a single executable that can behave like many different commands,
and BusyBox uses the name it was invoked under to determine the desired
behavior. (Try "mv busybox ls" and then "./ls -l".)
Installing busybox consists of creating symlinks (or hardlinks) to the busybox
binary for each applet enabled in busybox, and making sure these symlinks are
in the shell's command $PATH. Running "make install" creates these symlinks,
or "make install-hardlinks" creates hardlinks instead (useful on systems with
a limited number of inodes). This install process uses the file
"busybox.links" (created by make), which contains the list of enabled applets
and the path at which to install them.
Installing links to busybox is not always necessary. The special applet name
"busybox" (or with any optional suffix, such as "busybox-static") uses the
first argument to determine which applet to behave as, for example
"./busybox cat LICENSE". (Running the busybox applet with no arguments gives
a list of all enabled applets.) The standalone shell can also call busybox
applets without links to busybox under other names in the filesystem. You can
also configure a standaone install capability into the busybox base applet,
and then install such links at runtime with one of "busybox --install" (for
hardlinks) or "busybox --install -s" (for symlinks).
If you enabled the busybox shared library feature (libbusybox.so) and want
to run tests without installing, set your LD_LIBRARY_PATH accordingly when
running the executable:
LD_LIBRARY_PATH=`pwd` ./busybox
Building out-of-tree:
=====================
By default, the BusyBox build puts its temporary files in the source tree.
Building from a read-only source tree, or building multiple configurations from
the same source directory, requires the ability to put the temporary files
somewhere else.
To build out of tree, cd to an empty directory and configure busybox from there:
make -f /path/to/source/Makefile defconfig
make
make install
Alternately, use the O=$BUILDPATH option (with an absolute path) during the
configuration step, as in:
make O=/some/empty/directory allyesconfig
cd /some/empty/directory
make
make PREFIX=. install
More Information:
=================
Se also the busybox FAQ, under the questions "How can I get started using
BusyBox" and "How do I build a BusyBox-based system?" The BusyBox FAQ is
available from http://www.busybox.net/FAQ.html or as the file
docs/busybox.net/FAQ.html in this tarball.
+6 -36
View File
@@ -1,40 +1,11 @@
Original release code (unless otherwise noted)
Copyright 1995, 1996 Bruce Perens <bruce@pixar.com>
mkswap
Copyright 1991 Linus Torvalds
tiny-ls(ls)
Copyright 1996 Brian Candler <B.Candler@pobox.com>
tarcat, loadkmap, various fixes, Debian maintenance
Copyright 1998 Enrique Zanardi <ezanardi@ull.es>
more(v2), makedevs, dutmp, modularization, auto links file,
various fixes, Linux Router Project maintenance
Copyright 1998 Dave Cinege <dcinege@psychosis.com>
mini-gzip(gzip), mini-netcat(mnc)
Copyright 1998 Charles P. Wright <cpwright@villagenet.com>
Tons of new stuff as noted in header files
Copyright (C) 1999,2000,2001 by Lineo, inc. and written by
Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
Please feed suggestions, bug reports, insults, and bribes back to:
Erik Andersen
<andersen@lineo.com>
<andersee@debian.org>
Busybox may be used and distributed under the GNU General Public License.
---------------------------------------------------------------------------
--- A note on GPL versions
BusyBox is distributed under version 2 of the General Public License (included
in its entirety, below). Version 2 is the only version of this license which
this version of BusyBox (or modified versions derived from this one) may be
distributed under.
------------------------------------------------------------------------
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
@@ -375,4 +346,3 @@ proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
+1230 -262
View File
File diff suppressed because it is too large. Load diff
+145
View File
@@ -0,0 +1,145 @@
# ==========================================================================
# Build system
# ==========================================================================
%.bflt: %_unstripped
$(CROSS_COMPILE)elf2flt $(ELF2FLTFLAGS) $< -o $@
busybox.links: $(srctree)/applets/busybox.mkll $(objtree)/include/autoconf.h $(srctree)/include/applets.h
$(Q)-$(SHELL) $^ >$@
.PHONY: install
ifeq ($(CONFIG_INSTALL_APPLET_SYMLINKS),y)
INSTALL_OPTS:= --symlinks
endif
ifeq ($(CONFIG_INSTALL_APPLET_HARDLINKS),y)
INSTALL_OPTS:= --hardlinks
endif
install: $(srctree)/applets/install.sh busybox busybox.links
$(Q)DO_INSTALL_LIBS="$(strip $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS))" \
$(SHELL) $< $(CONFIG_PREFIX) $(INSTALL_OPTS)
ifeq ($(strip $(CONFIG_FEATURE_SUID)),y)
@echo
@echo
@echo --------------------------------------------------
@echo You will probably need to make your busybox binary
@echo setuid root to ensure all configured applets will
@echo work properly.
@echo --------------------------------------------------
@echo
endif
uninstall: busybox.links
rm -f $(CONFIG_PREFIX)/bin/busybox
for i in `cat busybox.links` ; do rm -f $(CONFIG_PREFIX)$$i; done
ifneq ($(strip $(DO_INSTALL_LIBS)),n)
for i in $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS); do \
rm -f $(CONFIG_PREFIX)$$i; \
done
endif
check test: busybox busybox.links
bindir=$(objtree) srcdir=$(srctree)/testsuite SED="$(SED)" \
$(SHELL) $(srctree)/testsuite/runtest $(if $(KBUILD_VERBOSE:0=),-v)
.PHONY: release
release: distclean
cd ..; \
rm -r -f busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION); \
cp -a busybox busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) && { \
find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type d \
-name .svn \
-print \
-exec rm -r -f {} \; ; \
find busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ -type f \
-name .\#* \
-print \
-exec rm -f {} \; ; \
tar -czf busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION).tar.gz \
busybox-$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)/ ; }
.PHONY: checkhelp
checkhelp:
$(Q)$(srctree)/scripts/checkhelp.awk \
$(patsubst %,$(srctree)/%,$(wildcard $(patsubst %,%/Config.in,$(busybox-dirs) ./)))
.PHONY: sizes
sizes: busybox_unstripped
$(NM) --size-sort $(<)
.PHONY: bloatcheck
bloatcheck: busybox_old busybox_unstripped
@$(srctree)/scripts/bloat-o-meter busybox_old busybox_unstripped
.PHONY: baseline
baseline: busybox_unstripped
@mv busybox_unstripped busybox_old
.PHONY: objsizes
objsizes: busybox_unstripped
$(srctree)/scripts/objsizes
.PHONY: bigdata
bigdata: busybox_unstripped
nm --size-sort busybox_unstripped | grep -vi ' [tr] ' | tail -20
# Documentation Targets
.PHONY: doc
doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
docs/busybox.pod: $(srctree)/docs/busybox_header.pod \
$(srctree)/include/usage.h \
$(srctree)/docs/busybox_footer.pod \
$(srctree)/docs/autodocifier.pl
$(disp_doc)
$(Q)-mkdir -p docs
$(Q)-( cat $(srctree)/docs/busybox_header.pod ; \
$(srctree)/docs/autodocifier.pl $(srctree)/include/usage.h ; \
cat $(srctree)/docs/busybox_footer.pod ; ) > docs/busybox.pod
docs/BusyBox.txt: docs/busybox.pod
$(disp_doc)
$(Q)-mkdir -p docs
$(Q)-pod2text $< > $@
docs/BusyBox.1: docs/busybox.pod
$(disp_doc)
$(Q)-mkdir -p docs
$(Q)-pod2man --center=BusyBox --release="version $(VERSION)" \
$< > $@
docs/BusyBox.html: docs/busybox.net/BusyBox.html
$(disp_doc)
$(Q)-mkdir -p docs
$(Q)-rm -f docs/BusyBox.html
$(Q)-cp docs/busybox.net/BusyBox.html docs/BusyBox.html
docs/busybox.net/BusyBox.html: docs/busybox.pod
$(Q)-mkdir -p docs/busybox.net
$(Q)-pod2html --noindex $< > \
docs/busybox.net/BusyBox.html
$(Q)-rm -f pod2htm*
# documentation, cross-reference
# Modern distributions already ship synopsis packages (e.g. debian)
# If you have an old distribution go to http://synopsis.fresco.org/
syn_tgt = $(wildcard $(patsubst %,%/*.c,$(busybox-alldirs)))
syn = $(patsubst %.c, %.syn, $(syn_tgt))
comma:= ,
brace_open:= (
brace_close:= )
SYN_CPPFLAGS := $(strip $(CPPFLAGS) $(EXTRA_CPPFLAGS))
SYN_CPPFLAGS := $(subst $(brace_open),\$(brace_open),$(SYN_CPPFLAGS))
SYN_CPPFLAGS := $(subst $(brace_close),\$(brace_close),$(SYN_CPPFLAGS))
#SYN_CPPFLAGS := $(subst ",\",$(SYN_CPPFLAGS))
#")
#SYN_CPPFLAGS := [$(patsubst %,'%'$(comma),$(SYN_CPPFLAGS))'']
%.syn: %.c
synopsis -p C -l Comments.SSDFilter,Comments.Previous -Wp,preprocess=True,cppflags="'$(SYN_CPPFLAGS)'" -o $@ $<
.PHONY: html
html: $(syn)
synopsis -f HTML -Wf,title="'BusyBox Documentation'" -o $@ $^
+31
View File
@@ -0,0 +1,31 @@
# ==========================================================================
# Build system
# ==========================================================================
BB_VER = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
# -std=gnu99 needed for [U]LLONG_MAX on some systems
CPPFLAGS += \
-std=gnu99 \
-Iinclude -Ilibbb \
$(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) -I$(srctree)/libbb \
-include include/autoconf.h \
-D_GNU_SOURCE -DNDEBUG \
$(if $(CONFIG_LFS),-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) \
-D"BB_VER=KBUILD_STR($(BB_VER))" -DBB_BT=AUTOCONF_TIMESTAMP
CFLAGS += \
-Wall -Wstrict-prototypes -Wshadow -Werror -Wundef \
-funsigned-char -fno-builtin-strlen -finline-limit=0 -static-libgcc \
-Os -falign-functions=1 -falign-jumps=1 -falign-loops=1 \
-fomit-frame-pointer -ffunction-sections -fdata-sections
ifeq ($(CONFIG_DEBUG),y)
CFLAGS += -g
endif
ifeq ($(CONFIG_STATIC),y)
LDFLAGS += -static
endif
#LDFLAGS += -nostdlib
+42
View File
@@ -0,0 +1,42 @@
# ==========================================================================
# Build system
# ==========================================================================
help:
@echo 'Cleaning:'
@echo ' clean - delete temporary files created by build'
@echo ' distclean - delete all non-source files (including .config)'
@echo
@echo 'Build:'
@echo ' all - Executable and documentation'
@echo ' busybox - the swiss-army executable'
@echo ' doc - docs/BusyBox.{txt,html,1}'
@echo ' html - create html-based cross-reference'
@echo
@echo 'Configuration:'
@echo ' allnoconfig - disable all symbols in .config'
@echo ' allyesconfig - enable all symbols in .config (see defconfig)'
@echo ' allbareconfig - enable all applets without any sub-features'
@echo ' config - text based configurator (of last resort)'
@echo ' defconfig - set .config to largest generic configuration'
@echo ' menuconfig - interactive curses-based configurator'
@echo ' oldconfig - resolve any unresolved symbols in .config'
@echo ' hosttools - build sed for the host.'
@echo ' You can use these commands if the commands on the host'
@echo ' is unusable. Afterwards use it like:'
@echo ' make SED="$(objtree)/sed"'
@echo
@echo 'Installation:'
@echo ' install - install busybox into $(PREFIX)'
@echo ' uninstall'
@echo
@echo 'Development:'
@echo ' baseline - create busybox_old for bloatcheck.'
@echo ' bloatcheck - show size difference between old and new versions'
@echo ' check - run the test suite for all applets'
@echo ' checkhelp - check for missing help-entries in Config.in'
@echo ' randconfig - generate a random configuration'
@echo ' release - create a distribution tarball'
@echo ' sizes - show size of all enabled busybox symbols'
@echo ' objsizes - show size of each .o object built'
@echo
+166 -90
View File
@@ -1,122 +1,198 @@
Please see the LICENSE file for copyright information.
BusyBox combines tiny versions of many common UNIX utilities into a single
small executable. It provides minimalist replacements for most of the utilities
you usually find in fileutils, shellutils, findutils, textutils, grep, gzip,
tar, etc. BusyBox provides a fairly complete POSIX environment for any small or
embedded system. The utilities in BusyBox generally have fewer options than
their full featured GNU cousins; however, the options that are included provide
the expected functionality and behave very much like their GNU counterparts.
Please see the LICENSE file for details on copying and usage.
Please refer to the INSTALL file for instructions on how to build.
BusyBox has been written with size-optimization and limited resources in mind.
It is also extremely modular so you can easily include or exclude commands (or
features) at compile time. This makes it easy to customize your embedded
systems. To create a working system, just add /dev, a kernel, and an editor,
such as nano, e3, or elvis-tiny. For a really minimal system, you can even use
the busybox shell (not Bourne compatible, but very small and quite usable).
What is busybox:
BusyBox was originally written to support the Debian Rescue/Install disks, but
it also makes an excellent environment for any small or embedded system.
BusyBox combines tiny versions of many common UNIX utilities into a single
small executable. It provides minimalist replacements for most of the
utilities you usually find in bzip2, coreutils, dhcp, diffutils, e2fsprogs,
file, findutils, gawk, grep, inetutils, less, modutils, net-tools, procps,
sed, shadow, sysklogd, sysvinit, tar, util-linux, and vim. The utilities
in BusyBox often have fewer options than their full-featured cousins;
however, the options that are included provide the expected functionality
and behave very much like their larger counterparts.
As of version 0.20 there is now a version number. : ) Also as of version 0.20,
BusyBox is now modularized to easily allow you to build only the components you
need, thereby reducing binary size. To turn off unwanted BusyBox components,
simply edit the file "Config.h" and comment out the components you do not need
using C++ style (//) comments.
BusyBox has been written with size-optimization and limited resources in
mind, both to produce small binaries and to reduce run-time memory usage.
Busybox is also extremely modular so you can easily include or exclude
commands (or features) at compile time. This makes it easy to customize
embedded systems; to create a working system, just add /dev, /etc, and a
Linux kernel. Busybox (usually together with uClibc) has also been used as
a component of "thin client" desktop systems, live-CD distributions, rescue
disks, installers, and so on.
After the build is complete, a busybox.links file is generated. This is
used by 'make install' to create symlinks to the busybox binary for all
compiled in functions. By default, 'make install' will place the symlink
forest into `pwd`/_install unless you have defined the PREFIX environment
variable (i.e., 'make PREFIX=/tmp/foo install')
----------------
Supported architectures:
Busybox in general will build on any architecture supported by gcc. It has
a few specialized features added for __sparc__ and __alpha__. insmod
functionality is currently limited to x86, ARM, and SH3/4.
Supported libcs:
glibc-2.0.x, glibc-2.1.x, Linux-libc5, uClibc. People are looking at
newlib and diet-libc, but consider them unsupported, untested, or worse.
Supported kernels:
Full functionality requires Linux 2.0.x, 2.2.x, or 2.4.x. A large fraction
of the code should run on just about anything.
BusyBox provides a fairly complete POSIX environment for any small system,
both embedded environments and more full featured systems concerned about
space. Busybox is slowly working towards implementing the full Single Unix
Specification V3 (http://www.opengroup.org/onlinepubs/009695399/), but isn't
there yet (and for size reasons will probably support at most UTF-8 for
internationalization). We are also interested in passing the Linux Test
Project (http://ltp.sourceforge.net).
----------------
Getting help:
Using busybox:
When you find you need help, you can check out the BusyBox mailing list
archives at http://opensource.lineo.com/lists/busybox/ or even join
the mailing list if you are interested.
BusyBox is extremely configurable. This allows you to include only the
components and options you need, thereby reducing binary size. Run 'make
config' or 'make menuconfig' to select the functionality that you wish to
enable. (See 'make help' for more commands.)
The behavior of busybox is determined by the name it's called under: as
"cp" it behaves like cp, as "sed" it behaves like sed, and so on. Called
as "busybox" it takes the second argument as the name of the applet to
run (I.E. "./busybox ls -l /proc").
The "standalone shell" mode is an easy way to try out busybox; this is a
command shell that calls the builtin applets without needing them to be
installed in the path. (Note that this requires /proc to be mounted, if
testing from a boot floppy or in a chroot environment.)
The build automatically generates a file "busybox.links", which is used by
'make install' to create symlinks to the BusyBox binary for all compiled in
commands. This uses the PREFIX environment variable to specify where to
install, and installs hardlinks or symlinks depending on the configuration
preferences. (You can also manually run the install script at
"applets/install.sh").
----------------
Bugs:
Downloading the current source code:
If you find bugs, please submit a bug report. Full instructions on how to
report a bug are found at http://bugs.lineo.com/Reporting.html.
Source for the latest released version, as well as daily snapshots, can always
be downloaded from
For the impatient: To submit a bug, simply send an email describing the problem
to submit@bugs.lineo.com. Bug reports should look something like this:
http://busybox.net/downloads/
To: submit@bugs.lineo.com
From: diligent@testing.linux.org
Subject: /bin/true doesn't work
You can browse the up to the minute source code and change history online.
Package: busybox
Version: 0.48
http://www.busybox.net/cgi-bin/viewcvs.cgi/trunk/busybox/
When I invoke '/bin/true' it doesn't work. I expected it to return
a "0" but it returned a "1" instead. Here is the transcript:
$ /bin/true ; echo $?
1
With GNU /bin/true, I get the following output:
$ /bin/true ; echo $?
0
I am using Debian 2.2r2, kernel version 2.2.18, and the latest
uClibc from CVS. Thanks for the wonderful program!
-Diligent
Anonymous SVN access is available. For instructions, check out:
Note the careful description and use of examples showing not only what BusyBox
does, but also a counter example showing what an equivalent GNU app does. Bug
reports lacking such detail may take a _long_ time to be fixed... Thanks for
understanding.
http://busybox.net/subversion.html
For those that are actively contributing and would like to check files in,
see:
http://busybox.net/developer.html
The developers also have a bug and patch tracking system
(http://bugs.busybox.net) although posting a bug/patch to the mailing list
is generally a faster way of getting it fixed, and the complete archive of
what happened is the subversion changelog.
----------------
FTP:
getting help:
Source for the latest released version can always be downloaded from
ftp://ftp.lineo.com/pub/busybox.
when you find you need help, you can check out the busybox mailing list
archives at http://busybox.net/lists/busybox/ or even join
the mailing list if you are interested.
----------------
CVS:
bugs:
BusyBox now has its own publicly browsable CVS tree at:
http://opensource.lineo.com/cgi-bin/cvsweb/busybox/
if you find bugs, please submit a detailed bug report to the busybox mailing
list at busybox@busybox.net. a well-written bug report should include a
transcript of a shell session that demonstrates the bad behavior and enables
anyone else to duplicate the bug on their own machine. the following is such
an example:
Anonymous CVS access is available. For instructions, check out:
http://opensource.lineo.com/cvs_anon.html
to: busybox@busybox.net
from: diligent@testing.linux.org
subject: /bin/date doesn't work
For those that are actively contributing there is even CVS write access:
http://opensource.lineo.com/cvs_write.html
package: busybox
version: 1.00
when i execute busybox 'date' it produces unexpected results.
with gnu date i get the following output:
$ date
fri oct 8 14:19:41 mdt 2004
but when i use busybox date i get this instead:
$ date
illegal instruction
i am using debian unstable, kernel version 2.4.25-vrs2 on a netwinder,
and the latest uclibc from cvs. thanks for the wonderful program!
-diligent
note the careful description and use of examples showing not only what
busybox does, but also a counter example showing what an equivalent app
does (or pointing to the text of a relevant standard). Bug reports lacking
such detail may never be fixed... Thanks for understanding.
----------------
Please feed suggestions, bug reports, insults, and bribes back to:
Erik Andersen
<andersen@lineo.com>
<andersee@debian.org>
Portability:
<blatant plug>
Many thanks to go to Lineo for paying me to work on busybox.
</blatant plug>
Busybox is developed and tested on Linux 2.4 and 2.6 kernels, compiled
with gcc (the unit-at-a-time optimizations in version 3.4 and later are
worth upgrading to get, but older versions should work), and linked against
uClibc (0.9.27 or greater) or glibc (2.2 or greater). In such an
environment, the full set of busybox features should work, and if
anything doesn't we want to know about it so we can fix it.
There are many other environments out there, in which busybox may build
and run just fine. We just don't test them. Since busybox consists of a
large number of more or less independent applets, portability is a question
of which features work where. Some busybox applets (such as cat and rm) are
highly portable and likely to work just about anywhere, while others (such as
insmod and losetup) require recent Linux kernels with recent C libraries.
Earlier versions of Linux and glibc may or may not work, for any given
configuration. Linux 2.2 or earlier should mostly work (there's still
some support code in things like mount.c) but this is no longer regularly
tested, and inherently won't support certain features (such as long files
and --bind mounts). The same is true for glibc 2.0 and 2.1: expect a higher
testing and debugging burden using such old infrastructure. (The busybox
developers are not very interested in supporting these older versions, but
will probably accept small self-contained patches to fix simple problems.)
Some environments are not recommended. Early versions of uClibc were buggy
and missing many features: upgrade. Linking against libc5 or dietlibc is
not supported and not interesting to the busybox developers. (The first is
obsolete and has no known size or feature advantages over uClibc, the second
has known bugs that its developers have actively refused to fix.) Ancient
Linux kernels (2.0.x and earlier) are similarly uninteresting.
In theory it's possible to use Busybox under other operating systems (such as
MacOS X, Solaris, Cygwin, or the BSD Fork Du Jour). This generally involves
a different kernel and a different C library at the same time. While it
should be possible to port the majority of the code to work in one of
these environments, don't be suprised if it doesn't work out of the box. If
you're into that sort of thing, start small (selecting just a few applets)
and work your way up.
Shaun Jackman has recently (2005) ported busybox to a combination of newlib
and libgloss, and some of his patches have been integrated. This platform
may join glibc/uclibc and Linux as a supported combination with the 1.1
release, but is not supported in 1.0.
Supported hardware:
BusyBox in general will build on any architecture supported by gcc. We
support both 32 and 64 bit platforms, and both big and little endian
systems.
Under 2.4 Linux kernels, kernel module loading was implemented in a
platform-specific manner. Busybox's insmod utility has been reported to
work under ARM, CRIS, H8/300, x86, ia64, x86_64, m68k, MIPS, PowerPC, S390,
SH3/4/5, Sparc, v850e, and x86_64. Anything else probably won't work.
The module loading mechanism for the 2.6 kernel is much more generic, and
we believe 2.6.x kernel module loading support should work on all
architectures supported by the kernel.
----------------
Please feed suggestions, bug reports, insults, and bribes back to the busybox
maintainer:
Denis Vlasenko
<vda.linux@googlemail.com>
+297 -37
View File
@@ -1,53 +1,313 @@
TODO list for busybox in no particular order. Just because something
is listed here doesn't mean that it is going to be added to busybox,
or that doing so is even a good idea. It just means that I _might_ get
around to it some time. If you have any good ideas, please let me know.
Busybox TODO
* login/sulogin/passwd/getty/etc are part of tinylogin, and so are not
needed or wanted in busybox (or else I'd have to link to libcrypt).
Stuff that needs to be done. This is organized by who plans to get around to
doing it eventually, but that doesn't mean they "own" the item. If you want to
do one of these bounce an email off the person it's listed under to see if they
have any suggestions how they plan to go about it, and to minimize conflicts
between your work and theirs. But otherwise, all of these are fair game.
* We _were_ going to split networking apps into a new package called
netkit-tiny. Per discussions on the mailing list, this isn't going
to happen. False alarm. Sorry about the confusion.
Rob Landley <rob@landley.net>:
Add BB_NOMMU to platform.h and migrate __uClinux__ tests to that.
#if defined __UCLIBC__ && !defined __ARCH_USE_MMU__
Add a libbb/platform.c
Implement fdprintf() for platforms that haven't got one.
Implement bb_realpath() that can handle NULL on non-glibc.
Cleanup bb_asprintf()
* The busybox shell, lash, is really too weak for serious use, although it is
possible to run simple systems with it. BusyBox 0.49 was supposed to have
a new shell, updated to understand full Bourne grammer. Well, that simply
didn't happen in time for the release. A rewrite is in progress that will
result in a new shell that understands the full Bourne grammar. This new
shell is being championed by Larry Doolittle <ldoolitt@recycle.lbl.gov>, and
could use your help. Please see the work in progress at
http://doolittle.faludi.com/~larry/parser.html
Migrate calloc() and bb_calloc() occurrences to bb_xzalloc().
Remove obsolete _() wrapper crud for internationalization we don't do.
Figure out where we need utf8 support, and add it.
-Erik
sh
The command shell situation is a big mess. We have three or four different
shells that don't really share any code, and the "standalone shell" doesn't
work all that well (especially not in a chroot environment), due to apps not
being reentrant. I'm writing a new shell (bbsh) to unify the various
shells and configurably add the minimal set of bash features people
actually use. The hardest part is it has to configure down as small as
lash while providing lash's features. The rest is easy in comparison.
bzip2
Compression-side support.
init
General cleanup (should use ENABLE_FEATURE_INIT_SYSLOG and ENABLE_FEATURE_INIT_DEBUG).
depmod
busybox lacks a way to update module deps when running from firmware without the
use of the depmod.pl (perl is to bloated for most embedded setups) and or orig
modutils. The orig depmod is rather pointless to have to add to a firmware image
in when we already have a insmod/rmmod and friends.
Unify base64 handling.
There's base64 encoding and decoding going on in:
networking/wget.c:base64enc()
coreutils/uudecode.c:read_base64()
coreutils/uuencode.c:tbl_base64[]
networking/httpd.c:decodeBase64()
And probably elsewhere. That needs to be unified into libbb functions.
Do a SUSv3 audit
Look at the full Single Unix Specification version 3 (available online at
"http://www.opengroup.org/onlinepubs/009695399/nfindex.html") and
figure out which of our apps are compliant, and what we're missing that
we might actually care about.
-----------
Even better would be some kind of automated compliance test harness that
exercises each command line option and the various corner cases.
Internationalization
How much internationalization should we do?
Possible apps to include some time:
The low hanging fruit is UTF-8 character set support. We should do this.
(Vodz pointed out the shell's cmdedit as needing work here. What else?)
* hwclock
* stty
* group/commonize strings, remove dups (for i18n, l10n)
We also have lots of hardwired english text messages. Consolidating this
into some kind of message table not only makes translation easier, but
also allows us to consolidate redundant (or close) strings.
-----------------------
We probably don't want to be bloated with locale support. (Not unless we
can cleanly export it from our underlying C library without having to
concern ourselves with it directly. Perhaps a few specific things like a
config option for "date" are low hanging fruit here?)
Running the following:
What level should things happen at? How much do we care about
internationalizing the text console when X11 and xterms are so much better
at it? (There's some infrastructure here we don't implement: The
"unicode_start" and "unicode_stop" shell scripts need "vt-is-UTF8" and a
--unicode option to loadkeys. That implies a real loadkeys/dumpkeys
implementation to replace loadkmap/dumpkmap. Plus messing with console font
loading. Is it worth it, or do we just say "use X"?)
rm -f busybox && make LDFLAGS+=-nostdlib 2>&1 | \
sed -ne 's/.*undefined reference to `\(.*\)..*/\1/gp' | sort | uniq
Individual compilation of applets.
It would be nice if busybox had the option to compile to individual applets,
for people who want an alternate implementation less bloated than the gnu
utils (or simply with less political baggage), but without it being one big
executable.
reveals the list of all external (i.e. libc) things that BusyBox depends on.
It would be a very nice thing to reduce this list to an absolute minimum, to
reduce the footprint of busybox, especially when staticly linking with
libraries such as uClibc.
Turning libbb into a real dll is another possibility, especially if libbb
could export some of the other library interfaces we've already more or less
got the code for (like zlib).
buildroot - Make a "dogfood" option
Busybox 1.1 will be capable of replacing most gnu packages for real world
use, such as developing software or in a live CD. It needs wider testing.
-----------------------
Busybox should now be able to replace bzip2, coreutils, e2fsprogs, file,
findutils, gawk, grep, inetutils, less, modutils, net-tools, patch, procps,
sed, shadow, sysklogd, sysvinit, tar, util-linux, and vim. The resulting
system should be self-hosting (I.E. able to rebuild itself from source
code). This means it would need (at least) binutils, gcc, and make, or
equivalents.
Compile with debugging on, run 'nm --size-sort ./busybox'
and then start with the biggest things and make them smaller...
It would be a good "eating our own dogfood" test if buildroot had the option
of using a "make allyesconfig" busybox instead of the all of the above
packages. Anything that's wrong with the resulting system, we can fix. (It
would be nice to be able to upgrade busybox to be able to replace bash and
diffutils as well, but we're not there yet.)
-----------------------
One example of an existing system that does this already is Firmware Linux:
http://www.landley.net/code/firmware
initramfs
Busybox should have a sample initramfs build script. This depends on
bbsh, mdev, and switch_root.
mkdep
Write a mkdep that doesn't segfault if there's a directory it doesn't
have permission to read, isn't based on manually editing the output of
lexx and yacc, doesn't make such a mess under include/config, etc.
Group globals into unions of structures.
Go through and turn all the global and static variables into structures,
and have all those structures be in a big union shared between processes,
so busybox uses less bss. (This is a big win on nommu machines.) See
sed.c and mdev.c for examples.
Go through bugs.busybox.net and close out all of that somehow.
This one's open to everybody, but I'll wind up doing it...
du.c probably ought to have an -x switch like GNU du does...
------------------------------------------------------------------
Bernhard Fischer <busybox@busybox.net> suggests to look at these:
New debug options:
-Wlarger-than-127
Cleanup any big users
-Wunused-parameter
Facilitate applet PROTOTYPES to provide means for having applets that
do a) not take any arguments b) need only one of argc or argv c) need
both argc and argv. All of these three options should go for the most
feature complete denominator.
Collate BUFSIZ IOBUF_SIZE MY_BUF_SIZE PIPE_PROGRESS_SIZE BUFSIZE PIPESIZE
make bb_common_bufsiz1 configurable, size wise.
make pipesize configurable, size wise.
Use bb_common_bufsiz1 throughout applets!
Add chrt applet. Please CC Bernhard if you suggest a patch.
As yet unclaimed:
----
find
doesn't understand (), lots of susv3 stuff.
----
diff
Make sure we handle empty files properly:
From the patch man page:
you can remove a file by sending out a context diff that compares
the file to be deleted with an empty file dated the Epoch. The
file will be removed unless patch is conforming to POSIX and the
-E or --remove-empty-files option is not given.
---
patch
Should have simple fuzz factor support to apply patches at an offset which
shouldn't take up too much space.
And while we're at it, a new patch filename quoting format is apparently
coming soon: http://marc.theaimsgroup.com/?l=git&m=112927316408690&w=2
---
man
It would be nice to have a man command. Not one that handles troff or
anything, just one that can handle preformatted ascii man pages, possibly
compressed. This could probably be a script in the extras directory that
calls cat/zcat/bzcat | less
(How doclifter might work into this is anybody's guess.)
---
ar
Write support?
----
stty / catv
stty's visible() function and catv's guts are identical. Merge them into
an appropriate libbb function.
----
Architectural issues:
bb_close() with fsync()
We should have a bb_close() in place of normal close, with a CONFIG_ option
to not just check the return value of close() for an error, but fsync().
Close can't reliably report anything useful because if write() accepted the
data then it either went out to the network or it's in cache or a pipe
buffer. Either way, there's no guarantee it'll make it to its final
destination before close() gets called, so there's no guarantee that any
error will be reported.
You need to call fsync() if you care about errors that occur after write(),
but that can have a big performance impact. So make it a config option.
---
Unify archivers
Lots of archivers have the same general infrastructure. The directory
traversal code should be factored out, and the guts of each archiver could
be some setup code and a series of callbacks for "add this file",
"add this directory", "add this symlink" and so on.
This could clean up tar and zip, and make it cheaper to add cpio and ar
write support, and possibly even cheaply add things like mkisofs or
mksquashfs someday, if they become relevant.
---
Text buffer support.
Several existing applets (sort, vi, less...) read
a whole file into memory and act on it. There might be an opportunity
for shared code in there that could be moved into libbb...
---
Memory Allocation
We have a CONFIG_BUFFER mechanism that lets us select whether to do memory
allocation on the stack or the heap. Unfortunately, we're not using it much.
We need to audit our memory allocations and turn a lot of malloc/free calls
into RESERVE_CONFIG_BUFFER/RELEASE_CONFIG_BUFFER.
For a start, see e.g. make EXTRA_CFLAGS=-Wlarger-than-64
And while we're at it, many of the CONFIG_FEATURE_CLEAN_UP #ifdefs will be
optimized out by the compiler in the stack allocation case (since there's no
free for an alloca()), and this means that various cleanup loops that just
call free might also be optimized out by the compiler if written right, so
we can yank those #ifdefs too, and generally clean up the code.
---
Switch CONFIG_SYMBOLS to ENABLE_SYMBOLS
In busybox 1.0 and earlier, configuration was done by CONFIG_SYMBOLS
that were either defined or undefined to indicate whether the symbol was
selected in the .config file. They were used with #ifdefs, ala:
#ifdef CONFIG_SYMBOL
if (other_test) {
do_code();
}
#endif
In 1.1, we have new ENABLE_SYMBOLS which are always defined (as 0 or 1),
meaning you can still use them for preprocessor tests by replacing
"#ifdef CONFIG_SYMBOL" with "#if ENABLE_SYMBOL". But more importantly, we
can use them as a true or false test in normal C code:
if (ENABLE_SYMBOL && other_test) {
do_code();
}
(Optimizing away if() statements that resolve to a constant value
is known as "dead code elimination", an optimization so old and simple that
Turbo Pascal for DOS did it twenty years ago. Even modern mini-compilers
like the Tiny C Compiler (tcc) and the Small Device C Compiler (SDCC)
perform dead code elimination.)
Right now, busybox.h is #including both "config.h" (defining the
CONFIG_SYMBOLS) and "bb_config.h" (defining the ENABLE_SYMBOLS). At some
point in the future, it would be nice to wean ourselves off of the
CONFIG versions. (Among other things, some defective build environments
leak the Linux kernel's CONFIG_SYMBOLS into the system's standard #include
files. We've experienced collisions before.)
---
FEATURE_CLEAN_UP
This is more an unresolved issue than a to-do item. More thought is needed.
Normally we rely on exit() to free memory, close files, and unmap segments
for us. This makes most calls to free(), close(), and unmap() optional in
busybox applets that don't intend to run for very long, and optional stuff
can be omitted to save size.
The idea was raised that we could simulate fork/exit with setjmp/longjmp
for _really_ brainless embedded systems, or speed up the standalone shell
by not forking. Doing so would require a reliable FEATURE_CLEAN_UP.
Unfortunately, this isn't as easy as it sounds.
The problem is, lots of things exit(), sometimes unexpectedly (xmalloc())
and sometimes reliably (bb_perror_msg_and_die() or show_usage()). This
jumps out of the normal flow control and bypasses any cleanup code we
put at the end of our applets.
It's possible to add hooks to libbb functions like xmalloc() and xopen()
to add their entries to a linked list, which could be traversed and
freed/closed automatically. (This would need to be able to free just the
entries after a checkpoint to be usable for a forkless standalone shell.
You don't want to free the shell's own resources.)
Right now, FEATURE_CLEAN_UP is more or less a debugging aid, to make things
like valgrind happy. It's also documentation of _what_ we're trusting
exit() to clean up for us. But new infrastructure to auto-free stuff would
render the existing FEATURE_CLEAN_UP code redundant.
For right now, exit() handles it just fine.
Minor stuff:
watchdog.c could autodetect the timer duration via:
if(!ioctl (fd, WDIOC_GETTIMEOUT, &tmo)) timer_duration = 1 + (tmo / 2);
Unfortunately, that needs linux/watchdog.h and that contains unfiltered
kernel types on some distros, which breaks the build.
---
use bb_error_msg where appropriate: See
egrep "(printf.*\([[:space:]]*(stderr|2)|[^_]write.*\([[:space:]]*(stderr|2))"
---
use bb_perror_msg where appropriate: See
egrep "[^_]perror"
---
Remove superfluous fmt occurances: e.g.
fprintf(stderr, "%s: %s not found\n", "unalias", *argptr);
-> fprintf(stderr, "unalias: %s not found\n", *argptr);
---
possible code duplication ingroup() and is_a_group_member()
---
Move __get_hz() to a better place and (re)use it in route.c, ash.c, msh.c
---
Code cleanup:
Replace deprecated functions.
bzero() -> memset()
---
sigblock(), siggetmask(), sigsetmask(), sigmask() -> sigprocmask et al
---
vdprintf() -> similar sized functionality
---
-397
View File
@@ -1,397 +0,0 @@
/*
* applets.h - a listing of all busybox applets.
*
* If you write a new applet, you need to add an entry to this list to make
* busybox aware of it.
*
* It is CRUCIAL that this listing be kept in ascii order, otherwise the binary
* search lookup contributed by Gaute B Strokkenes stops working. If you value
* your kneecaps, you'll be sure to *make sure* that any changes made to this
* file result in the listing remaining in ascii order. You have been warned.
*/
#if defined(PROTOTYPES)
#define APPLET(a,b,c,d) \
extern int b(int argc, char **argv); \
extern const char d[];
#define APPLET_NOUSAGE(a,b,c) \
extern int b(int argc, char **argv);
#elif defined(MAKE_LINKS)
#define APPLET(a,b,c,d) LINK c a
#define APPLET_NOUSAGE(a,b,c) LINK c a
#else
const struct BB_applet applets[] = {
#define APPLET(a,b,c,d) {a,b,c,d},
#define APPLET_NOUSAGE(a,b,c) {a,b,c,NULL},
#endif
#ifdef BB_TEST
APPLET("[", test_main, _BB_DIR_USR_BIN, test_usage)
#endif
#ifdef BB_AR
APPLET("ar", ar_main, _BB_DIR_USR_BIN, ar_usage)
#endif
#ifdef BB_BASENAME
APPLET("basename", basename_main, _BB_DIR_USR_BIN, basename_usage)
#endif
APPLET_NOUSAGE("busybox", busybox_main, _BB_DIR_BIN)
#ifdef BB_CAT
APPLET("cat", cat_main, _BB_DIR_BIN, cat_usage)
#endif
#ifdef BB_CHMOD_CHOWN_CHGRP
APPLET("chgrp", chmod_chown_chgrp_main, _BB_DIR_BIN, chgrp_usage)
#endif
#ifdef BB_CHMOD_CHOWN_CHGRP
APPLET("chmod", chmod_chown_chgrp_main, _BB_DIR_BIN, chmod_usage)
#endif
#ifdef BB_CHMOD_CHOWN_CHGRP
APPLET("chown", chmod_chown_chgrp_main, _BB_DIR_BIN, chown_usage)
#endif
#ifdef BB_CHROOT
APPLET("chroot", chroot_main, _BB_DIR_USR_SBIN, chroot_usage)
#endif
#ifdef BB_CHVT
APPLET("chvt", chvt_main, _BB_DIR_USR_BIN, chvt_usage)
#endif
#ifdef BB_CLEAR
APPLET("clear", clear_main, _BB_DIR_USR_BIN, clear_usage)
#endif
#ifdef BB_CMP
APPLET("cmp", cmp_main, _BB_DIR_USR_BIN, cmp_usage)
#endif
#ifdef BB_CP_MV
APPLET("cp", cp_mv_main, _BB_DIR_BIN, cp_usage)
#endif
#ifdef BB_CUT
APPLET("cut", cut_main, _BB_DIR_USR_BIN, cut_usage)
#endif
#ifdef BB_DATE
APPLET("date", date_main, _BB_DIR_BIN, date_usage)
#endif
#ifdef BB_DC
APPLET("dc", dc_main, _BB_DIR_USR_BIN, dc_usage)
#endif
#ifdef BB_DD
APPLET("dd", dd_main, _BB_DIR_BIN, dd_usage)
#endif
#ifdef BB_DEALLOCVT
APPLET("deallocvt", deallocvt_main, _BB_DIR_USR_BIN, deallocvt_usage)
#endif
#ifdef BB_DF
APPLET("df", df_main, _BB_DIR_BIN, df_usage)
#endif
#ifdef BB_DIRNAME
APPLET("dirname", dirname_main, _BB_DIR_USR_BIN, dirname_usage)
#endif
#ifdef BB_DMESG
APPLET("dmesg", dmesg_main, _BB_DIR_BIN, dmesg_usage)
#endif
#ifdef BB_DOS2UNIX
APPLET("dos2unix", dos2unix_main, _BB_DIR_USR_BIN, dos2unix_usage)
#endif
#ifdef BB_DPKG_DEB
APPLET("dpkg-deb", dpkg_deb_main, _BB_DIR_USR_BIN, dpkg_deb_usage)
#endif
#ifdef BB_DU
APPLET("du", du_main, _BB_DIR_USR_BIN, du_usage)
#endif
#ifdef BB_DUMPKMAP
APPLET("dumpkmap", dumpkmap_main, _BB_DIR_BIN, dumpkmap_usage)
#endif
#ifdef BB_DUTMP
APPLET("dutmp", dutmp_main, _BB_DIR_USR_SBIN, dutmp_usage)
#endif
#ifdef BB_ECHO
APPLET("echo", echo_main, _BB_DIR_BIN, echo_usage)
#endif
#ifdef BB_EXPR
APPLET("expr", expr_main, _BB_DIR_USR_BIN, expr_usage)
#endif
#ifdef BB_TRUE_FALSE
APPLET("false", false_main, _BB_DIR_BIN, false_usage)
#endif
#ifdef BB_FBSET
APPLET_NOUSAGE("fbset", fbset_main, _BB_DIR_USR_SBIN)
#endif
#ifdef BB_FDFLUSH
APPLET("fdflush", fdflush_main, _BB_DIR_BIN, fdflush_usage)
#endif
#ifdef BB_FIND
APPLET("find", find_main, _BB_DIR_USR_BIN, find_usage)
#endif
#ifdef BB_FREE
APPLET("free", free_main, _BB_DIR_USR_BIN, free_usage)
#endif
#ifdef BB_FREERAMDISK
APPLET("freeramdisk", freeramdisk_main, _BB_DIR_SBIN, freeramdisk_usage)
#endif
#ifdef BB_FSCK_MINIX
APPLET("fsck.minix", fsck_minix_main, _BB_DIR_SBIN, fsck_minix_usage)
#endif
#ifdef BB_GETOPT
APPLET("getopt", getopt_main, _BB_DIR_BIN, getopt_usage)
#endif
#ifdef BB_GREP
APPLET("grep", grep_main, _BB_DIR_BIN, grep_usage)
#endif
#ifdef BB_GUNZIP
APPLET("gunzip", gunzip_main, _BB_DIR_BIN, gunzip_usage)
#endif
#ifdef BB_GZIP
APPLET("gzip", gzip_main, _BB_DIR_BIN, gzip_usage)
#endif
#ifdef BB_HALT
APPLET("halt", halt_main, _BB_DIR_SBIN, halt_usage)
#endif
#ifdef BB_HEAD
APPLET("head", head_main, _BB_DIR_USR_BIN, head_usage)
#endif
#ifdef BB_HOSTID
APPLET("hostid", hostid_main, _BB_DIR_USR_BIN, hostid_usage)
#endif
#ifdef BB_HOSTNAME
APPLET("hostname", hostname_main, _BB_DIR_BIN, hostname_usage)
#endif
#ifdef BB_ID
APPLET("id", id_main, _BB_DIR_USR_BIN, id_usage)
#endif
#ifdef BB_INIT
APPLET_NOUSAGE("init", init_main, _BB_DIR_SBIN)
#endif
#ifdef BB_INSMOD
APPLET("insmod", insmod_main, _BB_DIR_SBIN, insmod_usage)
#endif
#ifdef BB_KILL
APPLET("kill", kill_main, _BB_DIR_BIN, kill_usage)
#endif
#ifdef BB_KILLALL
APPLET("killall", kill_main, _BB_DIR_USR_BIN, killall_usage)
#endif
#ifdef BB_LENGTH
APPLET("length", length_main, _BB_DIR_USR_BIN, length_usage)
#endif
#ifdef BB_LINUXRC
APPLET_NOUSAGE("linuxrc", init_main, _BB_DIR_ROOT)
#endif
#ifdef BB_LN
APPLET("ln", ln_main, _BB_DIR_BIN, ln_usage)
#endif
#ifdef BB_LOADACM
APPLET("loadacm", loadacm_main, _BB_DIR_USR_BIN, loadacm_usage)
#endif
#ifdef BB_LOADFONT
APPLET("loadfont", loadfont_main, _BB_DIR_USR_BIN, loadfont_usage)
#endif
#ifdef BB_LOADKMAP
APPLET("loadkmap", loadkmap_main, _BB_DIR_SBIN, loadkmap_usage)
#endif
#ifdef BB_LOGGER
APPLET("logger", logger_main, _BB_DIR_USR_BIN, logger_usage)
#endif
#ifdef BB_LOGNAME
APPLET("logname", logname_main, _BB_DIR_USR_BIN, logname_usage)
#endif
#ifdef BB_LS
APPLET("ls", ls_main, _BB_DIR_BIN, ls_usage)
#endif
#ifdef BB_LSMOD
APPLET("lsmod", lsmod_main, _BB_DIR_SBIN, lsmod_usage)
#endif
#ifdef BB_MAKEDEVS
APPLET("makedevs", makedevs_main, _BB_DIR_SBIN, makedevs_usage)
#endif
#ifdef BB_MD5SUM
APPLET("md5sum", md5sum_main, _BB_DIR_USR_BIN, md5sum_usage)
#endif
#ifdef BB_MKDIR
APPLET("mkdir", mkdir_main, _BB_DIR_BIN, mkdir_usage)
#endif
#ifdef BB_MKFIFO
APPLET("mkfifo", mkfifo_main, _BB_DIR_USR_BIN, mkfifo_usage)
#endif
#ifdef BB_MKFS_MINIX
APPLET("mkfs.minix", mkfs_minix_main, _BB_DIR_SBIN, mkfs_minix_usage)
#endif
#ifdef BB_MKNOD
APPLET("mknod", mknod_main, _BB_DIR_BIN, mknod_usage)
#endif
#ifdef BB_MKSWAP
APPLET("mkswap", mkswap_main, _BB_DIR_SBIN, mkswap_usage)
#endif
#ifdef BB_MKTEMP
APPLET("mktemp", mktemp_main, _BB_DIR_BIN, mktemp_usage)
#endif
#ifdef BB_MORE
APPLET("more", more_main, _BB_DIR_BIN, more_usage)
#endif
#ifdef BB_MOUNT
APPLET("mount", mount_main, _BB_DIR_BIN, mount_usage)
#endif
#ifdef BB_MT
APPLET("mt", mt_main, _BB_DIR_BIN, mt_usage)
#endif
#ifdef BB_CP_MV
APPLET("mv", cp_mv_main, _BB_DIR_BIN, mv_usage)
#endif
#ifdef BB_NC
APPLET("nc", nc_main, _BB_DIR_USR_BIN, nc_usage)
#endif
#ifdef BB_NSLOOKUP
APPLET("nslookup", nslookup_main, _BB_DIR_USR_BIN, nslookup_usage)
#endif
#ifdef BB_PING
APPLET("ping", ping_main, _BB_DIR_BIN, ping_usage)
#endif
#ifdef BB_POWEROFF
APPLET("poweroff", poweroff_main, _BB_DIR_SBIN, poweroff_usage)
#endif
#ifdef BB_PRINTF
APPLET("printf", printf_main, _BB_DIR_USR_BIN, printf_usage)
#endif
#ifdef BB_PS
APPLET("ps", ps_main, _BB_DIR_BIN, ps_usage)
#endif
#ifdef BB_PWD
APPLET("pwd", pwd_main, _BB_DIR_BIN, pwd_usage)
#endif
#ifdef BB_RDATE
APPLET("rdate", rdate_main, _BB_DIR_USR_BIN, rdate_usage)
#endif
#ifdef BB_READLINK
APPLET("readlink", readlink_main, _BB_DIR_USR_BIN, readlink_usage)
#endif
#ifdef BB_REBOOT
APPLET("reboot", reboot_main, _BB_DIR_SBIN, reboot_usage)
#endif
#ifdef BB_RENICE
APPLET("renice", renice_main, _BB_DIR_USR_BIN, renice_usage)
#endif
#ifdef BB_RESET
APPLET("reset", reset_main, _BB_DIR_USR_BIN, reset_usage)
#endif
#ifdef BB_RM
APPLET("rm", rm_main, _BB_DIR_BIN, rm_usage)
#endif
#ifdef BB_RMDIR
APPLET("rmdir", rmdir_main, _BB_DIR_BIN, rmdir_usage)
#endif
#ifdef BB_RMMOD
APPLET("rmmod", rmmod_main, _BB_DIR_SBIN, rmmod_usage)
#endif
#ifdef BB_RPMUNPACK
APPLET("rpmunpack", rpmunpack_main, _BB_DIR_USR_BIN, rpmunpack_usage)
#endif
#ifdef BB_SED
APPLET("sed", sed_main, _BB_DIR_BIN, sed_usage)
#endif
#ifdef BB_SETKEYCODES
APPLET("setkeycodes", setkeycodes_main, _BB_DIR_USR_BIN, setkeycodes_usage)
#endif
#ifdef BB_SH
APPLET("sh", shell_main, _BB_DIR_BIN, shell_usage)
#endif
#ifdef BB_SLEEP
APPLET("sleep", sleep_main, _BB_DIR_BIN, sleep_usage)
#endif
#ifdef BB_SORT
APPLET("sort", sort_main, _BB_DIR_USR_BIN, sort_usage)
#endif
#ifdef BB_SWAPONOFF
APPLET("swapoff", swap_on_off_main, _BB_DIR_SBIN, swapoff_usage)
#endif
#ifdef BB_SWAPONOFF
APPLET("swapon", swap_on_off_main, _BB_DIR_SBIN, swapon_usage)
#endif
#ifdef BB_SYNC
APPLET("sync", sync_main, _BB_DIR_BIN, sync_usage)
#endif
#ifdef BB_SYSLOGD
APPLET("syslogd", syslogd_main, _BB_DIR_SBIN, syslogd_usage)
#endif
#ifdef BB_TAIL
APPLET("tail", tail_main, _BB_DIR_USR_BIN, tail_usage)
#endif
#ifdef BB_TAR
APPLET("tar", tar_main, _BB_DIR_BIN, tar_usage)
#endif
#ifdef BB_TEE
APPLET("tee", tee_main, _BB_DIR_USR_BIN, tee_usage)
#endif
#ifdef BB_TELNET
APPLET("telnet", telnet_main, _BB_DIR_USR_BIN, telnet_usage)
#endif
#ifdef BB_TEST
APPLET("test", test_main, _BB_DIR_USR_BIN, test_usage)
#endif
#ifdef BB_TOUCH
APPLET("touch", touch_main, _BB_DIR_BIN, touch_usage)
#endif
#ifdef BB_TR
APPLET("tr", tr_main, _BB_DIR_USR_BIN, tr_usage)
#endif
#ifdef BB_TRUE_FALSE
APPLET("true", true_main, _BB_DIR_BIN, true_usage)
#endif
#ifdef BB_TTY
APPLET("tty", tty_main, _BB_DIR_USR_BIN, tty_usage)
#endif
#ifdef BB_UMOUNT
APPLET("umount", umount_main, _BB_DIR_BIN, umount_usage)
#endif
#ifdef BB_UNAME
APPLET("uname", uname_main, _BB_DIR_BIN, uname_usage)
#endif
#ifdef BB_UNIQ
APPLET("uniq", uniq_main, _BB_DIR_USR_BIN, uniq_usage)
#endif
#ifdef BB_UNIX2DOS
APPLET("unix2dos", unix2dos_main, _BB_DIR_USR_BIN, unix2dos_usage)
#endif
#ifdef BB_UPDATE
APPLET("update", update_main, _BB_DIR_SBIN, update_usage)
#endif
#ifdef BB_UPTIME
APPLET("uptime", uptime_main, _BB_DIR_USR_BIN, uptime_usage)
#endif
#ifdef BB_USLEEP
APPLET("usleep", usleep_main, _BB_DIR_BIN, usleep_usage)
#endif
#ifdef BB_UUDECODE
APPLET("uudecode", uudecode_main, _BB_DIR_USR_BIN, uudecode_usage)
#endif
#ifdef BB_UUENCODE
APPLET("uuencode", uuencode_main, _BB_DIR_USR_BIN, uuencode_usage)
#endif
#ifdef BB_WATCHDOG
APPLET("watchdog", watchdog_main, _BB_DIR_SBIN, watchdog_usage)
#endif
#ifdef BB_WC
APPLET("wc", wc_main, _BB_DIR_USR_BIN, wc_usage)
#endif
#ifdef BB_WGET
APPLET("wget", wget_main, _BB_DIR_USR_BIN, wget_usage)
#endif
#ifdef BB_WHICH
APPLET("which", which_main, _BB_DIR_USR_BIN, which_usage)
#endif
#ifdef BB_WHOAMI
APPLET("whoami", whoami_main, _BB_DIR_USR_BIN, whoami_usage)
#endif
#ifdef BB_XARGS
APPLET("xargs", xargs_main, _BB_DIR_USR_BIN, xargs_usage)
#endif
#ifdef BB_YES
APPLET("yes", yes_main, _BB_DIR_USR_BIN, yes_usage)
#endif
#ifdef BB_GUNZIP
APPLET("zcat", gunzip_main, _BB_DIR_BIN, gunzip_usage)
#endif
#if !defined(PROTOTYPES) && !defined(MAKE_LINKS)
{ 0,NULL,0,NULL}
};
/* The -1 arises because of the {0,NULL,0,NULL} entry above. */
size_t NUM_APPLETS = (sizeof (applets) / sizeof (struct BB_applet) - 1);
#endif
+22
View File
@@ -0,0 +1,22 @@
# Makefile for busybox
#
# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
obj-y:=
obj-y += applets.o
obj-y += busybox.o
# Generated file needs additional love
applets/applets.o: include/usage_compressed.h
hostprogs-y += usage
always := $(hostprogs-y)
HOSTCFLAGS_usage.o = -I$(srctree)/include
quiet_cmd_gen_usage_compressed = GEN include/usage_compressed.h
cmd_gen_usage_compressed = $(srctree)/applets/usage_compressed include/usage_compressed.h applets
include/usage_compressed.h: $(srctree)/include/usage.h applets/usage
$(call cmd,gen_usage_compressed)
+491
View File
@@ -0,0 +1,491 @@
/* vi: set sw=4 ts=4: */
/*
* Utility routines.
*
* Copyright (C) tons of folks. Tracking down who wrote what
* isn't something I'm going to worry about... If you wrote something
* here, please feel free to acknowledge your work.
*
* Based in part on code from sash, Copyright (c) 1999 by David I. Bell
* Permission has been granted to redistribute this code under the GPL.
*
* Licensed under GPLv2 or later, see file License in this tarball for details.
*/
#include "busybox.h"
#include <assert.h>
/* Apparently uclibc defines __GLIBC__ (compat trick?). Oh well. */
#if ENABLE_STATIC && defined(__GLIBC__) && !defined(__UCLIBC__)
#warning Static linking against glibc produces buggy executables
#warning (glibc does not cope well with ld --gc-sections).
#warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
#warning Note that glibc is unsuitable for static linking anyway.
#warning If you still want to do it, remove -Wl,--gc-sections
#warning from top-level Makefile and remove this warning.
#endif
#if ENABLE_SHOW_USAGE && !ENABLE_FEATURE_COMPRESS_USAGE
static const char usage_messages[] =
#define MAKE_USAGE
#include "usage.h"
#include "applets.h"
;
#undef MAKE_USAGE
#else
#define usage_messages 0
#endif /* ENABLE_SHOW_USAGE */
#undef APPLET
#undef APPLET_NOUSAGE
#undef PROTOTYPES
#include "applets.h"
static struct BB_applet *applet_using;
/* The -1 arises because of the {0,NULL,0,-1} entry above. */
const unsigned short NUM_APPLETS = (sizeof (applets) / sizeof (struct BB_applet) - 1);
#ifdef CONFIG_FEATURE_SUID_CONFIG
#include <ctype.h>
#define CONFIG_FILE "/etc/busybox.conf"
/* applets [] is const, so we have to define this "override" structure */
static struct BB_suid_config
{
struct BB_applet *m_applet;
uid_t m_uid;
gid_t m_gid;
mode_t m_mode;
struct BB_suid_config *m_next;
} *suid_config;
static int suid_cfg_readable;
/* check if u is member of group g */
static int ingroup(uid_t u, gid_t g)
{
struct group *grp = getgrgid(g);
if (grp) {
char **mem;
for (mem = grp->gr_mem; *mem; mem++) {
struct passwd *pwd = getpwnam(*mem);
if (pwd && (pwd->pw_uid == u))
return 1;
}
}
return 0;
}
/* This should probably be a libbb routine. In that case,
* I'd probably rename it to something like bb_trimmed_slice.
*/
static char *get_trimmed_slice(char *s, char *e)
{
/* First, consider the value at e to be nul and back up until we
* reach a non-space char. Set the char after that (possibly at
* the original e) to nul. */
while (e-- > s) {
if (!isspace(*e)) {
break;
}
}
e[1] = 0;
/* Next, advance past all leading space and return a ptr to the
* first non-space char; possibly the terminating nul. */
return skip_whitespace(s);
}
#define parse_error(x) { err=x; goto pe_label; }
/* Don't depend on the tools to combine strings. */
static const char config_file[] = CONFIG_FILE;
/* There are 4 chars + 1 nul for each of user/group/other. */
static const char mode_chars[] = "Ssx-\0Ssx-\0Ttx-";
/* We don't supply a value for the nul, so an index adjustment is
* necessary below. Also, we use unsigned short here to save some
* space even though these are really mode_t values. */
static const unsigned short mode_mask[] = {
/* SST sst xxx --- */
S_ISUID, S_ISUID|S_IXUSR, S_IXUSR, 0, /* user */
S_ISGID, S_ISGID|S_IXGRP, S_IXGRP, 0, /* group */
0, S_IXOTH, S_IXOTH, 0 /* other */
};
static void parse_config_file(void)
{
struct BB_suid_config *sct_head;
struct BB_suid_config *sct;
struct BB_applet *applet;
FILE *f;
char *err;
char *s;
char *e;
int i, lc, section;
char buffer[256];
struct stat st;
assert(!suid_config); /* Should be set to NULL by bss init. */
if ((stat(config_file, &st) != 0) /* No config file? */
|| !S_ISREG(st.st_mode) /* Not a regular file? */
|| (st.st_uid != 0) /* Not owned by root? */
|| (st.st_mode & (S_IWGRP | S_IWOTH)) /* Writable by non-root? */
|| !(f = fopen(config_file, "r")) /* Cannot open? */
) {
return;
}
suid_cfg_readable = 1;
sct_head = NULL;
section = lc = 0;
do {
s = buffer;
if (!fgets(s, sizeof(buffer), f)) { /* Are we done? */
if (ferror(f)) { /* Make sure it wasn't a read error. */
parse_error("reading");
}
fclose(f);
suid_config = sct_head; /* Success, so set the pointer. */
return;
}
lc++; /* Got a (partial) line. */
/* If a line is too long for our buffer, we consider it an error.
* The following test does mistreat one corner case though.
* If the final line of the file does not end with a newline and
* yet exactly fills the buffer, it will be treated as too long
* even though there isn't really a problem. But it isn't really
* worth adding code to deal with such an unlikely situation, and
* we do err on the side of caution. Besides, the line would be
* too long if it did end with a newline. */
if (!strchr(s, '\n') && !feof(f)) {
parse_error("line too long");
}
/* Trim leading and trailing whitespace, ignoring comments, and
* check if the resulting string is empty. */
if (!*(s = get_trimmed_slice(s, strchrnul(s, '#')))) {
continue;
}
/* Check for a section header. */
if (*s == '[') {
/* Unlike the old code, we ignore leading and trailing
* whitespace for the section name. We also require that
* there are no stray characters after the closing bracket. */
if (!(e = strchr(s, ']')) /* Missing right bracket? */
|| e[1] /* Trailing characters? */
|| !*(s = get_trimmed_slice(s+1, e)) /* Missing name? */
) {
parse_error("section header");
}
/* Right now we only have one section so just check it.
* If more sections are added in the future, please don't
* resort to cascading ifs with multiple strcasecmp calls.
* That kind of bloated code is all too common. A loop
* and a string table would be a better choice unless the
* number of sections is very small. */
if (strcasecmp(s, "SUID") == 0) {
section = 1;
continue;
}
section = -1; /* Unknown section so set to skip. */
continue;
}
/* Process sections. */
if (section == 1) { /* SUID */
/* Since we trimmed leading and trailing space above, we're
* now looking for strings of the form
* <key>[::space::]*=[::space::]*<value>
* where both key and value could contain inner whitespace. */
/* First get the key (an applet name in our case). */
if (!!(e = strchr(s, '='))) {
s = get_trimmed_slice(s, e);
}
if (!e || !*s) { /* Missing '=' or empty key. */
parse_error("keyword");
}
/* Ok, we have an applet name. Process the rhs if this
* applet is currently built in and ignore it otherwise.
* Note: This can hide config file bugs which only pop
* up when the busybox configuration is changed. */
if ((applet = find_applet_by_name(s))) {
/* Note: We currently don't check for duplicates!
* The last config line for each applet will be the
* one used since we insert at the head of the list.
* I suppose this could be considered a feature. */
sct = xmalloc(sizeof(struct BB_suid_config));
sct->m_applet = applet;
sct->m_mode = 0;
sct->m_next = sct_head;
sct_head = sct;
/* Get the specified mode. */
e = skip_whitespace(e+1);
for (i=0 ; i < 3 ; i++) {
const char *q;
if (!*(q = strchrnul(mode_chars + 5*i, *e++))) {
parse_error("mode");
}
/* Adjust by -i to account for nul. */
sct->m_mode |= mode_mask[(q - mode_chars) - i];
}
/* Now get the the user/group info. */
s = skip_whitespace(e);
/* Note: We require whitespace between the mode and the
* user/group info. */
if ((s == e) || !(e = strchr(s, '.'))) {
parse_error("<uid>.<gid>");
}
*e++ = 0;
/* We can't use get_ug_id here since it would exit()
* if a uid or gid was not found. Oh well... */
{
char *e2;
sct->m_uid = strtoul(s, &e2, 10);
if (*e2 || (s == e2)) {
struct passwd *pwd = getpwnam(s);
if (!pwd) {
parse_error("user");
}
sct->m_uid = pwd->pw_uid;
}
sct->m_gid = strtoul(e, &e2, 10);
if (*e2 || (e == e2)) {
struct group *grp;
if (!(grp = getgrnam(e))) {
parse_error("group");
}
sct->m_gid = grp->gr_gid;
}
}
}
continue;
}
/* Unknown sections are ignored. */
/* Encountering configuration lines prior to seeing a
* section header is treated as an error. This is how
* the old code worked, but it may not be desirable.
* We may want to simply ignore such lines in case they
* are used in some future version of busybox. */
if (!section) {
parse_error("keyword outside section");
}
} while (1);
pe_label:
fprintf(stderr, "Parse error in %s, line %d: %s\n",
config_file, lc, err);
fclose(f);
/* Release any allocated memory before returning. */
while (sct_head) {
sct = sct_head->m_next;
free(sct_head);
sct_head = sct;
}
return;
}
#else
#define parse_config_file() ((void)0)
#endif /* CONFIG_FEATURE_SUID_CONFIG */
#ifdef CONFIG_FEATURE_SUID
static void check_suid(struct BB_applet *applet)
{
uid_t ruid = getuid(); /* real [ug]id */
uid_t rgid = getgid();
#ifdef CONFIG_FEATURE_SUID_CONFIG
if (suid_cfg_readable) {
struct BB_suid_config *sct;
for (sct = suid_config; sct; sct = sct->m_next) {
if (sct->m_applet == applet)
break;
}
if (sct) {
mode_t m = sct->m_mode;
if (sct->m_uid == ruid)
/* same uid */
m >>= 6;
else if ((sct->m_gid == rgid) || ingroup(ruid, sct->m_gid))
/* same group / in group */
m >>= 3;
if (!(m & S_IXOTH)) /* is x bit not set ? */
bb_error_msg_and_die("you have no permission to run this applet!");
if (sct->m_gid != 0) {
/* _both_ have to be set for sgid */
if ((sct->m_mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) {
xsetgid(sct->m_gid);
} else xsetgid(rgid); /* no sgid -> drop */
}
if (sct->m_uid != 0) {
if (sct->m_mode & S_ISUID) xsetuid(sct->m_uid);
else xsetuid(ruid); /* no suid -> drop */
}
} else {
/* default: drop all privileges */
xsetgid(rgid);
xsetuid(ruid);
}
return;
} else {
#ifndef CONFIG_FEATURE_SUID_CONFIG_QUIET
static int onetime = 0;
if (!onetime) {
onetime = 1;
fprintf(stderr, "Using fallback suid method\n");
}
#endif
}
#endif
if (applet->need_suid == _BB_SUID_ALWAYS) {
if (geteuid()) bb_error_msg_and_die("applet requires root privileges!");
} else if (applet->need_suid == _BB_SUID_NEVER) {
xsetgid(rgid); /* drop all privileges */
xsetuid(ruid);
}
}
#else
#define check_suid(x)
#endif /* CONFIG_FEATURE_SUID */
#ifdef CONFIG_FEATURE_COMPRESS_USAGE
#include "usage_compressed.h"
#include "unarchive.h"
static const char *unpack_usage_messages(void)
{
int input[2], output[2], pid;
char *buf;
if(pipe(input) < 0 || pipe(output) < 0)
exit(1);
pid = fork();
switch (pid) {
case -1: /* error */
exit(1);
case 0: /* child */
close(input[1]);
close(output[0]);
uncompressStream(input[0], output[1]);
exit(0);
}
/* parent */
close(input[0]);
close(output[1]);
pid = fork();
switch (pid) {
case -1: /* error */
exit(1);
case 0: /* child */
full_write(input[1], packed_usage, sizeof(packed_usage));
exit(0);
}
/* parent */
close(input[1]);
buf = xmalloc(SIZEOF_usage_messages);
full_read(output[0], buf, SIZEOF_usage_messages);
return buf;
}
#else
#define unpack_usage_messages() usage_messages
#endif /* ENABLE_FEATURE_COMPRESS_USAGE */
void bb_show_usage(void)
{
if (ENABLE_SHOW_USAGE) {
const char *format_string;
const char *usage_string = unpack_usage_messages();
int i;
for (i = applet_using - applets; i > 0;)
if (!*usage_string++) --i;
format_string = "%s\n\nUsage: %s %s\n\n";
if (*usage_string == '\b')
format_string = "%s\n\nNo help available.\n\n";
fprintf(stderr, format_string, bb_msg_full_version,
applet_using->name, usage_string);
}
exit(xfunc_error_retval);
}
static int applet_name_compare(const void *name, const void *vapplet)
{
const struct BB_applet *applet = vapplet;
return strcmp(name, applet->name);
}
struct BB_applet *find_applet_by_name(const char *name)
{
return bsearch(name, applets, NUM_APPLETS, sizeof(struct BB_applet),
applet_name_compare);
}
void run_applet_by_name(const char *name, int argc, char **argv)
{
if (ENABLE_FEATURE_SUID_CONFIG)
parse_config_file();
if (!strncmp(name, "busybox", 7))
exit(busybox_main(argc, argv));
/* Do a binary search to find the applet entry given the name. */
applet_using = find_applet_by_name(name);
if (applet_using) {
applet_name = applet_using->name;
if (argc == 2 && !strcmp(argv[1], "--help"))
bb_show_usage();
if (ENABLE_FEATURE_SUID)
check_suid(applet_using);
exit(applet_using->main(argc, argv));
}
}
+96 -155
View File
@@ -1,205 +1,146 @@
/* vi: set sw=4 ts=4: */
/*
* BusyBox' main applet dispatcher.
*
* Licensed under GPLv2, see file LICENSE in this tarball for details.
*/
#include "busybox.h"
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
#undef APPLET
#undef APPLET_NOUSAGE
#undef PROTOTYPES
#include "applets.h"
const char *applet_name ATTRIBUTE_EXTERNALLY_VISIBLE;
#define bb_need_full_version
#define BB_DECLARE_EXTERN
#include "messages.c"
static int been_there_done_that = 0;
const char *applet_name;
#ifdef BB_FEATURE_INSTALLER
/*
#ifdef CONFIG_FEATURE_INSTALLER
/*
* directory table
* this should be consistent w/ the enum, busybox.h::Location,
* or else...
*/
static char* install_dir[] = {
"/",
"/bin",
"/sbin",
"/usr/bin",
"/usr/sbin",
static const char usr_bin [] = "/usr/bin";
static const char usr_sbin[] = "/usr/sbin";
static const char* const install_dir[] = {
&usr_bin [8], /* "", equivalent to "/" for concat_path_file() */
&usr_bin [4], /* "/bin" */
&usr_sbin[4], /* "/sbin" */
usr_bin,
usr_sbin
};
/* abstract link() */
typedef int (*__link_f)(const char *, const char *);
/*
* Where in the filesystem is this busybox?
* [return]
* malloc'd string w/ full pathname of busybox's location
* NULL on failure
*/
static char *busybox_fullpath()
{
pid_t pid;
char path[256];
char proc[256];
int len;
pid = getpid();
sprintf(proc, "/proc/%d/exe", pid);
len = readlink(proc, path, 256);
if (len != -1) {
path[len] = 0;
} else {
perror_msg("%s", proc);
return NULL;
}
return strdup(path);
}
typedef int (*link_func)(const char *, const char *);
/* create (sym)links for each applet */
static void install_links(const char *busybox, int use_symbolic_links)
{
__link_f Link = link;
char command[256];
link_func lf = link;
char *fpc;
int i;
int rc;
if (use_symbolic_links)
Link = symlink;
if (use_symbolic_links)
lf = symlink;
for (i = 0; applets[i].name != NULL; i++) {
sprintf ( command, "%s/%s",
install_dir[applets[i].location], applets[i].name);
rc = Link(busybox, command);
if (rc) {
perror_msg("%s", command);
fpc = concat_path_file(
install_dir[applets[i].location],
applets[i].name);
rc = lf(busybox, fpc);
if (rc != 0 && errno != EEXIST) {
bb_perror_msg("%s", fpc);
}
free(fpc);
}
}
#endif /* BB_FEATURE_INSTALLER */
#else
#define install_links(x,y)
#endif /* CONFIG_FEATURE_INSTALLER */
int main(int argc, char **argv)
{
struct BB_applet search_applet, *applet;
const char *s;
const char *s;
for (s = applet_name = argv[0]; *s != '\0';) {
if (*s++ == '/')
applet_name = s;
}
applet_name = argv[0];
if (*applet_name == '-')
applet_name++;
while ((s = strchr(applet_name, '/')))
applet_name = s + 1;
#ifdef BB_SH
/* Add in a special case hack -- whenever **argv == '-'
* (i.e. '-su' or '-sh') always invoke the shell */
if (**argv == '-' && *(*argv+1)!= '-') {
exit(((*(shell_main)) (argc, argv)));
}
#endif
/* Set locale for everybody except 'init' */
if (ENABLE_LOCALE_SUPPORT && getpid() != 1)
setlocale(LC_ALL, "");
/* Do a binary search to find the applet entry given the name. */
search_applet.name = applet_name;
applet = bsearch(&search_applet, applets, NUM_APPLETS,
sizeof(struct BB_applet), applet_name_compare);
if (applet != NULL) {
if (applet->usage && argv[1] && strcmp(argv[1], "--help") == 0)
usage(applet->usage);
exit((*(applet->main)) (argc, argv));
}
error_msg_and_die("applet not found\n");
run_applet_by_name(applet_name, argc, argv);
bb_error_msg_and_die("applet not found");
}
int busybox_main(int argc, char **argv)
{
int col = 0, len, i;
#ifdef BB_FEATURE_INSTALLER
/*
* This style of argument parsing doesn't scale well
/*
* This style of argument parsing doesn't scale well
* in the event that busybox starts wanting more --options.
* If someone has a cleaner approach, by all means implement it.
*/
if (argc > 1 && (strcmp(argv[1], "--install") == 0)) {
if (ENABLE_FEATURE_INSTALLER && argc > 1 && !strcmp(argv[1], "--install")) {
int use_symbolic_links = 0;
int rc = 0;
char *busybox;
/* to use symlinks, or not to use symlinks... */
if (argc > 2) {
if ((strcmp(argv[2], "-s") == 0)) {
use_symbolic_links = 1;
}
}
if (argc > 2)
if (strcmp(argv[2], "-s") == 0)
use_symbolic_links = 1;
/* link */
busybox = busybox_fullpath();
if (busybox) {
install_links(busybox, use_symbolic_links);
// XXX: FIXME: this is broken. Why not just use argv[0] ?
busybox = xreadlink("/proc/self/exe");
if (!busybox)
return 1;
install_links(busybox, use_symbolic_links);
if (ENABLE_FEATURE_CLEAN_UP)
free(busybox);
return 0;
}
/* Deal with --help. (Also print help when called with no arguments) */
if (argc == 1 || !strcmp(argv[1], "--help") ) {
if (argc > 2) {
applet_name = argv[2];
run_applet_by_name(applet_name, 2, argv);
} else {
rc = 1;
}
return rc;
}
#endif /* BB_FEATURE_INSTALLER */
const struct BB_applet *a;
int col, output_width;
argc--;
/* If we've already been here once, exit now */
if (been_there_done_that == 1 || argc < 1) {
const struct BB_applet *a = applets;
fprintf(stderr, "%s\n\n"
"Usage: busybox [function] [arguments]...\n"
" or: [function] [arguments]...\n\n"
"\tBusyBox is a multi-call binary that combines many common Unix\n"
"\tutilities into a single executable. Most people will create a\n"
"\tlink to busybox for each function they wish to use, and BusyBox\n"
"\twill act like whatever it was invoked as.\n"
"\nCurrently defined functions:\n", full_version);
while (a->name != 0) {
col +=
fprintf(stderr, "%s%s", ((col == 0) ? "\t" : ", "),
(a++)->name);
if (col > 60 && a->name != 0) {
fprintf(stderr, ",\n");
col = 0;
output_width = 80 - sizeof("start-stop-daemon, ") - 8;
if (ENABLE_FEATURE_AUTOWIDTH) {
/* Obtain the terminal width. */
get_terminal_width_height(0, &output_width, NULL);
/* leading tab and room to wrap */
output_width -= sizeof("start-stop-daemon, ") + 8;
}
printf("%s\n"
"Copyright (C) 1998-2006  Erik Andersen, Rob Landley, and others.\n"
"Licensed under GPLv2.  See source distribution for full notice.\n\n"
"Usage: busybox [function] [arguments]...\n"
" or: [function] [arguments]...\n\n"
"\tBusyBox is a multi-call binary that combines many common Unix\n"
"\tutilities into a single executable. Most people will create a\n"
"\tlink to busybox for each function they wish to use and BusyBox\n"
"\twill act like whatever it was invoked as!\n"
"\nCurrently defined functions:\n", bb_msg_full_version);
col = 0;
for (a = applets; a->name;) {
col += printf("%s%s", (col ? ", " : "\t"), a->name);
a++;
if (col > output_width && a->name) {
puts(",");
col = 0;
}
}
puts("\n");
return 0;
}
fprintf(stderr, "\n\n");
exit(-1);
}
} else run_applet_by_name(argv[1], argc - 1, argv + 1);
/* Flag that we've been here already */
been_there_done_that = 1;
/* Move the command line down a notch */
len = argv[argc] + strlen(argv[argc]) - argv[1];
memmove(argv[0], argv[1], len);
memset(argv[0] + len, 0, argv[1] - argv[0]);
/* Fix up the argv pointers */
len = argv[1] - argv[0];
memmove(argv, argv + 1, sizeof(char *) * (argc + 1));
for (i = 0; i < argc; i++)
argv[i] -= len;
return (main(argc, argv));
bb_error_msg_and_die("applet not found");
}
/*
Local Variables:
c-file-style: "linux"
c-basic-offset: 4
tab-width: 4
End:
*/
+6 -3
View File
@@ -7,9 +7,12 @@
# Maintainer: Larry Doolittle <ldoolitt@recycle.lbl.gov>
CONFIG_H=${1:-Config.h}
APPLETS_H=${2:-applets.h}
gcc -E -DMAKE_LINKS -include $CONFIG_H $APPLETS_H |
export LC_ALL=POSIX
export LC_CTYPE=POSIX
CONFIG_H=${1:-include/autoconf.h}
APPLETS_H=${2:-include/applets.h}
$HOSTCC -E -DMAKE_LINKS -include $CONFIG_H $APPLETS_H |
awk '/^[ \t]*LINK/{
dir=substr($2,8)
gsub("_","/",dir)
-13
View File
@@ -1,13 +0,0 @@
#!/bin/sh
RAW=` \
gcc -E -dM ${1:-Config.h} | \
sed -n -e '/^.*BB_FEATURE.*$/d;s/^#define.*\<BB_\(.*\)\>/\1.c/gp;' \
| tr A-Z a-z | sort
`
test "${RAW}" != "" || exit
cd ${2:-.}
# I added in the extra "ls" so only source files that
# actually exist will show up in the compile list.
ls -1 $RAW 2>/dev/null | sed -e 's/\.c$/\.o/g'
+27
View File
@@ -0,0 +1,27 @@
/* Minimal wrapper to build an individual busybox applet.
*
* Copyright 2005 Rob Landley <rob@landley.net
*
* Licensed under GPL version 2, see file LICENSE in this tarball for details
*/
const char *applet_name;
#include <stdio.h>
#include <stdlib.h>
//Ok to remove? #include "bb_config.h"
#include "usage.h"
int main(int argc, char *argv[])
{
applet_name=argv[0];
return APPLET_main(argc,argv);
}
void bb_show_usage(void)
{
printf(APPLET_full_usage "\n");
exit(1);
}
+63 -18
View File
@@ -1,17 +1,58 @@
#!/bin/sh
prefix=$1
if [ "$prefix" = "" ]; then
echo "No installation directory, aborting."
exit 1;
fi
if [ "$2" = "--hardlinks" ]; then
linkopts="-f"
else
linkopts="-fs"
export LC_ALL=POSIX
export LC_CTYPE=POSIX
prefix=${1}
if [ -z "$prefix" ]; then
echo "usage: applets/install.sh DESTINATION [--symlinks/--hardlinks]"
exit 1;
fi
h=`sort busybox.links | uniq`
cleanup="0"
noclobber="0"
case "$2" in
--hardlinks) linkopts="-f";;
--symlinks) linkopts="-fs";;
--cleanup) cleanup="1";;
--noclobber) noclobber="1";;
"") h="";;
*) echo "Unknown install option: $2"; exit 1;;
esac
if [ -n "$DO_INSTALL_LIBS" ] && [ "$DO_INSTALL_LIBS" != "n" ]; then
# get the target dir for the libs
# assume it starts with lib
libdir=$($CC -print-file-name=libc.so | \
sed -n 's%^.*\(/lib[^\/]*\)/libc.so%\1%p')
if test -z "$libdir"; then
libdir=/lib
fi
mkdir -p $prefix/$libdir || exit 1
for i in $DO_INSTALL_LIBS; do
rm -f $prefix/$libdir/$i || exit 1
if [ -f $i ]; then
cp -a $i $prefix/$libdir/ || exit 1
chmod 0644 $prefix/$libdir/$i || exit 1
fi
done
fi
if [ "$cleanup" = "1" ] && [ -e "$prefix/bin/busybox" ]; then
inode=`ls -i "$prefix/bin/busybox" | awk '{print $1}'`
sub_shell_it=`
cd "$prefix"
for d in usr/sbin usr/bin sbin bin ; do
pd=$PWD
if [ -d "$d" ]; then
cd $d
ls -iL . | grep "^ *$inode" | awk '{print $2}' | env -i xargs rm -f
fi
cd "$pd"
done
`
fi
rm -f $prefix/bin/busybox || exit 1
mkdir -p $prefix/bin || exit 1
@@ -21,29 +62,33 @@ for i in $h ; do
appdir=`dirname $i`
mkdir -p $prefix/$appdir || exit 1
if [ "$2" = "--hardlinks" ]; then
bb_path="$prefix/bin/busybox"
bb_path="$prefix/bin/busybox"
else
case "$appdir" in
case "$appdir" in
/)
bb_path="bin/busybox"
bb_path="bin/busybox"
;;
/bin)
bb_path="busybox"
bb_path="busybox"
;;
/sbin)
bb_path="../bin/busybox"
bb_path="../bin/busybox"
;;
/usr/bin|/usr/sbin)
bb_path="../../bin/busybox"
bb_path="../../bin/busybox"
;;
*)
echo "Unknown installation directory: $appdir"
exit 1
;;
esac
esac
fi
if [ "$noclobber" = "0" ] || [ ! -e "$prefix$i" ]; then
echo " $prefix$i -> $bb_path"
ln $linkopts $bb_path $prefix$i || exit 1
else
echo " $prefix$i already exists"
fi
echo " $prefix$i -> $bb_path"
ln $linkopts $bb_path $prefix$i || exit 1
done
exit 0
+13 -1556
View File
File diff suppressed because it is too large. Load diff
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
target="$1"
loc="$2"
test "$target" || exit 1
test "$loc" || loc=.
test -x "$loc/usage" || exit 1
test "$SED" || SED=sed
sz=`"$loc/usage" | wc -c` || exit 1
exec >"$target"
echo 'static const char packed_usage[] = '
"$loc/usage" | bzip2 -1 | od -v -t x1 \
| $SED -e 's/^[^ ]*//' -e 's/ \(..\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/'
echo ';'
echo '#define SIZEOF_usage_messages' `expr 0 + $sz`
-223
View File
@@ -1,223 +0,0 @@
/* vi: set sw=4 ts=4: */
/*
* Mini ar implementation for busybox
*
* Copyright (C) 2000 by Glenn McGrath
* Written by Glenn McGrath <bug1@optushome.com.au> 1 June 2000
*
* Based in part on BusyBox tar, Debian dpkg-deb and GNU ar.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include <getopt.h>
#include <unistd.h>
#include "busybox.h"
typedef struct ar_headers_s {
char *name;
size_t size;
uid_t uid;
gid_t gid;
mode_t mode;
time_t mtime;
off_t offset;
struct ar_headers_s *next;
} ar_headers_t;
/*
* return the headerL_t struct for the filename descriptor
*/
extern ar_headers_t get_headers(int srcFd)
{
typedef struct raw_ar_header_s { /* Byte Offset */
char name[16]; /* 0-15 */
char date[12]; /* 16-27 */
char uid[6];
char gid[6]; /* 28-39 */
char mode[8]; /* 40-47 */
char size[10]; /* 48-57 */
char fmag[2]; /* 58-59 */
} raw_ar_header_t;
raw_ar_header_t raw_ar_header;
ar_headers_t *head, *entry;
char ar_magic[8];
char *long_name=NULL;
head = (ar_headers_t *) xmalloc(sizeof(ar_headers_t));
entry = (ar_headers_t *) xmalloc(sizeof(ar_headers_t));
/* check ar magic */
if (full_read(srcFd, ar_magic, 8) != 8)
error_msg_and_die("cannot read magic\n");
if (strncmp(ar_magic,"!<arch>",7) != 0)
error_msg_and_die("invalid magic\n");
while (full_read(srcFd, (char *) &raw_ar_header, 60)==60) {
/* check the end of header markers are valid */
if ((raw_ar_header.fmag[0]!='`') || (raw_ar_header.fmag[1]!='\n')) {
char newline[1];
if (raw_ar_header.fmag[1]!='`') {
break;
}
/* some version of ar, have an extra '\n' after each entry */
read(srcFd, newline, 1);
if (newline[0]!='\n') {
break;
}
/* fix up the header, we started reading 1 byte too early due to a '\n' */
memmove((char *) &raw_ar_header, (char *)&raw_ar_header+1, 59);
/* dont worry about adding the last '\n', we dont need it now */
}
entry->size = (size_t) atoi(raw_ar_header.size);
/* long filenames have '/' as the first character */
if (raw_ar_header.name[0] == '/') {
if (raw_ar_header.name[1] == '/') {
/* multiple long filenames are stored as data in one entry */
long_name = (char *) xrealloc(long_name, entry->size);
full_read(srcFd, long_name, entry->size);
continue;
}
else {
/* The number after the '/' indicates the offset in the ar data section
(saved in variable long_name) that conatains the real filename */
const int long_name_offset = (int) atoi((char *) &raw_ar_header.name[1]);
entry->name = xmalloc(strlen(&long_name[long_name_offset]));
strcpy(entry->name, &long_name[long_name_offset]);
}
}
else {
/* short filenames */
entry->name = xmalloc(16);
strncpy(entry->name, raw_ar_header.name, 16);
}
entry->name[strcspn(entry->name, " /")]='\0';
/* convert the rest of the now valid char header to its typed struct */
parse_mode(raw_ar_header.mode, &entry->mode);
entry->mtime = atoi(raw_ar_header.date);
entry->uid = atoi(raw_ar_header.uid);
entry->gid = atoi(raw_ar_header.gid);
entry->offset = lseek(srcFd, 0, SEEK_CUR);
/* add this entries header to our combined list */
entry->next = (ar_headers_t *) xmalloc(sizeof(ar_headers_t));
*entry->next = *head;
*head = *entry;
lseek(srcFd, (off_t) entry->size, SEEK_CUR);
}
return(*head);
}
extern int ar_main(int argc, char **argv)
{
const int preserve_date = 1; /* preserve original dates */
const int verbose = 2; /* be verbose */
const int display = 4; /* display contents */
const int extract_to_file = 8; /* extract contents of archive */
const int extract_to_stdout = 16; /* extract to stdout */
int funct = 0, opt=0;
int srcFd=0, dstFd=0;
ar_headers_t head, *extract_list=NULL;
extract_list = (ar_headers_t *) xmalloc(sizeof(ar_headers_t));
while ((opt = getopt(argc, argv, "ovtpx")) != -1) {
switch (opt) {
case 'o':
funct |= preserve_date;
break;
case 'v':
funct |= verbose;
break;
case 't':
funct |= display;
break;
case 'p':
funct |= extract_to_stdout;
break;
case 'x':
funct |= extract_to_file;
break;
default:
usage(ar_usage);
}
}
/* check the src filename was specified */
if (optind == argc)
usage(ar_usage);
if ( (srcFd = open(argv[optind], O_RDONLY)) < 0)
error_msg_and_die("Cannot read %s\n", argv[optind]);
optind++;
head = get_headers(srcFd);
/* find files to extract or display */
/* search through argv and build extract list */
for (;optind<argc; optind++) {
ar_headers_t *ar_entry;
ar_entry = (ar_headers_t *) xmalloc(sizeof(ar_headers_t));
ar_entry = &head;
while (ar_entry->next != NULL) {
if (strcmp(argv[optind], ar_entry->name) == 0) {
ar_headers_t *tmp;
tmp = (ar_headers_t *) xmalloc(sizeof(ar_headers_t));
*tmp = *extract_list;
*extract_list = *ar_entry;
extract_list->next = tmp;
break;
}
ar_entry=ar_entry->next;
}
}
/* if individual files not found extract all files */
if (extract_list->next==NULL) {
extract_list = &head;
}
/* find files to extract or display */
while (extract_list->next != NULL) {
if (funct & extract_to_file) {
dstFd = open(extract_list->name, O_WRONLY | O_CREAT, extract_list->mode);
}
else if (funct & extract_to_stdout) {
dstFd = fileno(stdout);
}
if ((funct & extract_to_file) || (funct & extract_to_stdout)) {
lseek(srcFd, extract_list->offset, SEEK_SET);
copy_file_chunk(srcFd, dstFd, (size_t) extract_list->size);
}
if (funct & verbose) {
printf("%s %d/%d %8d %s ", mode_string(extract_list->mode),
extract_list->uid, extract_list->gid,
extract_list->size, time_string(extract_list->mtime));
}
if ((funct & display) || (funct & verbose)){
printf("%s\n", extract_list->name);
}
extract_list=extract_list->next;
}
return EXIT_SUCCESS;
}
+5
View File
@@ -0,0 +1,5 @@
# ==========================================================================
# Build system
# ==========================================================================
CFLAGS += -march=i386 -mpreferred-stack-boundary=2
+300
View File
@@ -0,0 +1,300 @@
#
# For a description of the syntax of this configuration file,
# see scripts/kbuild/config-language.txt.
#
menu "Archival Utilities"
config AR
bool "ar"
default n
help
ar is an archival utility program used to create, modify, and
extract contents from archives. An archive is a single file holding
a collection of other files in a structure that makes it possible to
retrieve the original individual files (called archive members).
The original files' contents, mode (permissions), timestamp, owner,
and group are preserved in the archive, and can be restored on
extraction.
The stored filename is limited to 15 characters. (for more information
see long filename support).
ar has 60 bytes of overheads for every stored file.
This implementation of ar can extract archives, it cannot create or
modify them.
On an x86 system, the ar applet adds about 1K.
Unless you have a specific application which requires ar, you should
probably say N here.
config FEATURE_AR_LONG_FILENAMES
bool "Enable support for long filenames (not need for debs)"
default n
depends on AR
help
By default the ar format can only store the first 15 characters of the
filename, this option removes that limitation.
It supports the GNU ar long filename method which moves multiple long
filenames into a the data section of a new ar entry.
config BUNZIP2
bool "bunzip2"
default n
help
bunzip2 is a compression utility using the Burrows-Wheeler block
sorting text compression algorithm, and Huffman coding. Compression
is generally considerably better than that achieved by more
conventional LZ77/LZ78-based compressors, and approaches the
performance of the PPM family of statistical compressors.
The BusyBox bunzip2 applet is limited to de-compression only.
On an x86 system, this applet adds about 11K.
Unless you have a specific application which requires bunzip2, you
should probably say N here.
config CPIO
bool "cpio"
default n
help
cpio is an archival utility program used to create, modify, and extract
contents from archives.
cpio has 110 bytes of overheads for every stored file.
This implementation of cpio can extract cpio archives created in the
"newc" or "crc" format, it cannot create or modify them.
Unless you have a specific application which requires cpio, you should
probably say N here.
config DPKG
bool "dpkg"
default n
help
dpkg is a medium-level tool to install, build, remove and manage Debian packages.
This implementation of dpkg has a number of limitations, you should use the
official dpkg if possible.
config DPKG_DEB
bool "dpkg_deb"
default n
help
dpkg-deb packs, unpacks and provides information about Debian archives.
This implementation of dpkg-deb cannot pack archives.
Unless you have a specific application which requires dpkg-deb, you should
probably say N here.
config FEATURE_DPKG_DEB_EXTRACT_ONLY
bool "extract only (-x)"
default n
depends on DPKG_DEB
help
This reduces dpkg-deb to the equivalent of "ar -p <deb> data.tar.gz | tar -zx".
However it saves space as none of the extra dpkg-deb, ar or tar options are
needed, they are linked to internally.
config GUNZIP
bool "gunzip"
default n
help
gunzip is used to decompress archives created by gzip.
You can use the `-t' option to test the integrity of
an archive, without decompressing it.
config FEATURE_GUNZIP_UNCOMPRESS
bool "Uncompress support"
default n
depends on GUNZIP
help
Enable if you want gunzip to have the ability to decompress
archives created by the program compress (not much
used anymore).
config GZIP
bool "gzip"
default n
help
gzip is used to compress files.
It's probably the most widely used UNIX compression program.
config RPM2CPIO
bool "rpm2cpio"
default n
help
Converts an RPM file into a CPIO archive.
config RPM
bool "rpm"
default n
help
Mini RPM applet - queries and extracts RPM packages.
config TAR
bool "tar"
default n
help
tar is an archiving program. It's commonly used with gzip to
create compressed archives. It's probably the most widely used
UNIX archive program.
config FEATURE_TAR_CREATE
bool "Enable archive creation"
default y
depends on TAR
help
If you enable this option you'll be able to create
tar archives using the `-c' option.
config FEATURE_TAR_BZIP2
bool "Enable -j option to handle .tar.bz2 files"
default n
depends on TAR
help
If you enable this option you'll be able to extract
archives compressed with bzip2.
config FEATURE_TAR_LZMA
bool "Enable -a option to handle .tar.lzma files"
default n
depends on TAR
help
If you enable this option you'll be able to extract
archives compressed with lzma.
config FEATURE_TAR_FROM
bool "Enable -X (exclude from) and -T (include from) options)"
default n
depends on TAR
help
If you enable this option you'll be able to specify
a list of files to include or exclude from an archive.
config FEATURE_TAR_GZIP
bool "Enable -z option"
default y
depends on TAR
help
If you enable this option tar will be able to call gzip,
when creating or extracting tar gziped archives.
config FEATURE_TAR_COMPRESS
bool "Enable -Z option"
default n
depends on TAR
help
If you enable this option tar will be able to call uncompress,
when extracting .tar.Z archives.
config FEATURE_TAR_OLDGNU_COMPATIBILITY
bool "Enable support for old tar header format"
default N
depends on TAR
help
This option is required to unpack archives created in
the old GNU format; help to kill this old format by
repacking your ancient archives with the new format.
config FEATURE_TAR_GNU_EXTENSIONS
bool "Enable support for some GNU tar extensions"
default y
depends on TAR
help
With this option busybox supports GNU long filenames and
linknames.
config FEATURE_TAR_LONG_OPTIONS
bool "Enable long options"
default n
depends on TAR && GETOPT_LONG
help
Enable use of long options, increases size by about 400 Bytes
config UNCOMPRESS
bool "uncompress"
default n
help
uncompress is used to decompress archives created by compress.
Not much used anymore, replaced by gzip/gunzip.
config UNLZMA
bool "unlzma"
default n
help
unlzma is a compression utility using the Lempel-Ziv-Markov chain
compression algorithm, and range coding. Compression
is generally considerably better than that achieved by the bzip2
compressors.
The BusyBox unlzma applet is limited to de-compression only.
On an x86 system, this applet adds about 4K.
Unless you have a specific application which requires unlzma, you
should probably say N here.
config FEATURE_LZMA_FAST
bool "Optimze unlzma for speed"
default n
depends on UNLZMA
help
This option reduces decompression time by about 33% at the cost of
a 2K bigger binary.
config UNZIP
bool "unzip"
default n
help
unzip will list or extract files from a ZIP archive,
commonly found on DOS/WIN systems. The default behavior
(with no options) is to extract the archive into the
current directory. Use the `-d' option to extract to a
directory of your choice.
comment "Common options for cpio and tar"
depends on CPIO || TAR
config FEATURE_UNARCHIVE_TAPE
bool "Enable tape drive support"
default n
depends on CPIO || TAR
help
I don't think this is needed anymore.
comment "Common options for dpkg and dpkg_deb"
depends on DPKG || DPKG_DEB
config FEATURE_DEB_TAR_GZ
bool "gzip debian packages (normal)"
default y if DPKG || DPKG_DEB
depends on DPKG || DPKG_DEB
help
This is the default compression method inside the debian ar file.
If you want compatibility with standard .deb's you should say yes here.
config FEATURE_DEB_TAR_BZ2
bool "bzip2 debian packages"
default n
depends on DPKG || DPKG_DEB
help
This allows dpkg and dpkg-deb to extract deb's that are compressed internally
with bzip2 instead of gzip.
You only want this if you are creating your own custom debian packages that
use an internal control.tar.bz2 or data.tar.bz2.
config FEATURE_DEB_TAR_LZMA
bool "lzma debian packages"
default n
depends on DPKG || DPKG_DEB
help
This allows dpkg and dpkg-deb to extract deb's that are compressed
internally with lzma instead of gzip.
You only want this if you are creating your own custom debian
packages that use an internal control.tar.lzma or data.tar.lzma.
endmenu
+22
View File
@@ -0,0 +1,22 @@
# Makefile for busybox
#
# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
libs-y += libunarchive/
lib-y:=
lib-$(CONFIG_AR) += ar.o
lib-$(CONFIG_BUNZIP2) += bunzip2.o
lib-$(CONFIG_UNLZMA) += unlzma.o
lib-$(CONFIG_CPIO) += cpio.o
lib-$(CONFIG_DPKG) += dpkg.o
lib-$(CONFIG_DPKG_DEB) += dpkg_deb.o
lib-$(CONFIG_GUNZIP) += gunzip.o
lib-$(CONFIG_GZIP) += gzip.o
lib-$(CONFIG_RPM2CPIO) += rpm2cpio.o
lib-$(CONFIG_RPM) += rpm.o
lib-$(CONFIG_TAR) += tar.o
lib-$(CONFIG_UNCOMPRESS) += uncompress.o
lib-$(CONFIG_UNZIP) += unzip.o
+68 -198
View File
@@ -1,223 +1,93 @@
/* vi: set sw=4 ts=4: */
/*
* Mini ar implementation for busybox
* Mini ar implementation for busybox
*
* Copyright (C) 2000 by Glenn McGrath
* Written by Glenn McGrath <bug1@optushome.com.au> 1 June 2000
*
* Written by Glenn McGrath <bug1@iinet.net.au> 1 June 2000
*
* Based in part on BusyBox tar, Debian dpkg-deb and GNU ar.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*
* There is no single standard to adhere to so ar may not portable
* between different systems
* http://www.unix-systems.org/single_unix_specification_v2/xcu/ar.html
*/
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include <getopt.h>
#include <unistd.h>
#include "busybox.h"
#include "unarchive.h"
typedef struct ar_headers_s {
char *name;
size_t size;
uid_t uid;
gid_t gid;
mode_t mode;
time_t mtime;
off_t offset;
struct ar_headers_s *next;
} ar_headers_t;
/*
* return the headerL_t struct for the filename descriptor
*/
extern ar_headers_t get_headers(int srcFd)
static void header_verbose_list_ar(const file_header_t *file_header)
{
typedef struct raw_ar_header_s { /* Byte Offset */
char name[16]; /* 0-15 */
char date[12]; /* 16-27 */
char uid[6];
char gid[6]; /* 28-39 */
char mode[8]; /* 40-47 */
char size[10]; /* 48-57 */
char fmag[2]; /* 58-59 */
} raw_ar_header_t;
raw_ar_header_t raw_ar_header;
const char *mode = bb_mode_string(file_header->mode);
char *mtime;
ar_headers_t *head, *entry;
char ar_magic[8];
char *long_name=NULL;
head = (ar_headers_t *) xmalloc(sizeof(ar_headers_t));
entry = (ar_headers_t *) xmalloc(sizeof(ar_headers_t));
/* check ar magic */
if (full_read(srcFd, ar_magic, 8) != 8)
error_msg_and_die("cannot read magic\n");
if (strncmp(ar_magic,"!<arch>",7) != 0)
error_msg_and_die("invalid magic\n");
while (full_read(srcFd, (char *) &raw_ar_header, 60)==60) {
/* check the end of header markers are valid */
if ((raw_ar_header.fmag[0]!='`') || (raw_ar_header.fmag[1]!='\n')) {
char newline[1];
if (raw_ar_header.fmag[1]!='`') {
break;
}
/* some version of ar, have an extra '\n' after each entry */
read(srcFd, newline, 1);
if (newline[0]!='\n') {
break;
}
/* fix up the header, we started reading 1 byte too early due to a '\n' */
memmove((char *) &raw_ar_header, (char *)&raw_ar_header+1, 59);
/* dont worry about adding the last '\n', we dont need it now */
}
entry->size = (size_t) atoi(raw_ar_header.size);
/* long filenames have '/' as the first character */
if (raw_ar_header.name[0] == '/') {
if (raw_ar_header.name[1] == '/') {
/* multiple long filenames are stored as data in one entry */
long_name = (char *) xrealloc(long_name, entry->size);
full_read(srcFd, long_name, entry->size);
continue;
}
else {
/* The number after the '/' indicates the offset in the ar data section
(saved in variable long_name) that conatains the real filename */
const int long_name_offset = (int) atoi((char *) &raw_ar_header.name[1]);
entry->name = xmalloc(strlen(&long_name[long_name_offset]));
strcpy(entry->name, &long_name[long_name_offset]);
}
}
else {
/* short filenames */
entry->name = xmalloc(16);
strncpy(entry->name, raw_ar_header.name, 16);
}
entry->name[strcspn(entry->name, " /")]='\0';
/* convert the rest of the now valid char header to its typed struct */
parse_mode(raw_ar_header.mode, &entry->mode);
entry->mtime = atoi(raw_ar_header.date);
entry->uid = atoi(raw_ar_header.uid);
entry->gid = atoi(raw_ar_header.gid);
entry->offset = lseek(srcFd, 0, SEEK_CUR);
/* add this entries header to our combined list */
entry->next = (ar_headers_t *) xmalloc(sizeof(ar_headers_t));
*entry->next = *head;
*head = *entry;
lseek(srcFd, (off_t) entry->size, SEEK_CUR);
}
return(*head);
mtime = ctime(&file_header->mtime);
mtime[16] = ' ';
memmove(&mtime[17], &mtime[20], 4);
mtime[21] = '\0';
printf("%s %d/%d%7d %s %s\n", &mode[1], file_header->uid, file_header->gid,
(int) file_header->size, &mtime[4], file_header->name);
}
extern int ar_main(int argc, char **argv)
#define AR_CTX_PRINT 0x01
#define AR_CTX_LIST 0x02
#define AR_CTX_EXTRACT 0x04
#define AR_OPT_PRESERVE_DATE 0x08
#define AR_OPT_VERBOSE 0x10
#define AR_OPT_CREATE 0x20
#define AR_OPT_INSERT 0x40
int ar_main(int argc, char **argv)
{
const int preserve_date = 1; /* preserve original dates */
const int verbose = 2; /* be verbose */
const int display = 4; /* display contents */
const int extract_to_file = 8; /* extract contents of archive */
const int extract_to_stdout = 16; /* extract to stdout */
archive_handle_t *archive_handle;
unsigned opt;
static const char msg_unsupported_err[] =
"Archive %s not supported. Install binutils 'ar'.";
char magic[8];
int funct = 0, opt=0;
int srcFd=0, dstFd=0;
archive_handle = init_handle();
ar_headers_t head, *extract_list=NULL;
/* Prepend '-' to the first argument if required */
opt_complementary = "--:p:t:x:-1:?:p--tx:t--px:x--pt";
opt = getopt32(argc, argv, "ptxovcr");
extract_list = (ar_headers_t *) xmalloc(sizeof(ar_headers_t));
while ((opt = getopt(argc, argv, "ovtpx")) != -1) {
switch (opt) {
case 'o':
funct |= preserve_date;
break;
case 'v':
funct |= verbose;
break;
case 't':
funct |= display;
break;
case 'p':
funct |= extract_to_stdout;
break;
case 'x':
funct |= extract_to_file;
break;
default:
usage(ar_usage);
}
if (opt & AR_CTX_PRINT) {
archive_handle->action_data = data_extract_to_stdout;
}
/* check the src filename was specified */
if (optind == argc)
usage(ar_usage);
if ( (srcFd = open(argv[optind], O_RDONLY)) < 0)
error_msg_and_die("Cannot read %s\n", argv[optind]);
optind++;
head = get_headers(srcFd);
/* find files to extract or display */
/* search through argv and build extract list */
for (;optind<argc; optind++) {
ar_headers_t *ar_entry;
ar_entry = (ar_headers_t *) xmalloc(sizeof(ar_headers_t));
ar_entry = &head;
while (ar_entry->next != NULL) {
if (strcmp(argv[optind], ar_entry->name) == 0) {
ar_headers_t *tmp;
tmp = (ar_headers_t *) xmalloc(sizeof(ar_headers_t));
*tmp = *extract_list;
*extract_list = *ar_entry;
extract_list->next = tmp;
break;
}
ar_entry=ar_entry->next;
}
if (opt & AR_CTX_LIST) {
archive_handle->action_header = header_list;
}
if (opt & AR_CTX_EXTRACT) {
archive_handle->action_data = data_extract_all;
}
if (opt & AR_OPT_PRESERVE_DATE) {
archive_handle->flags |= ARCHIVE_PRESERVE_DATE;
}
if (opt & AR_OPT_VERBOSE) {
archive_handle->action_header = header_verbose_list_ar;
}
if (opt & AR_OPT_CREATE) {
bb_error_msg_and_die(msg_unsupported_err, "creation");
}
if (opt & AR_OPT_INSERT) {
bb_error_msg_and_die(msg_unsupported_err, "insertion");
}
/* if individual files not found extract all files */
if (extract_list->next==NULL) {
extract_list = &head;
archive_handle->src_fd = xopen(argv[optind++], O_RDONLY);
while (optind < argc) {
archive_handle->filter = filter_accept_list;
llist_add_to(&(archive_handle->accept), argv[optind++]);
}
/* find files to extract or display */
while (extract_list->next != NULL) {
if (funct & extract_to_file) {
dstFd = open(extract_list->name, O_WRONLY | O_CREAT, extract_list->mode);
}
else if (funct & extract_to_stdout) {
dstFd = fileno(stdout);
}
if ((funct & extract_to_file) || (funct & extract_to_stdout)) {
lseek(srcFd, extract_list->offset, SEEK_SET);
copy_file_chunk(srcFd, dstFd, (size_t) extract_list->size);
}
if (funct & verbose) {
printf("%s %d/%d %8d %s ", mode_string(extract_list->mode),
extract_list->uid, extract_list->gid,
extract_list->size, time_string(extract_list->mtime));
}
if ((funct & display) || (funct & verbose)){
printf("%s\n", extract_list->name);
}
extract_list=extract_list->next;
xread(archive_handle->src_fd, magic, 7);
if (strncmp(magic, "!<arch>", 7) != 0) {
bb_error_msg_and_die("invalid ar magic");
}
archive_handle->offset += 7;
while (get_header_ar(archive_handle) == EXIT_SUCCESS) /* repeat */;
return EXIT_SUCCESS;
}
+66
View File
@@ -0,0 +1,66 @@
/* vi: set sw=4 ts=4: */
/*
* Modified for busybox by Glenn McGrath <bug1@iinet.net.au>
* Added support output to stdout by Thomas Lundquist <thomasez@zelow.no>
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "busybox.h"
#include "unarchive.h"
#define BUNZIP2_OPT_STDOUT 1
#define BUNZIP2_OPT_FORCE 2
int bunzip2_main(int argc, char **argv)
{
USE_DESKTOP(long long) int status;
char *filename;
unsigned opt;
int src_fd, dst_fd;
opt = getopt32(argc, argv, "cf");
/* Set input filename and number */
filename = argv[optind];
if (filename && NOT_LONE_DASH(filename)) {
/* Open input file */
src_fd = xopen(filename, O_RDONLY);
} else {
src_fd = STDIN_FILENO;
filename = 0;
}
/* if called as bzcat force the stdout flag */
if ((opt & BUNZIP2_OPT_STDOUT) || applet_name[2] == 'c')
filename = 0;
/* Check that the input is sane. */
if (isatty(src_fd) && (opt & BUNZIP2_OPT_FORCE) == 0) {
bb_error_msg_and_die("compressed data not read from terminal, "
"use -f to force it");
}
if (filename) {
struct stat stat_buf;
/* extension = filename+strlen(filename)-4 is buggy:
* strlen may be less than 4 */
char *extension = strrchr(filename, '.');
if (!extension || strcmp(extension, ".bz2") != 0) {
bb_error_msg_and_die("invalid extension");
}
xstat(filename, &stat_buf);
*extension = '\0';
dst_fd = xopen3(filename, O_WRONLY | O_CREAT | O_TRUNC,
stat_buf.st_mode);
} else dst_fd = STDOUT_FILENO;
status = uncompressStream(src_fd, dst_fd);
if (filename) {
if (status >= 0) filename[strlen(filename)] = '.';
if (unlink(filename) < 0) {
bb_error_msg_and_die("cannot remove %s", filename);
}
}
return status;
}
+86
View File
@@ -0,0 +1,86 @@
/* vi: set sw=4 ts=4: */
/*
* Mini cpio implementation for busybox
*
* Copyright (C) 2001 by Glenn McGrath
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*
* Limitations:
* Doesn't check CRC's
* Only supports new ASCII and CRC formats
*
*/
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "unarchive.h"
#include "busybox.h"
#define CPIO_OPT_EXTRACT 0x01
#define CPIO_OPT_TEST 0x02
#define CPIO_OPT_UNCONDITIONAL 0x04
#define CPIO_OPT_VERBOSE 0x08
#define CPIO_OPT_FILE 0x10
#define CPIO_OPT_CREATE_LEADING_DIR 0x20
#define CPIO_OPT_PRESERVE_MTIME 0x40
int cpio_main(int argc, char **argv)
{
archive_handle_t *archive_handle;
char *cpio_filename = NULL;
unsigned opt;
/* Initialise */
archive_handle = init_handle();
archive_handle->src_fd = STDIN_FILENO;
archive_handle->seek = seek_by_read;
archive_handle->flags = ARCHIVE_EXTRACT_NEWER | ARCHIVE_PRESERVE_DATE;
opt = getopt32(argc, argv, "ituvF:dm", &cpio_filename);
/* One of either extract or test options must be given */
if ((opt & (CPIO_OPT_TEST | CPIO_OPT_EXTRACT)) == 0) {
bb_show_usage();
}
if (opt & CPIO_OPT_TEST) {
/* if both extract and test options are given, ignore extract option */
if (opt & CPIO_OPT_EXTRACT) {
opt &= ~CPIO_OPT_EXTRACT;
}
archive_handle->action_header = header_list;
}
if (opt & CPIO_OPT_EXTRACT) {
archive_handle->action_data = data_extract_all;
}
if (opt & CPIO_OPT_UNCONDITIONAL) {
archive_handle->flags |= ARCHIVE_EXTRACT_UNCONDITIONAL;
archive_handle->flags &= ~ARCHIVE_EXTRACT_NEWER;
}
if (opt & CPIO_OPT_VERBOSE) {
if (archive_handle->action_header == header_list) {
archive_handle->action_header = header_verbose_list;
} else {
archive_handle->action_header = header_list;
}
}
if (cpio_filename) { /* CPIO_OPT_FILE */
archive_handle->src_fd = xopen(cpio_filename, O_RDONLY);
archive_handle->seek = seek_by_jump;
}
if (opt & CPIO_OPT_CREATE_LEADING_DIR) {
archive_handle->flags |= ARCHIVE_CREATE_LEADING_DIRS;
}
while (optind < argc) {
archive_handle->filter = filter_accept_list;
llist_add_to(&(archive_handle->accept), argv[optind]);
optind++;
}
while (get_header_cpio(archive_handle) == EXIT_SUCCESS);
return EXIT_SUCCESS;
}
+1766
View File
File diff suppressed because it is too large. Load diff
+82 -149
View File
@@ -1,163 +1,96 @@
/* vi: set sw=4 ts=4: */
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* dpkg-deb packs, unpacks and provides information about Debian archives.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include "busybox.h"
#include "unarchive.h"
typedef struct ar_headers_s {
char *name;
size_t size;
uid_t uid;
gid_t gid;
mode_t mode;
time_t mtime;
off_t offset;
struct ar_headers_s *next;
} ar_headers_t;
#define DPKG_DEB_OPT_CONTENTS 1
#define DPKG_DEB_OPT_CONTROL 2
#define DPKG_DEB_OPT_FIELD 4
#define DPKG_DEB_OPT_EXTRACT 8
#define DPKG_DEB_OPT_EXTRACT_VERBOSE 16
extern ar_headers_t get_headers(int srcFd);
extern int tar_unzip_init(int tarFd);
extern int readTarFile(int tarFd, int extractFlag, int listFlag,
int tostdoutFlag, int verboseFlag, char** extractList,
char** excludeList);
extern int dpkg_deb_main(int argc, char **argv)
int dpkg_deb_main(int argc, char **argv)
{
const int dpkg_deb_contents = 1;
const int dpkg_deb_control = 2;
// const int dpkg_deb_info = 4;
const int dpkg_deb_extract = 8;
const int dpkg_deb_verbose_extract = 16;
int opt=0;
int optflag=0;
int extract_flag = FALSE;
int list_flag = FALSE;
int verbose_flag = FALSE;
int extract_to_stdout = FALSE;
char ar_filename[15];
int srcFd=0;
int status=0;
ar_headers_t *ar_headers = NULL;
char **extract_list=NULL;
char *target_dir=NULL;
while ((opt = getopt(argc, argv, "cexX")) != -1) {
switch (opt) {
case 'c':
optflag |= dpkg_deb_contents;
break;
case 'e':
optflag |= dpkg_deb_control;
break;
/* case 'I':
optflag |= dpkg_deb_info;
break;
*/
case 'x':
optflag |= dpkg_deb_extract;
break;
case 'X':
optflag |= dpkg_deb_verbose_extract;
break;
default:
usage(dpkg_deb_usage);
return EXIT_FAILURE;
archive_handle_t *ar_archive;
archive_handle_t *tar_archive;
llist_t *control_tar_llist = NULL;
unsigned opt;
char *extract_dir = NULL;
short argcount = 1;
/* Setup the tar archive handle */
tar_archive = init_handle();
/* Setup an ar archive handle that refers to the gzip sub archive */
ar_archive = init_handle();
ar_archive->sub_archive = tar_archive;
ar_archive->filter = filter_accept_list_reassign;
#ifdef CONFIG_FEATURE_DEB_TAR_GZ
llist_add_to(&(ar_archive->accept), "data.tar.gz");
llist_add_to(&control_tar_llist, "control.tar.gz");
#endif
#ifdef CONFIG_FEATURE_DEB_TAR_BZ2
llist_add_to(&(ar_archive->accept), "data.tar.bz2");
llist_add_to(&control_tar_llist, "control.tar.bz2");
#endif
opt_complementary = "?c--efXx:e--cfXx:f--ceXx:X--cefx:x--cefX";
opt = getopt32(argc, argv, "cefXx");
if (opt & DPKG_DEB_OPT_CONTENTS) {
tar_archive->action_header = header_verbose_list;
}
if (opt & DPKG_DEB_OPT_CONTROL) {
ar_archive->accept = control_tar_llist;
tar_archive->action_data = data_extract_all;
if (optind + 1 == argc) {
extract_dir = "./DEBIAN";
} else {
argcount++;
}
}
if (opt & DPKG_DEB_OPT_FIELD) {
/* Print the entire control file
* it should accept a second argument which specifies a
* specific field to print */
ar_archive->accept = control_tar_llist;
llist_add_to(&(tar_archive->accept), "./control");
tar_archive->filter = filter_accept_list;
tar_archive->action_data = data_extract_to_stdout;
}
if (opt & DPKG_DEB_OPT_EXTRACT) {
tar_archive->action_header = header_list;
}
if (opt & (DPKG_DEB_OPT_EXTRACT_VERBOSE | DPKG_DEB_OPT_EXTRACT)) {
tar_archive->action_data = data_extract_all;
argcount = 2;
}
if (((optind + 1 ) > argc) || (optflag == 0)) {
usage(dpkg_deb_usage);
return(EXIT_FAILURE);
}
if (optflag & dpkg_deb_contents) {
list_flag = TRUE;
verbose_flag = TRUE;
strcpy(ar_filename, "data.tar.gz");
}
else if (optflag & dpkg_deb_control) {
extract_flag = TRUE;
strcpy(ar_filename, "control.tar.gz");
if ( (optind + 1) == argc ) {
target_dir = (char *) xmalloc(7);
strcpy(target_dir, "DEBIAN");
}
else {
target_dir = (char *) xmalloc(strlen(argv[optind+1]));
strcpy(target_dir, argv[optind+1]);
}
}
/* else if (optflag & dpkg_deb_info) {
extract_flag = TRUE;
extract_to_stdout = TRUE;
strcpy(ar_filename, "control.tar.gz");
extract_list = argv+optind+1;
printf("list one is [%s]\n",extract_list[0]);
}
*/
else if (optflag & dpkg_deb_extract) {
extract_flag = TRUE;
strcpy(ar_filename, "data.tar.gz");
if ( (optind + 2) > argc ) {
error_msg_and_die("No directory specified\n");
}
target_dir = (char *) xmalloc(strlen(argv[optind+1]));
strcpy(target_dir, argv[optind+1]);
}
else if (optflag & dpkg_deb_verbose_extract) {
extract_flag = TRUE;
list_flag = TRUE;
strcpy(ar_filename, "data.tar.gz");
if ( (optind + 2) > argc ) {
error_msg_and_die("No directory specified\n");
}
target_dir = (char *) xmalloc(strlen(argv[optind+1]));
strcpy(target_dir, argv[optind+1]);
}
ar_headers = (ar_headers_t *) xmalloc(sizeof(ar_headers_t));
srcFd = open(argv[optind], O_RDONLY);
*ar_headers = get_headers(srcFd);
if (ar_headers->next==NULL)
error_msg_and_die("Couldnt find %s in %s\n",ar_filename, argv[optind]);
while (ar_headers->next != NULL) {
if (strcmp(ar_headers->name, ar_filename)==0)
break;
ar_headers = ar_headers->next;
if ((optind + argcount) != argc) {
bb_show_usage();
}
lseek(srcFd, ar_headers->offset, SEEK_SET);
srcFd = tar_unzip_init(srcFd);
if ( target_dir != NULL) {
if (is_directory(target_dir, TRUE, NULL)==FALSE) {
mkdir(target_dir, 0755);
}
if (chdir(target_dir)==-1) {
error_msg_and_die("Cannot change to dir %s\n",argv[optind+1]);
}
tar_archive->src_fd = ar_archive->src_fd = xopen(argv[optind++], O_RDONLY);
/* Workout where to extract the files */
/* 2nd argument is a dir name */
if (argv[optind]) {
extract_dir = argv[optind];
}
status = readTarFile(srcFd, extract_flag, list_flag, extract_to_stdout, verbose_flag, NULL, extract_list);
close (srcFd);
return(EXIT_SUCCESS);
if (extract_dir) {
mkdir(extract_dir, 0777); /* bb_make_directory(extract_dir, 0777, 0) */
xchdir(extract_dir);
}
unpack_ar_archive(ar_archive);
/* Cleanup */
close(ar_archive->src_fd);
return EXIT_SUCCESS;
}
+119 -1320
View File
File diff suppressed because it is too large. Load diff
+1271 -2439
View File
File diff suppressed because it is too large. Load diff
+59
View File
@@ -0,0 +1,59 @@
# Makefile for busybox
#
# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
#
# Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
lib-y:= \
\
data_skip.o \
data_extract_all.o \
data_extract_to_stdout.o \
data_extract_to_buffer.o \
\
filter_accept_all.o \
filter_accept_list.o \
filter_accept_reject_list.o \
\
header_skip.o \
header_list.o \
header_verbose_list.o \
\
archive_xread_all_eof.o \
\
seek_by_read.o \
seek_by_jump.o \
\
data_align.o \
find_list_entry.o \
open_transformer.o \
init_handle.o
GUNZIP_FILES:= check_header_gzip.o decompress_unzip.o
DPKG_FILES:= \
get_header_ar.o \
unpack_ar_archive.o \
get_header_tar.o \
filter_accept_list_reassign.o
lib-$(CONFIG_AR) += get_header_ar.o unpack_ar_archive.o
lib-$(CONFIG_BUNZIP2) += decompress_bunzip2.o
lib-$(CONFIG_UNLZMA) += decompress_unlzma.o
lib-$(CONFIG_CPIO) += get_header_cpio.o
lib-$(CONFIG_DPKG) += $(DPKG_FILES)
lib-$(CONFIG_DPKG_DEB) += $(DPKG_FILES)
lib-$(CONFIG_FEATURE_DEB_TAR_GZ) += $(GUNZIP_FILES) get_header_tar_gz.o
lib-$(CONFIG_FEATURE_DEB_TAR_BZ2) += decompress_bunzip2.o get_header_tar_bz2.o
lib-$(CONFIG_FEATURE_DEB_TAR_LZMA) += decompress_unlzma.o get_header_tar_lzma.o
lib-$(CONFIG_GUNZIP) += $(GUNZIP_FILES)
lib-$(CONFIG_FEATURE_GUNZIP_UNCOMPRESS) += decompress_uncompress.o
lib-$(CONFIG_RPM2CPIO) += $(GUNZIP_FILES) get_header_cpio.o
lib-$(CONFIG_RPM) += $(GUNZIP_FILES) get_header_cpio.o
lib-$(CONFIG_TAR) += get_header_tar.o
lib-$(CONFIG_FEATURE_TAR_BZIP2) += decompress_bunzip2.o get_header_tar_bz2.o
lib-$(CONFIG_FEATURE_TAR_LZMA) += decompress_unlzma.o get_header_tar_lzma.o
lib-$(CONFIG_FEATURE_TAR_GZIP) += $(GUNZIP_FILES) get_header_tar_gz.o
lib-$(CONFIG_FEATURE_TAR_COMPRESS) += decompress_uncompress.o
lib-$(CONFIG_UNCOMPRESS) += decompress_uncompress.o
lib-$(CONFIG_UNZIP) += $(GUNZIP_FILES)
lib-$(CONFIG_FEATURE_COMPRESS_USAGE) += decompress_bunzip2.o
@@ -0,0 +1,20 @@
/* vi: set sw=4 ts=4: */
/*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "unarchive.h"
#include "libbb.h"
ssize_t archive_xread_all_eof(archive_handle_t *archive_handle,
unsigned char *buf, size_t count)
{
ssize_t size;
size = full_read(archive_handle->src_fd, buf, count);
if (size != 0 && size != count) {
bb_error_msg_and_die("short read: %u of %u",
(unsigned)size, (unsigned)count);
}
return size;
}
+62
View File
@@ -0,0 +1,62 @@
/* vi: set sw=4 ts=4: */
/*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include <stdlib.h>
#include <unistd.h>
#include "libbb.h"
#include "unarchive.h" /* for external decl of check_header_gzip */
void check_header_gzip(int src_fd)
{
union {
unsigned char raw[8];
struct {
unsigned char method;
unsigned char flags;
unsigned int mtime;
unsigned char xtra_flags;
unsigned char os_flags;
} formatted;
} header;
xread(src_fd, header.raw, 8);
/* Check the compression method */
if (header.formatted.method != 8) {
bb_error_msg_and_die("unknown compression method %d",
header.formatted.method);
}
if (header.formatted.flags & 0x04) {
/* bit 2 set: extra field present */
unsigned char extra_short;
extra_short = xread_char(src_fd) + (xread_char(src_fd) << 8);
while (extra_short > 0) {
/* Ignore extra field */
xread_char(src_fd);
extra_short--;
}
}
/* Discard original name if any */
if (header.formatted.flags & 0x08) {
/* bit 3 set: original file name present */
while (xread_char(src_fd) != 0);
}
/* Discard file comment if any */
if (header.formatted.flags & 0x10) {
/* bit 4 set: file comment present */
while (xread_char(src_fd) != 0);
}
/* Read the header checksum */
if (header.formatted.flags & 0x02) {
xread_char(src_fd);
xread_char(src_fd);
}
return;
}
+22
View File
@@ -0,0 +1,22 @@
/* vi: set sw=4 ts=4: */
/*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include <sys/types.h>
#include <errno.h>
#include <unistd.h>
#include "libbb.h"
#include "unarchive.h"
void data_align(archive_handle_t *archive_handle, const unsigned short boundary)
{
const unsigned short skip_amount = (boundary - (archive_handle->offset % boundary)) % boundary;
archive_handle->seek(archive_handle, skip_amount);
archive_handle->offset += skip_amount;
return;
}
+119
View File
@@ -0,0 +1,119 @@
/* vi: set sw=4 ts=4: */
/*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "libbb.h"
#include "unarchive.h"
void data_extract_all(archive_handle_t *archive_handle)
{
file_header_t *file_header = archive_handle->file_header;
int dst_fd;
int res;
if (archive_handle->flags & ARCHIVE_CREATE_LEADING_DIRS) {
char *name = xstrdup(file_header->name);
bb_make_directory(dirname(name), -1, FILEUTILS_RECUR);
free(name);
}
/* Check if the file already exists */
if (archive_handle->flags & ARCHIVE_EXTRACT_UNCONDITIONAL) {
/* Remove the existing entry if it exists */
if (((file_header->mode & S_IFMT) != S_IFDIR)
&& (unlink(file_header->name) == -1)
&& (errno != ENOENT)
) {
bb_perror_msg_and_die("cannot remove old file");
}
}
else if (archive_handle->flags & ARCHIVE_EXTRACT_NEWER) {
/* Remove the existing entry if its older than the extracted entry */
struct stat statbuf;
if (lstat(file_header->name, &statbuf) == -1) {
if (errno != ENOENT) {
bb_perror_msg_and_die("cannot stat old file");
}
}
else if (statbuf.st_mtime <= file_header->mtime) {
if (!(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
bb_error_msg("%s not created: newer or "
"same age file exists", file_header->name);
}
data_skip(archive_handle);
return;
}
else if ((unlink(file_header->name) == -1) && (errno != EISDIR)) {
bb_perror_msg_and_die("cannot remove old file %s",
file_header->name);
}
}
/* Handle hard links separately
* We identified hard links as regular files of size 0 with a symlink */
if (S_ISREG(file_header->mode) && (file_header->link_name)
&& (file_header->size == 0)
) {
/* hard link */
res = link(file_header->link_name, file_header->name);
if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
bb_perror_msg("cannot create hard link");
}
} else {
/* Create the filesystem entry */
switch (file_header->mode & S_IFMT) {
case S_IFREG: {
/* Regular file */
dst_fd = xopen3(file_header->name, O_WRONLY | O_CREAT | O_EXCL,
file_header->mode);
bb_copyfd_exact_size(archive_handle->src_fd, dst_fd, file_header->size);
close(dst_fd);
break;
}
case S_IFDIR:
res = mkdir(file_header->name, file_header->mode);
if ((errno != EISDIR) && (res == -1)
&& !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)
) {
bb_perror_msg("extract_archive: %s", file_header->name);
}
break;
case S_IFLNK:
/* Symlink */
res = symlink(file_header->link_name, file_header->name);
if ((res == -1)
&& !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)
) {
bb_perror_msg("cannot create symlink "
"from %s to '%s'",
file_header->name,
file_header->link_name);
}
break;
case S_IFSOCK:
case S_IFBLK:
case S_IFCHR:
case S_IFIFO:
res = mknod(file_header->name, file_header->mode, file_header->device);
if ((res == -1)
&& !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)
) {
bb_perror_msg("cannot create node %s", file_header->name);
}
break;
default:
bb_error_msg_and_die("unrecognized file type");
}
}
if (!(archive_handle->flags & ARCHIVE_NOPRESERVE_OWN)) {
lchown(file_header->name, file_header->uid, file_header->gid);
}
if (archive_handle->flags & ARCHIVE_PRESERVE_DATE) {
struct utimbuf t;
t.actime = t.modtime = file_header->mtime;
utime(file_header->name, &t);
}
}
@@ -0,0 +1,17 @@
/* vi: set sw=4 ts=4: */
/*
* Copyright 2002 Glenn McGrath
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "libbb.h"
#include "unarchive.h"
void data_extract_to_buffer(archive_handle_t *archive_handle)
{
unsigned int size = archive_handle->file_header->size;
archive_handle->buffer = xzalloc(size + 1);
xread(archive_handle->src_fd, archive_handle->buffer, size);
}
@@ -0,0 +1,13 @@
/* vi: set sw=4 ts=4: */
/*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "unarchive.h"
void data_extract_to_stdout(archive_handle_t *archive_handle)
{
bb_copyfd_exact_size(archive_handle->src_fd,
STDOUT_FILENO,
archive_handle->file_header->size);
}
+16
View File
@@ -0,0 +1,16 @@
/* vi: set sw=4 ts=4: */
/*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include <sys/types.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include "unarchive.h"
#include "libbb.h"
void data_skip(archive_handle_t *archive_handle)
{
archive_handle->seek(archive_handle, archive_handle->file_header->size);
}
+731
View File
@@ -0,0 +1,731 @@
/* vi: set sw=4 ts=4: */
/* Small bzip2 deflate implementation, by Rob Landley (rob@landley.net).
Based on bzip2 decompression code by Julian R Seward (jseward@acm.org),
which also acknowledges contributions by Mike Burrows, David Wheeler,
Peter Fenwick, Alistair Moffat, Radford Neal, Ian H. Witten,
Robert Sedgewick, and Jon L. Bentley.
Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
/*
Size and speed optimizations by Manuel Novoa III (mjn3@codepoet.org).
More efficient reading of Huffman codes, a streamlined read_bunzip()
function, and various other tweaks. In (limited) tests, approximately
20% faster than bzcat on x86 and about 10% faster on arm.
Note that about 2/3 of the time is spent in read_unzip() reversing
the Burrows-Wheeler transformation. Much of that time is delay
resulting from cache misses.
I would ask that anyone benefiting from this work, especially those
using it in commercial products, consider making a donation to my local
non-profit hospice organization (www.hospiceacadiana.com) in the name of
the woman I loved, Toni W. Hagan, who passed away Feb. 12, 2003.
Manuel
*/
#include "libbb.h"
#include "unarchive.h"
/* Constants for Huffman coding */
#define MAX_GROUPS 6
#define GROUP_SIZE 50 /* 64 would have been more efficient */
#define MAX_HUFCODE_BITS 20 /* Longest Huffman code allowed */
#define MAX_SYMBOLS 258 /* 256 literals + RUNA + RUNB */
#define SYMBOL_RUNA 0
#define SYMBOL_RUNB 1
/* Status return values */
#define RETVAL_OK 0
#define RETVAL_LAST_BLOCK (-1)
#define RETVAL_NOT_BZIP_DATA (-2)
#define RETVAL_UNEXPECTED_INPUT_EOF (-3)
#define RETVAL_UNEXPECTED_OUTPUT_EOF (-4)
#define RETVAL_DATA_ERROR (-5)
#define RETVAL_OUT_OF_MEMORY (-6)
#define RETVAL_OBSOLETE_INPUT (-7)
/* Other housekeeping constants */
#define IOBUF_SIZE 4096
/* This is what we know about each Huffman coding group */
struct group_data {
/* We have an extra slot at the end of limit[] for a sentinal value. */
int limit[MAX_HUFCODE_BITS+1],base[MAX_HUFCODE_BITS],permute[MAX_SYMBOLS];
int minLen, maxLen;
};
/* Structure holding all the housekeeping data, including IO buffers and
memory that persists between calls to bunzip */
typedef struct {
/* State for interrupting output loop */
int writeCopies,writePos,writeRunCountdown,writeCount,writeCurrent;
/* I/O tracking data (file handles, buffers, positions, etc.) */
int in_fd,out_fd,inbufCount,inbufPos /*,outbufPos*/;
unsigned char *inbuf /*,*outbuf*/;
unsigned int inbufBitCount, inbufBits;
/* The CRC values stored in the block header and calculated from the data */
uint32_t headerCRC, totalCRC, writeCRC;
uint32_t *crc32Table;
/* Intermediate buffer and its size (in bytes) */
unsigned int *dbuf, dbufSize;
/* These things are a bit too big to go on the stack */
unsigned char selectors[32768]; /* nSelectors=15 bits */
struct group_data groups[MAX_GROUPS]; /* Huffman coding tables */
/* For I/O error handling */
jmp_buf jmpbuf;
} bunzip_data;
/* Return the next nnn bits of input. All reads from the compressed input
are done through this function. All reads are big endian */
static unsigned int get_bits(bunzip_data *bd, char bits_wanted)
{
unsigned int bits=0;
/* If we need to get more data from the byte buffer, do so. (Loop getting
one byte at a time to enforce endianness and avoid unaligned access.) */
while (bd->inbufBitCount<bits_wanted) {
/* If we need to read more data from file into byte buffer, do so */
if(bd->inbufPos==bd->inbufCount) {
if((bd->inbufCount = read(bd->in_fd, bd->inbuf, IOBUF_SIZE)) <= 0)
longjmp(bd->jmpbuf,RETVAL_UNEXPECTED_INPUT_EOF);
bd->inbufPos=0;
}
/* Avoid 32-bit overflow (dump bit buffer to top of output) */
if(bd->inbufBitCount>=24) {
bits=bd->inbufBits&((1<<bd->inbufBitCount)-1);
bits_wanted-=bd->inbufBitCount;
bits<<=bits_wanted;
bd->inbufBitCount=0;
}
/* Grab next 8 bits of input from buffer. */
bd->inbufBits=(bd->inbufBits<<8)|bd->inbuf[bd->inbufPos++];
bd->inbufBitCount+=8;
}
/* Calculate result */
bd->inbufBitCount-=bits_wanted;
bits|=(bd->inbufBits>>bd->inbufBitCount)&((1<<bits_wanted)-1);
return bits;
}
/* Unpacks the next block and sets up for the inverse burrows-wheeler step. */
static int get_next_block(bunzip_data *bd)
{
struct group_data *hufGroup;
int dbufCount,nextSym,dbufSize,groupCount,*base,*limit,selector,
i,j,k,t,runPos,symCount,symTotal,nSelectors,byteCount[256];
unsigned char uc, symToByte[256], mtfSymbol[256], *selectors;
unsigned int *dbuf,origPtr;
dbuf=bd->dbuf;
dbufSize=bd->dbufSize;
selectors=bd->selectors;
/* Reset longjmp I/O error handling */
i=setjmp(bd->jmpbuf);
if (i) return i;
/* Read in header signature and CRC, then validate signature.
(last block signature means CRC is for whole file, return now) */
i = get_bits(bd,24);
j = get_bits(bd,24);
bd->headerCRC=get_bits(bd,32);
if ((i == 0x177245) && (j == 0x385090)) return RETVAL_LAST_BLOCK;
if ((i != 0x314159) || (j != 0x265359)) return RETVAL_NOT_BZIP_DATA;
/* We can add support for blockRandomised if anybody complains. There was
some code for this in busybox 1.0.0-pre3, but nobody ever noticed that
it didn't actually work. */
if (get_bits(bd,1)) return RETVAL_OBSOLETE_INPUT;
if ((origPtr=get_bits(bd,24)) > dbufSize) return RETVAL_DATA_ERROR;
/* mapping table: if some byte values are never used (encoding things
like ascii text), the compression code removes the gaps to have fewer
symbols to deal with, and writes a sparse bitfield indicating which
values were present. We make a translation table to convert the symbols
back to the corresponding bytes. */
t=get_bits(bd, 16);
symTotal=0;
for (i=0;i<16;i++) {
if(t&(1<<(15-i))) {
k=get_bits(bd,16);
for (j=0;j<16;j++)
if(k&(1<<(15-j))) symToByte[symTotal++]=(16*i)+j;
}
}
/* How many different Huffman coding groups does this block use? */
groupCount=get_bits(bd,3);
if (groupCount<2 || groupCount>MAX_GROUPS) return RETVAL_DATA_ERROR;
/* nSelectors: Every GROUP_SIZE many symbols we select a new Huffman coding
group. Read in the group selector list, which is stored as MTF encoded
bit runs. (MTF=Move To Front, as each value is used it's moved to the
start of the list.) */
if(!(nSelectors=get_bits(bd, 15))) return RETVAL_DATA_ERROR;
for (i=0; i<groupCount; i++) mtfSymbol[i] = i;
for (i=0; i<nSelectors; i++) {
/* Get next value */
for (j=0;get_bits(bd,1);j++) if (j>=groupCount) return RETVAL_DATA_ERROR;
/* Decode MTF to get the next selector */
uc = mtfSymbol[j];
for (;j;j--) mtfSymbol[j] = mtfSymbol[j-1];
mtfSymbol[0]=selectors[i]=uc;
}
/* Read the Huffman coding tables for each group, which code for symTotal
literal symbols, plus two run symbols (RUNA, RUNB) */
symCount=symTotal+2;
for (j=0; j<groupCount; j++) {
unsigned char length[MAX_SYMBOLS],temp[MAX_HUFCODE_BITS+1];
int minLen, maxLen, pp;
/* Read Huffman code lengths for each symbol. They're stored in
a way similar to mtf; record a starting value for the first symbol,
and an offset from the previous value for everys symbol after that.
(Subtracting 1 before the loop and then adding it back at the end is
an optimization that makes the test inside the loop simpler: symbol
length 0 becomes negative, so an unsigned inequality catches it.) */
t=get_bits(bd, 5)-1;
for (i = 0; i < symCount; i++) {
for (;;) {
if (((unsigned)t) > (MAX_HUFCODE_BITS-1))
return RETVAL_DATA_ERROR;
/* If first bit is 0, stop. Else second bit indicates whether
to increment or decrement the value. Optimization: grab 2
bits and unget the second if the first was 0. */
k = get_bits(bd,2);
if (k < 2) {
bd->inbufBitCount++;
break;
}
/* Add one if second bit 1, else subtract 1. Avoids if/else */
t+=(((k+1)&2)-1);
}
/* Correct for the initial -1, to get the final symbol length */
length[i]=t+1;
}
/* Find largest and smallest lengths in this group */
minLen=maxLen=length[0];
for (i = 1; i < symCount; i++) {
if(length[i] > maxLen) maxLen = length[i];
else if(length[i] < minLen) minLen = length[i];
}
/* Calculate permute[], base[], and limit[] tables from length[].
*
* permute[] is the lookup table for converting Huffman coded symbols
* into decoded symbols. base[] is the amount to subtract from the
* value of a Huffman symbol of a given length when using permute[].
*
* limit[] indicates the largest numerical value a symbol with a given
* number of bits can have. This is how the Huffman codes can vary in
* length: each code with a value>limit[length] needs another bit.
*/
hufGroup=bd->groups+j;
hufGroup->minLen = minLen;
hufGroup->maxLen = maxLen;
/* Note that minLen can't be smaller than 1, so we adjust the base
and limit array pointers so we're not always wasting the first
entry. We do this again when using them (during symbol decoding).*/
base=hufGroup->base-1;
limit=hufGroup->limit-1;
/* Calculate permute[]. Concurently, initialize temp[] and limit[]. */
pp=0;
for (i=minLen;i<=maxLen;i++) {
temp[i]=limit[i]=0;
for (t=0;t<symCount;t++)
if(length[t]==i) hufGroup->permute[pp++] = t;
}
/* Count symbols coded for at each bit length */
for (i=0;i<symCount;i++) temp[length[i]]++;
/* Calculate limit[] (the largest symbol-coding value at each bit
* length, which is (previous limit<<1)+symbols at this level), and
* base[] (number of symbols to ignore at each bit length, which is
* limit minus the cumulative count of symbols coded for already). */
pp=t=0;
for (i=minLen; i<maxLen; i++) {
pp+=temp[i];
/* We read the largest possible symbol size and then unget bits
after determining how many we need, and those extra bits could
be set to anything. (They're noise from future symbols.) At
each level we're really only interested in the first few bits,
so here we set all the trailing to-be-ignored bits to 1 so they
don't affect the value>limit[length] comparison. */
limit[i]= (pp << (maxLen - i)) - 1;
pp<<=1;
base[i+1]=pp-(t+=temp[i]);
}
limit[maxLen+1] = INT_MAX; /* Sentinal value for reading next sym. */
limit[maxLen]=pp+temp[maxLen]-1;
base[minLen]=0;
}
/* We've finished reading and digesting the block header. Now read this
block's Huffman coded symbols from the file and undo the Huffman coding
and run length encoding, saving the result into dbuf[dbufCount++]=uc */
/* Initialize symbol occurrence counters and symbol Move To Front table */
for (i=0;i<256;i++) {
byteCount[i] = 0;
mtfSymbol[i]=(unsigned char)i;
}
/* Loop through compressed symbols. */
runPos=dbufCount=selector=0;
for (;;) {
/* fetch next Huffman coding group from list. */
symCount=GROUP_SIZE-1;
if(selector>=nSelectors) return RETVAL_DATA_ERROR;
hufGroup=bd->groups+selectors[selector++];
base=hufGroup->base-1;
limit=hufGroup->limit-1;
continue_this_group:
/* Read next Huffman-coded symbol. */
/* Note: It is far cheaper to read maxLen bits and back up than it is
to read minLen bits and then an additional bit at a time, testing
as we go. Because there is a trailing last block (with file CRC),
there is no danger of the overread causing an unexpected EOF for a
valid compressed file. As a further optimization, we do the read
inline (falling back to a call to get_bits if the buffer runs
dry). The following (up to got_huff_bits:) is equivalent to
j=get_bits(bd,hufGroup->maxLen);
*/
while (bd->inbufBitCount<hufGroup->maxLen) {
if(bd->inbufPos==bd->inbufCount) {
j = get_bits(bd,hufGroup->maxLen);
goto got_huff_bits;
}
bd->inbufBits=(bd->inbufBits<<8)|bd->inbuf[bd->inbufPos++];
bd->inbufBitCount+=8;
};
bd->inbufBitCount-=hufGroup->maxLen;
j = (bd->inbufBits>>bd->inbufBitCount)&((1<<hufGroup->maxLen)-1);
got_huff_bits:
/* Figure how how many bits are in next symbol and unget extras */
i=hufGroup->minLen;
while (j>limit[i]) ++i;
bd->inbufBitCount += (hufGroup->maxLen - i);
/* Huffman decode value to get nextSym (with bounds checking) */
if ((i > hufGroup->maxLen)
|| (((unsigned)(j=(j>>(hufGroup->maxLen-i))-base[i]))
>= MAX_SYMBOLS))
return RETVAL_DATA_ERROR;
nextSym = hufGroup->permute[j];
/* We have now decoded the symbol, which indicates either a new literal
byte, or a repeated run of the most recent literal byte. First,
check if nextSym indicates a repeated run, and if so loop collecting
how many times to repeat the last literal. */
if (((unsigned)nextSym) <= SYMBOL_RUNB) { /* RUNA or RUNB */
/* If this is the start of a new run, zero out counter */
if(!runPos) {
runPos = 1;
t = 0;
}
/* Neat trick that saves 1 symbol: instead of or-ing 0 or 1 at
each bit position, add 1 or 2 instead. For example,
1011 is 1<<0 + 1<<1 + 2<<2. 1010 is 2<<0 + 2<<1 + 1<<2.
You can make any bit pattern that way using 1 less symbol than
the basic or 0/1 method (except all bits 0, which would use no
symbols, but a run of length 0 doesn't mean anything in this
context). Thus space is saved. */
t += (runPos << nextSym); /* +runPos if RUNA; +2*runPos if RUNB */
if(runPos < dbufSize) runPos <<= 1;
goto end_of_huffman_loop;
}
/* When we hit the first non-run symbol after a run, we now know
how many times to repeat the last literal, so append that many
copies to our buffer of decoded symbols (dbuf) now. (The last
literal used is the one at the head of the mtfSymbol array.) */
if(runPos) {
runPos=0;
if(dbufCount+t>=dbufSize) return RETVAL_DATA_ERROR;
uc = symToByte[mtfSymbol[0]];
byteCount[uc] += t;
while (t--) dbuf[dbufCount++]=uc;
}
/* Is this the terminating symbol? */
if(nextSym>symTotal) break;
/* At this point, nextSym indicates a new literal character. Subtract
one to get the position in the MTF array at which this literal is
currently to be found. (Note that the result can't be -1 or 0,
because 0 and 1 are RUNA and RUNB. But another instance of the
first symbol in the mtf array, position 0, would have been handled
as part of a run above. Therefore 1 unused mtf position minus
2 non-literal nextSym values equals -1.) */
if(dbufCount>=dbufSize) return RETVAL_DATA_ERROR;
i = nextSym - 1;
uc = mtfSymbol[i];
/* Adjust the MTF array. Since we typically expect to move only a
* small number of symbols, and are bound by 256 in any case, using
* memmove here would typically be bigger and slower due to function
* call overhead and other assorted setup costs. */
do {
mtfSymbol[i] = mtfSymbol[i-1];
} while (--i);
mtfSymbol[0] = uc;
uc=symToByte[uc];
/* We have our literal byte. Save it into dbuf. */
byteCount[uc]++;
dbuf[dbufCount++] = (unsigned int)uc;
/* Skip group initialization if we're not done with this group. Done
* this way to avoid compiler warning. */
end_of_huffman_loop:
if(symCount--) goto continue_this_group;
}
/* At this point, we've read all the Huffman-coded symbols (and repeated
runs) for this block from the input stream, and decoded them into the
intermediate buffer. There are dbufCount many decoded bytes in dbuf[].
Now undo the Burrows-Wheeler transform on dbuf.
See http://dogma.net/markn/articles/bwt/bwt.htm
*/
/* Turn byteCount into cumulative occurrence counts of 0 to n-1. */
j=0;
for (i=0;i<256;i++) {
k=j+byteCount[i];
byteCount[i] = j;
j=k;
}
/* Figure out what order dbuf would be in if we sorted it. */
for (i=0;i<dbufCount;i++) {
uc=(unsigned char)(dbuf[i] & 0xff);
dbuf[byteCount[uc]] |= (i << 8);
byteCount[uc]++;
}
/* Decode first byte by hand to initialize "previous" byte. Note that it
doesn't get output, and if the first three characters are identical
it doesn't qualify as a run (hence writeRunCountdown=5). */
if(dbufCount) {
if(origPtr>=dbufCount) return RETVAL_DATA_ERROR;
bd->writePos=dbuf[origPtr];
bd->writeCurrent=(unsigned char)(bd->writePos&0xff);
bd->writePos>>=8;
bd->writeRunCountdown=5;
}
bd->writeCount=dbufCount;
return RETVAL_OK;
}
/* Undo burrows-wheeler transform on intermediate buffer to produce output.
If start_bunzip was initialized with out_fd=-1, then up to len bytes of
data are written to outbuf. Return value is number of bytes written or
error (all errors are negative numbers). If out_fd!=-1, outbuf and len
are ignored, data is written to out_fd and return is RETVAL_OK or error.
*/
static int read_bunzip(bunzip_data *bd, char *outbuf, int len)
{
const unsigned int *dbuf;
int pos,current,previous,gotcount;
/* If last read was short due to end of file, return last block now */
if(bd->writeCount<0) return bd->writeCount;
gotcount = 0;
dbuf=bd->dbuf;
pos=bd->writePos;
current=bd->writeCurrent;
/* We will always have pending decoded data to write into the output
buffer unless this is the very first call (in which case we haven't
Huffman-decoded a block into the intermediate buffer yet). */
if (bd->writeCopies) {
/* Inside the loop, writeCopies means extra copies (beyond 1) */
--bd->writeCopies;
/* Loop outputting bytes */
for (;;) {
/* If the output buffer is full, snapshot state and return */
if(gotcount >= len) {
bd->writePos=pos;
bd->writeCurrent=current;
bd->writeCopies++;
return len;
}
/* Write next byte into output buffer, updating CRC */
outbuf[gotcount++] = current;
bd->writeCRC=(((bd->writeCRC)<<8)
^bd->crc32Table[((bd->writeCRC)>>24)^current]);
/* Loop now if we're outputting multiple copies of this byte */
if (bd->writeCopies) {
--bd->writeCopies;
continue;
}
decode_next_byte:
if (!bd->writeCount--) break;
/* Follow sequence vector to undo Burrows-Wheeler transform */
previous=current;
pos=dbuf[pos];
current=pos&0xff;
pos>>=8;
/* After 3 consecutive copies of the same byte, the 4th is a repeat
count. We count down from 4 instead
* of counting up because testing for non-zero is faster */
if(--bd->writeRunCountdown) {
if(current!=previous) bd->writeRunCountdown=4;
} else {
/* We have a repeated run, this byte indicates the count */
bd->writeCopies=current;
current=previous;
bd->writeRunCountdown=5;
/* Sometimes there are just 3 bytes (run length 0) */
if(!bd->writeCopies) goto decode_next_byte;
/* Subtract the 1 copy we'd output anyway to get extras */
--bd->writeCopies;
}
}
/* Decompression of this block completed successfully */
bd->writeCRC=~bd->writeCRC;
bd->totalCRC=((bd->totalCRC<<1) | (bd->totalCRC>>31)) ^ bd->writeCRC;
/* If this block had a CRC error, force file level CRC error. */
if(bd->writeCRC!=bd->headerCRC) {
bd->totalCRC=bd->headerCRC+1;
return RETVAL_LAST_BLOCK;
}
}
/* Refill the intermediate buffer by Huffman-decoding next block of input */
/* (previous is just a convenient unused temp variable here) */
previous=get_next_block(bd);
if(previous) {
bd->writeCount=previous;
return (previous!=RETVAL_LAST_BLOCK) ? previous : gotcount;
}
bd->writeCRC=~0;
pos=bd->writePos;
current=bd->writeCurrent;
goto decode_next_byte;
}
/* Allocate the structure, read file header. If in_fd==-1, inbuf must contain
a complete bunzip file (len bytes long). If in_fd!=-1, inbuf and len are
ignored, and data is read from file handle into temporary buffer. */
static int start_bunzip(bunzip_data **bdp, int in_fd, unsigned char *inbuf,
int len)
{
bunzip_data *bd;
unsigned int i;
const unsigned int BZh0=(((unsigned int)'B')<<24)+(((unsigned int)'Z')<<16)
+(((unsigned int)'h')<<8)+(unsigned int)'0';
/* Figure out how much data to allocate */
i=sizeof(bunzip_data);
if(in_fd!=-1) i+=IOBUF_SIZE;
/* Allocate bunzip_data. Most fields initialize to zero. */
bd=*bdp=xzalloc(i);
/* Setup input buffer */
if(-1==(bd->in_fd=in_fd)) {
bd->inbuf=inbuf;
bd->inbufCount=len;
} else bd->inbuf=(unsigned char *)(bd+1);
/* Init the CRC32 table (big endian) */
bd->crc32Table = crc32_filltable(1);
/* Setup for I/O error handling via longjmp */
i=setjmp(bd->jmpbuf);
if(i) return i;
/* Ensure that file starts with "BZh['1'-'9']." */
i = get_bits(bd,32);
if (((unsigned int)(i-BZh0-1)) >= 9) return RETVAL_NOT_BZIP_DATA;
/* Fourth byte (ascii '1'-'9'), indicates block size in units of 100k of
uncompressed data. Allocate intermediate buffer for block. */
bd->dbufSize=100000*(i-BZh0);
bd->dbuf=xmalloc(bd->dbufSize * sizeof(int));
return RETVAL_OK;
}
/* Example usage: decompress src_fd to dst_fd. (Stops at end of bzip data,
not end of file.) */
USE_DESKTOP(long long) int
uncompressStream(int src_fd, int dst_fd)
{
USE_DESKTOP(long long total_written = 0;)
char *outbuf;
bunzip_data *bd;
int i;
outbuf=xmalloc(IOBUF_SIZE);
i=start_bunzip(&bd,src_fd,0,0);
if(!i) {
for (;;) {
if((i=read_bunzip(bd,outbuf,IOBUF_SIZE)) <= 0) break;
if(i!=write(dst_fd,outbuf,i)) {
i=RETVAL_UNEXPECTED_OUTPUT_EOF;
break;
}
USE_DESKTOP(total_written += i;)
}
}
/* Check CRC and release memory */
if(i==RETVAL_LAST_BLOCK) {
if (bd->headerCRC!=bd->totalCRC) {
bb_error_msg("data integrity error when decompressing");
} else {
i=RETVAL_OK;
}
} else if (i==RETVAL_UNEXPECTED_OUTPUT_EOF) {
bb_error_msg("compressed file ends unexpectedly");
} else {
bb_error_msg("decompression failed");
}
free(bd->dbuf);
free(bd);
free(outbuf);
return i ? i : USE_DESKTOP(total_written) + 0;
}
#ifdef TESTING
static char * const bunzip_errors[]={NULL,"Bad file checksum","Not bzip data",
"Unexpected input EOF","Unexpected output EOF","Data error",
"Out of memory","Obsolete (pre 0.9.5) bzip format not supported."};
/* Dumb little test thing, decompress stdin to stdout */
int main(int argc, char *argv[])
{
int i=uncompressStream(0,1);
char c;
if(i<0) fprintf(stderr,"%s\n", bunzip_errors[-i]);
else if(read(0,&c,1)) fprintf(stderr,"Trailing garbage ignored\n");
return -i;
}
#endif
@@ -0,0 +1,308 @@
/* vi: set sw=4 ts=4: */
#include "libbb.h"
/* uncompress for busybox -- (c) 2002 Robert Griebl
*
* based on the original compress42.c source
* (see disclaimer below)
*/
/* (N)compress42.c - File compression ala IEEE Computer, Mar 1992.
*
* Authors:
* Spencer W. Thomas (decvax!harpo!utah-cs!utah-gr!thomas)
* Jim McKie (decvax!mcvax!jim)
* Steve Davies (decvax!vax135!petsd!peora!srd)
* Ken Turkowski (decvax!decwrl!turtlevax!ken)
* James A. Woods (decvax!ihnp4!ames!jaw)
* Joe Orost (decvax!vax135!petsd!joe)
* Dave Mack (csu@alembic.acs.com)
* Peter Jannesen, Network Communication Systems
* (peter@ncs.nl)
*
* marc@suse.de : a small security fix for a buffer overflow
*
* [... History snipped ...]
*
*/
#include <stdio.h>
#include <string.h>
#include <unistd.h>
/* Default input buffer size */
#define IBUFSIZ 2048
/* Default output buffer size */
#define OBUFSIZ 2048
/* Defines for third byte of header */
#define MAGIC_1 (char_type)'\037' /* First byte of compressed file */
#define MAGIC_2 (char_type)'\235' /* Second byte of compressed file */
#define BIT_MASK 0x1f /* Mask for 'number of compresssion bits' */
/* Masks 0x20 and 0x40 are free. */
/* I think 0x20 should mean that there is */
/* a fourth header byte (for expansion). */
#define BLOCK_MODE 0x80 /* Block compresssion if table is full and */
/* compression rate is dropping flush tables */
/* the next two codes should not be changed lightly, as they must not */
/* lie within the contiguous general code space. */
#define FIRST 257 /* first free entry */
#define CLEAR 256 /* table clear output code */
#define INIT_BITS 9 /* initial number of bits/code */
/* machine variants which require cc -Dmachine: pdp11, z8000, DOS */
#define FAST
#define HBITS 17 /* 50% occupancy */
#define HSIZE (1<<HBITS)
#define HMASK (HSIZE-1)
#define HPRIME 9941
#define BITS 16
#undef MAXSEG_64K
#define MAXCODE(n) (1L << (n))
#define htabof(i) htab[i]
#define codetabof(i) codetab[i]
#define tab_prefixof(i) codetabof(i)
#define tab_suffixof(i) ((unsigned char *)(htab))[i]
#define de_stack ((unsigned char *)&(htab[HSIZE-1]))
#define clear_htab() memset(htab, -1, HSIZE)
#define clear_tab_prefixof() memset(codetab, 0, 256);
/*
* Decompress stdin to stdout. This routine adapts to the codes in the
* file building the "string" table on-the-fly; requiring no table to
* be stored in the compressed file. The tables used herein are shared
* with those of the compress() routine. See the definitions above.
*/
USE_DESKTOP(long long) int
uncompress(int fd_in, int fd_out)
{
USE_DESKTOP(long long total_written = 0;)
unsigned char *stackp;
long int code;
int finchar;
long int oldcode;
long int incode;
int inbits;
int posbits;
int outpos;
int insize;
int bitmask;
long int free_ent;
long int maxcode;
long int maxmaxcode;
int n_bits;
int rsize = 0;
RESERVE_CONFIG_UBUFFER(inbuf, IBUFSIZ + 64);
RESERVE_CONFIG_UBUFFER(outbuf, OBUFSIZ + 2048);
unsigned char htab[HSIZE];
unsigned short codetab[HSIZE];
/* Hmm, these were statics - why?! */
/* user settable max # bits/code */
int maxbits; /* = BITS; */
/* block compress mode -C compatible with 2.0 */
int block_mode; /* = BLOCK_MODE; */
memset(inbuf, 0, IBUFSIZ + 64);
memset(outbuf, 0, OBUFSIZ + 2048);
insize = 0;
/* xread isn't good here, we have to return - caller may want
* to do some cleanup (e.g. delete incomplete unpacked file etc) */
if (full_read(fd_in, inbuf, 1) != 1) {
bb_error_msg("short read");
return -1;
}
maxbits = inbuf[0] & BIT_MASK;
block_mode = inbuf[0] & BLOCK_MODE;
maxmaxcode = MAXCODE(maxbits);
if (maxbits > BITS) {
bb_error_msg("compressed with %d bits, can only handle "
"%d bits", maxbits, BITS);
return -1;
}
n_bits = INIT_BITS;
maxcode = MAXCODE(INIT_BITS) - 1;
bitmask = (1 << INIT_BITS) - 1;
oldcode = -1;
finchar = 0;
outpos = 0;
posbits = 0 << 3;
free_ent = ((block_mode) ? FIRST : 256);
/* As above, initialize the first 256 entries in the table. */
clear_tab_prefixof();
for (code = 255; code >= 0; --code) {
tab_suffixof(code) = (unsigned char) code;
}
do {
resetbuf:
{
int i;
int e;
int o;
o = posbits >> 3;
e = insize - o;
for (i = 0; i < e; ++i)
inbuf[i] = inbuf[i + o];
insize = e;
posbits = 0;
}
if (insize < (int) (IBUFSIZ + 64) - IBUFSIZ) {
rsize = safe_read(fd_in, inbuf + insize, IBUFSIZ);
//error check??
insize += rsize;
}
inbits = ((rsize > 0) ? (insize - insize % n_bits) << 3 :
(insize << 3) - (n_bits - 1));
while (inbits > posbits) {
if (free_ent > maxcode) {
posbits =
((posbits - 1) +
((n_bits << 3) -
(posbits - 1 + (n_bits << 3)) % (n_bits << 3)));
++n_bits;
if (n_bits == maxbits) {
maxcode = maxmaxcode;
} else {
maxcode = MAXCODE(n_bits) - 1;
}
bitmask = (1 << n_bits) - 1;
goto resetbuf;
}
{
unsigned char *p = &inbuf[posbits >> 3];
code = ((((long) (p[0])) | ((long) (p[1]) << 8) |
((long) (p[2]) << 16)) >> (posbits & 0x7)) & bitmask;
}
posbits += n_bits;
if (oldcode == -1) {
oldcode = code;
finchar = (int) oldcode;
outbuf[outpos++] = (unsigned char) finchar;
continue;
}
if (code == CLEAR && block_mode) {
clear_tab_prefixof();
free_ent = FIRST - 1;
posbits =
((posbits - 1) +
((n_bits << 3) -
(posbits - 1 + (n_bits << 3)) % (n_bits << 3)));
n_bits = INIT_BITS;
maxcode = MAXCODE(INIT_BITS) - 1;
bitmask = (1 << INIT_BITS) - 1;
goto resetbuf;
}
incode = code;
stackp = de_stack;
/* Special case for KwKwK string. */
if (code >= free_ent) {
if (code > free_ent) {
unsigned char *p;
posbits -= n_bits;
p = &inbuf[posbits >> 3];
bb_error_msg
("insize:%d posbits:%d inbuf:%02X %02X %02X %02X %02X (%d)",
insize, posbits, p[-1], p[0], p[1], p[2], p[3],
(posbits & 07));
bb_error_msg("uncompress: corrupt input");
return -1;
}
*--stackp = (unsigned char) finchar;
code = oldcode;
}
/* Generate output characters in reverse order */
while ((long int) code >= (long int) 256) {
*--stackp = tab_suffixof(code);
code = tab_prefixof(code);
}
finchar = tab_suffixof(code);
*--stackp = (unsigned char) finchar;
/* And put them out in forward order */
{
int i;
i = de_stack - stackp;
if (outpos + i >= OBUFSIZ) {
do {
if (i > OBUFSIZ - outpos) {
i = OBUFSIZ - outpos;
}
if (i > 0) {
memcpy(outbuf + outpos, stackp, i);
outpos += i;
}
if (outpos >= OBUFSIZ) {
full_write(fd_out, outbuf, outpos);
//error check??
USE_DESKTOP(total_written += outpos;)
outpos = 0;
}
stackp += i;
i = de_stack - stackp;
} while (i > 0);
} else {
memcpy(outbuf + outpos, stackp, i);
outpos += i;
}
}
/* Generate the new entry. */
code = free_ent;
if (code < maxmaxcode) {
tab_prefixof(code) = (unsigned short) oldcode;
tab_suffixof(code) = (unsigned char) finchar;
free_ent = code + 1;
}
/* Remember previous code. */
oldcode = incode;
}
} while (rsize > 0);
if (outpos > 0) {
full_write(fd_out, outbuf, outpos);
//error check??
USE_DESKTOP(total_written += outpos;)
}
RELEASE_CONFIG_BUFFER(inbuf);
RELEASE_CONFIG_BUFFER(outbuf);
return USE_DESKTOP(total_written) + 0;
}
+497
View File
@@ -0,0 +1,497 @@
/* vi: set sw=4 ts=4: */
/*
* Small lzma deflate implementation.
* Copyright (C) 2006 Aurelien Jacobs <aurel@gnuage.org>
*
* Based on LzmaDecode.c from the LZMA SDK 4.22 (http://www.7-zip.org/)
* Copyright (C) 1999-2005 Igor Pavlov
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "libbb.h"
#include "unarchive.h"
#ifdef CONFIG_FEATURE_LZMA_FAST
# define speed_inline ATTRIBUTE_ALWAYS_INLINE
#else
# define speed_inline
#endif
typedef struct {
int fd;
uint8_t *ptr;
/* Was keeping rc on stack in unlzma and separately allocating buffer,
* but with "buffer 'attached to' allocated rc" code is smaller: */
/* uint8_t *buffer; */
#define RC_BUFFER ((uint8_t*)(rc+1))
uint8_t *buffer_end;
/* Had provisions for variable buffer, but we don't need it here */
/* int buffer_size; */
#define RC_BUFFER_SIZE 0x10000
uint32_t code;
uint32_t range;
uint32_t bound;
} rc_t;
#define RC_TOP_BITS 24
#define RC_MOVE_BITS 5
#define RC_MODEL_TOTAL_BITS 11
/* Called twice: once at startup and once in rc_normalize() */
static void rc_read(rc_t * rc)
{
int buffer_size = safe_read(rc->fd, RC_BUFFER, RC_BUFFER_SIZE);
if (buffer_size <= 0)
bb_error_msg_and_die("unexpected EOF");
rc->ptr = RC_BUFFER;
rc->buffer_end = RC_BUFFER + buffer_size;
}
/* Called once */
static rc_t* rc_init(int fd) /*, int buffer_size) */
{
int i;
rc_t* rc;
rc = xmalloc(sizeof(rc_t) + RC_BUFFER_SIZE);
rc->fd = fd;
/* rc->buffer_size = buffer_size; */
rc->buffer_end = RC_BUFFER + RC_BUFFER_SIZE;
rc->ptr = rc->buffer_end;
rc->code = 0;
rc->range = 0xFFFFFFFF;
for (i = 0; i < 5; i++) {
if (rc->ptr >= rc->buffer_end)
rc_read(rc);
rc->code = (rc->code << 8) | *rc->ptr++;
}
return rc;
}
/* Called once */
static ATTRIBUTE_ALWAYS_INLINE void rc_free(rc_t * rc)
{
if (ENABLE_FEATURE_CLEAN_UP)
free(rc);
}
/* Called twice, but one callsite is in speed_inline'd rc_is_bit_0_helper() */
static void rc_do_normalize(rc_t * rc)
{
if (rc->ptr >= rc->buffer_end)
rc_read(rc);
rc->range <<= 8;
rc->code = (rc->code << 8) | *rc->ptr++;
}
static ATTRIBUTE_ALWAYS_INLINE void rc_normalize(rc_t * rc)
{
if (rc->range < (1 << RC_TOP_BITS)) {
rc_do_normalize(rc);
}
}
/* Called 9 times */
/* Why rc_is_bit_0_helper exists?
* Because we want to always expose (rc->code < rc->bound) to optimizer
*/
static speed_inline uint32_t rc_is_bit_0_helper(rc_t * rc, uint16_t * p)
{
rc_normalize(rc);
rc->bound = *p * (rc->range >> RC_MODEL_TOTAL_BITS);
return rc->bound;
}
static ATTRIBUTE_ALWAYS_INLINE int rc_is_bit_0(rc_t * rc, uint16_t * p)
{
uint32_t t = rc_is_bit_0_helper(rc, p);
return rc->code < t;
}
/* Called ~10 times, but very small, thus inlined */
static speed_inline void rc_update_bit_0(rc_t * rc, uint16_t * p)
{
rc->range = rc->bound;
*p += ((1 << RC_MODEL_TOTAL_BITS) - *p) >> RC_MOVE_BITS;
}
static speed_inline void rc_update_bit_1(rc_t * rc, uint16_t * p)
{
rc->range -= rc->bound;
rc->code -= rc->bound;
*p -= *p >> RC_MOVE_BITS;
}
/* Called 4 times in unlzma loop */
static int rc_get_bit(rc_t * rc, uint16_t * p, int *symbol)
{
if (rc_is_bit_0(rc, p)) {
rc_update_bit_0(rc, p);
*symbol *= 2;
return 0;
} else {
rc_update_bit_1(rc, p);
*symbol = *symbol * 2 + 1;
return 1;
}
}
/* Called once */
static ATTRIBUTE_ALWAYS_INLINE int rc_direct_bit(rc_t * rc)
{
rc_normalize(rc);
rc->range >>= 1;
if (rc->code >= rc->range) {
rc->code -= rc->range;
return 1;
}
return 0;
}
/* Called twice */
static speed_inline void
rc_bit_tree_decode(rc_t * rc, uint16_t * p, int num_levels, int *symbol)
{
int i = num_levels;
*symbol = 1;
while (i--)
rc_get_bit(rc, p + *symbol, symbol);
*symbol -= 1 << num_levels;
}
typedef struct {
uint8_t pos;
uint32_t dict_size;
uint64_t dst_size;
} __attribute__ ((packed)) lzma_header_t;
/* #defines will force compiler to compute/optimize each one with each usage.
* Have heart and use enum instead. */
enum {
LZMA_BASE_SIZE = 1846,
LZMA_LIT_SIZE = 768,
LZMA_NUM_POS_BITS_MAX = 4,
LZMA_LEN_NUM_LOW_BITS = 3,
LZMA_LEN_NUM_MID_BITS = 3,
LZMA_LEN_NUM_HIGH_BITS = 8,
LZMA_LEN_CHOICE = 0,
LZMA_LEN_CHOICE_2 = (LZMA_LEN_CHOICE + 1),
LZMA_LEN_LOW = (LZMA_LEN_CHOICE_2 + 1),
LZMA_LEN_MID = (LZMA_LEN_LOW \
+ (1 << (LZMA_NUM_POS_BITS_MAX + LZMA_LEN_NUM_LOW_BITS))),
LZMA_LEN_HIGH = (LZMA_LEN_MID \
+ (1 << (LZMA_NUM_POS_BITS_MAX + LZMA_LEN_NUM_MID_BITS))),
LZMA_NUM_LEN_PROBS = (LZMA_LEN_HIGH + (1 << LZMA_LEN_NUM_HIGH_BITS)),
LZMA_NUM_STATES = 12,
LZMA_NUM_LIT_STATES = 7,
LZMA_START_POS_MODEL_INDEX = 4,
LZMA_END_POS_MODEL_INDEX = 14,
LZMA_NUM_FULL_DISTANCES = (1 << (LZMA_END_POS_MODEL_INDEX >> 1)),
LZMA_NUM_POS_SLOT_BITS = 6,
LZMA_NUM_LEN_TO_POS_STATES = 4,
LZMA_NUM_ALIGN_BITS = 4,
LZMA_MATCH_MIN_LEN = 2,
LZMA_IS_MATCH = 0,
LZMA_IS_REP = (LZMA_IS_MATCH + (LZMA_NUM_STATES << LZMA_NUM_POS_BITS_MAX)),
LZMA_IS_REP_G0 = (LZMA_IS_REP + LZMA_NUM_STATES),
LZMA_IS_REP_G1 = (LZMA_IS_REP_G0 + LZMA_NUM_STATES),
LZMA_IS_REP_G2 = (LZMA_IS_REP_G1 + LZMA_NUM_STATES),
LZMA_IS_REP_0_LONG = (LZMA_IS_REP_G2 + LZMA_NUM_STATES),
LZMA_POS_SLOT = (LZMA_IS_REP_0_LONG \
+ (LZMA_NUM_STATES << LZMA_NUM_POS_BITS_MAX)),
LZMA_SPEC_POS = (LZMA_POS_SLOT \
+ (LZMA_NUM_LEN_TO_POS_STATES << LZMA_NUM_POS_SLOT_BITS)),
LZMA_ALIGN = (LZMA_SPEC_POS \
+ LZMA_NUM_FULL_DISTANCES - LZMA_END_POS_MODEL_INDEX),
LZMA_LEN_CODER = (LZMA_ALIGN + (1 << LZMA_NUM_ALIGN_BITS)),
LZMA_REP_LEN_CODER = (LZMA_LEN_CODER + LZMA_NUM_LEN_PROBS),
LZMA_LITERAL = (LZMA_REP_LEN_CODER + LZMA_NUM_LEN_PROBS),
};
USE_DESKTOP(long long) int
unlzma(int src_fd, int dst_fd)
{
USE_DESKTOP(long long total_written = 0;)
lzma_header_t header;
int lc, pb, lp;
uint32_t pos_state_mask;
uint32_t literal_pos_mask;
uint32_t pos;
uint16_t *p;
uint16_t *prob;
uint16_t *prob_lit;
int num_bits;
int num_probs;
rc_t *rc;
int i, mi;
uint8_t *buffer;
uint8_t previous_byte = 0;
size_t buffer_pos = 0, global_pos = 0;
int len = 0;
int state = 0;
uint32_t rep0 = 1, rep1 = 1, rep2 = 1, rep3 = 1;
xread(src_fd, &header, sizeof(header));
if (header.pos >= (9 * 5 * 5))
bb_error_msg_and_die("bad header");
mi = header.pos / 9;
lc = header.pos % 9;
pb = mi / 5;
lp = mi % 5;
pos_state_mask = (1 << pb) - 1;
literal_pos_mask = (1 << lp) - 1;
header.dict_size = SWAP_LE32(header.dict_size);
header.dst_size = SWAP_LE64(header.dst_size);
if (header.dict_size == 0)
header.dict_size = 1;
buffer = xmalloc(MIN(header.dst_size, header.dict_size));
num_probs = LZMA_BASE_SIZE + (LZMA_LIT_SIZE << (lc + lp));
p = xmalloc(num_probs * sizeof(*p));
num_probs = LZMA_LITERAL + (LZMA_LIT_SIZE << (lc + lp));
for (i = 0; i < num_probs; i++)
p[i] = (1 << RC_MODEL_TOTAL_BITS) >> 1;
rc = rc_init(src_fd); /*, RC_BUFFER_SIZE); */
while (global_pos + buffer_pos < header.dst_size) {
int pos_state = (buffer_pos + global_pos) & pos_state_mask;
prob =
p + LZMA_IS_MATCH + (state << LZMA_NUM_POS_BITS_MAX) + pos_state;
if (rc_is_bit_0(rc, prob)) {
mi = 1;
rc_update_bit_0(rc, prob);
prob = (p + LZMA_LITERAL + (LZMA_LIT_SIZE
* ((((buffer_pos + global_pos) & literal_pos_mask) << lc)
+ (previous_byte >> (8 - lc)))));
if (state >= LZMA_NUM_LIT_STATES) {
int match_byte;
pos = buffer_pos - rep0;
while (pos >= header.dict_size)
pos += header.dict_size;
match_byte = buffer[pos];
do {
int bit;
match_byte <<= 1;
bit = match_byte & 0x100;
prob_lit = prob + 0x100 + bit + mi;
if (rc_get_bit(rc, prob_lit, &mi)) {
if (!bit)
break;
} else {
if (bit)
break;
}
} while (mi < 0x100);
}
while (mi < 0x100) {
prob_lit = prob + mi;
rc_get_bit(rc, prob_lit, &mi);
}
previous_byte = (uint8_t) mi;
buffer[buffer_pos++] = previous_byte;
if (buffer_pos == header.dict_size) {
buffer_pos = 0;
global_pos += header.dict_size;
if (full_write(dst_fd, buffer, header.dict_size) != header.dict_size)
goto bad;
USE_DESKTOP(total_written += header.dict_size;)
}
if (state < 4)
state = 0;
else if (state < 10)
state -= 3;
else
state -= 6;
} else {
int offset;
uint16_t *prob_len;
rc_update_bit_1(rc, prob);
prob = p + LZMA_IS_REP + state;
if (rc_is_bit_0(rc, prob)) {
rc_update_bit_0(rc, prob);
rep3 = rep2;
rep2 = rep1;
rep1 = rep0;
state = state < LZMA_NUM_LIT_STATES ? 0 : 3;
prob = p + LZMA_LEN_CODER;
} else {
rc_update_bit_1(rc, prob);
prob = p + LZMA_IS_REP_G0 + state;
if (rc_is_bit_0(rc, prob)) {
rc_update_bit_0(rc, prob);
prob = (p + LZMA_IS_REP_0_LONG
+ (state << LZMA_NUM_POS_BITS_MAX) + pos_state);
if (rc_is_bit_0(rc, prob)) {
rc_update_bit_0(rc, prob);
state = state < LZMA_NUM_LIT_STATES ? 9 : 11;
pos = buffer_pos - rep0;
while (pos >= header.dict_size)
pos += header.dict_size;
previous_byte = buffer[pos];
buffer[buffer_pos++] = previous_byte;
if (buffer_pos == header.dict_size) {
buffer_pos = 0;
global_pos += header.dict_size;
if (full_write(dst_fd, buffer, header.dict_size) != header.dict_size)
goto bad;
USE_DESKTOP(total_written += header.dict_size;)
}
continue;
} else {
rc_update_bit_1(rc, prob);
}
} else {
uint32_t distance;
rc_update_bit_1(rc, prob);
prob = p + LZMA_IS_REP_G1 + state;
if (rc_is_bit_0(rc, prob)) {
rc_update_bit_0(rc, prob);
distance = rep1;
} else {
rc_update_bit_1(rc, prob);
prob = p + LZMA_IS_REP_G2 + state;
if (rc_is_bit_0(rc, prob)) {
rc_update_bit_0(rc, prob);
distance = rep2;
} else {
rc_update_bit_1(rc, prob);
distance = rep3;
rep3 = rep2;
}
rep2 = rep1;
}
rep1 = rep0;
rep0 = distance;
}
state = state < LZMA_NUM_LIT_STATES ? 8 : 11;
prob = p + LZMA_REP_LEN_CODER;
}
prob_len = prob + LZMA_LEN_CHOICE;
if (rc_is_bit_0(rc, prob_len)) {
rc_update_bit_0(rc, prob_len);
prob_len = (prob + LZMA_LEN_LOW
+ (pos_state << LZMA_LEN_NUM_LOW_BITS));
offset = 0;
num_bits = LZMA_LEN_NUM_LOW_BITS;
} else {
rc_update_bit_1(rc, prob_len);
prob_len = prob + LZMA_LEN_CHOICE_2;
if (rc_is_bit_0(rc, prob_len)) {
rc_update_bit_0(rc, prob_len);
prob_len = (prob + LZMA_LEN_MID
+ (pos_state << LZMA_LEN_NUM_MID_BITS));
offset = 1 << LZMA_LEN_NUM_LOW_BITS;
num_bits = LZMA_LEN_NUM_MID_BITS;
} else {
rc_update_bit_1(rc, prob_len);
prob_len = prob + LZMA_LEN_HIGH;
offset = ((1 << LZMA_LEN_NUM_LOW_BITS)
+ (1 << LZMA_LEN_NUM_MID_BITS));
num_bits = LZMA_LEN_NUM_HIGH_BITS;
}
}
rc_bit_tree_decode(rc, prob_len, num_bits, &len);
len += offset;
if (state < 4) {
int pos_slot;
state += LZMA_NUM_LIT_STATES;
prob =
p + LZMA_POS_SLOT +
((len <
LZMA_NUM_LEN_TO_POS_STATES ? len :
LZMA_NUM_LEN_TO_POS_STATES - 1)
<< LZMA_NUM_POS_SLOT_BITS);
rc_bit_tree_decode(rc, prob, LZMA_NUM_POS_SLOT_BITS,
&pos_slot);
if (pos_slot >= LZMA_START_POS_MODEL_INDEX) {
num_bits = (pos_slot >> 1) - 1;
rep0 = 2 | (pos_slot & 1);
if (pos_slot < LZMA_END_POS_MODEL_INDEX) {
rep0 <<= num_bits;
prob = p + LZMA_SPEC_POS + rep0 - pos_slot - 1;
} else {
num_bits -= LZMA_NUM_ALIGN_BITS;
while (num_bits--)
rep0 = (rep0 << 1) | rc_direct_bit(rc);
prob = p + LZMA_ALIGN;
rep0 <<= LZMA_NUM_ALIGN_BITS;
num_bits = LZMA_NUM_ALIGN_BITS;
}
i = 1;
mi = 1;
while (num_bits--) {
if (rc_get_bit(rc, prob + mi, &mi))
rep0 |= i;
i <<= 1;
}
} else
rep0 = pos_slot;
if (++rep0 == 0)
break;
}
len += LZMA_MATCH_MIN_LEN;
do {
pos = buffer_pos - rep0;
while (pos >= header.dict_size)
pos += header.dict_size;
previous_byte = buffer[pos];
buffer[buffer_pos++] = previous_byte;
if (buffer_pos == header.dict_size) {
buffer_pos = 0;
global_pos += header.dict_size;
if (full_write(dst_fd, buffer, header.dict_size) != header.dict_size)
goto bad;
USE_DESKTOP(total_written += header.dict_size;)
}
len--;
} while (len != 0 && buffer_pos < header.dst_size);
}
}
if (full_write(dst_fd, buffer, buffer_pos) != buffer_pos) {
bad:
rc_free(rc);
return -1;
}
rc_free(rc);
USE_DESKTOP(total_written += buffer_pos;)
return USE_DESKTOP(total_written) + 0;
}
File diff suppressed because it is too large. Load diff
+17
View File
@@ -0,0 +1,17 @@
/* vi: set sw=4 ts=4: */
/*
* Copyright (C) 2002 by Glenn McGrath
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include <stdlib.h>
#include "unarchive.h"
/* Accept any non-null name, its not really a filter at all */
char filter_accept_all(archive_handle_t *archive_handle)
{
if (archive_handle->file_header->name)
return EXIT_SUCCESS;
return EXIT_FAILURE;
}
@@ -0,0 +1,19 @@
/* vi: set sw=4 ts=4: */
/*
* Copyright (C) 2002 by Glenn McGrath
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include <stdlib.h>
#include "unarchive.h"
/*
* Accept names that are in the accept list, ignoring reject list.
*/
char filter_accept_list(archive_handle_t *archive_handle)
{
if (find_list_entry(archive_handle->accept, archive_handle->file_header->name))
return EXIT_SUCCESS;
return EXIT_FAILURE;
}
@@ -0,0 +1,44 @@
/* vi: set sw=4 ts=4: */
/*
* Copyright (C) 2002 by Glenn McGrath
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "libbb.h"
#include "unarchive.h"
/*
* Reassign the subarchive metadata parser based on the filename extension
* e.g. if its a .tar.gz modify archive_handle->sub_archive to process a .tar.gz
* or if its a .tar.bz2 make archive_handle->sub_archive handle that
*/
char filter_accept_list_reassign(archive_handle_t *archive_handle)
{
/* Check the file entry is in the accept list */
if (find_list_entry(archive_handle->accept, archive_handle->file_header->name)) {
const char *name_ptr;
/* Extract the last 2 extensions */
name_ptr = strrchr(archive_handle->file_header->name, '.');
/* Modify the subarchive handler based on the extension */
#ifdef CONFIG_FEATURE_DEB_TAR_GZ
if (strcmp(name_ptr, ".gz") == 0) {
archive_handle->action_data_subarchive = get_header_tar_gz;
return EXIT_SUCCESS;
}
#endif
#ifdef CONFIG_FEATURE_DEB_TAR_BZ2
if (strcmp(name_ptr, ".bz2") == 0) {
archive_handle->action_data_subarchive = get_header_tar_bz2;
return EXIT_SUCCESS;
}
#endif
if (ENABLE_FEATURE_DEB_TAR_LZMA && !strcmp(name_ptr, ".lzma")) {
archive_handle->action_data_subarchive = get_header_tar_lzma;
return EXIT_SUCCESS;
}
}
return EXIT_FAILURE;
}
@@ -0,0 +1,33 @@
/* vi: set sw=4 ts=4: */
/*
* Copyright (C) 2002 by Glenn McGrath
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include <stdlib.h>
#include "unarchive.h"
/*
* Accept names that are in the accept list and not in the reject list
*/
char filter_accept_reject_list(archive_handle_t *archive_handle)
{
const char *key = archive_handle->file_header->name;
const llist_t *reject_entry = find_list_entry2(archive_handle->reject, key);
const llist_t *accept_entry;
/* If the key is in a reject list fail */
if (reject_entry) {
return EXIT_FAILURE;
}
accept_entry = find_list_entry2(archive_handle->accept, key);
/* Fail if an accept list was specified and the key wasnt in there */
if ((accept_entry == NULL) && archive_handle->accept) {
return EXIT_FAILURE;
}
/* Accepted */
return EXIT_SUCCESS;
}
+54
View File
@@ -0,0 +1,54 @@
/* vi: set sw=4 ts=4: */
/*
* Copyright (C) 2002 by Glenn McGrath
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include <fnmatch.h>
#include <stdlib.h>
#include "unarchive.h"
/* Find a string in a shell pattern list */
const llist_t *find_list_entry(const llist_t *list, const char *filename)
{
while (list) {
if (fnmatch(list->data, filename, 0) == 0) {
return list;
}
list = list->link;
}
return NULL;
}
/* Same, but compares only path components present in pattern
* (extra trailing path components in filename are assumed to match)
*/
const llist_t *find_list_entry2(const llist_t *list, const char *filename)
{
char buf[PATH_MAX];
int pattern_slash_cnt;
const char *c;
char *d;
while (list) {
c = list->data;
pattern_slash_cnt = 0;
while (*c)
if (*c++ == '/') pattern_slash_cnt++;
c = filename;
d = buf;
/* paranoia is better that buffer overflows */
while (*c && d != buf + sizeof(buf)-1) {
if (*c == '/' && --pattern_slash_cnt < 0)
break;
*d++ = *c++;
}
*d = '\0';
if (fnmatch(list->data, buf, 0) == 0) {
return list;
}
list = list->link;
}
return NULL;
}
+122
View File
@@ -0,0 +1,122 @@
/* vi: set sw=4 ts=4: */
/* Copyright 2001 Glenn McGrath.
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "libbb.h"
#include "unarchive.h"
char get_header_ar(archive_handle_t *archive_handle)
{
int err;
file_header_t *typed = archive_handle->file_header;
union {
char raw[60];
struct {
char name[16];
char date[12];
char uid[6];
char gid[6];
char mode[8];
char size[10];
char magic[2];
} formatted;
} ar;
#ifdef CONFIG_FEATURE_AR_LONG_FILENAMES
static char *ar_long_names;
static unsigned int ar_long_name_size;
#endif
/* dont use xread as we want to handle the error ourself */
if (read(archive_handle->src_fd, ar.raw, 60) != 60) {
/* End Of File */
return EXIT_FAILURE;
}
/* ar header starts on an even byte (2 byte aligned)
* '\n' is used for padding
*/
if (ar.raw[0] == '\n') {
/* fix up the header, we started reading 1 byte too early */
memmove(ar.raw, &ar.raw[1], 59);
ar.raw[59] = xread_char(archive_handle->src_fd);
archive_handle->offset++;
}
archive_handle->offset += 60;
/* align the headers based on the header magic */
if (ar.formatted.magic[0] != '`' || ar.formatted.magic[1] != '\n')
bb_error_msg_and_die("invalid ar header");
/* FIXME: more thorough routine would be in order here */
/* (we have something like that in tar) */
/* but for now we are lax. This code works because */
/* on misformatted numbers bb_strtou returns all-ones */
typed->mode = err = bb_strtou(ar.formatted.mode, NULL, 8);
if (err == -1) bb_error_msg_and_die("invalid ar header");
typed->mtime = err = bb_strtou(ar.formatted.date, NULL, 10);
if (err == -1) bb_error_msg_and_die("invalid ar header");
typed->uid = err = bb_strtou(ar.formatted.uid, NULL, 10);
if (err == -1) bb_error_msg_and_die("invalid ar header");
typed->gid = err = bb_strtou(ar.formatted.gid, NULL, 10);
if (err == -1) bb_error_msg_and_die("invalid ar header");
typed->size = err = bb_strtou(ar.formatted.size, NULL, 10);
if (err == -1) bb_error_msg_and_die("invalid ar header");
/* long filenames have '/' as the first character */
if (ar.formatted.name[0] == '/') {
#ifdef CONFIG_FEATURE_AR_LONG_FILENAMES
if (ar.formatted.name[1] == '/') {
/* If the second char is a '/' then this entries data section
* stores long filename for multiple entries, they are stored
* in static variable long_names for use in future entries */
ar_long_name_size = typed->size;
ar_long_names = xmalloc(ar_long_name_size);
xread(archive_handle->src_fd, ar_long_names, ar_long_name_size);
archive_handle->offset += ar_long_name_size;
/* This ar entries data section only contained filenames for other records
* they are stored in the static ar_long_names for future reference */
return get_header_ar(archive_handle); /* Return next header */
} else if (ar.formatted.name[1] == ' ') {
/* This is the index of symbols in the file for compilers */
data_skip(archive_handle);
archive_handle->offset += typed->size;
return get_header_ar(archive_handle); /* Return next header */
} else {
/* The number after the '/' indicates the offset in the ar data section
(saved in variable long_name) that conatains the real filename */
const unsigned int long_offset = atoi(&ar.formatted.name[1]);
if (long_offset >= ar_long_name_size) {
bb_error_msg_and_die("can't resolve long filename");
}
typed->name = xstrdup(ar_long_names + long_offset);
}
#else
bb_error_msg_and_die("long filenames not supported");
#endif
} else {
/* short filenames */
typed->name = xstrndup(ar.formatted.name, 16);
}
typed->name[strcspn(typed->name, " /")] = '\0';
if (archive_handle->filter(archive_handle) == EXIT_SUCCESS) {
archive_handle->action_header(typed);
if (archive_handle->sub_archive) {
while (archive_handle->action_data_subarchive(archive_handle->sub_archive) == EXIT_SUCCESS)
/* repeat */;
} else {
archive_handle->action_data(archive_handle);
}
} else {
data_skip(archive_handle);
}
archive_handle->offset += typed->size;
/* Set the file pointer to the correct spot, we may have been reading a compressed file */
lseek(archive_handle->src_fd, archive_handle->offset, SEEK_SET);
return EXIT_SUCCESS;
}
+160
View File
@@ -0,0 +1,160 @@
/* vi: set sw=4 ts=4: */
/* Copyright 2002 Laurence Anderson
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "libbb.h"
#include "unarchive.h"
typedef struct hardlinks_s {
char *name;
int inode;
struct hardlinks_s *next;
} hardlinks_t;
char get_header_cpio(archive_handle_t *archive_handle)
{
static hardlinks_t *saved_hardlinks = NULL;
static unsigned short pending_hardlinks = 0;
static int inode;
file_header_t *file_header = archive_handle->file_header;
char cpio_header[110];
int namesize;
char dummy[16];
int major, minor, nlink;
if (pending_hardlinks) { /* Deal with any pending hardlinks */
hardlinks_t *tmp, *oldtmp;
tmp = saved_hardlinks;
oldtmp = NULL;
file_header->link_name = file_header->name;
file_header->size = 0;
while (tmp) {
if (tmp->inode != inode) {
tmp = tmp->next;
continue;
}
file_header->name = tmp->name;
if (archive_handle->filter(archive_handle) == EXIT_SUCCESS) {
archive_handle->action_data(archive_handle);
archive_handle->action_header(archive_handle->file_header);
}
pending_hardlinks--;
oldtmp = tmp;
tmp = tmp->next;
free(oldtmp->name);
free(oldtmp);
if (oldtmp == saved_hardlinks)
saved_hardlinks = tmp;
}
file_header->name = file_header->link_name;
if (pending_hardlinks > 1) {
bb_error_msg("error resolving hardlink: archive made by GNU cpio 2.0-2.2?");
}
/* No more pending hardlinks, read next file entry */
pending_hardlinks = 0;
}
/* There can be padding before archive header */
data_align(archive_handle, 4);
if (archive_xread_all_eof(archive_handle, (unsigned char*)cpio_header, 110) == 0) {
return EXIT_FAILURE;
}
archive_handle->offset += 110;
if (strncmp(&cpio_header[0], "07070", 5) != 0
|| (cpio_header[5] != '1' && cpio_header[5] != '2')
) {
bb_error_msg_and_die("unsupported cpio format, use newc or crc");
}
{
unsigned long tmpsize;
sscanf(cpio_header, "%6c%8x%8x%8x%8x%8x%8lx%8lx%16c%8x%8x%8x%8c",
dummy, &inode, (unsigned int*)&file_header->mode,
(unsigned int*)&file_header->uid, (unsigned int*)&file_header->gid,
&nlink, &file_header->mtime, &tmpsize,
dummy, &major, &minor, &namesize, dummy);
file_header->size = tmpsize;
}
free(file_header->name);
file_header->name = xzalloc(namesize + 1);
/* Read in filename */
xread(archive_handle->src_fd, file_header->name, namesize);
archive_handle->offset += namesize;
/* Update offset amount and skip padding before file contents */
data_align(archive_handle, 4);
if (strcmp(file_header->name, "TRAILER!!!") == 0) {
/* Always round up */
printf("%d blocks\n", (int) (archive_handle->offset % 512 ?
archive_handle->offset / 512 + 1 :
archive_handle->offset / 512
));
if (saved_hardlinks) { /* Bummer - we still have unresolved hardlinks */
hardlinks_t *tmp = saved_hardlinks;
hardlinks_t *oldtmp = NULL;
while (tmp) {
bb_error_msg("%s not created: cannot resolve hardlink", tmp->name);
oldtmp = tmp;
tmp = tmp->next;
free(oldtmp->name);
free(oldtmp);
}
saved_hardlinks = NULL;
pending_hardlinks = 0;
}
return EXIT_FAILURE;
}
if (S_ISLNK(file_header->mode)) {
file_header->link_name = xzalloc(file_header->size + 1);
xread(archive_handle->src_fd, file_header->link_name, file_header->size);
archive_handle->offset += file_header->size;
file_header->size = 0; /* Stop possible seeks in future */
} else {
file_header->link_name = NULL;
}
if (nlink > 1 && !S_ISDIR(file_header->mode)) {
if (file_header->size == 0) { /* Put file on a linked list for later */
hardlinks_t *new = xmalloc(sizeof(hardlinks_t));
new->next = saved_hardlinks;
new->inode = inode;
/* name current allocated, freed later */
new->name = file_header->name;
file_header->name = NULL;
saved_hardlinks = new;
return EXIT_SUCCESS; /* Skip this one */
}
/* Found the file with data in */
pending_hardlinks = nlink;
}
file_header->device = makedev(major, minor);
if (archive_handle->filter(archive_handle) == EXIT_SUCCESS) {
archive_handle->action_data(archive_handle);
archive_handle->action_header(archive_handle->file_header);
} else {
data_skip(archive_handle);
}
archive_handle->offset += file_header->size;
free(file_header->link_name);
return EXIT_SUCCESS;
}
+277
View File
@@ -0,0 +1,277 @@
/* vi: set sw=4 ts=4: */
/* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*
* FIXME:
* In privileged mode if uname and gname map to a uid and gid then use the
* mapped value instead of the uid/gid values in tar header
*
* References:
* GNU tar and star man pages,
* Opengroup's ustar interchange format,
* http://www.opengroup.org/onlinepubs/007904975/utilities/pax.html
*/
#include "libbb.h"
#include "unarchive.h"
#if ENABLE_FEATURE_TAR_GNU_EXTENSIONS
static char *longname;
static char *linkname;
#else
enum {
longname = 0,
linkname = 0,
};
#endif
/* NB: _DESTROYS_ str[len] character! */
static unsigned long long getOctal(char *str, int len)
{
unsigned long long v;
/* Actually, tar header allows leading spaces also.
* Oh well, we will be liberal and skip this...
* The only downside probably is that we allow "-123" too :)
if (*str < '0' || *str > '7')
bb_error_msg_and_die("corrupted octal value in tar header");
*/
str[len] = '\0';
v = strtoull(str, &str, 8);
if (*str)
bb_error_msg_and_die("corrupted octal value in tar header");
return v;
}
#define GET_OCTAL(a) getOctal((a), sizeof(a))
void BUG_tar_header_size(void);
char get_header_tar(archive_handle_t *archive_handle)
{
static int end;
file_header_t *file_header = archive_handle->file_header;
struct {
/* ustar header, Posix 1003.1 */
char name[100]; /* 0-99 */
char mode[8]; /* 100-107 */
char uid[8]; /* 108-115 */
char gid[8]; /* 116-123 */
char size[12]; /* 124-135 */
char mtime[12]; /* 136-147 */
char chksum[8]; /* 148-155 */
char typeflag; /* 156-156 */
char linkname[100]; /* 157-256 */
char magic[6]; /* 257-262 */
char version[2]; /* 263-264 */
char uname[32]; /* 265-296 */
char gname[32]; /* 297-328 */
char devmajor[8]; /* 329-336 */
char devminor[8]; /* 337-344 */
char prefix[155]; /* 345-499 */
char padding[12]; /* 500-512 */
} tar;
char *cp;
int sum, i;
int parse_names;
if (sizeof(tar) != 512)
BUG_tar_header_size();
#if ENABLE_FEATURE_TAR_GNU_EXTENSIONS
again:
#endif
/* Align header */
data_align(archive_handle, 512);
again_after_align:
xread(archive_handle->src_fd, &tar, 512);
archive_handle->offset += 512;
/* If there is no filename its an empty header */
if (tar.name[0] == 0) {
if (end) {
/* This is the second consecutive empty header! End of archive!
* Read until the end to empty the pipe from gz or bz2
*/
while (full_read(archive_handle->src_fd, &tar, 512) == 512)
/* repeat */;
return EXIT_FAILURE;
}
end = 1;
return EXIT_SUCCESS;
}
end = 0;
/* Check header has valid magic, "ustar" is for the proper tar
* 0's are for the old tar format
*/
if (strncmp(tar.magic, "ustar", 5) != 0) {
#if ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY
if (memcmp(tar.magic, "\0\0\0\0", 5) != 0)
#endif
bb_error_msg_and_die("invalid tar magic");
}
/* Do checksum on headers */
sum = ' ' * sizeof(tar.chksum);
for (i = 0; i < 148 ; i++) {
sum += ((char*)&tar)[i];
}
for (i = 156; i < 512 ; i++) {
sum += ((char*)&tar)[i];
}
/* This field does not need special treatment (getOctal) */
if (sum != xstrtoul(tar.chksum, 8)) {
bb_error_msg_and_die("invalid tar header checksum");
}
/* 0 is reserved for high perf file, treat as normal file */
if (!tar.typeflag) tar.typeflag = '0';
parse_names = (tar.typeflag >= '0' && tar.typeflag <= '7');
/* getOctal trashes subsequent field, therefore we call it
* on fields in reverse order */
if (tar.devmajor[0]) {
unsigned minor = GET_OCTAL(tar.devminor);
unsigned major = GET_OCTAL(tar.devmajor);
file_header->device = makedev(major, minor);
}
file_header->link_name = NULL;
if (!linkname && parse_names && tar.linkname[0]) {
/* we trash magic[0] here, it's ok */
tar.linkname[sizeof(tar.linkname)] = '\0';
file_header->link_name = xstrdup(tar.linkname);
/* FIXME: what if we have non-link object with link_name? */
/* Will link_name be free()ed? */
}
file_header->mtime = GET_OCTAL(tar.mtime);
file_header->size = GET_OCTAL(tar.size);
file_header->gid = GET_OCTAL(tar.gid);
file_header->uid = GET_OCTAL(tar.uid);
/* Set bits 0-11 of the files mode */
file_header->mode = 07777 & GET_OCTAL(tar.mode);
file_header->name = NULL;
if (!longname && parse_names) {
/* we trash mode[0] here, it's ok */
tar.name[sizeof(tar.name)] = '\0';
if (tar.prefix[0]) {
/* and padding[0] */
tar.prefix[sizeof(tar.prefix)] = '\0';
file_header->name = concat_path_file(tar.prefix, tar.name);
} else
file_header->name = xstrdup(tar.name);
}
/* Set bits 12-15 of the files mode */
/* (typeflag was not trashed because chksum does not use getOctal) */
switch (tar.typeflag) {
/* busybox identifies hard links as being regular files with 0 size and a link name */
case '1':
file_header->mode |= S_IFREG;
break;
case '7':
/* case 0: */
case '0':
#if ENABLE_FEATURE_TAR_OLDGNU_COMPATIBILITY
if (last_char_is(file_header->name, '/')) {
file_header->mode |= S_IFDIR;
} else
#endif
file_header->mode |= S_IFREG;
break;
case '2':
file_header->mode |= S_IFLNK;
break;
case '3':
file_header->mode |= S_IFCHR;
break;
case '4':
file_header->mode |= S_IFBLK;
break;
case '5':
file_header->mode |= S_IFDIR;
break;
case '6':
file_header->mode |= S_IFIFO;
break;
#if ENABLE_FEATURE_TAR_GNU_EXTENSIONS
case 'L':
/* free: paranoia: tar with several consecutive longnames */
free(longname);
/* For paranoia reasons we allocate extra NUL char */
longname = xzalloc(file_header->size + 1);
/* We read ASCIZ string, including NUL */
xread(archive_handle->src_fd, longname, file_header->size);
archive_handle->offset += file_header->size;
/* return get_header_tar(archive_handle); */
/* gcc 4.1.1 didn't optimize it into jump */
/* so we will do it ourself, this also saves stack */
goto again;
case 'K':
free(linkname);
linkname = xzalloc(file_header->size + 1);
xread(archive_handle->src_fd, linkname, file_header->size);
archive_handle->offset += file_header->size;
/* return get_header_tar(archive_handle); */
goto again;
case 'D': /* GNU dump dir */
case 'M': /* Continuation of multi volume archive */
case 'N': /* Old GNU for names > 100 characters */
case 'S': /* Sparse file */
case 'V': /* Volume header */
#endif
case 'g': /* pax global header */
case 'x': { /* pax extended header */
off_t sz;
bb_error_msg("warning: skipping header '%c'", tar.typeflag);
sz = (file_header->size + 511) & ~(off_t)511;
archive_handle->offset += sz;
sz >>= 9; /* sz /= 512 but w/o contortions for signed div */
while (sz--)
xread(archive_handle->src_fd, &tar, 512);
/* return get_header_tar(archive_handle); */
goto again_after_align;
}
default:
bb_error_msg_and_die("unknown typeflag: 0x%x", tar.typeflag);
}
#if ENABLE_FEATURE_TAR_GNU_EXTENSIONS
if (longname) {
file_header->name = longname;
longname = NULL;
}
if (linkname) {
file_header->link_name = linkname;
linkname = NULL;
}
#endif
if (!strncmp(file_header->name, "/../"+1, 3)
|| strstr(file_header->name, "/../")
) {
bb_error_msg_and_die("name with '..' encountered: '%s'",
file_header->name);
}
/* Strip trailing '/' in directories */
/* Must be done after mode is set as '/' is used to check if it's a directory */
cp = last_char_is(file_header->name, '/');
if (archive_handle->filter(archive_handle) == EXIT_SUCCESS) {
archive_handle->action_header(archive_handle->file_header);
/* Note that we kill the '/' only after action_header() */
/* (like GNU tar 1.15.1: verbose mode outputs "dir/dir/") */
if (cp) *cp = '\0';
archive_handle->flags |= ARCHIVE_EXTRACT_QUIET;
archive_handle->action_data(archive_handle);
llist_add_to(&(archive_handle->passed), file_header->name);
} else {
data_skip(archive_handle);
free(file_header->name);
}
archive_handle->offset += file_header->size;
free(file_header->link_name);
/* Do not free(file_header->name)! */
return EXIT_SUCCESS;
}
@@ -0,0 +1,20 @@
/* vi: set sw=4 ts=4: */
/*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "libbb.h"
#include "unarchive.h"
char get_header_tar_bz2(archive_handle_t *archive_handle)
{
/* Can't lseek over pipes */
archive_handle->seek = seek_by_read;
archive_handle->src_fd = open_transformer(archive_handle->src_fd, uncompressStream);
archive_handle->offset = 0;
while (get_header_tar(archive_handle) == EXIT_SUCCESS) /**/;
/* Can only do one file at a time */
return EXIT_FAILURE;
}
+31
View File
@@ -0,0 +1,31 @@
/* vi: set sw=4 ts=4: */
/*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include <stdlib.h>
#include "libbb.h"
#include "unarchive.h"
char get_header_tar_gz(archive_handle_t *archive_handle)
{
unsigned char magic[2];
/* Can't lseek over pipes */
archive_handle->seek = seek_by_read;
xread(archive_handle->src_fd, &magic, 2);
if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) {
bb_error_msg_and_die("invalid gzip magic");
}
check_header_gzip(archive_handle->src_fd);
archive_handle->src_fd = open_transformer(archive_handle->src_fd, inflate_gunzip);
archive_handle->offset = 0;
while (get_header_tar(archive_handle) == EXIT_SUCCESS) /**/;
/* Can only do one file at a time */
return EXIT_FAILURE;
}
@@ -0,0 +1,22 @@
/* vi: set sw=4 ts=4: */
/*
* Small lzma deflate implementation.
* Copyright (C) 2006 Aurelien Jacobs <aurel@gnuage.org>
*
* Licensed under GPL v2, see file LICENSE in this tarball for details.
*/
#include "unarchive.h"
char get_header_tar_lzma(archive_handle_t * archive_handle)
{
/* Can't lseek over pipes */
archive_handle->seek = seek_by_read;
archive_handle->src_fd = open_transformer(archive_handle->src_fd, unlzma);
archive_handle->offset = 0;
while (get_header_tar(archive_handle) == EXIT_SUCCESS) /**/;
/* Can only do one file at a time */
return EXIT_FAILURE;
}
+11
View File
@@ -0,0 +1,11 @@
/* vi: set sw=4 ts=4: */
/*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include <stdio.h>
#include "unarchive.h"
void header_list(const file_header_t *file_header)
{
puts(file_header->name);
}
+10
View File
@@ -0,0 +1,10 @@
/* vi: set sw=4 ts=4: */
/*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include <stdio.h>
#include "unarchive.h"
void header_skip(const file_header_t *file_header ATTRIBUTE_UNUSED)
{
}
@@ -0,0 +1,31 @@
/* vi: set sw=4 ts=4: */
/*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "libbb.h"
#include "unarchive.h"
void header_verbose_list(const file_header_t *file_header)
{
struct tm *mtime = localtime(&(file_header->mtime));
printf("%s %d/%d %9"OFF_FMT"u %4u-%02u-%02u %02u:%02u:%02u %s",
bb_mode_string(file_header->mode),
file_header->uid,
file_header->gid,
file_header->size,
1900 + mtime->tm_year,
1 + mtime->tm_mon,
mtime->tm_mday,
mtime->tm_hour,
mtime->tm_min,
mtime->tm_sec,
file_header->name);
if (file_header->link_name) {
printf(" -> %s", file_header->link_name);
}
/* putchar isnt used anywhere else i dont think */
puts("");
}
+22
View File
@@ -0,0 +1,22 @@
/* vi: set sw=4 ts=4: */
/*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "libbb.h"
#include "unarchive.h"
archive_handle_t *init_handle(void)
{
archive_handle_t *archive_handle;
/* Initialize default values */
archive_handle = xzalloc(sizeof(archive_handle_t));
archive_handle->file_header = xzalloc(sizeof(file_header_t));
archive_handle->action_header = header_skip;
archive_handle->action_data = data_skip;
archive_handle->filter = filter_accept_all;
archive_handle->seek = seek_by_jump;
return archive_handle;
}
+44
View File
@@ -0,0 +1,44 @@
/* vi: set sw=4 ts=4: */
/*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include <stdlib.h>
#include <unistd.h>
#include "libbb.h"
#include "unarchive.h"
/* transformer(), more than meets the eye */
int open_transformer(int src_fd,
USE_DESKTOP(long long) int (*transformer)(int src_fd, int dst_fd))
{
int fd_pipe[2];
int pid;
if (pipe(fd_pipe) != 0) {
bb_perror_msg_and_die("can't create pipe");
}
pid = fork();
if (pid == -1) {
bb_perror_msg_and_die("fork failed");
}
if (pid == 0) {
/* child process */
close(fd_pipe[0]); /* We don't wan't to read from the parent */
// FIXME: error check?
transformer(src_fd, fd_pipe[1]);
close(fd_pipe[1]); /* Send EOF */
close(src_fd);
exit(0);
/* notreached */
}
/* parent process */
close(fd_pipe[1]); /* Don't want to write to the child */
return fd_pipe[0];
}
+24
View File
@@ -0,0 +1,24 @@
/* vi: set sw=4 ts=4: */
/*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include <sys/types.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include "libbb.h"
#include "unarchive.h"
void seek_by_jump(const archive_handle_t *archive_handle, const unsigned int amount)
{
if (lseek(archive_handle->src_fd, (off_t) amount, SEEK_CUR) == (off_t) -1) {
#ifdef CONFIG_FEATURE_UNARCHIVE_TAPE
if (errno == ESPIPE) {
seek_by_read(archive_handle, amount);
} else
#endif
bb_perror_msg_and_die("seek failure");
}
}
+18
View File
@@ -0,0 +1,18 @@
/* vi: set sw=4 ts=4: */
/*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include <stdlib.h>
#include "unarchive.h"
#include "libbb.h"
/* If we are reading through a pipe(), or from stdin then we can't lseek,
* we must read and discard the data to skip over it.
*/
void seek_by_read(const archive_handle_t *archive_handle, const unsigned int jump_size)
{
if (jump_size)
bb_copyfd_exact_size(archive_handle->src_fd, -1, jump_size);
}
+22
View File
@@ -0,0 +1,22 @@
/* vi: set sw=4 ts=4: */
/*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include "unarchive.h"
#include "libbb.h"
void unpack_ar_archive(archive_handle_t *ar_archive)
{
char magic[7];
xread(ar_archive->src_fd, magic, 7);
if (strncmp(magic, "!<arch>", 7) != 0) {
bb_error_msg_and_die("invalid ar magic");
}
ar_archive->offset += 7;
while (get_header_ar(ar_archive) == EXIT_SUCCESS);
}
+366
View File
@@ -0,0 +1,366 @@
/* vi: set sw=4 ts=4: */
/*
* Mini rpm applet for busybox
*
* Copyright (C) 2001,2002 by Laurence Anderson
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "busybox.h"
#include "unarchive.h"
#define RPM_HEADER_MAGIC "\216\255\350"
#define RPM_CHAR_TYPE 1
#define RPM_INT8_TYPE 2
#define RPM_INT16_TYPE 3
#define RPM_INT32_TYPE 4
/* #define RPM_INT64_TYPE 5 ---- These aren't supported (yet) */
#define RPM_STRING_TYPE 6
#define RPM_BIN_TYPE 7
#define RPM_STRING_ARRAY_TYPE 8
#define RPM_I18NSTRING_TYPE 9
#define TAG_NAME 1000
#define TAG_VERSION 1001
#define TAG_RELEASE 1002
#define TAG_SUMMARY 1004
#define TAG_DESCRIPTION 1005
#define TAG_BUILDTIME 1006
#define TAG_BUILDHOST 1007
#define TAG_SIZE 1009
#define TAG_VENDOR 1011
#define TAG_LICENSE 1014
#define TAG_PACKAGER 1015
#define TAG_GROUP 1016
#define TAG_URL 1020
#define TAG_PREIN 1023
#define TAG_POSTIN 1024
#define TAG_FILEFLAGS 1037
#define TAG_FILEUSERNAME 1039
#define TAG_FILEGROUPNAME 1040
#define TAG_SOURCERPM 1044
#define TAG_PREINPROG 1085
#define TAG_POSTINPROG 1086
#define TAG_PREFIXS 1098
#define TAG_DIRINDEXES 1116
#define TAG_BASENAMES 1117
#define TAG_DIRNAMES 1118
#define RPMFILE_CONFIG (1 << 0)
#define RPMFILE_DOC (1 << 1)
enum rpm_functions_e {
rpm_query = 1,
rpm_install = 2,
rpm_query_info = 4,
rpm_query_package = 8,
rpm_query_list = 16,
rpm_query_list_doc = 32,
rpm_query_list_config = 64
};
typedef struct {
uint32_t tag; /* 4 byte tag */
uint32_t type; /* 4 byte type */
uint32_t offset; /* 4 byte offset */
uint32_t count; /* 4 byte count */
} rpm_index;
static void *map;
static rpm_index **mytags;
static int tagcount;
static void extract_cpio_gz(int fd);
static rpm_index **rpm_gettags(int fd, int *num_tags);
static int bsearch_rpmtag(const void *key, const void *item);
static char *rpm_getstr(int tag, int itemindex);
static int rpm_getint(int tag, int itemindex);
static int rpm_getcount(int tag);
static void fileaction_dobackup(char *filename, int fileref);
static void fileaction_setowngrp(char *filename, int fileref);
static void loop_through_files(int filetag, void (*fileaction)(char *filename, int fileref));
int rpm_main(int argc, char **argv)
{
int opt = 0, func = 0, rpm_fd, offset;
const int pagesize = getpagesize();
while ((opt = getopt(argc, argv, "iqpldc")) != -1) {
switch (opt) {
case 'i': /* First arg: Install mode, with q: Information */
if (!func) func = rpm_install;
else func |= rpm_query_info;
break;
case 'q': /* First arg: Query mode */
if (func) bb_show_usage();
func = rpm_query;
break;
case 'p': /* Query a package */
func |= rpm_query_package;
break;
case 'l': /* List files in a package */
func |= rpm_query_list;
break;
case 'd': /* List doc files in a package (implies list) */
func |= rpm_query_list;
func |= rpm_query_list_doc;
break;
case 'c': /* List config files in a package (implies list) */
func |= rpm_query_list;
func |= rpm_query_list_config;
break;
default:
bb_show_usage();
}
}
argv += optind;
argc -= optind;
if (!argc) bb_show_usage();
while (*argv) {
rpm_fd = xopen(*argv++, O_RDONLY);
mytags = rpm_gettags(rpm_fd, &tagcount);
if (!mytags)
bb_error_msg_and_die("error reading rpm header");
offset = xlseek(rpm_fd, 0, SEEK_CUR);
/* Mimimum is one page */
map = mmap(0, offset > pagesize ? (offset + offset % pagesize) : pagesize, PROT_READ, MAP_PRIVATE, rpm_fd, 0);
if (func & rpm_install) {
/* Backup any config files */
loop_through_files(TAG_BASENAMES, fileaction_dobackup);
/* Extact the archive */
extract_cpio_gz(rpm_fd);
/* Set the correct file uid/gid's */
loop_through_files(TAG_BASENAMES, fileaction_setowngrp);
}
else if ((func & (rpm_query|rpm_query_package)) == (rpm_query|rpm_query_package)) {
if (!(func & (rpm_query_info|rpm_query_list))) {
/* If just a straight query, just give package name */
printf("%s-%s-%s\n", rpm_getstr(TAG_NAME, 0), rpm_getstr(TAG_VERSION, 0), rpm_getstr(TAG_RELEASE, 0));
}
if (func & rpm_query_info) {
/* Do the nice printout */
time_t bdate_time;
struct tm *bdate;
char bdatestring[50];
printf("Name : %-29sRelocations: %s\n", rpm_getstr(TAG_NAME, 0), rpm_getstr(TAG_PREFIXS, 0) ? rpm_getstr(TAG_PREFIXS, 0) : "(not relocateable)");
printf("Version : %-34sVendor: %s\n", rpm_getstr(TAG_VERSION, 0), rpm_getstr(TAG_VENDOR, 0) ? rpm_getstr(TAG_VENDOR, 0) : "(none)");
bdate_time = rpm_getint(TAG_BUILDTIME, 0);
bdate = localtime((time_t *) &bdate_time);
strftime(bdatestring, 50, "%a %d %b %Y %T %Z", bdate);
printf("Release : %-30sBuild Date: %s\n", rpm_getstr(TAG_RELEASE, 0), bdatestring);
printf("Install date: %-30sBuild Host: %s\n", "(not installed)", rpm_getstr(TAG_BUILDHOST, 0));
printf("Group : %-30sSource RPM: %s\n", rpm_getstr(TAG_GROUP, 0), rpm_getstr(TAG_SOURCERPM, 0));
printf("Size : %-33dLicense: %s\n", rpm_getint(TAG_SIZE, 0), rpm_getstr(TAG_LICENSE, 0));
printf("URL : %s\n", rpm_getstr(TAG_URL, 0));
printf("Summary : %s\n", rpm_getstr(TAG_SUMMARY, 0));
printf("Description :\n%s\n", rpm_getstr(TAG_DESCRIPTION, 0));
}
if (func & rpm_query_list) {
int count, it, flags;
count = rpm_getcount(TAG_BASENAMES);
for (it = 0; it < count; it++) {
flags = rpm_getint(TAG_FILEFLAGS, it);
switch (func & (rpm_query_list_doc|rpm_query_list_config)) {
case rpm_query_list_doc:
if (!(flags & RPMFILE_DOC)) continue;
break;
case rpm_query_list_config:
if (!(flags & RPMFILE_CONFIG)) continue;
break;
case rpm_query_list_doc|rpm_query_list_config:
if (!(flags & (RPMFILE_CONFIG|RPMFILE_DOC))) continue;
break;
}
printf("%s%s\n",
rpm_getstr(TAG_DIRNAMES, rpm_getint(TAG_DIRINDEXES, it)),
rpm_getstr(TAG_BASENAMES, it));
}
}
}
free(mytags);
}
return 0;
}
static void extract_cpio_gz(int fd) {
archive_handle_t *archive_handle;
unsigned char magic[2];
/* Initialise */
archive_handle = init_handle();
archive_handle->seek = seek_by_read;
//archive_handle->action_header = header_list;
archive_handle->action_data = data_extract_all;
archive_handle->flags |= ARCHIVE_PRESERVE_DATE;
archive_handle->flags |= ARCHIVE_CREATE_LEADING_DIRS;
archive_handle->src_fd = fd;
archive_handle->offset = 0;
xread(archive_handle->src_fd, &magic, 2);
if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) {
bb_error_msg_and_die("invalid gzip magic");
}
check_header_gzip(archive_handle->src_fd);
xchdir("/"); /* Install RPM's to root */
archive_handle->src_fd = open_transformer(archive_handle->src_fd, inflate_gunzip);
archive_handle->offset = 0;
while (get_header_cpio(archive_handle) == EXIT_SUCCESS)
/* loop */;
}
static rpm_index **rpm_gettags(int fd, int *num_tags)
{
/* We should never need mode than 200, and realloc later */
rpm_index **tags = xzalloc(200 * sizeof(struct rpmtag *));
int pass, tagindex = 0;
xlseek(fd, 96, SEEK_CUR); /* Seek past the unused lead */
/* 1st pass is the signature headers, 2nd is the main stuff */
for (pass = 0; pass < 2; pass++) {
struct {
char magic[3]; /* 3 byte magic: 0x8e 0xad 0xe8 */
uint8_t version; /* 1 byte version number */
uint32_t reserved; /* 4 bytes reserved */
uint32_t entries; /* Number of entries in header (4 bytes) */
uint32_t size; /* Size of store (4 bytes) */
} header;
rpm_index *tmpindex;
int storepos;
xread(fd, &header, sizeof(header));
if (strncmp((char *) &header.magic, RPM_HEADER_MAGIC, 3) != 0)
return NULL; /* Invalid magic */
if (header.version != 1)
return NULL; /* This program only supports v1 headers */
header.size = ntohl(header.size);
header.entries = ntohl(header.entries);
storepos = xlseek(fd,0,SEEK_CUR) + header.entries * 16;
while (header.entries--) {
tmpindex = tags[tagindex++] = xmalloc(sizeof(rpm_index));
xread(fd, tmpindex, sizeof(rpm_index));
tmpindex->tag = ntohl(tmpindex->tag);
tmpindex->type = ntohl(tmpindex->type);
tmpindex->count = ntohl(tmpindex->count);
tmpindex->offset = storepos + ntohl(tmpindex->offset);
if (pass==0)
tmpindex->tag -= 743;
}
xlseek(fd, header.size, SEEK_CUR); /* Seek past store */
/* Skip padding to 8 byte boundary after reading signature headers */
if (pass==0)
xlseek(fd, (8 - (xlseek(fd,0,SEEK_CUR) % 8)) % 8, SEEK_CUR);
}
tags = xrealloc(tags, tagindex * sizeof(struct rpmtag *)); /* realloc tags to save space */
*num_tags = tagindex;
return tags; /* All done, leave the file at the start of the gzipped cpio archive */
}
static int bsearch_rpmtag(const void *key, const void *item)
{
int *tag = (int *)key;
rpm_index **tmp = (rpm_index **) item;
return (*tag - tmp[0]->tag);
}
static int rpm_getcount(int tag)
{
rpm_index **found;
found = bsearch(&tag, mytags, tagcount, sizeof(struct rpmtag *), bsearch_rpmtag);
if (!found)
return 0;
return found[0]->count;
}
static char *rpm_getstr(int tag, int itemindex)
{
rpm_index **found;
found = bsearch(&tag, mytags, tagcount, sizeof(struct rpmtag *), bsearch_rpmtag);
if (!found || itemindex >= found[0]->count)
return NULL;
if (found[0]->type == RPM_STRING_TYPE || found[0]->type == RPM_I18NSTRING_TYPE || found[0]->type == RPM_STRING_ARRAY_TYPE) {
int n;
char *tmpstr = (char *) (map + found[0]->offset);
for (n=0; n < itemindex; n++)
tmpstr = tmpstr + strlen(tmpstr) + 1;
return tmpstr;
}
return NULL;
}
static int rpm_getint(int tag, int itemindex)
{
rpm_index **found;
int *tmpint; /* NB: using int8_t* would be easier to code */
/* gcc throws warnings here when sizeof(void*)!=sizeof(int) ...
* it's ok to ignore it because tag won't be used as a pointer */
found = bsearch(&tag, mytags, tagcount, sizeof(struct rpmtag *), bsearch_rpmtag);
if (!found || itemindex >= found[0]->count)
return -1;
tmpint = (int *) (map + found[0]->offset);
if (found[0]->type == RPM_INT32_TYPE) {
tmpint = (int *) ((char *) tmpint + itemindex*4);
/*return ntohl(*tmpint);*/
/* int can be != int32_t */
return ntohl(*(int32_t*)tmpint);
}
if (found[0]->type == RPM_INT16_TYPE) {
tmpint = (int *) ((char *) tmpint + itemindex*2);
/* ??? read int, and THEN ntohs() it?? */
/*return ntohs(*tmpint);*/
return ntohs(*(int16_t*)tmpint);
}
if (found[0]->type == RPM_INT8_TYPE) {
tmpint = (int *) ((char *) tmpint + itemindex);
/* ??? why we don't read byte here??? */
/*return ntohs(*tmpint);*/
return *(int8_t*)tmpint;
}
return -1;
}
static void fileaction_dobackup(char *filename, int fileref)
{
struct stat oldfile;
int stat_res;
char *newname;
if (rpm_getint(TAG_FILEFLAGS, fileref) & RPMFILE_CONFIG) {
/* Only need to backup config files */
stat_res = lstat(filename, &oldfile);
if (stat_res == 0 && S_ISREG(oldfile.st_mode)) {
/* File already exists - really should check MD5's etc to see if different */
newname = xasprintf("%s.rpmorig", filename);
copy_file(filename, newname, FILEUTILS_RECUR | FILEUTILS_PRESERVE_STATUS);
remove_file(filename, FILEUTILS_RECUR | FILEUTILS_FORCE);
free(newname);
}
}
}
static void fileaction_setowngrp(char *filename, int fileref)
{
int uid, gid;
uid = xuname2uid(rpm_getstr(TAG_FILEUSERNAME, fileref));
gid = xgroup2gid(rpm_getstr(TAG_FILEGROUPNAME, fileref));
chown(filename, uid, gid);
}
static void loop_through_files(int filetag, void (*fileaction)(char *filename, int fileref))
{
int count = 0;
while (rpm_getstr(filetag, count)) {
char* filename = xasprintf("%s%s",
rpm_getstr(TAG_DIRNAMES, rpm_getint(TAG_DIRINDEXES, count)),
rpm_getstr(TAG_BASENAMES, count));
fileaction(filename, count++);
free(filename);
}
}
+89
View File
@@ -0,0 +1,89 @@
/* vi: set sw=4 ts=4: */
/*
* Mini rpm2cpio implementation for busybox
*
* Copyright (C) 2001 by Laurence Anderson
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "busybox.h"
#include "unarchive.h"
#define RPM_MAGIC "\355\253\356\333"
#define RPM_HEADER_MAGIC "\216\255\350"
struct rpm_lead {
unsigned char magic[4];
uint8_t major, minor;
uint16_t type;
uint16_t archnum;
char name[66];
uint16_t osnum;
uint16_t signature_type;
char reserved[16];
};
struct rpm_header {
char magic[3]; /* 3 byte magic: 0x8e 0xad 0xe8 */
uint8_t version; /* 1 byte version number */
uint32_t reserved; /* 4 bytes reserved */
uint32_t entries; /* Number of entries in header (4 bytes) */
uint32_t size; /* Size of store (4 bytes) */
};
static void skip_header(int rpm_fd)
{
struct rpm_header header;
xread(rpm_fd, &header, sizeof(struct rpm_header));
if (strncmp((char *) &header.magic, RPM_HEADER_MAGIC, 3) != 0) {
bb_error_msg_and_die("invalid RPM header magic"); /* Invalid magic */
}
if (header.version != 1) {
bb_error_msg_and_die("unsupported RPM header version"); /* This program only supports v1 headers */
}
header.entries = ntohl(header.entries);
header.size = ntohl(header.size);
lseek (rpm_fd, 16 * header.entries, SEEK_CUR); /* Seek past index entries */
lseek (rpm_fd, header.size, SEEK_CUR); /* Seek past store */
}
/* No getopt required */
int rpm2cpio_main(int argc, char **argv)
{
struct rpm_lead lead;
int rpm_fd;
unsigned char magic[2];
if (argc == 1) {
rpm_fd = STDIN_FILENO;
} else {
rpm_fd = xopen(argv[1], O_RDONLY);
}
xread(rpm_fd, &lead, sizeof(struct rpm_lead));
if (strncmp((char *) &lead.magic, RPM_MAGIC, 4) != 0) {
bb_error_msg_and_die("invalid RPM magic"); /* Just check the magic, the rest is irrelevant */
}
/* Skip the signature header */
skip_header(rpm_fd);
lseek(rpm_fd, (8 - (lseek(rpm_fd, 0, SEEK_CUR) % 8)) % 8, SEEK_CUR);
/* Skip the main header */
skip_header(rpm_fd);
xread(rpm_fd, &magic, 2);
if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) {
bb_error_msg_and_die("invalid gzip magic");
}
check_header_gzip(rpm_fd);
if (inflate_gunzip(rpm_fd, STDOUT_FILENO) < 0) {
bb_error_msg("error inflating");
}
close(rpm_fd);
return 0;
}
+763 -1033
View File
File diff suppressed because it is too large. Load diff
+94
View File
@@ -0,0 +1,94 @@
/* vi: set sw=4 ts=4: */
/*
* Uncompress applet for busybox (c) 2002 Glenn McGrath
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "busybox.h"
#include "unarchive.h"
#define GUNZIP_TO_STDOUT 1
#define GUNZIP_FORCE 2
int uncompress_main(int argc, char **argv)
{
int status = EXIT_SUCCESS;
unsigned long flags;
flags = getopt32(argc, argv, "cf");
while (optind < argc) {
char *compressed_file = argv[optind++];
char *delete_path = NULL;
char *uncompressed_file = NULL;
int src_fd;
int dst_fd;
if (LONE_DASH(compressed_file)) {
src_fd = STDIN_FILENO;
flags |= GUNZIP_TO_STDOUT;
} else {
src_fd = xopen(compressed_file, O_RDONLY);
}
/* Check that the input is sane. */
if (isatty(src_fd) && ((flags & GUNZIP_FORCE) == 0)) {
bb_error_msg_and_die
("compressed data not read from terminal. Use -f to force it.");
}
/* Set output filename and number */
if (flags & GUNZIP_TO_STDOUT) {
dst_fd = STDOUT_FILENO;
} else {
struct stat stat_buf;
char *extension;
uncompressed_file = xstrdup(compressed_file);
extension = strrchr(uncompressed_file, '.');
if (!extension || (strcmp(extension, ".Z") != 0)) {
bb_error_msg_and_die("invalid extension");
}
*extension = '\0';
/* Open output file */
xstat(compressed_file, &stat_buf);
dst_fd = xopen3(uncompressed_file,
O_WRONLY | O_CREAT | O_TRUNC,
stat_buf.st_mode);
/* If unzip succeeds remove the old file */
delete_path = compressed_file;
}
/* do the decompression, and cleanup */
if ((xread_char(src_fd) != 0x1f) || (xread_char(src_fd) != 0x9d)) {
bb_error_msg_and_die("invalid magic");
}
status = uncompress(src_fd, dst_fd);
if ((status != EXIT_SUCCESS) && (uncompressed_file)) {
/* Unzip failed, remove the uncomressed file instead of compressed file */
delete_path = uncompressed_file;
}
if (dst_fd != STDOUT_FILENO) {
close(dst_fd);
}
if (src_fd != STDIN_FILENO) {
close(src_fd);
}
/* delete_path will be NULL if in test mode or from stdin */
if (delete_path && (unlink(delete_path) == -1)) {
bb_error_msg_and_die("cannot remove %s", delete_path);
}
free(uncompressed_file);
}
return status;
}
+64
View File
@@ -0,0 +1,64 @@
/* vi: set sw=4 ts=4: */
/*
* Small lzma deflate implementation.
* Copyright (C) 2006 Aurelien Jacobs <aurel@gnuage.org>
*
* Based on bunzip.c from busybox
*
* Licensed under GPL v2, see file LICENSE in this tarball for details.
*/
/* Why our g[un]zip/bunzip2 are so ugly compared to this beauty? */
#include "busybox.h"
#include "unarchive.h"
#define UNLZMA_OPT_STDOUT 1
int unlzma_main(int argc, char **argv)
{
USE_DESKTOP(long long) int status;
char *filename;
unsigned opt;
int src_fd, dst_fd;
opt = getopt32(argc, argv, "c");
/* Set input filename and number */
filename = argv[optind];
if (filename && NOT_LONE_DASH(filename)) {
/* Open input file */
src_fd = xopen(filename, O_RDONLY);
} else {
src_fd = STDIN_FILENO;
filename = 0;
}
/* if called as lzmacat force the stdout flag */
if ((opt & UNLZMA_OPT_STDOUT) || applet_name[4] == 'c')
filename = 0;
if (filename) {
struct stat stat_buf;
/* bug: char *extension = filename + strlen(filename) - 5; */
char *extension = strrchr(filename, '.');
if (!extension || strcmp(extension, ".lzma") != 0) {
bb_error_msg_and_die("invalid extension");
}
xstat(filename, &stat_buf);
*extension = '\0';
dst_fd = xopen3(filename, O_WRONLY | O_CREAT | O_TRUNC,
stat_buf.st_mode);
} else
dst_fd = STDOUT_FILENO;
status = unlzma(src_fd, dst_fd);
if (filename) {
if (status >= 0) /* if success delete src, else delete dst */
filename[strlen(filename)] = '.';
if (unlink(filename) < 0) {
bb_error_msg_and_die("cannot remove %s", filename);
}
}
return (status < 0);
}
+375
View File
@@ -0,0 +1,375 @@
/* vi: set sw=4 ts=4: */
/*
* Mini unzip implementation for busybox
*
* Copyright (C) 2004 by Ed Clark
*
* Loosely based on original busybox unzip applet by Laurence Anderson.
* All options and features should work in this version.
*
* Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
*/
/* For reference see
* http://www.pkware.com/company/standards/appnote/
* http://www.info-zip.org/pub/infozip/doc/appnote-iz-latest.zip
*/
/* TODO
* Endian issues
* Zip64 + other methods
* Improve handling of zip format, ie.
* - deferred CRC, comp. & uncomp. lengths (zip header flags bit 3)
* - unix file permissions, etc.
* - central directory
*/
#include "busybox.h"
#include "unarchive.h"
#define ZIP_FILEHEADER_MAGIC SWAP_LE32(0x04034b50)
#define ZIP_CDS_MAGIC SWAP_LE32(0x02014b50)
#define ZIP_CDS_END_MAGIC SWAP_LE32(0x06054b50)
#define ZIP_DD_MAGIC SWAP_LE32(0x08074b50)
typedef union {
unsigned char raw[26];
struct {
unsigned short version; /* 0-1 */
unsigned short flags; /* 2-3 */
unsigned short method; /* 4-5 */
unsigned short modtime; /* 6-7 */
unsigned short moddate; /* 8-9 */
unsigned int crc32 ATTRIBUTE_PACKED; /* 10-13 */
unsigned int cmpsize ATTRIBUTE_PACKED; /* 14-17 */
unsigned int ucmpsize ATTRIBUTE_PACKED; /* 18-21 */
unsigned short filename_len; /* 22-23 */
unsigned short extra_len; /* 24-25 */
} formatted ATTRIBUTE_PACKED;
} zip_header_t;
static void unzip_skip(int fd, off_t skip)
{
if (lseek(fd, skip, SEEK_CUR) == (off_t)-1) {
if (errno != ESPIPE)
bb_error_msg_and_die("seek failure");
bb_copyfd_exact_size(fd, -1, skip);
}
}
static void unzip_create_leading_dirs(char *fn)
{
/* Create all leading directories */
char *name = xstrdup(fn);
if (bb_make_directory(dirname(name), 0777, FILEUTILS_RECUR)) {
bb_error_msg_and_die("exiting"); /* bb_make_directory is noisy */
}
free(name);
}
static int unzip_extract(zip_header_t *zip_header, int src_fd, int dst_fd)
{
if (zip_header->formatted.method == 0) {
/* Method 0 - stored (not compressed) */
off_t size = zip_header->formatted.ucmpsize;
if (size)
bb_copyfd_exact_size(src_fd, dst_fd, size);
} else {
/* Method 8 - inflate */
inflate_unzip_result res;
/* err = */ inflate_unzip(&res, zip_header->formatted.cmpsize, src_fd, dst_fd);
// we should check for -1 error return
/* Validate decompression - crc */
if (zip_header->formatted.crc32 != (res.crc ^ 0xffffffffL)) {
bb_error_msg("invalid compressed data--%s error", "crc");
return 1;
}
/* Validate decompression - size */
if (zip_header->formatted.ucmpsize != res.bytes_out) {
bb_error_msg("invalid compressed data--%s error", "length");
return 1;
}
}
return 0;
}
int unzip_main(int argc, char **argv)
{
zip_header_t zip_header;
enum {v_silent, v_normal, v_list} verbosity = v_normal;
enum {o_prompt, o_never, o_always} overwrite = o_prompt;
unsigned int total_size = 0;
unsigned int total_entries = 0;
int src_fd = -1, dst_fd = -1;
char *src_fn = NULL, *dst_fn = NULL;
llist_t *zaccept = NULL;
llist_t *zreject = NULL;
char *base_dir = NULL;
int failed, i, opt, opt_range = 0, list_header_done = 0;
char key_buf[512];
struct stat stat_buf;
while ((opt = getopt(argc, argv, "-d:lnopqx")) != -1) {
switch (opt_range) {
case 0: /* Options */
switch (opt) {
case 'l': /* List */
verbosity = v_list;
break;
case 'n': /* Never overwrite existing files */
overwrite = o_never;
break;
case 'o': /* Always overwrite existing files */
overwrite = o_always;
break;
case 'p': /* Extract files to stdout and fall through to set verbosity */
dst_fd = STDOUT_FILENO;
case 'q': /* Be quiet */
verbosity = (verbosity == v_normal) ? v_silent : verbosity;
break;
case 1 : /* The zip file */
src_fn = xstrndup(optarg, strlen(optarg)+4);
opt_range++;
break;
default:
bb_show_usage();
}
break;
case 1: /* Include files */
if (opt == 1) {
llist_add_to(&zaccept, optarg);
} else if (opt == 'd') {
base_dir = optarg;
opt_range += 2;
} else if (opt == 'x') {
opt_range++;
} else {
bb_show_usage();
}
break;
case 2 : /* Exclude files */
if (opt == 1) {
llist_add_to(&zreject, optarg);
} else if (opt == 'd') { /* Extract to base directory */
base_dir = optarg;
opt_range++;
} else {
bb_show_usage();
}
break;
default:
bb_show_usage();
}
}
if (src_fn == NULL) {
bb_show_usage();
}
/* Open input file */
if (LONE_DASH(src_fn)) {
src_fd = STDIN_FILENO;
/* Cannot use prompt mode since zip data is arriving on STDIN */
overwrite = (overwrite == o_prompt) ? o_never : overwrite;
} else {
static const char *const extn[] = {"", ".zip", ".ZIP"};
int orig_src_fn_len = strlen(src_fn);
for (i = 0; (i < 3) && (src_fd == -1); i++) {
strcpy(src_fn + orig_src_fn_len, extn[i]);
src_fd = open(src_fn, O_RDONLY);
}
if (src_fd == -1) {
src_fn[orig_src_fn_len] = 0;
bb_error_msg_and_die("cannot open %s, %s.zip, %s.ZIP", src_fn, src_fn, src_fn);
}
}
/* Change dir if necessary */
if (base_dir)
xchdir(base_dir);
if (verbosity != v_silent)
printf("Archive: %s\n", src_fn);
failed = 0;
while (1) {
unsigned int magic;
/* Check magic number */
xread(src_fd, &magic, 4);
if (magic == ZIP_CDS_MAGIC) {
break;
} else if (magic != ZIP_FILEHEADER_MAGIC) {
bb_error_msg_and_die("invalid zip magic %08X", magic);
}
/* Read the file header */
xread(src_fd, zip_header.raw, 26);
zip_header.formatted.version = SWAP_LE32(zip_header.formatted.version);
zip_header.formatted.flags = SWAP_LE32(zip_header.formatted.flags);
zip_header.formatted.method = SWAP_LE32(zip_header.formatted.method);
zip_header.formatted.modtime = SWAP_LE32(zip_header.formatted.modtime);
zip_header.formatted.moddate = SWAP_LE32(zip_header.formatted.moddate);
zip_header.formatted.crc32 = SWAP_LE32(zip_header.formatted.crc32);
zip_header.formatted.cmpsize = SWAP_LE32(zip_header.formatted.cmpsize);
zip_header.formatted.ucmpsize = SWAP_LE32(zip_header.formatted.ucmpsize);
zip_header.formatted.filename_len = SWAP_LE32(zip_header.formatted.filename_len);
zip_header.formatted.extra_len = SWAP_LE32(zip_header.formatted.extra_len);
if ((zip_header.formatted.method != 0) && (zip_header.formatted.method != 8)) {
bb_error_msg_and_die("unsupported compression method %d", zip_header.formatted.method);
}
/* Read filename */
free(dst_fn);
dst_fn = xzalloc(zip_header.formatted.filename_len + 1);
xread(src_fd, dst_fn, zip_header.formatted.filename_len);
/* Skip extra header bytes */
unzip_skip(src_fd, zip_header.formatted.extra_len);
if ((verbosity == v_list) && !list_header_done){
puts(" Length Date Time Name\n"
" -------- ---- ---- ----");
list_header_done = 1;
}
/* Filter zip entries */
if (find_list_entry(zreject, dst_fn) ||
(zaccept && !find_list_entry(zaccept, dst_fn))) { /* Skip entry */
i = 'n';
} else { /* Extract entry */
total_size += zip_header.formatted.ucmpsize;
if (verbosity == v_list) { /* List entry */
unsigned int dostime = zip_header.formatted.modtime | (zip_header.formatted.moddate << 16);
printf("%9u %02u-%02u-%02u %02u:%02u %s\n",
zip_header.formatted.ucmpsize,
(dostime & 0x01e00000) >> 21,
(dostime & 0x001f0000) >> 16,
(((dostime & 0xfe000000) >> 25) + 1980) % 100,
(dostime & 0x0000f800) >> 11,
(dostime & 0x000007e0) >> 5,
dst_fn);
total_entries++;
i = 'n';
} else if (dst_fd == STDOUT_FILENO) { /* Extracting to STDOUT */
i = -1;
} else if (last_char_is(dst_fn, '/')) { /* Extract directory */
if (stat(dst_fn, &stat_buf) == -1) {
if (errno != ENOENT) {
bb_perror_msg_and_die("cannot stat '%s'",dst_fn);
}
if (verbosity == v_normal) {
printf(" creating: %s\n", dst_fn);
}
unzip_create_leading_dirs(dst_fn);
if (bb_make_directory(dst_fn, 0777, 0)) {
bb_error_msg_and_die("exiting");
}
} else {
if (!S_ISDIR(stat_buf.st_mode)) {
bb_error_msg_and_die("'%s' exists but is not directory", dst_fn);
}
}
i = 'n';
} else { /* Extract file */
_check_file:
if (stat(dst_fn, &stat_buf) == -1) { /* File does not exist */
if (errno != ENOENT) {
bb_perror_msg_and_die("cannot stat '%s'",dst_fn);
}
i = 'y';
} else { /* File already exists */
if (overwrite == o_never) {
i = 'n';
} else if (S_ISREG(stat_buf.st_mode)) { /* File is regular file */
if (overwrite == o_always) {
i = 'y';
} else {
printf("replace %s? [y]es, [n]o, [A]ll, [N]one, [r]ename: ", dst_fn);
if (!fgets(key_buf, 512, stdin)) {
bb_perror_msg_and_die("cannot read input");
}
i = key_buf[0];
}
} else { /* File is not regular file */
bb_error_msg_and_die("'%s' exists but is not regular file",dst_fn);
}
}
}
}
switch (i) {
case 'A':
overwrite = o_always;
case 'y': /* Open file and fall into unzip */
unzip_create_leading_dirs(dst_fn);
dst_fd = xopen(dst_fn, O_WRONLY | O_CREAT | O_TRUNC);
case -1: /* Unzip */
if (verbosity == v_normal) {
printf(" inflating: %s\n", dst_fn);
}
if (unzip_extract(&zip_header, src_fd, dst_fd)) {
failed = 1;
}
if (dst_fd != STDOUT_FILENO) {
/* closing STDOUT is potentially bad for future business */
close(dst_fd);
}
break;
case 'N':
overwrite = o_never;
case 'n':
/* Skip entry data */
unzip_skip(src_fd, zip_header.formatted.cmpsize);
break;
case 'r':
/* Prompt for new name */
printf("new name: ");
if (!fgets(key_buf, 512, stdin)) {
bb_perror_msg_and_die("cannot read input");
}
free(dst_fn);
dst_fn = xstrdup(key_buf);
chomp(dst_fn);
goto _check_file;
default:
printf("error: invalid response [%c]\n",(char)i);
goto _check_file;
}
/* Data descriptor section */
if (zip_header.formatted.flags & 4) {
/* skip over duplicate crc, compressed size and uncompressed size */
unzip_skip(src_fd, 12);
}
}
if (verbosity == v_list) {
printf(" -------- -------\n"
"%9d %d files\n", total_size, total_entries);
}
return failed;
}
-50
View File
@@ -1,50 +0,0 @@
/* vi: set sw=4 ts=4: */
/*
* Mini basename implementation for busybox
*
* Copyright (C) 1999,2000,2001 by Lineo, inc.
* Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "busybox.h"
#include <stdlib.h>
#include <string.h>
extern int basename_main(int argc, char **argv)
{
int m, n;
char *s;
if ((argc < 2) || (**(argv + 1) == '-')) {
usage(basename_usage);
}
argv++;
s = get_last_path_component(*argv);
if (argc>2) {
argv++;
n = strlen(*argv);
m = strlen(s);
if (m>=n && strncmp(s+m-n, *argv, n)==0)
s[m-n] = '\0';
}
printf("%s\n", s);
return EXIT_SUCCESS;
}
-205
View File
@@ -1,205 +0,0 @@
/* vi: set sw=4 ts=4: */
#include "busybox.h"
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
#undef APPLET
#undef APPLET_NOUSAGE
#undef PROTOTYPES
#include "applets.h"
#define bb_need_full_version
#define BB_DECLARE_EXTERN
#include "messages.c"
static int been_there_done_that = 0;
const char *applet_name;
#ifdef BB_FEATURE_INSTALLER
/*
* directory table
* this should be consistent w/ the enum, busybox.h::Location,
* or else...
*/
static char* install_dir[] = {
"/",
"/bin",
"/sbin",
"/usr/bin",
"/usr/sbin",
};
/* abstract link() */
typedef int (*__link_f)(const char *, const char *);
/*
* Where in the filesystem is this busybox?
* [return]
* malloc'd string w/ full pathname of busybox's location
* NULL on failure
*/
static char *busybox_fullpath()
{
pid_t pid;
char path[256];
char proc[256];
int len;
pid = getpid();
sprintf(proc, "/proc/%d/exe", pid);
len = readlink(proc, path, 256);
if (len != -1) {
path[len] = 0;
} else {
perror_msg("%s", proc);
return NULL;
}
return strdup(path);
}
/* create (sym)links for each applet */
static void install_links(const char *busybox, int use_symbolic_links)
{
__link_f Link = link;
char command[256];
int i;
int rc;
if (use_symbolic_links)
Link = symlink;
for (i = 0; applets[i].name != NULL; i++) {
sprintf ( command, "%s/%s",
install_dir[applets[i].location], applets[i].name);
rc = Link(busybox, command);
if (rc) {
perror_msg("%s", command);
}
}
}
#endif /* BB_FEATURE_INSTALLER */
int main(int argc, char **argv)
{
struct BB_applet search_applet, *applet;
const char *s;
for (s = applet_name = argv[0]; *s != '\0';) {
if (*s++ == '/')
applet_name = s;
}
#ifdef BB_SH
/* Add in a special case hack -- whenever **argv == '-'
* (i.e. '-su' or '-sh') always invoke the shell */
if (**argv == '-' && *(*argv+1)!= '-') {
exit(((*(shell_main)) (argc, argv)));
}
#endif
/* Do a binary search to find the applet entry given the name. */
search_applet.name = applet_name;
applet = bsearch(&search_applet, applets, NUM_APPLETS,
sizeof(struct BB_applet), applet_name_compare);
if (applet != NULL) {
if (applet->usage && argv[1] && strcmp(argv[1], "--help") == 0)
usage(applet->usage);
exit((*(applet->main)) (argc, argv));
}
error_msg_and_die("applet not found\n");
}
int busybox_main(int argc, char **argv)
{
int col = 0, len, i;
#ifdef BB_FEATURE_INSTALLER
/*
* This style of argument parsing doesn't scale well
* in the event that busybox starts wanting more --options.
* If someone has a cleaner approach, by all means implement it.
*/
if (argc > 1 && (strcmp(argv[1], "--install") == 0)) {
int use_symbolic_links = 0;
int rc = 0;
char *busybox;
/* to use symlinks, or not to use symlinks... */
if (argc > 2) {
if ((strcmp(argv[2], "-s") == 0)) {
use_symbolic_links = 1;
}
}
/* link */
busybox = busybox_fullpath();
if (busybox) {
install_links(busybox, use_symbolic_links);
free(busybox);
} else {
rc = 1;
}
return rc;
}
#endif /* BB_FEATURE_INSTALLER */
argc--;
/* If we've already been here once, exit now */
if (been_there_done_that == 1 || argc < 1) {
const struct BB_applet *a = applets;
fprintf(stderr, "%s\n\n"
"Usage: busybox [function] [arguments]...\n"
" or: [function] [arguments]...\n\n"
"\tBusyBox is a multi-call binary that combines many common Unix\n"
"\tutilities into a single executable. Most people will create a\n"
"\tlink to busybox for each function they wish to use, and BusyBox\n"
"\twill act like whatever it was invoked as.\n"
"\nCurrently defined functions:\n", full_version);
while (a->name != 0) {
col +=
fprintf(stderr, "%s%s", ((col == 0) ? "\t" : ", "),
(a++)->name);
if (col > 60 && a->name != 0) {
fprintf(stderr, ",\n");
col = 0;
}
}
fprintf(stderr, "\n\n");
exit(-1);
}
/* Flag that we've been here already */
been_there_done_that = 1;
/* Move the command line down a notch */
len = argv[argc] + strlen(argv[argc]) - argv[1];
memmove(argv[0], argv[1], len);
memset(argv[0] + len, 0, argv[1] - argv[0]);
/* Fix up the argv pointers */
len = argv[1] - argv[0];
memmove(argv, argv + 1, sizeof(char *) * (argc + 1));
for (i = 0; i < argc; i++)
argv[i] -= len;
return (main(argc, argv));
}
/*
Local Variables:
c-file-style: "linux"
c-basic-offset: 4
tab-width: 4
End:
*/
-247
View File
@@ -1,247 +0,0 @@
/* vi: set sw=4 ts=4: */
/*
* Busybox main internal header file
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Based in part on code from sash, Copyright (c) 1999 by David I. Bell
* Permission has been granted to redistribute this code under the GPL.
*
*/
#ifndef _BB_INTERNAL_H_
#define _BB_INTERNAL_H_ 1
#include "Config.h"
#include <stdio.h>
#include <stdarg.h>
#include <sys/stat.h>
#include <sys/types.h>
#ifdef DMALLOC
#include "dmalloc.h"
#endif
/* Some useful definitions */
#define FALSE ((int) 0)
#define TRUE ((int) 1)
#define SKIP ((int) 2)
/* for mtab.c */
#define MTAB_GETMOUNTPT '1'
#define MTAB_GETDEVICE '2'
#define BUF_SIZE 8192
#define EXPAND_ALLOC 1024
static inline int is_decimal(ch) { return ((ch >= '0') && (ch <= '9')); }
static inline int is_octal(ch) { return ((ch >= '0') && (ch <= '7')); }
/* Macros for min/max. */
#ifndef MIN
#define MIN(a,b) (((a)<(b))?(a):(b))
#endif
#ifndef MAX
#define MAX(a,b) (((a)>(b))?(a):(b))
#endif
enum Location {
_BB_DIR_ROOT = 0,
_BB_DIR_BIN,
_BB_DIR_SBIN,
_BB_DIR_USR_BIN,
_BB_DIR_USR_SBIN
};
struct BB_applet {
const char* name;
int (*main)(int argc, char** argv);
enum Location location;
const char* usage;
};
/* From busybox.c */
extern const struct BB_applet applets[];
/* Automagically pull in all the applet function prototypes and
* applet usage strings. These are all of the form:
* extern int foo_main(int argc, char **argv);
* extern const char foo_usage[];
* These are all autogenerated from the set of currently defined applets.
*/
#define PROTOTYPES
#include "applets.h"
#undef PROTOTYPES
extern const char *applet_name;
extern int applet_name_compare(const void *x, const void *y);
extern void usage(const char *usage) __attribute__ ((noreturn));
extern void error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
extern void error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
extern void perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
extern void perror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
const char *mode_string(int mode);
const char *time_string(time_t timeVal);
int is_directory(const char *name, const int followLinks, struct stat *statBuf);
int isDevice(const char *name);
typedef struct ino_dev_hash_bucket_struct {
struct ino_dev_hash_bucket_struct *next;
ino_t ino;
dev_t dev;
char name[1];
} ino_dev_hashtable_bucket_t;
int is_in_ino_dev_hashtable(const struct stat *statbuf, char **name);
void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name);
void reset_ino_dev_hashtable(void);
int copy_file(const char *srcName, const char *destName,
int setModes, int followLinks, int forceFlag);
int copy_file_chunk(int srcFd, int dstFd, size_t remaining);
char *buildName(const char *dirName, const char *fileName);
int makeString(int argc, const char **argv, char *buf, int bufLen);
char *getChunk(int size);
char *chunkstrdup(const char *str);
void freeChunks(void);
ssize_t safe_read(int fd, void *buf, size_t count);
int full_write(int fd, const char *buf, int len);
int full_read(int fd, char *buf, int len);
int recursive_action(const char *fileName, int recurse, int followLinks, int depthFirst,
int (*fileAction) (const char *fileName, struct stat* statbuf, void* userData),
int (*dirAction) (const char *fileName, struct stat* statbuf, void* userData),
void* userData);
extern int create_path (const char *name, int mode);
extern int parse_mode( const char* s, mode_t* theMode);
extern int get_kernel_revision(void);
extern int get_console_fd(char* tty_name);
extern struct mntent *find_mount_point(const char *name, const char *table);
extern void write_mtab(char* blockDevice, char* directory,
char* filesystemType, long flags, char* string_flags);
extern void erase_mtab(const char * name);
extern void mtab_read(void);
extern char *mtab_first(void **iter);
extern char *mtab_next(void **iter);
extern char *mtab_getinfo(const char *match, const char which);
extern int check_wildcard_match(const char* text, const char* pattern);
extern long atoi_w_units (const char *cp);
extern pid_t* find_pid_by_name( char* pidName);
extern int find_real_root_device_name(char* name);
extern char *get_line_from_file(FILE *file);
extern void print_file(FILE *file);
extern int print_file_by_name(char *filename);
extern char process_escape_sequence(char **ptr);
extern char *get_last_path_component(char *path);
extern FILE *wfopen(const char *path, const char *mode);
extern FILE *xfopen(const char *path, const char *mode);
#ifndef DMALLOC
extern void *xmalloc (size_t size);
extern void *xrealloc(void *old, size_t size);
extern void *xcalloc(size_t nmemb, size_t size);
extern char *xstrdup (const char *s);
#endif
extern char *xstrndup (const char *s, int n);
struct suffix_mult {
char *suffix;
int mult;
};
extern unsigned long parse_number(const char *numstr, struct suffix_mult *suffixes);
/* These parse entries in /etc/passwd and /etc/group. This is desirable
* for BusyBox since we want to avoid using the glibc NSS stuff, which
* increases target size and is often not needed embedded systems. */
extern long my_getpwnam(char *name);
extern long my_getgrnam(char *name);
extern void my_getpwuid(char *name, long uid);
extern void my_getgrgid(char *group, long gid);
extern long my_getpwnamegid(char *name);
extern int device_open(char *device, int mode);
#if defined BB_FEATURE_MOUNT_LOOP
extern int del_loop(const char *device);
extern int set_loop(const char *device, const char *file, int offset, int *loopro);
extern char *find_unused_loop_device (void);
#endif
#if (__GLIBC__ < 2) && (defined BB_SYSLOGD || defined BB_INIT)
extern int vdprintf(int d, const char *format, va_list ap);
#endif
#if defined BB_NFSMOUNT
int nfsmount(const char *spec, const char *node, int *flags,
char **extra_opts, char **mount_opts, int running_bg);
#endif
#ifndef RB_POWER_OFF
/* Stop system and switch power off if possible. */
#define RB_POWER_OFF 0x4321fedc
#endif
/* Include our own copy of struct sysinfo to avoid binary compatability
* problems with Linux 2.4, which changed things. Grumble, grumble. */
struct sysinfo {
long uptime; /* Seconds since boot */
unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
unsigned long totalram; /* Total usable main memory size */
unsigned long freeram; /* Available memory size */
unsigned long sharedram; /* Amount of shared memory */
unsigned long bufferram; /* Memory used by buffers */
unsigned long totalswap; /* Total swap space size */
unsigned long freeswap; /* swap space still available */
unsigned short procs; /* Number of current processes */
unsigned long totalhigh; /* Total high memory size */
unsigned long freehigh; /* Available high memory size */
unsigned int mem_unit; /* Memory unit size in bytes */
char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
};
extern int sysinfo (struct sysinfo* info);
/* Bit map related macros -- libc5 doens't provide these... sigh. */
#ifndef setbit
#define NBBY CHAR_BIT
#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
#endif
#ifdef BB_FEATURE_HUMAN_READABLE
char *format(unsigned long val, unsigned long hr);
#define KILOBYTE 1024
#define MEGABYTE (KILOBYTE*1024)
#define GIGABYTE (MEGABYTE*1024)
#endif
#ifdef BB_FEATURE_BUFFERS_GO_ON_STACK
#define RESERVE_BB_BUFFER(buffer,len) char buffer[len]
#define RESERVE_BB_UBUFFER(buffer,len) unsigned char buffer[len]
#else
#define RESERVE_BB_BUFFER(buffer,len) char *buffer=xmalloc(len)
#define RESERVE_BB_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len)
#endif
#endif /* _BB_INTERNAL_H_ */
-21
View File
@@ -1,21 +0,0 @@
#!/bin/sh
# Make busybox links list file.
# input $1: full path to Config.h
# input $2: full path to applets.h
# output (stdout): list of pathnames that should be linked to busybox
# Maintainer: Larry Doolittle <ldoolitt@recycle.lbl.gov>
CONFIG_H=${1:-Config.h}
APPLETS_H=${2:-applets.h}
gcc -E -DMAKE_LINKS -include $CONFIG_H $APPLETS_H |
awk '/^[ \t]*LINK/{
dir=substr($2,8)
gsub("_","/",dir)
if(dir=="/ROOT") dir=""
file=$3
gsub("\"","",file)
if (file=="busybox") next
print tolower(dir) "/" file
}'
-13
View File
@@ -1,13 +0,0 @@
#!/bin/sh
RAW=` \
gcc -E -dM ${1:-Config.h} | \
sed -n -e '/^.*BB_FEATURE.*$/d;s/^#define.*\<BB_\(.*\)\>/\1.c/gp;' \
| tr A-Z a-z | sort
`
test "${RAW}" != "" || exit
cd ${2:-.}
# I added in the extra "ls" so only source files that
# actually exist will show up in the compile list.
ls -1 $RAW 2>/dev/null | sed -e 's/\.c$/\.o/g'
-36
View File
@@ -1,36 +0,0 @@
Name: busybox
Version: 0.49
Release: 1
Group: System/Utilities
Summary: BusyBox is a tiny suite of Unix utilities in a multi-call binary.
Copyright: GPL
Packager : Erik Andersen <andersen@lineo.com>
Conflicts: fileutils grep shellutils
Buildroot: /tmp/%{Name}-%{Version}
Source: %{Name}-%{Version}.tar.gz
%Description
BusyBox combines tiny versions of many common UNIX utilities into a single
small executable. It provides minimalist replacements for most of the utilities
you usually find in fileutils, shellutils, findutils, textutils, grep, gzip,
tar, etc. BusyBox provides a fairly complete POSIX environment for any small
or emdedded system. The utilities in BusyBox generally have fewer options then
their full featured GNU cousins; however, the options that are provided behave
very much like their GNU counterparts.
%Prep
%setup -q -n %{Name}-%{Version}
%Build
make
%Install
rm -rf $RPM_BUILD_ROOT
make PREFIX=$RPM_BUILD_ROOT install
%Clean
rm -rf $RPM_BUILD_ROOT
%Files
%defattr(-,root,root)
/
-52
View File
@@ -1,52 +0,0 @@
/* vi: set sw=4 ts=4: */
/*
* Mini Cat implementation for busybox
*
* Copyright (C) 1999,2000,2001 by Lineo, inc.
* Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "busybox.h"
#include <stdlib.h>
extern int cat_main(int argc, char **argv)
{
int status = EXIT_SUCCESS;
if (argc == 1) {
print_file(stdin);
return status;
}
while (--argc > 0) {
if(!(strcmp(*++argv, "-"))) {
print_file(stdin);
} else if (print_file_by_name(*argv) == FALSE) {
status = EXIT_FAILURE;
}
}
return status;
}
/*
Local Variables:
c-file-style: "linux"
c-basic-offset: 4
tab-width: 4
End:
*/
-179
View File
@@ -1,179 +0,0 @@
/* vi: set sw=4 ts=4: */
/*
* Mini chown/chmod/chgrp implementation for busybox
*
*
* Copyright (C) 1999,2000,2001 by Lineo, inc.
* Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "busybox.h"
#define BB_DECLARE_EXTERN
#define bb_need_invalid_option
#define bb_need_too_few_args
#include "messages.c"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
static long uid = -1;
static long gid = -1;
static int whichApp;
static char *theMode = NULL;
#define CHGRP_APP 1
#define CHOWN_APP 2
#define CHMOD_APP 3
static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
{
switch (whichApp) {
case CHGRP_APP:
case CHOWN_APP:
#if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1)
if (lchown
(fileName, (whichApp == CHOWN_APP) ? uid : statbuf->st_uid,
(gid == -1) ? statbuf->st_gid : gid) == 0)
#else
if (chown
(fileName, (whichApp == CHOWN_APP) ? uid : statbuf->st_uid,
(gid == -1) ? statbuf->st_gid : gid) == 0)
#endif
{
return (TRUE);
}
break;
case CHMOD_APP:
/* Parse the specified modes */
if (parse_mode(theMode, &(statbuf->st_mode)) == FALSE) {
error_msg_and_die( "unknown mode: %s\n", theMode);
}
if (chmod(fileName, statbuf->st_mode) == 0)
return (TRUE);
break;
}
perror(fileName);
return (FALSE);
}
int chmod_chown_chgrp_main(int argc, char **argv)
{
int stopIt = FALSE;
int recursiveFlag = FALSE;
char *groupName=NULL;
char *p=NULL;
const char *appUsage;
whichApp = (strcmp(applet_name, "chown") == 0)?
CHOWN_APP : (strcmp(applet_name, "chmod") == 0)?
CHMOD_APP : CHGRP_APP;
appUsage = (whichApp == CHOWN_APP)?
chown_usage : (whichApp == CHMOD_APP) ? chmod_usage : chgrp_usage;
if (argc < 2)
usage(appUsage);
argv++;
/* Parse options */
while (--argc >= 0 && *argv && (**argv == '-')) {
while (stopIt==FALSE && *++(*argv)) {
switch (**argv) {
case 'R':
recursiveFlag = TRUE;
break;
default:
theMode=*argv-1;
stopIt = TRUE;
}
}
if (stopIt==TRUE)
break;
argv++;
}
if (argc == 0 || *argv == NULL) {
error_msg(too_few_args);
}
if (whichApp == CHMOD_APP) {
if (theMode==NULL)
theMode = *argv;
} else {
/* Find the selected group */
if (whichApp == CHGRP_APP) {
groupName = *argv;
gid = strtoul(groupName, &p, 10); /* maybe it's already numeric */
if (groupName == p)
gid = my_getgrnam(groupName);
if (gid == -1)
goto bad_group;
} else {
groupName = strchr(*argv, '.');
if (groupName == NULL)
groupName = strchr(*argv, ':');
if (groupName) {
*groupName++ = '\0';
gid = strtoul(groupName, &p, 10);
if (groupName == p)
gid = my_getgrnam(groupName);
if (gid == -1)
goto bad_group;
} else
gid = -1;
}
/* Find the selected user (if appropriate) */
if (whichApp == CHOWN_APP) {
uid = strtoul(*argv, &p, 10); /* if numeric ... */
if (*argv == p)
uid = my_getpwnam(*argv);
if (uid == -1) {
error_msg_and_die( "unknown user name: %s\n", *argv);
}
}
}
/* Ok, ready to do the deed now */
if (argc < 1) {
error_msg_and_die(too_few_args);
}
while (argc-- > 1) {
if (recursive_action (*(++argv), recursiveFlag, FALSE, FALSE,
fileAction, fileAction, NULL) == FALSE)
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
bad_group:
error_msg_and_die( "unknown group name: %s\n", groupName);
}
/*
Local Variables:
c-file-style: "linux"
c-basic-offset: 4
tab-width: 4
End:
*/
-72
View File
@@ -1,72 +0,0 @@
/* vi: set sw=4 ts=4: */
/*
* Mini chroot implementation for busybox
*
*
* Copyright (C) 1999,2000,2001 by Lineo, inc.
* Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "busybox.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
int chroot_main(int argc, char **argv)
{
char *prog;
if ((argc < 2) || (**(argv + 1) == '-')) {
usage(chroot_usage);
}
argc--;
argv++;
if (chroot(*argv) || (chdir("/"))) {
perror_msg_and_die("cannot change root directory to %s", *argv);
}
argc--;
argv++;
if (argc >= 1) {
prog = *argv;
execvp(*argv, argv);
} else {
#ifndef BB_SH
prog = getenv("SHELL");
if (!prog)
prog = "/bin/sh";
execlp(prog, prog, NULL);
#else
shell_main(argc, argv);
return EXIT_SUCCESS;
#endif
}
perror_msg_and_die("cannot execute %s", prog);
}
/*
Local Variables:
c-file-style: "linux"
c-basic-offset: 4
tab-width: 4
End:
*/
-40
View File
@@ -1,40 +0,0 @@
/* vi: set sw=4 ts=4: */
/*
* chvt.c - aeb - 940227 - Change virtual terminal
*
* busyboxed by Erik Andersen
*/
#include "busybox.h"
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/ioctl.h>
/* From <linux/vt.h> */
static const int VT_ACTIVATE = 0x5606; /* make vt active */
static const int VT_WAITACTIVE = 0x5607; /* wait for vt active */
int chvt_main(int argc, char **argv)
{
int fd, num;
if ((argc != 2) || (**(argv + 1) == '-'))
usage (chvt_usage);
fd = get_console_fd("/dev/console");
num = atoi(argv[1]);
if (ioctl(fd, VT_ACTIVATE, num))
perror_msg_and_die("VT_ACTIVATE");
if (ioctl(fd, VT_WAITACTIVE, num))
perror_msg_and_die("VT_WAITACTIVE");
return EXIT_SUCCESS;
}
/*
Local Variables:
c-file-style: "linux"
c-basic-offset: 4
tab-width: 4
End:
*/
-34
View File
@@ -1,34 +0,0 @@
/* vi: set sw=4 ts=4: */
/*
* Mini clear implementation for busybox
*
*
* Copyright (C) 1999,2000,2001 by Lineo, inc.
* Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "busybox.h"
#include <stdio.h>
#include <stdlib.h>
extern int clear_main(int argc, char **argv)
{
printf("\033[H\033[J");
return EXIT_SUCCESS;
}
-1012
View File
File diff suppressed because it is too large. Load diff
-13
View File
@@ -1,13 +0,0 @@
#ifndef CMDEDIT_H
#define CMDEDIT_H
#ifdef BB_FEATURE_SH_COMMAND_EDITING
#include <stddef.h>
void cmdedit_init(void);
void cmdedit_terminate(void);
void cmdedit_read_input(char* promptStr, char* command); /* read a line of input */
#endif /* BB_FEATURE_SH_COMMAND_EDITING */
#endif /* CMDEDIT_H */
-66
View File
@@ -1,66 +0,0 @@
/* vi: set sw=4 ts=4: */
/*
* Mini cmp implementation for busybox
*
*
* Copyright (C) 1999,2000,2001 by Lineo, inc.
* Written by Matt Kraai <kraai@alumni.carnegiemellon.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "busybox.h"
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
int cmp_main(int argc, char **argv)
{
FILE *fp1 = NULL, *fp2 = stdin;
char *filename1 = argv[1], *filename2 = "-";
int c1, c2, char_pos = 1, line_pos = 1;
/* parse argv[] */
if (argc < 2 || 3 < argc)
usage(cmp_usage);
fp1 = xfopen(argv[1], "r");
if (argv[2] != NULL) {
fp2 = xfopen(argv[2], "r");
filename2 = argv[2];
}
do {
c1 = fgetc(fp1);
c2 = fgetc(fp2);
if (c1 != c2) {
if (c1 == EOF)
printf("EOF on %s\n", filename1);
else if (c2 == EOF)
printf("EOF on %s\n", filename2);
else
printf("%s %s differ: char %d, line %d\n", filename1, filename2,
char_pos, line_pos);
return EXIT_FAILURE;
}
char_pos++;
if (c1 == '\n')
line_pos++;
} while (c1 != EOF);
return EXIT_SUCCESS;
}
+105
View File
@@ -0,0 +1,105 @@
#
# For a description of the syntax of this configuration file,
# see scripts/kbuild/config-language.txt.
#
menu "Console Utilities"
config CHVT
bool "chvt"
default n
help
This program is used to change to another terminal.
Example: chvt 4 (change to terminal /dev/tty4)
config CLEAR
bool "clear"
default n
help
This program clears the terminal screen.
config DEALLOCVT
bool "deallocvt"
default n
help
This program deallocates unused virtual consoles.
config DUMPKMAP
bool "dumpkmap"
default n
help
This program dumps the kernel's keyboard translation table to
stdout, in binary format. You can then use loadkmap to load it.
config LOADFONT
bool "loadfont"
default n
help
This program loads a console font from standard input.
config LOADKMAP
bool "loadkmap"
default n
help
This program loads a keyboard translation table from
standard input.
config OPENVT
bool "openvt"
default n
help
This program is used to start a command on an unused
virtual terminal.
config RESET
bool "reset"
default n
help
This program is used to reset the terminal screen, if it
gets messed up.
config RESIZE
bool "resize"
default n
help
This program is used to (re)set the width and height of your current
terminal.
config FEATURE_RESIZE_PRINT
bool "print environment variables"
default n
depends on RESIZE
help
Prints the newly set size (number of columns and rows) of
the terminal.
E.g.:
COLUMNS=80;LINES=44;export COLUMNS LINES;
config SETCONSOLE
bool "setconsole"
default n
help
This program redirects the system console to another device,
like the current tty while logged in via telnet.
config FEATURE_SETCONSOLE_LONG_OPTIONS
bool "Enable long options"
default n
depends on SET_CONSOLE && GETOPT_LONG
help
Support long options for the setconsole applet.
config SETKEYCODES
bool "setkeycodes"
default n
help
This program loads entries into the kernel's scancode-to-keycode
map, allowing unusual keyboards to generate usable keycodes.
config SETLOGCONS
bool "setlogcons"
default n
help
This program redirects the output console of kernel messages.
endmenu
+19
View File
@@ -0,0 +1,19 @@
# Makefile for busybox
#
# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.
lib-y:=
lib-$(CONFIG_CHVT) += chvt.o
lib-$(CONFIG_CLEAR) += clear.o
lib-$(CONFIG_DEALLOCVT) += deallocvt.o
lib-$(CONFIG_DUMPKMAP) += dumpkmap.o
lib-$(CONFIG_SETCONSOLE) += setconsole.o
lib-$(CONFIG_LOADFONT) += loadfont.o
lib-$(CONFIG_LOADKMAP) += loadkmap.o
lib-$(CONFIG_OPENVT) += openvt.o
lib-$(CONFIG_RESET) += reset.o
lib-$(CONFIG_RESIZE) += resize.o
lib-$(CONFIG_SETKEYCODES) += setkeycodes.o
lib-$(CONFIG_SETLOGCONS) += setlogcons.o
+19 -26
View File
@@ -1,40 +1,33 @@
/* vi: set sw=4 ts=4: */
/*
* chvt.c - aeb - 940227 - Change virtual terminal
* Mini chvt implementation for busybox
*
* busyboxed by Erik Andersen
* Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "busybox.h"
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/ioctl.h>
/* From <linux/vt.h> */
static const int VT_ACTIVATE = 0x5606; /* make vt active */
static const int VT_WAITACTIVE = 0x5607; /* wait for vt active */
enum {
VT_ACTIVATE = 0x5606, /* make vt active */
VT_WAITACTIVE = 0x5607 /* wait for vt active */
};
int chvt_main(int argc, char **argv)
{
int fd, num;
if ((argc != 2) || (**(argv + 1) == '-'))
usage (chvt_usage);
fd = get_console_fd("/dev/console");
num = atoi(argv[1]);
if (ioctl(fd, VT_ACTIVATE, num))
perror_msg_and_die("VT_ACTIVATE");
if (ioctl(fd, VT_WAITACTIVE, num))
perror_msg_and_die("VT_WAITACTIVE");
if (argc != 2) {
bb_show_usage();
}
fd = get_console_fd();
num = xatoul_range(argv[1], 1, 63);
if ((-1 == ioctl(fd, VT_ACTIVATE, num))
|| (-1 == ioctl(fd, VT_WAITACTIVE, num))) {
bb_perror_msg_and_die("ioctl");
}
return EXIT_SUCCESS;
}
/*
Local Variables:
c-file-style: "linux"
c-basic-offset: 4
tab-width: 4
End:
*/
+7 -20
View File
@@ -2,33 +2,20 @@
/*
* Mini clear implementation for busybox
*
* Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
*
* Copyright (C) 1999,2000,2001 by Lineo, inc.
* Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*
*/
#include "busybox.h"
/* no options, no getopt */
#include <stdio.h>
#include <stdlib.h>
#include "busybox.h"
extern int clear_main(int argc, char **argv)
int clear_main(int argc, char **argv)
{
printf("\033[H\033[J");
return EXIT_SUCCESS;
return printf("\033[H\033[J") != 6;
}
+23 -29
View File
@@ -1,43 +1,37 @@
/* vi: set sw=4 ts=4: */
/*
* disalloc.c - aeb - 940501 - Disallocate virtual terminal(s)
* Renamed deallocvt.
* Disallocate virtual terminal(s)
*
* Copyright (C) 2003 by Tito Ragusa <farmatito@tiscali.it>
* Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
/* no options, no getopt */
#include "busybox.h"
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/ioctl.h>
/* From <linux/vt.h> */
static const int VT_DISALLOCATE = 0x5608; /* free memory associated to vt */
enum { VT_DISALLOCATE = 0x5608 }; /* free memory associated to vt */
int deallocvt_main(int argc, char *argv[])
{
int fd, num, i;
/* num = 0 deallocate all unused consoles */
int num = 0;
//if ((argc > 2) || ((argv == 2) && (**(argv + 1) == '-')))
if (argc > 2)
usage(deallocvt_usage);
fd = get_console_fd("/dev/console");
if (argc == 1) {
/* deallocate all unused consoles */
if (ioctl(fd, VT_DISALLOCATE, 0))
perror_msg_and_die("VT_DISALLOCATE");
} else {
for (i = 1; i < argc; i++) {
num = atoi(argv[i]);
if (num == 0)
error_msg("0: illegal VT number\n");
else if (num == 1)
error_msg("VT 1 cannot be deallocated\n");
else if (ioctl(fd, VT_DISALLOCATE, num))
perror_msg_and_die("VT_DISALLOCATE");
}
switch (argc) {
case 2:
num = xatoul_range(argv[1], 1, 63);
/* Fallthrough */
case 1:
break;
default:
bb_show_usage();
}
if (-1 == ioctl(get_console_fd(), VT_DISALLOCATE, num)) {
bb_perror_msg_and_die("VT_DISALLOCATE");
}
return EXIT_SUCCESS;
}
+21 -51
View File
@@ -4,30 +4,11 @@
*
* Copyright (C) Arne Bernin <arne@matrix.loopback.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*
*/
#include "busybox.h"
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <sys/ioctl.h>
/* From <linux/kd.h> */
struct kbentry {
@@ -35,11 +16,11 @@ struct kbentry {
unsigned char kb_index;
unsigned short kb_value;
};
static const int KDGKBENT = 0x4B46; /* gets one entry in translation table */
#define KDGKBENT 0x4B46 /* gets one entry in translation table */
/* From <linux/keyboard.h> */
static const int NR_KEYS = 128;
static const int MAX_NR_KEYMAPS = 256;
#define NR_KEYS 128
#define MAX_NR_KEYMAPS 256
int dumpkmap_main(int argc, char **argv)
{
@@ -47,32 +28,21 @@ int dumpkmap_main(int argc, char **argv)
int i, j, fd;
char flags[MAX_NR_KEYMAPS], magic[] = "bkeymap";
if (argc>=2 && *argv[1]=='-') {
usage(dumpkmap_usage);
}
if (argc >= 2 && *argv[1] == '-')
bb_show_usage();
fd = open("/dev/tty0", O_RDWR);
if (fd < 0) {
perror_msg("Error opening /dev/tty0");
return EXIT_FAILURE;
}
fd = xopen(CURRENT_VC, O_RDWR);
write(1, magic, 7);
for (i=0; i < MAX_NR_KEYMAPS; i++) flags[i]=0;
flags[0]=1;
flags[1]=1;
flags[2]=1;
flags[4]=1;
flags[5]=1;
flags[6]=1;
flags[8]=1;
flags[9]=1;
flags[10]=1;
flags[12]=1;
/* Here we want to set everything to 0 except for indexes:
* [0-2] [4-6] [8-10] [12] */
memset(flags, 0x00, MAX_NR_KEYMAPS);
memset(flags, 0x01, 13);
flags[3] = flags[7] = flags[11] = 0;
/* dump flags */
for (i=0; i < MAX_NR_KEYMAPS; i++) write(1,&flags[i],1);
write(1, flags, MAX_NR_KEYMAPS);
for (i = 0; i < MAX_NR_KEYMAPS; i++) {
if (flags[i] == 1) {
@@ -80,13 +50,13 @@ int dumpkmap_main(int argc, char **argv)
ke.kb_index = j;
ke.kb_table = i;
if (ioctl(fd, KDGKBENT, &ke) < 0) {
error_msg("ioctl returned: %s, %s, %s, %xqq\n",strerror(errno),(char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value);
}
else {
write(1,(void*)&ke.kb_value,2);
}
bb_perror_msg("ioctl failed with %s, %s, %p",
(char *)&ke.kb_index,
(char *)&ke.kb_table,
&ke.kb_value);
} else {
write(1, (void*)&ke.kb_value, 2);
}
}
}
}
-392
View File
@@ -1,392 +0,0 @@
/* vi: set sw=4 ts=4: */
/*
* Derived from
* mapscrn.c - version 0.92
*
* Was taken from console-tools and adapted by
* Peter Novodvorsky <petya@logic.ru>
*/
#include "busybox.h"
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <assert.h>
#include <errno.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/kd.h>
typedef unsigned short unicode;
static long int ctoi(unsigned char *s, int *is_unicode);
int old_screen_map_read_ascii(FILE * fp, unsigned char buf[]);
int uni_screen_map_read_ascii(FILE * fp, unicode buf[], int *is_unicode);
unicode utf8_to_ucs2(char *buf);
int screen_map_load(int fd, FILE * fp);
int loadacm_main(int argc, char **argv)
{
int fd;
if (argc>=2 && *argv[1]=='-') {
usage(loadacm_usage);
}
fd = open("/dev/tty", O_RDWR);
if (fd < 0) {
perror_msg_and_die("Error opening /dev/tty1");
}
if (screen_map_load(fd, stdin)) {
perror_msg_and_die("Error loading acm");
}
write(fd, "\033(K", 3);
return EXIT_SUCCESS;
}
int screen_map_load(int fd, FILE * fp)
{
struct stat stbuf;
unicode wbuf[E_TABSZ];
unsigned char buf[E_TABSZ];
int parse_failed = 0;
int is_unicode;
if (fstat(fileno(fp), &stbuf))
perror_msg_and_die("Cannot stat map file");
/* first try a UTF screen-map: either ASCII (no restriction) or binary (regular file) */
if (!
(parse_failed =
(-1 == uni_screen_map_read_ascii(fp, wbuf, &is_unicode)))
|| (S_ISREG(stbuf.st_mode) && (stbuf.st_size == (sizeof(unicode) * E_TABSZ)))) { /* test for binary UTF map by size */
if (parse_failed) {
if (-1 == fseek(fp, 0, SEEK_SET)) {
if (errno == ESPIPE)
error_msg_and_die("16bit screen-map MUST be a regular file.\n");
else
perror_msg_and_die("fseek failed reading binary 16bit screen-map");
}
if (fread(wbuf, sizeof(unicode) * E_TABSZ, 1, fp) != 1)
perror_msg_and_die("Cannot read [new] map from file");
#if 0
else
error_msg("Input screen-map is binary.\n");
#endif
}
/* if it was effectively a 16-bit ASCII, OK, else try to read as 8-bit map */
/* same if it was binary, ie. if parse_failed */
if (parse_failed || is_unicode) {
if (ioctl(fd, PIO_UNISCRNMAP, wbuf))
perror_msg_and_die("PIO_UNISCRNMAP ioctl");
else
return 0;
}
}
/* rewind... */
if (-1 == fseek(fp, 0, SEEK_SET)) {
if (errno == ESPIPE)
error_msg("Assuming 8bit screen-map - MUST be a regular file.\n"),
exit(1);
else
perror_msg_and_die("fseek failed assuming 8bit screen-map");
}
/* ... and try an old 8-bit screen-map */
if (!(parse_failed = (-1 == old_screen_map_read_ascii(fp, buf))) ||
(S_ISREG(stbuf.st_mode) && (stbuf.st_size == E_TABSZ))) { /* test for binary old 8-bit map by size */
if (parse_failed) {
if (-1 == fseek(fp, 0, SEEK_SET)) {
if (errno == ESPIPE)
/* should not - it succedeed above */
error_msg_and_die("fseek() returned ESPIPE !\n");
else
perror_msg_and_die("fseek for binary 8bit screen-map");
}
if (fread(buf, E_TABSZ, 1, fp) != 1)
perror_msg_and_die("Cannot read [old] map from file");
#if 0
else
error_msg("Input screen-map is binary.\n");
#endif
}
if (ioctl(fd, PIO_SCRNMAP, buf))
perror_msg_and_die("PIO_SCRNMAP ioctl");
else
return 0;
}
error_msg("Error parsing symbolic map\n");
return(1);
}
/*
* - reads `fp' as a 16-bit ASCII SFM file.
* - returns -1 on error.
* - returns it in `unicode' in an E_TABSZ-elements array.
* - sets `*is_unicode' flagiff there were any non-8-bit
* (ie. real 16-bit) mapping.
*
* FIXME: ignores everything after second word
*/
int uni_screen_map_read_ascii(FILE * fp, unicode buf[], int *is_unicode)
{
char buffer[256]; /* line buffer reading file */
char *p, *q; /* 1st + 2nd words in line */
int in, on; /* the same, as numbers */
int tmp_is_unicode; /* tmp for is_unicode calculation */
int i; /* loop index - result holder */
int ret_code = 0; /* return code */
sigset_t sigset, old_sigset;
assert(is_unicode);
*is_unicode = 0;
/* first 128 codes defaults to ASCII */
for (i = 0; i < 128; i++)
buf[i] = i;
/* remaining defaults to replacement char (usually E_TABSZ = 256) */
for (; i < E_TABSZ; i++)
buf[i] = 0xfffd;
/* block SIGCHLD */
sigemptyset(&sigset);
sigaddset(&sigset, SIGCHLD);
sigprocmask(SIG_BLOCK, &sigset, &old_sigset);
do {
if (NULL == fgets(buffer, sizeof(buffer), fp)) {
if (feof(fp))
break;
else
perror_msg_and_die("uni_screen_map_read_ascii() can't read line");
}
/* get "charset-relative charcode", stripping leading spaces */
p = strtok(buffer, " \t\n");
/* skip empty lines and comments */
if (!p || *p == '#')
continue;
/* get unicode mapping */
q = strtok(NULL, " \t\n");
if (q) {
in = ctoi(p, NULL);
if (in < 0 || in > 255) {
ret_code = -1;
break;
}
on = ctoi(q, &tmp_is_unicode);
if (in < 0 && on > 65535) {
ret_code = -1;
break;
}
*is_unicode |= tmp_is_unicode;
buf[in] = on;
} else {
ret_code = -1;
break;
}
}
while (1); /* terminated by break on feof() */
/* restore sig mask */
sigprocmask(SIG_SETMASK, &old_sigset, NULL);
return ret_code;
}
int old_screen_map_read_ascii(FILE * fp, unsigned char buf[])
{
char buffer[256];
int in, on;
char *p, *q;
for (in = 0; in < 256; in++)
buf[in] = in;
while (fgets(buffer, sizeof(buffer) - 1, fp)) {
p = strtok(buffer, " \t\n");
if (!p || *p == '#')
continue;
q = strtok(NULL, " \t\n#");
if (q) {
in = ctoi(p, NULL);
if (in < 0 || in > 255)
return -1;
on = ctoi(q, NULL);
if (in < 0 && on > 255)
return -1;
buf[in] = on;
} else
return -1;
}
return (0);
}
/*
* - converts a string into an int.
* - supports dec and hex bytes, hex UCS2, single-quoted byte and UTF8 chars.
* - returns the converted value
* - if `is_unicode != NULL', use it to tell whether it was unicode
*
* CAVEAT: will report valid UTF mappings using only 1 byte as 8-bit ones.
*/
long int ctoi(unsigned char *s, int *is_unicode)
{
int i;
size_t ls;
ls = strlen(s);
if (is_unicode)
*is_unicode = 0;
/* hex-specified UCS2 */
if ((strncmp(s, "U+", 2) == 0) &&
(strspn(s + 2, "0123456789abcdefABCDEF") == ls - 2)) {
sscanf(s + 2, "%x", &i);
if (is_unicode)
*is_unicode = 1;
}
/* hex-specified byte */
else if ((ls <= 4) && (strncmp(s, "0x", 2) == 0) &&
(strspn(s + 2, "0123456789abcdefABCDEF") == ls - 2))
sscanf(s + 2, "%x", &i);
/* oct-specified number (byte) */
else if ((*s == '0') && (strspn(s, "01234567") == ls))
sscanf(s, "%o", &i);
/* dec-specified number (byte) */
else if (strspn(s, "0123456789") == ls)
sscanf(s, "%d", &i);
/* single-byte quoted char */
else if ((strlen(s) == 3) && (s[0] == '\'') && (s[2] == '\''))
i = s[1];
/* multi-byte UTF8 quoted char */
else if ((s[0] == '\'') && (s[ls - 1] == '\'')) {
s[ls - 1] = 0; /* ensure we'll not "parse UTF too far" */
i = utf8_to_ucs2(s + 1);
if (is_unicode)
*is_unicode = 1;
} else
return (-1);
return (i);
}
void saveoldmap(int fd, char *omfil)
{
FILE *fp;
char buf[E_TABSZ];
#ifdef GIO_UNISCRNMAP
unicode xbuf[E_TABSZ];
int is_old_map = 0;
if (ioctl(fd, GIO_UNISCRNMAP, xbuf)) {
perror_msg("GIO_UNISCRNMAP ioctl error");
#endif
if (ioctl(fd, GIO_SCRNMAP, buf))
perror_msg_and_die("GIO_SCRNMAP ioctl error");
else
is_old_map = 1;
#ifdef GIO_UNISCRNMAP
}
#endif
fp = xfopen(omfil, "w");
#ifdef GIO_UNISCRNMAP
if (is_old_map) {
#endif
if (fwrite(buf, E_TABSZ, 1, fp) != 1)
perror_msg_and_die("Error writing map to file");
#ifdef GIO_UNISCRNMAP
} else if (fwrite(xbuf, sizeof(unicode) * E_TABSZ, 1, fp) != 1) {
perror_msg_and_die("Error writing map to file");
}
#endif
fclose(fp);
}
unicode utf8_to_ucs2(char *buf)
{
int utf_count = 0;
long utf_char = 0;
unicode tc = 0;
unsigned char c;
do {
c = *buf;
buf++;
/* if byte should be part of multi-byte sequence */
if (c & 0x80) {
/* if we have already started to parse a UTF8 sequence */
if (utf_count > 0 && (c & 0xc0) == 0x80) {
utf_char = (utf_char << 6) | (c & 0x3f);
utf_count--;
if (utf_count == 0)
tc = utf_char;
else
continue;
} else { /* Possibly 1st char of a UTF8 sequence */
if ((c & 0xe0) == 0xc0) {
utf_count = 1;
utf_char = (c & 0x1f);
} else if ((c & 0xf0) == 0xe0) {
utf_count = 2;
utf_char = (c & 0x0f);
} else if ((c & 0xf8) == 0xf0) {
utf_count = 3;
utf_char = (c & 0x07);
} else if ((c & 0xfc) == 0xf8) {
utf_count = 4;
utf_char = (c & 0x03);
} else if ((c & 0xfe) == 0xfc) {
utf_count = 5;
utf_char = (c & 0x01);
} else
utf_count = 0;
continue;
}
} else { /* not part of multi-byte sequence - treat as ASCII
* this makes incomplete sequences to be ignored
*/
tc = c;
utf_count = 0;
}
}
while (utf_count);
return tc;
}
+29 -45
View File
@@ -8,26 +8,17 @@
* (Adapted for busybox by Matej Vela.)
*/
#include "busybox.h"
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <memory.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <dirent.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/kd.h>
#include <endian.h>
static const int PSF_MAGIC1 = 0x36;
static const int PSF_MAGIC2 = 0x04;
enum {
PSF_MAGIC1 = 0x36,
PSF_MAGIC2 = 0x04,
static const int PSF_MODE512 = 0x01;
static const int PSF_MODEHASTAB = 0x02;
static const int PSF_MAXMODE = 0x03;
static const int PSF_SEPARATOR = 0xFFFF;
PSF_MODE512 = 0x01,
PSF_MODEHASTAB = 0x02,
PSF_MAXMODE = 0x03,
PSF_SEPARATOR = 0xFFFF
};
struct psf_header {
unsigned char magic1, magic2; /* Magic number */
@@ -39,22 +30,20 @@ struct psf_header {
static void loadnewfont(int fd);
extern int loadfont_main(int argc, char **argv)
int loadfont_main(int argc, char **argv)
{
int fd;
if (argc != 1)
usage(loadfont_usage);
bb_show_usage();
fd = open("/dev/tty0", O_RDWR);
if (fd < 0)
perror_msg_and_die("Error opening /dev/tty0");
fd = xopen(CURRENT_VC, O_RDWR);
loadnewfont(fd);
return EXIT_SUCCESS;
}
static void do_loadfont(int fd, char *inbuf, int unit, int fontsize)
static void do_loadfont(int fd, unsigned char *inbuf, int unit, int fontsize)
{
char buf[16384];
int i;
@@ -62,7 +51,7 @@ static void do_loadfont(int fd, char *inbuf, int unit, int fontsize)
memset(buf, 0, sizeof(buf));
if (unit < 1 || unit > 32)
error_msg_and_die("Bad character size %d\n", unit);
bb_error_msg_and_die("bad character size %d", unit);
for (i = 0; i < fontsize; i++)
memcpy(buf + (32 * i), inbuf + (unit * i), unit);
@@ -77,11 +66,11 @@ static void do_loadfont(int fd, char *inbuf, int unit, int fontsize)
if (ioctl(fd, PIO_FONTX, &cfd) == 0)
return; /* success */
perror_msg("PIO_FONTX ioctl error (trying PIO_FONT)");
bb_perror_msg("PIO_FONTX ioctl error (trying PIO_FONT)");
}
#endif
if (ioctl(fd, PIO_FONT, buf))
perror_msg_and_die("PIO_FONT ioctl error");
bb_perror_msg_and_die("PIO_FONT ioctl error");
}
static void
@@ -92,14 +81,14 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
struct unipair *up;
int ct = 0, maxct;
int glyph;
u_short unicode;
uint16_t unicode;
maxct = tailsz; /* more than enough */
up = (struct unipair *) xmalloc(maxct * sizeof(struct unipair));
up = xmalloc(maxct * sizeof(struct unipair));
for (glyph = 0; glyph < fontsize; glyph++) {
while (tailsz >= 2) {
unicode = (((u_short) inbuf[1]) << 8) + inbuf[0];
unicode = (((uint16_t) inbuf[1]) << 8) + inbuf[0];
tailsz -= 2;
inbuf += 2;
if (unicode == PSF_SEPARATOR)
@@ -119,28 +108,23 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
if (ioctl(fd, PIO_UNIMAPCLR, &advice)) {
#ifdef ENOIOCTLCMD
if (errno == ENOIOCTLCMD) {
error_msg("It seems this kernel is older than 1.1.92\n");
error_msg_and_die("No Unicode mapping table loaded.\n");
bb_error_msg("it seems this kernel is older than 1.1.92");
bb_error_msg_and_die("no Unicode mapping table loaded");
} else
#endif
perror_msg_and_die("PIO_UNIMAPCLR");
bb_perror_msg_and_die("PIO_UNIMAPCLR");
}
ud.entry_ct = ct;
ud.entries = up;
if (ioctl(fd, PIO_UNIMAP, &ud)) {
#if 0
if (errno == ENOMEM) {
/* change advice parameters */
}
#endif
perror_msg_and_die("PIO_UNIMAP");
bb_perror_msg_and_die("PIO_UNIMAP");
}
}
static void loadnewfont(int fd)
{
int unit;
char inbuf[32768]; /* primitive */
unsigned char inbuf[32768]; /* primitive */
unsigned int inputlth, offset;
/*
@@ -150,13 +134,13 @@ static void loadnewfont(int fd)
*/
inputlth = fread(inbuf, 1, sizeof(inbuf), stdin);
if (ferror(stdin))
perror_msg_and_die("Error reading input font");
bb_perror_msg_and_die("error reading input font");
/* use malloc/realloc in case of giant files;
maybe these do not occur: 16kB for the font,
and 16kB for the map leaves 32 unicode values
for each font position */
if (!feof(stdin))
perror_msg_and_die("Font too large");
bb_perror_msg_and_die("font too large");
/* test for psf first */
{
@@ -174,11 +158,11 @@ static void loadnewfont(int fd)
goto no_psf;
if (psfhdr.mode > PSF_MAXMODE)
error_msg_and_die("Unsupported psf file mode\n");
bb_error_msg_and_die("unsupported psf file mode");
fontsize = ((psfhdr.mode & PSF_MODE512) ? 512 : 256);
#if !defined( PIO_FONTX ) || defined( __sparc__ )
if (fontsize != 256)
error_msg_and_die("Only fontsize 256 supported\n");
bb_error_msg_and_die("only fontsize 256 supported");
#endif
hastable = (psfhdr.mode & PSF_MODEHASTAB);
unit = psfhdr.charsize;
@@ -186,7 +170,7 @@ static void loadnewfont(int fd)
head = head0 + fontsize * unit;
if (head > inputlth || (!hastable && head != inputlth))
error_msg_and_die("Input file: bad length\n");
bb_error_msg_and_die("input file: bad length");
do_loadfont(fd, inbuf + head0, unit, fontsize);
if (hastable)
do_loadtable(fd, inbuf + head, inputlth - head, fontsize);
@@ -201,7 +185,7 @@ static void loadnewfont(int fd)
} else {
/* bare font */
if (inputlth & 0377)
error_msg_and_die("Bad input file size\n");
bb_error_msg_and_die("bad input file size");
offset = 0;
unit = inputlth / 256;
}
+19 -47
View File
@@ -4,30 +4,11 @@
*
* Copyright (C) 1998 Enrique Zanardi <ezanardi@ull.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*
*/
#include "busybox.h"
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/ioctl.h>
#define BINARY_KEYMAP_MAGIC "bkeymap"
@@ -37,43 +18,35 @@ struct kbentry {
unsigned char kb_index;
unsigned short kb_value;
};
static const int KDSKBENT = 0x4B47; /* sets one entry in translation table */
/* sets one entry in translation table */
#define KDSKBENT 0x4B47
/* From <linux/keyboard.h> */
static const int NR_KEYS = 128;
static const int MAX_NR_KEYMAPS = 256;
#define NR_KEYS 128
#define MAX_NR_KEYMAPS 256
int loadkmap_main(int argc, char **argv)
{
struct kbentry ke;
u_short *ibuff;
int i, j, fd, readsz, pos, ibuffsz = NR_KEYS * sizeof(u_short);
char flags[MAX_NR_KEYMAPS], buff[7];
int i, j, fd;
uint16_t ibuff[NR_KEYS];
char flags[MAX_NR_KEYMAPS];
char buff[7];
if (argc != 1)
usage(loadkmap_usage);
bb_show_usage();
fd = open("/dev/tty0", O_RDWR);
if (fd < 0)
perror_msg_and_die("Error opening /dev/tty0");
fd = xopen(CURRENT_VC, O_RDWR);
read(0, buff, 7);
if (0 != strncmp(buff, BINARY_KEYMAP_MAGIC, 7))
error_msg_and_die("This is not a valid binary keymap.\n");
xread(0, buff, 7);
if (strncmp(buff, BINARY_KEYMAP_MAGIC, 7))
bb_error_msg_and_die("this is not a valid binary keymap");
if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS))
perror_msg_and_die("Error reading keymap flags");
ibuff = (u_short *) xmalloc(ibuffsz);
xread(0, flags, MAX_NR_KEYMAPS);
for (i = 0; i < MAX_NR_KEYMAPS; i++) {
if (flags[i] == 1) {
pos = 0;
while (pos < ibuffsz) {
if ((readsz = read(0, (char *) ibuff + pos, ibuffsz - pos)) < 0)
perror_msg_and_die("Error reading keymap");
pos += readsz;
}
xread(0, ibuff, NR_KEYS * sizeof(uint16_t));
for (j = 0; j < NR_KEYS; j++) {
ke.kb_index = j;
ke.kb_table = i;
@@ -82,8 +55,7 @@ int loadkmap_main(int argc, char **argv)
}
}
}
/* Don't bother to close files. Exit does that
* automagically, so we can save a few bytes */
/* close(fd); */
return EXIT_SUCCESS;
if (ENABLE_FEATURE_CLEAN_UP) close(fd);
return 0;
}
+42
View File
@@ -0,0 +1,42 @@
/* vi: set sw=4 ts=4: */
/*
* openvt.c - open a vt to run a command.
*
* busyboxed by Quy Tonthat <quy@signal3.com>
* hacked by Tito <farmatito@tiscali.it>
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
/* getopt not needed */
#include "busybox.h"
int openvt_main(int argc, char **argv)
{
int fd;
char vtname[sizeof(VC_FORMAT) + 2];
if (argc < 3) {
bb_show_usage();
}
/* check for illegal vt number: < 1 or > 63 */
sprintf(vtname, VC_FORMAT, (int)xatoul_range(argv[1], 1, 63));
if (fork() == 0) {
/* child */
/* leave current vt (controlling tty) */
setsid();
/* and grab new one */
fd = xopen(vtname, O_RDWR);
/* Reassign stdin, stdout and sterr */
dup2(fd, STDIN_FILENO);
dup2(fd, STDOUT_FILENO);
dup2(fd, STDERR_FILENO);
while (fd > 2) close(fd--);
execvp(argv[2], &argv[2]);
_exit(1);
}
return EXIT_SUCCESS;
}
+19 -22
View File
@@ -2,34 +2,31 @@
/*
* Mini reset implementation for busybox
*
* Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
* Written by Erik Andersen and Kent Robotti <robotti@metconnect.com>
*
* Copyright (C) 1999,2000,2001 by Lineo, inc.
* Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
* and Kent Robotti <robotti@metconnect.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "busybox.h"
/* no options, no getopt */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "busybox.h"
extern int reset_main(int argc, char **argv)
int reset_main(int argc, char **argv)
{
printf("\033c");
return EXIT_SUCCESS;
if (isatty(1)) {
/* See 'man 4 console_codes' for details:
* "ESC c" -- Reset
* "ESC ( K" -- Select user mapping
* "ESC [ J" -- Erase display
* "ESC [ 0 m" -- Reset all display attributes
* "ESC [ ? 25 h" -- Make cursor visible.
*/
printf("\033c\033(K\033[J\033[0m\033[?25h");
}
return EXIT_SUCCESS;
}
+38
View File
@@ -0,0 +1,38 @@
/* vi: set sw=4 ts=4: */
/*
* resize - set terminal width and height.
*
* Copyright 2006 Bernhard Fischer
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
/* no options, no getopt */
#include "busybox.h"
int resize_main(int argc, char **argv)
{
struct termios old, new;
struct winsize w = {0,0,0,0};
int ret;
tcgetattr(STDOUT_FILENO, &old); /* fiddle echo */
new = old;
new.c_cflag |= (CLOCAL | CREAD);
new.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
tcsetattr(STDOUT_FILENO, TCSANOW, &new);
/* save_cursor_pos 7
* scroll_whole_screen [r
* put_cursor_waaaay_off [$x;$yH
* get_cursor_pos [6n
* restore_cursor_pos 8
*/
printf("\0337\033[r\033[999;999H\033[6n");
scanf("\033[%hu;%huR", &w.ws_row, &w.ws_col);
ret = ioctl(STDOUT_FILENO, TIOCSWINSZ, &w);
printf("\0338");
tcsetattr(STDOUT_FILENO, TCSANOW, &old);
if (ENABLE_FEATURE_RESIZE_PRINT)
printf("COLUMNS=%d;LINES=%d;export COLUMNS LINES;\n",
w.ws_col, w.ws_row);
return ret;
}
+47
View File
@@ -0,0 +1,47 @@
/* vi: set sw=4 ts=4: */
/*
* setconsole.c - redirect system console output
*
* Copyright (C) 2004,2005 Enrik Berkhan <Enrik.Berkhan@inka.de>
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "busybox.h"
#if ENABLE_FEATURE_SETCONSOLE_LONG_OPTIONS
static const struct option setconsole_long_options[] = {
{ "reset", 0, NULL, 'r' },
{ 0, 0, 0, 0 }
};
#endif
#define OPT_SETCONS_RESET 1
int setconsole_main(int argc, char **argv)
{
unsigned long flags;
const char *device = CURRENT_TTY;
#if ENABLE_FEATURE_SETCONSOLE_LONG_OPTIONS
applet_long_options = setconsole_long_options;
#endif
flags = getopt32(argc, argv, "r");
if (argc - optind > 1)
bb_show_usage();
if (argc - optind == 1) {
if (flags & OPT_SETCONS_RESET)
bb_show_usage();
device = argv[optind];
} else {
if (flags & OPT_SETCONS_RESET)
device = CONSOLE_DEV;
}
if (-1 == ioctl(xopen(device, O_RDONLY), TIOCCONS)) {
bb_perror_msg_and_die("TIOCCONS");
}
return EXIT_SUCCESS;
}
+25 -44
View File
@@ -4,69 +4,50 @@
*
* Copyright (C) 1994-1998 Andries E. Brouwer <aeb@cwi.nl>
*
* Adjusted for BusyBox by Erik Andersen <andersee@debian.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Adjusted for BusyBox by Erik Andersen <andersen@codepoet.org>
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "busybox.h"
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include "busybox.h"
/* From <linux/kd.h> */
struct kbkeycode {
unsigned int scancode, keycode;
};
static const int KDSETKEYCODE = 0x4B4D; /* write kernel keycode table entry */
enum {
KDSETKEYCODE = 0x4B4D /* write kernel keycode table entry */
};
extern int
extern int
setkeycodes_main(int argc, char** argv)
{
char *ep;
int fd, sc;
struct kbkeycode a;
int fd, sc;
struct kbkeycode a;
if (argc % 2 != 1 || argc < 2) {
usage(setkeycodes_usage);
if (argc % 2 != 1 || argc < 2) {
bb_show_usage();
}
fd = get_console_fd("/dev/console");
while (argc > 2) {
a.keycode = atoi(argv[2]);
a.scancode = sc = strtol(argv[1], &ep, 16);
if (*ep) {
error_msg_and_die("error reading SCANCODE: '%s'\n", argv[1]);
fd = get_console_fd();
while (argc > 2) {
a.keycode = xatoul_range(argv[2], 0, 127);
a.scancode = sc = xstrtoul_range(argv[1], 16, 0, 255);
if (a.scancode > 127) {
a.scancode -= 0xe000;
a.scancode += 128;
}
if (ioctl(fd, KDSETKEYCODE, &a)) {
bb_perror_msg_and_die("failed to set SCANCODE %x to KEYCODE %d", sc, a.keycode);
}
argc -= 2;
argv += 2;
}
if (a.scancode > 127) {
a.scancode -= 0xe000;
a.scancode += 128;
}
if (a.scancode > 255 || a.keycode > 127) {
error_msg_and_die("SCANCODE or KEYCODE outside bounds\n");
}
if (ioctl(fd,KDSETKEYCODE,&a)) {
perror("KDSETKEYCODE");
error_msg_and_die("failed to set SCANCODE %x to KEYCODE %d\n", sc, a.keycode);
}
argc -= 2;
argv += 2;
}
return EXIT_SUCCESS;
}
Loaded 100 of 1097 files, more files were not shown because too many files have changed in this diff. Show more