oweals/busybox.git
15 years agohush: fix strcpy of potentially overlapping strings
Denis Vlasenko [Sat, 21 Mar 2009 21:51:11 +0000 (21:51 -0000)]
hush: fix strcpy of potentially overlapping strings

15 years agomsh testsuite: fix false positive, tweak run stript
Denis Vlasenko [Sat, 21 Mar 2009 19:58:58 +0000 (19:58 -0000)]
msh testsuite: fix false positive, tweak run stript

15 years agols: make readlink error to not disrupt output (try ls -l /proc/self/fd).
Denis Vlasenko [Sat, 21 Mar 2009 19:11:23 +0000 (19:11 -0000)]
ls: make readlink error to not disrupt output (try ls -l /proc/self/fd).
libbb: make xmalloc_readlink_or_warn warning more specific.

function                                             old     new   delta
xmalloc_readlink_or_warn                              33      61     +28
showfiles                                           1495    1460     -35
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 28/-35)             Total: -7 bytes

15 years agocpio: more compat: -0 and -L options
Denis Vlasenko [Fri, 20 Mar 2009 23:01:48 +0000 (23:01 -0000)]
cpio: more compat: -0 and -L options

function                                             old     new   delta
cpio_main                                           1417    1473     +56

15 years agoCompatibility fixes:
Denis Vlasenko [Fri, 20 Mar 2009 22:17:13 +0000 (22:17 -0000)]
Compatibility fixes:

grep: support -z
find: support --mindepth
  together +45 bytes
cpio: support -p (configurable, +230 bytes)
libbb: tweaks for cpio

15 years agocd: "support" -v by ignoring it
Denis Vlasenko [Fri, 20 Mar 2009 14:04:00 +0000 (14:04 -0000)]
cd: "support" -v by ignoring it

15 years agohush: tweak testsuite
Denis Vlasenko [Fri, 20 Mar 2009 12:12:33 +0000 (12:12 -0000)]
hush: tweak testsuite

15 years agohush: fix bug 207 and "hush -c" parameter passing.
Denis Vlasenko [Fri, 20 Mar 2009 12:05:14 +0000 (12:05 -0000)]
hush: fix bug 207 and "hush -c" parameter passing.
 Now hush -c 'printf "%s\n" "$@"' (prints "\n")
 and hush -c 'printf "%s\n" "$@"' qwe asd (prints "asd\n")
 both work correctly

15 years agoash: expand comment
Denis Vlasenko [Fri, 20 Mar 2009 10:20:08 +0000 (10:20 -0000)]
ash: expand comment

15 years agohush: fix set [--] params. Closes bug 199.
Denis Vlasenko [Fri, 20 Mar 2009 10:13:08 +0000 (10:13 -0000)]
hush: fix set [--] params. Closes bug 199.

function                                             old     new   delta
builtin_set                                           55     194    +139
add_strings_to_strings                                 -     130    +130
add_string_to_strings                                110      26     -84
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/1 up/down: 269/-84)           Total: 185 bytes

15 years agoash: add missing comma in debug scaffolding
Denis Vlasenko [Fri, 20 Mar 2009 07:45:36 +0000 (07:45 -0000)]
ash: add missing comma in debug scaffolding

15 years agoash: fix a case where we close wrong descriptor; add debug hack for that
Denis Vlasenko [Fri, 20 Mar 2009 01:24:08 +0000 (01:24 -0000)]
ash: fix a case where we close wrong descriptor; add debug hack for that

15 years agoash: DEBUG should be 0 :)
Denis Vlasenko [Thu, 19 Mar 2009 23:21:55 +0000 (23:21 -0000)]
ash: DEBUG should be 0 :)

15 years agoash: fix TRACE commands
Denis Vlasenko [Thu, 19 Mar 2009 23:09:58 +0000 (23:09 -0000)]
ash: fix TRACE commands

15 years agoash: make evaltree save/restore int suppression depth.
Denis Vlasenko [Thu, 19 Mar 2009 21:59:35 +0000 (21:59 -0000)]
ash: make evaltree save/restore int suppression depth.
 Hopefully this fixes bug 189. Not confirmed by users yet.

function                                             old     new   delta
evaltree                                             809     842     +33
evalvar                                             1374    1376      +2

15 years agodoc update
Denis Vlasenko [Thu, 19 Mar 2009 13:42:05 +0000 (13:42 -0000)]
doc update

15 years agoash: in dotrap(), do not clear gotsig[] for SIGINT if there is no handler
Denis Vlasenko [Thu, 19 Mar 2009 13:30:04 +0000 (13:30 -0000)]
ash: in dotrap(), do not clear gotsig[] for SIGINT if there is no handler
 for it, otherwise raise interrupt gets confused later.
 The rest are readability fixes.

function                                             old     new   delta
evaltreenr                                           817     818      +1
evaltree                                             817     818      +1
evalstring                                            88      89      +1
cmdloop                                              420     419      -1
evalskip                                               4       1      -3
breakcmd                                              84      81      -3
ash_main                                            1382    1379      -3
evalloop                                             183     177      -6
evalfor                                              231     225      -6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/6 up/down: 3/-22)             Total: -19 bytes

15 years agodf: fix FEATURE_DF_FANCY=off, FEATURE_HUMAN_READABLE=on case.
Denis Vlasenko [Thu, 19 Mar 2009 03:56:20 +0000 (03:56 -0000)]
df: fix FEATURE_DF_FANCY=off, FEATURE_HUMAN_READABLE=on case.

15 years agoash: tentatively fix bug 189.
Denis Vlasenko [Thu, 19 Mar 2009 03:36:18 +0000 (03:36 -0000)]
ash: tentatively fix bug 189.

15 years agoinit: test for vt terminal with VT_OPENQRY,
Denis Vlasenko [Thu, 19 Mar 2009 02:35:44 +0000 (02:35 -0000)]
init: test for vt terminal with VT_OPENQRY,
 assume that anything else is TERM=vt102, not TERM=linux.
 (Serial console test is less correct)
 Tentatively closes bug 195.

function                                             old     new   delta
init_main                                            946     919     -27

15 years agoash: fix "ash -c 'exec 1>&0'" complaining that fd 0 is busy
Denis Vlasenko [Thu, 19 Mar 2009 01:59:59 +0000 (01:59 -0000)]
ash: fix "ash -c 'exec 1>&0'" complaining that fd 0 is busy

15 years agols: make color-related code more readable. Fix a case when
Denis Vlasenko [Wed, 18 Mar 2009 22:39:34 +0000 (22:39 -0000)]
ls: make color-related code more readable. Fix a case when
 it was working non-deterministically.

function                                             old     new   delta
bold                                                   -      34     +34
showfiles                                           1508    1495     -13
fgcolor                                               50      34     -16
bgcolor                                               34       -     -34
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 0/2 up/down: 34/-63)            Total: -29 bytes

15 years agohttpd: add comment explaining why SERVER_NAME etc is not set.
Denis Vlasenko [Wed, 18 Mar 2009 20:00:46 +0000 (20:00 -0000)]
httpd: add comment explaining why SERVER_NAME etc is not set.

15 years agoftpd: fix command fetching to not do it in 1-byte reads;
Denis Vlasenko [Wed, 18 Mar 2009 17:32:44 +0000 (17:32 -0000)]
ftpd: fix command fetching to not do it in 1-byte reads;
 fix command de-escaping. Tested to download files with embeeded \xff and LF.
libbb: tweaks for the above

function                                             old     new   delta
ftpd_main                                           2231    2321     +90
xmalloc_fgets_internal                               190     222     +32
xmalloc_fgets_str_len                                  -      27     +27
xmalloc_fgets_str                                      7      23     +16
xmalloc_fgetline_str                                  10      26     +16
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 4/0 up/down: 181/0)             Total: 181 bytes

15 years agoftpd: add some comments
Denis Vlasenko [Wed, 18 Mar 2009 16:02:54 +0000 (16:02 -0000)]
ftpd: add some comments

15 years agoftpd: trim messages (but make sure they still make sense)
Denis Vlasenko [Wed, 18 Mar 2009 14:25:28 +0000 (14:25 -0000)]
ftpd: trim messages (but make sure they still make sense)
   text    data     bss     dec     hex filename
   4400       0       0    4400    1130 ftpd_old.o
   4346       0       0    4346    10fa ftpd.o

15 years agoftpd: do not use nasty tricks for re-execing if we are on MMU machine.
Denis Vlasenko [Wed, 18 Mar 2009 14:12:22 +0000 (14:12 -0000)]
ftpd: do not use nasty tricks for re-execing if we are on MMU machine.
On NOMMU, code is alomost the same, on MMU:

function                                             old     new   delta
handle_dir_common                                    223     390    +167
ftpd_main                                           2306    2231     -75
popen_ls                                             203       -    -203
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/1 up/down: 167/-278)         Total: -111 bytes

15 years agoftpd: add support for MDTM, I see clients often use it,
Denis Vlasenko [Wed, 18 Mar 2009 00:45:00 +0000 (00:45 -0000)]
ftpd: add support for MDTM, I see clients often use it,
 it may allow client-side caching.

function                                             old     new   delta
ftpd_main                                           2232    2306     +74
gmtime_r                                               -      19     +19
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/0 up/down: 93/0)               Total: 93 bytes

15 years agoftpd: document NLST format
Denis Vlasenko [Tue, 17 Mar 2009 13:03:06 +0000 (13:03 -0000)]
ftpd: document NLST format

15 years agoftpd: instead of wordy HELP, implement useful, and smaller, FEAT.
Denis Vlasenko [Tue, 17 Mar 2009 12:40:34 +0000 (12:40 -0000)]
ftpd: instead of wordy HELP, implement useful, and smaller, FEAT.
 (HELP is still "supported" as an alias to FEAT)

   text    data     bss     dec     hex filename
 807331     468    7856  815655   c7227 busybox_old
 807246     468    7856  815570   c71d2 busybox_unstripped

15 years agoftpd: implement -vv verbosity
Denis Vlasenko [Tue, 17 Mar 2009 12:23:24 +0000 (12:23 -0000)]
ftpd: implement -vv verbosity

function                                             old     new   delta
ftpd_main                                           2097    2190     +93
verbose_log                                            -      33     +33
cmdio_write_raw                                       12      34     +22
cmdio_write_ok                                        25      45     +20
cmdio_write_error                                     25      45     +20
cmdio_write                                           62      78     +16
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 5/0 up/down: 204/0)             Total: 204 bytes

15 years agoftpd: tweak timeout code
Denis Vlasenko [Tue, 17 Mar 2009 05:11:51 +0000 (05:11 -0000)]
ftpd: tweak timeout code

15 years agochat: update by Vladimir
Denis Vlasenko [Mon, 16 Mar 2009 23:06:23 +0000 (23:06 -0000)]
chat: update by Vladimir
 1) to treat timeout more correctly (timeout affects whole send command
    duration, not a single char);
 2) to recognize RECORD directive.

function                                             old     new   delta
chat_main                                           1246    1359    +113
exitcode                                               1       -      -1

15 years agoftpd: fix thinko: set_nport takes port in network order
Denis Vlasenko [Mon, 16 Mar 2009 21:01:41 +0000 (21:01 -0000)]
ftpd: fix thinko: set_nport takes port in network order

15 years agoftpd: dont use fdprintf for simple status messages
Denis Vlasenko [Mon, 16 Mar 2009 20:54:45 +0000 (20:54 -0000)]
ftpd: dont use fdprintf for simple status messages

function                                             old     new   delta
ftpd_main                                           2025    2055     +30
cmdio_write_ok                                        17      25      +8
cmdio_write_error                                     17      25      +8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 46/0)               Total: 46 bytes

15 years agoftpd: simplify PORT check by assuming IP = peer's IP.
Denis Vlasenko [Mon, 16 Mar 2009 19:54:06 +0000 (19:54 -0000)]
ftpd: simplify PORT check by assuming IP = peer's IP.
 Should be as safe as before this change.

function                                             old     new   delta
ftpd_main                                           2115    2025     -90

15 years agoftpd: add idle and absolute timeouts. This is a security issue,
Denis Vlasenko [Mon, 16 Mar 2009 16:19:53 +0000 (16:19 -0000)]
ftpd: add idle and absolute timeouts. This is a security issue,
 otherwise ftpd may end up hanging indefinitely.

function                                             old     new   delta
timeout_handler                                        -     110    +110
ftpd_main                                           2019    2115     +96
packed_usage                                       25662   25685     +23
handle_upload_common                                 306     322     +16
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 3/0 up/down: 245/0)             Total: 245 bytes

15 years agoftpd: security tightened up:
Denis Vlasenko [Mon, 16 Mar 2009 14:53:54 +0000 (14:53 -0000)]
ftpd: security tightened up:
 PORT is not allowed on !IPv4
 PORT must have IP == peer's IP
 upload is allowed only into regular files

function                                             old     new   delta
ftpd_main                                           1815    2019    +204
handle_upload_common                                 260     306     +46
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 250/0)             Total: 250 bytes

15 years agoawk: fix compat issue found by gpm build
Denis Vlasenko [Sun, 15 Mar 2009 22:20:31 +0000 (22:20 -0000)]
awk: fix compat issue found by gpm build

function                                             old     new   delta
as_regex                                             105     131     +26
hash_find                                            247     233     -14
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 26/-14)             Total: 12 bytes

15 years agotr: support -C as synonym to -c
Denis Vlasenko [Sun, 15 Mar 2009 16:41:55 +0000 (16:41 -0000)]
tr: support -C as synonym to -c

15 years agoftpd: fix the bug where >2GB file ops report errors;
Denis Vlasenko [Sun, 15 Mar 2009 15:54:58 +0000 (15:54 -0000)]
ftpd: fix the bug where >2GB file ops report errors;
 make a few simplifications; add TODOs.

function                                             old     new   delta
port_or_pasv_was_seen                                  -      37     +37
get_remote_transfer_fd                               104     109      +5
handle_upload_common                                 265     260      -5
handle_dir_common                                    228     223      -5
popen_ls                                             211     203      -8
ftpd_main                                           1825    1815     -10
data_transfer_checks_ok                               37       -     -37
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 1/4 up/down: 42/-65)            Total: -23 bytes

15 years agosha: merge K[] for sha256 and 512
Denis Vlasenko [Sun, 15 Mar 2009 04:56:51 +0000 (04:56 -0000)]
sha: merge K[] for sha256 and 512

function                                             old     new   delta
sha_K                                                  -     640    +640
sha256_process_block64                               440     425     -15
sha512_process_block128                             1336    1283     -53
K512_lo                                              320       -    -320
K256                                                 320       -    -320
------------------------------------------------------------------------------
(add/remove: 1/2 grow/shrink: 0/2 up/down: 640/-708)          Total: -68 bytes

15 years agosha: fix thinko in sha512; add FAST_FUNC to sha1/sha256
Denis Vlasenko [Sun, 15 Mar 2009 02:56:00 +0000 (02:56 -0000)]
sha: fix thinko in sha512; add FAST_FUNC to sha1/sha256

function                                             old     new   delta
sha512_process_block128                             1334    1336      +2
sha1_hash                                            112     111      -1
sha256_process_block64                               446     440      -6
sha1_process_block64                                 494     484     -10
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/3 up/down: 2/-17)             Total: -15 bytes

15 years agosha: merge sha1/sha256 handling (they are similar enough for this),
Denis Vlasenko [Sun, 15 Mar 2009 02:28:05 +0000 (02:28 -0000)]
sha: merge sha1/sha256 handling (they are similar enough for this),
 shrink sha215 code

function                                             old     new   delta
sha1_end                                             129     142     +13
sha1_process_block64                                 486     494      +8
sha256_begin                                          37      44      +7
sha1_begin                                            49      56      +7
sha1_hash                                            108     112      +4
...
sha512_end                                           204     184     -20
sha512_process_block128                             1405    1334     -71
sha256_process_block64                               520     446     -74
sha256_end                                           147       -    -147
sha512_hash                                          297     130    -167
sha256_hash                                          260       -    -260
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 11/9 up/down: 59/-752)         Total: -693 bytes

15 years agouname: correct cut/paste error
Denis Vlasenko [Sun, 15 Mar 2009 01:28:30 +0000 (01:28 -0000)]
uname: correct cut/paste error
touch: add long options

function                                             old     new   delta
static.longopts                                      137     162     +25
touch_main                                           221     231     +10
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 35/0)               Total: 35 bytes

15 years agomount: support "-O option"; stop trying to mount swap partitions
Denis Vlasenko [Sat, 14 Mar 2009 22:57:20 +0000 (22:57 -0000)]
mount: support "-O option"; stop trying to mount swap partitions

function                                             old     new   delta
mount_main                                           975    1152    +177
umount_main                                          640     636      -4
packed_usage                                       25666   25662      -4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 177/-8)            Total: 169 bytes

15 years agouname: support long options
Denis Vlasenko [Sat, 14 Mar 2009 18:41:19 +0000 (18:41 -0000)]
uname: support long options

15 years agoinsmod/modprobe: do not pass NULL to kernel as module parameter
Denis Vlasenko [Fri, 13 Mar 2009 23:43:26 +0000 (23:43 -0000)]
insmod/modprobe: do not pass NULL to kernel as module parameter

15 years agotar: make FEATURE_TAR_AUTODETECT work with DESKTOP off too.
Denis Vlasenko [Fri, 13 Mar 2009 14:26:44 +0000 (14:26 -0000)]
tar: make FEATURE_TAR_AUTODETECT work with DESKTOP off too.

15 years agosha: reduce sha256/512 context size. Make sha1/sha256 code more similar
Denis Vlasenko [Thu, 12 Mar 2009 19:06:18 +0000 (19:06 -0000)]
sha: reduce sha256/512 context size. Make sha1/sha256 code more similar

function                                             old     new   delta
sha512_end                                           182     204     +22
sha256_end                                           137     147     +10
sha1_hash                                            113     108      -5
sha1_end                                             143     129     -14
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/2 up/down: 32/-19)             Total: 13 bytes

15 years agosha: tiny shrink
Denis Vlasenko [Thu, 12 Mar 2009 17:50:50 +0000 (17:50 -0000)]
sha: tiny shrink

15 years agoadd comment about sha testing
Denis Vlasenko [Thu, 12 Mar 2009 16:05:02 +0000 (16:05 -0000)]
add comment about sha testing

15 years agoshrink sha hashing a bit more (remove wbuflen field from ctx),
Denis Vlasenko [Thu, 12 Mar 2009 15:40:27 +0000 (15:40 -0000)]
shrink sha hashing a bit more (remove wbuflen field from ctx),
remove the requirement for aligned buffer

function                                             old     new   delta
sha512_hash                                          262     297     +35
sha1_end                                             136     143      +7
passwd_main                                         1019    1023      +4
sha256_end                                           135     137      +2
count_lines                                           72      74      +2
sha256_hash                                          259     260      +1
popstring                                            164     158      -6
sha512_begin                                          88      81      -7
sha256_begin                                          44      37      -7
parse_expr                                           832     824      -8
bbunpack                                             446     438      -8
sha256_process_block64                               529     520      -9
md5_end                                              166     151     -15
evaltreenr                                           817     802     -15
evaltree                                             817     802     -15
sha512_end                                           204     182     -22
sha512_process_block128                             1444    1405     -39
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 6/11 up/down: 51/-151)         Total: -100 bytes

15 years agoshrink sha hashing
Denis Vlasenko [Thu, 12 Mar 2009 15:39:11 +0000 (15:39 -0000)]
shrink sha hashing

function                                             old     new   delta
sha512_hash                                          262     281     +19
sha512_end                                           204     221     +17
sha1_hash                                            128     113     -15
static.mask                                           16       -     -16
static.bits                                           16       -     -16
sha1_end                                             160     136     -24
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 2/2 up/down: 36/-71)            Total: -35 bytes

15 years agopopmaildir: fix several grave bugs with using memory past end of malloc block
Denis Vlasenko [Thu, 12 Mar 2009 15:35:26 +0000 (15:35 -0000)]
popmaildir: fix several grave bugs with using memory past end of malloc block

15 years agothe -elf2flt flag can be used w/out -Wl, so drop the requirement so people can use...
Mike Frysinger [Thu, 12 Mar 2009 07:56:49 +0000 (07:56 -0000)]
the -elf2flt flag can be used w/out -Wl, so drop the requirement so people can use either form

15 years agosha256/512: code shrink. Run-tested.
Denis Vlasenko [Wed, 11 Mar 2009 21:15:51 +0000 (21:15 -0000)]
sha256/512: code shrink. Run-tested.

function                                             old     new   delta
sha512_process_block128                                -    1444   +1444
sha1_process_block64                                   -     542    +542
sha256_process_block64                                 -     529    +529
K512_lo                                                -     320    +320
K256                                                   -     320    +320
init512_lo                                             -      32     +32
init256                                                -      32     +32
sha1_hash                                             99     128     +29
sha256_end                                           160     135     -25
sha1_end                                             189     160     -29
sha512_end                                           237     204     -33
sha256_begin                                          77      44     -33
sha512_begin                                         154      88     -66
sha256_hash                                          338     259     -79
sha512_hash                                          358     262     -96
sha1_compile                                         542       -    -542
sha256_process_block                                 594       -    -594
static.K                                             896       -    -896
sha512_process_block                                1861       -   -1861
------------------------------------------------------------------------------
(add/remove: 7/4 grow/shrink: 1/7 up/down: 3248/-4254)      Total: -1006 bytes
   text    data     bss     dec     hex filename
 808013     468    7856  816337   c74d1 busybox_old
 807007     468    7856  815331   c70e3 busybox_unstripped

15 years ago*: remove LOG_NOWAIT
Denis Vlasenko [Wed, 11 Mar 2009 15:59:49 +0000 (15:59 -0000)]
*: remove LOG_NOWAIT

15 years agoftpd: stop unconditional logging to syslog. This was the only applet
Denis Vlasenko [Wed, 11 Mar 2009 15:07:44 +0000 (15:07 -0000)]
ftpd: stop unconditional logging to syslog. This was the only applet
 which was doing it. Added option -S to enable it when desired.

function                                             old     new   delta
packed_usage                                       25647   25666     +19
ftpd_main                                           1826    1825      -1

15 years agodocs/logging_and_backgrounding.txt: new mini-doc
Denis Vlasenko [Wed, 11 Mar 2009 14:40:00 +0000 (14:40 -0000)]
docs/logging_and_backgrounding.txt: new mini-doc
dnsd: remove statics, remove nerly-useless SIGINT handler
crond: correct more of logfile to 0666 (as usual, umask allows
 user to remove unwanted bits).
nameif: print errors to stderr too, not just to syslog

function                                             old     new   delta
udhcp_read_interface                                 308     306      -2
ttl                                                    4       -      -4
fileconf                                               4       -      -4
dnsentry                                               4       -      -4
interrupt                                             19       -     -19
dnsd_main                                           1463    1394     -69
------------------------------------------------------------------------------
(add/remove: 0/4 grow/shrink: 0/2 up/down: 0/-102)           Total: -102 bytes
   text    data     bss     dec     hex filename
 808161     476    7864  816501   c7575 busybox_old
 807994     468    7856  816318   c74be busybox_unstripped

15 years agomail.c: more robust handling of SIGCHLD
Denis Vlasenko [Tue, 10 Mar 2009 16:01:57 +0000 (16:01 -0000)]
mail.c: more robust handling of SIGCHLD
init: more robust signal handling

15 years agoftpd + ls - timestamp = confused Mozilla. Prevent that.
Denis Vlasenko [Mon, 9 Mar 2009 22:37:23 +0000 (22:37 -0000)]
ftpd + ls - timestamp = confused Mozilla. Prevent that.

15 years agoftpd: add LOG_NDELAY to openlog
Denis Vlasenko [Mon, 9 Mar 2009 17:22:16 +0000 (17:22 -0000)]
ftpd: add LOG_NDELAY to openlog

15 years agouniq: strncmp(a,b, -1) might be problematic, use INT_MAX instead
Denis Vlasenko [Mon, 9 Mar 2009 16:43:28 +0000 (16:43 -0000)]
uniq: strncmp(a,b, -1) might be problematic, use INT_MAX instead

15 years agofix typo in help text
Denis Vlasenko [Mon, 9 Mar 2009 16:25:33 +0000 (16:25 -0000)]
fix typo in help text

15 years agoftpd: reuse ls applet for LIST/NLST/STAT generation
Denis Vlasenko [Mon, 9 Mar 2009 15:46:07 +0000 (15:46 -0000)]
ftpd: reuse ls applet for LIST/NLST/STAT generation

function                                             old     new   delta
popen_ls                                               -     211    +211
ftpd_main                                           1760    1826     +66
handle_dir_common                                    199     228     +29
get_remote_transfer_fd                                89     104     +15
replace_char                                          30      34      +4
handle_upload_common                                 263     265      +2
bind_for_passive_mode                                129     121      -8
cmdio_write                                           84      62     -22
escape_text                                          166     136     -30
init_data_sock_params                                 81       -     -81
ftpdataio_dispose_transfer_fd                         87       -     -87
write_dirstats                                       149       -    -149
write_filestats                                      603       -    -603
------------------------------------------------------------------------------
(add/remove: 1/4 grow/shrink: 11/5 up/down: 384/-986)        Total: -602 bytes
   text    data     bss     dec     hex filename
 808804     476    7864  817144   c77f8 busybox_old
 808156     476    7864  816496   c7570 busybox_unstripped

15 years agoftpd: EPSV and SIZE support. Tested to work on IPv6 too.
Denis Vlasenko [Mon, 9 Mar 2009 13:01:08 +0000 (13:01 -0000)]
ftpd: EPSV and SIZE support. Tested to work on IPv6 too.
libbb: str2sockaddr shuld accept [IPv6] addr without port -
 wget 'ftp://[::1]/file' needs that to work.

function                                             old     new   delta
bind_for_passive_mode                                  -     129    +129
get_nport                                              -      30     +30
ftpd_main                                           1731    1760     +29
str2sockaddr                                         412     431     +19
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 2/0 up/down: 207/0)             Total: 207 bytes
   text    data     bss     dec     hex filename
 808568     476    7864  816908   c770c busybox_old
 808804     476    7864  817144   c77f8 busybox_unstripped

15 years agoftp: reduce amount of realloc's done in cmdio_write
Denis Vlasenko [Mon, 9 Mar 2009 04:38:37 +0000 (04:38 -0000)]
ftp: reduce amount of realloc's done in cmdio_write

   text    data     bss     dec     hex filename
 808562     476    7864  816902   c7706 busybox_old
 808568     476    7864  816908   c770c busybox_unstripped

15 years agoftpd: code shrink
Denis Vlasenko [Mon, 9 Mar 2009 04:22:52 +0000 (04:22 -0000)]
ftpd: code shrink

15 years agoftpd: code shrink
Denis Vlasenko [Mon, 9 Mar 2009 04:18:00 +0000 (04:18 -0000)]
ftpd: code shrink

15 years agoftp: code shrink
Denis Vlasenko [Mon, 9 Mar 2009 04:13:59 +0000 (04:13 -0000)]
ftp: code shrink

   text    data     bss     dec     hex filename
 809078     476    7864  817418   c790a busybox_old
 808590     476    7864  816930   c7722 busybox_unstripped

15 years agoftpd: code shuffled a bit, added comments
Denis Vlasenko [Mon, 9 Mar 2009 03:15:05 +0000 (03:15 -0000)]
ftpd: code shuffled a bit, added comments

15 years agoftpd: add comment
Denis Vlasenko [Mon, 9 Mar 2009 02:51:46 +0000 (02:51 -0000)]
ftpd: add comment

15 years agoftpd: further code shrink
Denis Vlasenko [Mon, 9 Mar 2009 02:23:45 +0000 (02:23 -0000)]
ftpd: further code shrink

function                                             old     new   delta
port_pasv_cleanup                                      -      50     +50
replace_char                                           -      30     +30
ftp_write_str_common                                 102     104      +2
handle_dir_common                                    209     204      -5
ftpd_main                                           1990    1970     -20
port_cleanup                                          23       -     -23
pasv_cleanup                                          28       -     -28
handle_upload_common                                 320     273     -47
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 1/3 up/down: 82/-123)           Total: -41 bytes

15 years ago*: move get_sock_lsa and xwrite_str to libbb, use where appropriate
Denis Vlasenko [Mon, 9 Mar 2009 00:12:37 +0000 (00:12 -0000)]
*: move get_sock_lsa and xwrite_str to libbb, use where appropriate

function                                             old     new   delta
get_sock_lsa                                           -      72     +72
buffer_fill_and_print                                179     196     +17
parse_expr                                           824     832      +8
read_base64                                          343     348      +5
nameval                                              202     206      +4
fbset_main                                          1694    1698      +4
expand                                              1849    1853      +4
udhcp_send_kernel_packet                             249     252      +3
udhcp_get_option                                     223     222      -1
chat_main                                           1246    1245      -1
pack_gzip                                           1661    1659      -2
doset                                                299     297      -2
bb__parsespent                                       119     117      -2
test_main                                            260     257      -3
qgravechar                                           109     106      -3
tcpudpsvd_main                                      1834    1830      -4
sysctl_display_all                                   589     580      -9
xopen_xwrite_close                                    44      33     -11
prs                                                   30      18     -12
find_main                                            418     406     -12
full_write2_str                                       25      12     -13
adduser_main                                         667     654     -13
evaltreenr                                           817     802     -15
evaltree                                             817     802     -15
tftpd_main                                           526     493     -33
ftpd_main                                           2050    1990     -60
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 7/18 up/down: 117/-211)         Total: -94 bytes

15 years agoftpd: code chrink, fixed some minor bugs
Denis Vlasenko [Sun, 8 Mar 2009 23:46:48 +0000 (23:46 -0000)]
ftpd: code chrink, fixed some minor bugs
ls: update comment
*: openlog fixes (added LOG_PID, set LOG_DAEMON as appropriate)

function                                             old     new   delta
xwrite_str                                             -      26     +26
cmdio_write_ok                                         -      15     +15
handle_cwd                                            40      45      +5
packed_usage                                       25668   25670      +2
cmdio_write_raw                                        7       9      +2
handle_upload_common                                 322     320      -2
udhcpd_main                                         1375    1372      -3
udhcpc_main                                         2362    2359      -3
port_cleanup                                          27      23      -4
handle_dir_common                                    221     209     -12
str_netfd_write                                       26       -     -26
cmdio_get_cmd_and_arg                                122       -    -122
ftpd_main                                           2208    2050    -158
------------------------------------------------------------------------------
   text    data     bss     dec     hex filename
 809933     476    7864  818273   c7c61 busybox_old
 809199     476    7864  817539   c7983 busybox_unstripped

15 years agoadding forgotten new file
Denis Vlasenko [Sun, 8 Mar 2009 09:31:28 +0000 (09:31 -0000)]
adding forgotten new file

15 years agoftpd: new applet by Adam Tkac
Denis Vlasenko [Sun, 8 Mar 2009 09:30:56 +0000 (09:30 -0000)]
ftpd: new applet by Adam Tkac

$ size ftpd.o
   text    data     bss     dec     hex filename
   5703       0       0    5703    1647 ftpd.o

15 years agowebsite: mention fixes to syslogd
Denis Vlasenko [Sun, 8 Mar 2009 01:06:18 +0000 (01:06 -0000)]
website: mention fixes to syslogd

15 years agowebsite: announce 1.13.3
Denis Vlasenko [Sun, 8 Mar 2009 01:00:16 +0000 (01:00 -0000)]
website: announce 1.13.3

15 years agohalt/reboot/poweroff: improve error reporting
Denis Vlasenko [Sat, 7 Mar 2009 01:54:24 +0000 (01:54 -0000)]
halt/reboot/poweroff: improve error reporting

function                                             old     new   delta
halt_main                                            207     185     -22

15 years agofurther work on modprobe
Denis Vlasenko [Fri, 6 Mar 2009 22:48:11 +0000 (22:48 -0000)]
further work on modprobe

function                                             old     new   delta
gather_options_str                                     -      75     +75
config_file_action                                   388     413     +25
load_modules_dep                                     175     192     +17
add_probe                                             67      72      +5
modprobe_main                                        494     488      -6
gather_options                                        89       -     -89
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 3/1 up/down: 122/-95)            Total: 27 bytes

15 years ago- test commit
Bernhard Reutner-Fischer [Thu, 5 Mar 2009 17:27:39 +0000 (17:27 -0000)]
- test commit

15 years agomodprobe: rework/speedup by Timo Teras (timo.teras AT iki.fi)
Denis Vlasenko [Thu, 5 Mar 2009 16:32:27 +0000 (16:32 -0000)]
modprobe: rework/speedup by Timo Teras (timo.teras AT iki.fi)

function                                             old     new   delta
load_modules_dep                                       -     175    +175
helper_get_module                                      -     106    +106
gather_options                                         -      89     +89
add_probe                                              -      67     +67
config_file_action                                   345     388     +43
get_or_add_modentry                                    -      10     +10
loaded                                                 4       -      -4
read_config                                          239     234      -5
llist_find                                            34       -     -34
add_option                                            60       -     -60
modprobe_main                                        567     494     -73
do_modprobe                                          601     273    -328
------------------------------------------------------------------------------
(add/remove: 5/3 grow/shrink: 1/3 up/down: 490/-504)          Total: -14 bytes
   text    data     bss     dec     hex filename
 816778     476    7888  825142   c9736 busybox_old
 816768     476    7880  825124   c9724 busybox_unstripped

15 years agomodutils: delete unused global variable
Denis Vlasenko [Thu, 5 Mar 2009 09:26:17 +0000 (09:26 -0000)]
modutils: delete unused global variable

function                                             old     new   delta
modprobe_main                                        570     567      -3
insmod_main                                          101      98      -3
insmod_outputname                                      4       -      -4
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/2 up/down: 0/-10)             Total: -10 bytes
   text    data     bss     dec     hex filename
 816784     476    7892  825152   c9740 busybox_old
 816778     476    7888  825142   c9736 busybox_unstripped

15 years agonetworking/libiproute/*: code shrink by optimizing numeric conversions
Denis Vlasenko [Thu, 5 Mar 2009 09:21:57 +0000 (09:21 -0000)]
networking/libiproute/*: code shrink by optimizing numeric conversions
 and other misc stuff

function                                             old     new   delta
print_tunnel                                         660     656      -4
format_host                                            5       -      -5
get_unsigned                                          70      54     -16
get_u32                                               70      54     -16
do_iplink                                           1173    1151     -22
get_prefix                                           417     393     -24
print_rule                                           800     771     -29
print_addrinfo                                      1374    1342     -32
print_route                                         1745    1709     -36
iprule_modify                                        905     866     -39
iproute_modify                                      1105    1048     -57
get_integer                                           70       -     -70
parse_args                                          1684    1440    -244
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 0/11 up/down: 0/-594)          Total: -594 bytes
   text    data     bss     dec     hex filename
 817378     476    7892  825746   c9992 busybox_old
 816784     476    7892  825152   c9740 busybox_unstripped

15 years agosendmail: document and fix usage of fd #4, fix check for helper failure.
Denis Vlasenko [Wed, 4 Mar 2009 17:56:00 +0000 (17:56 -0000)]
sendmail: document and fix usage of fd #4, fix check for helper failure.

function                                             old     new   delta
packed_usage                                       25663   25694     +31
signal_handler                                       191     215     +24
kill_helper                                           22      31      +9
launch_helper                                        194     184     -10
get_cred_or_die                                      142     129     -13
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/2 up/down: 64/-23)             Total: 41 bytes

15 years agowget: --post-data support by Harald Kuthe (harald-tuxbox AT arcor.de)
Denis Vlasenko [Wed, 4 Mar 2009 14:13:37 +0000 (14:13 -0000)]
wget: --post-data support by Harald Kuthe (harald-tuxbox AT arcor.de)

function                                             old     new   delta
wget_main                                           2467    2793    +326
static.wget_longopts                                 110     122     +12
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 338/0)             Total: 338 bytes

15 years agomodprobe: emit "can't open 'modules.dep': (errno)" instead of "module not found"
Denis Vlasenko [Tue, 3 Mar 2009 18:47:56 +0000 (18:47 -0000)]
modprobe: emit "can't open 'modules.dep': (errno)" instead of "module not found"
*: s/can't open %s/can't open '%s'/, it's better to use same string.

function                                             old     new   delta
do_modprobe                                          588     601     +13
config_file_action                                   339     345      +6
modprobe_main                                        565     570      +5
unable_to_open                                        14      16      +2
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 26/0)               Total: 26 bytes
   text    data     bss     dec     hex filename
 816800     476    7892  825168   c9750 busybox_old
 816812     476    7892  825180   c975c busybox_unstripped

15 years agoip: in "ip rule add from all table 1", "all" is taken as 0.0.0.0/32,
Denis Vlasenko [Tue, 3 Mar 2009 14:55:29 +0000 (14:55 -0000)]
ip: in "ip rule add from all table 1", "all" is taken as 0.0.0.0/32,
whereas "any" and "default" would be 0.0.0.0/0. They must be all 0.0.0.0/0.
Closes bug 57.

15 years agoexpr: a bit more robust handling of regexps with groups (closes bug 87)
Denis Vlasenko [Tue, 3 Mar 2009 14:27:36 +0000 (14:27 -0000)]
expr: a bit more robust handling of regexps with groups (closes bug 87)

15 years agoprintf: fix 1.12.0 breakage (from %*d fix). It was misinterpreting "*"
Denis Vlasenko [Tue, 3 Mar 2009 14:14:44 +0000 (14:14 -0000)]
printf: fix 1.12.0 breakage (from %*d fix). It was misinterpreting "*"

15 years agols: implement -Q and -g (-g was accepted but ignored)
Denis Vlasenko [Tue, 3 Mar 2009 14:09:04 +0000 (14:09 -0000)]
ls: implement -Q and -g (-g was accepted but ignored)

function                                             old     new   delta
print_name                                             -     198    +198
showfiles                                           1489    1508     +19
ls_options                                            30      31      +1
opt_flags                                            112     108      -4
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/1 up/down: 218/-4)            Total: 214 bytes

15 years agols: do not follow links with -s (closes bug 33),
Denis Vlasenko [Tue, 3 Mar 2009 13:20:22 +0000 (13:20 -0000)]
ls: do not follow links with -s (closes bug 33),
 display unsigned data with %XXu, not %XXd.

15 years agotop: make it work again on 2.4 kernels (closes bug 125)
Denis Vlasenko [Tue, 3 Mar 2009 11:55:31 +0000 (11:55 -0000)]
top: make it work again on 2.4 kernels (closes bug 125)

15 years agosendmail: improve help text
Denis Vlasenko [Mon, 2 Mar 2009 16:12:00 +0000 (16:12 -0000)]
sendmail: improve help text

15 years agowget: fix --header handling
Denis Vlasenko [Mon, 2 Mar 2009 15:08:06 +0000 (15:08 -0000)]
wget: fix --header handling

15 years agosyslogd: create logfile with 0666, not 0600.
Denis Vlasenko [Mon, 2 Mar 2009 14:26:28 +0000 (14:26 -0000)]
syslogd: create logfile with 0666, not 0600.

15 years agotr: update testsuite
Denis Vlasenko [Mon, 2 Mar 2009 12:07:15 +0000 (12:07 -0000)]
tr: update testsuite

15 years agotr: fix overflow in expand and complement, fix stop after [:class:],
Denis Vlasenko [Mon, 2 Mar 2009 12:05:57 +0000 (12:05 -0000)]
tr: fix overflow in expand and complement, fix stop after [:class:],
 fix order of [:xdigit:], make tr require one param at least.

function                                             old     new   delta
expand                                              1743    1849    +106
tr_main                                              463     518     +55
complement                                            72      75      +3
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 164/0)             Total: 164 bytes