Commit Graph

13364 Commits

Author SHA1 Message Date
Denys Vlasenko
0ed5f7aacd use [s]rand(), not [s]random()
rand() is the most standard C library function,
and on uclibc they are the same. I guess
they are the same in most todays' libc...

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-05 18:58:15 +01:00
Denys Vlasenko
2cdcb1082c shuf: new applet
function                                             old     new   delta
shuf_main                                              -     478    +478
packed_usage                                       29571   29719    +148
applet_names                                        2460    2465      +5
applet_main                                         1428    1432      +4
applet_nameofs                                       714     716      +2
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 4/0 up/down: 637/0)             Total: 637 bytes

Based on the code by Bartosz Golaszewski <bartekgola@gmail.com>

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-05 18:56:20 +01:00
Denys Vlasenko
30f17e9556 man: default to ascii
Default to ascii instead of latin1. Otherwise man pages can be displayed
incorrectly. E.g. bullets show as "<B7>".

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-03 15:14:26 +01:00
Denys Vlasenko
ecd8c3affc ip link: add support for "address ETHADDR". Closes 4862
function                                             old     new   delta
do_iplink                                           2175    2289    +114

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-01 17:38:41 +01:00
Denys Vlasenko
81071e6872 unlzma: add comments about possible bug from BZ 2689
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-28 15:42:10 +01:00
Denys Vlasenko
2108a6f0b5 unlzma: move some variables in "more local" scope
No code changes as verified by objdump

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-28 15:05:43 +01:00
Denys Vlasenko
e2318bbad7 udhcpc: ignore NAKs from "wrong" servers. Closes 4267
function                                             old     new   delta
udhcpc_main                                         2716    2814     +98

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-27 18:15:50 +01:00
Denys Vlasenko
fca0ee5959 ls: make "ls -s DIR" show total too. Clases 4946
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-27 15:40:26 +01:00
Denys Vlasenko
3795266841 xargs: fix compilation breakage
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-27 15:02:36 +01:00
Denys Vlasenko
83e49ade57 grep: fix -w match if first match isn't a word, but second is. Closes 4520
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-27 14:56:12 +01:00
Denys Vlasenko
6f068904dc xargs: add support for -I and -i. Closes 493
function                                             old     new   delta
process_stdin_with_replace                             -     195    +195
xmalloc_substitute_string                              -     145    +145
xargs_main                                           808     884     +76
count_strstr                                           -      45     +45
packed_usage                                       29580   29571      -9
parse_params                                        1445    1416     -29
func_exec                                            285     138    -147
------------------------------------------------------------------------------
(add/remove: 4/0 grow/shrink: 1/3 up/down: 461/-185)          Total: 276 bytes
   text	   data	    bss	    dec	    hex	filename
 922156	    932	  17692	 940780	  e5aec	busybox_old
 922440	    932	  17692	 941064	  e5c08	busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-27 11:17:06 +01:00
Denys Vlasenko
6885e49ba5 find: code shrink
function                                             old     new   delta
func_exec                                            306     285     -21

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-26 15:27:10 +01:00
Denys Vlasenko
c472898eaa nc: fix option bit positions. Closes 6926
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-26 13:58:59 +01:00
Denys Vlasenko
589051b565 hwclock: fix setting of tz_minuteswest. Closes 5414
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-25 17:52:10 +01:00
Denys Vlasenko
18b699c30f build system: remove a dead link from Config help text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-25 17:31:22 +01:00
Denys Vlasenko
83bc4332e7 du, copy_file: fix file matching on cramfs. Closes 5456
function                                             old     new   delta
is_in_ino_dev_hashtable                               88     108     +20
add_to_ino_dev_hashtable                             150     142      -8
reset_ino_dev_hashtable                               84      75      -9
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 20/-17)              Total: 3 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-25 15:27:58 +01:00
Denys Vlasenko
12916b9220 libbb: trivial code shrink
function                                             old     new   delta
reset_ino_dev_hashtable                               84      74     -10

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-25 15:09:01 +01:00
Denys Vlasenko
6554d03735 sysctl: do not error out showing write-only data. Closes 6386
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-24 17:28:43 +01:00
Denys Vlasenko
a2796223cb wget: fix comment
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-24 17:20:40 +01:00
Denys Vlasenko
53315570bb wget: add commented-out code to use ssl_helper instead of openssl
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-23 23:39:47 +01:00
Denys Vlasenko
d82046f59f networking/ssl_helper: experimental matrixssl-based ssl helper
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-23 23:31:13 +01:00
Denys Vlasenko
8b7e8ae224 wget: add support for https using "openssl s_client" as a helper
www.kernel.org started redirecting http:// to https://
making https support mandatory for any auto build scripts.

function                                             old     new   delta
wget_main                                           2631    2971    +340
parse_url                                            409     471     +62
.rodata                                           115607  115626     +19
P_HTTPS                                                -       6      +6
P_HTTP                                                 -       5      +5
P_FTP                                                  -       4      +4
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 3/0 up/down: 436/0)             Total: 436 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-22 14:12:29 +01:00
Denys Vlasenko
192c14bd87 Improve examples/var_service READMEs
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-21 12:55:43 +01:00
Bartosz Golaszewski
265a74b983 Kbuild: move CONFIG_PAM to general configuration
Currently CONFIG_PAM depends on CONFIG_LOGIN, but is used by the httpd applet too.

This patch moves said option to general configuration, thus allowing to
compile httpd with PAM support independently from login.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-19 18:53:25 +01:00
Denys Vlasenko
ffc3a93d0d udhcpc: fix BPF filter. Hopefully fixes the root cause of 4598 and 6746
Use a *signed* large positive value in BPF filter to indicate success.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-19 14:17:11 +01:00
Denys Vlasenko
50e4cc29f5 ifplugd: code shrink
function                                             old     new   delta
ifplugd_main                                        1161    1144     -17

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-10 09:51:03 +01:00
Denys Vlasenko
3e78f6f955 htpd: trivial simplification in random interval selection
function                                             old     new   delta
poll_interval                                         57      52      -5

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-09 15:35:04 +01:00
Denys Vlasenko
8ed9672660 libbb: don't die if crypt() returns NULL
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-09 14:38:03 +01:00
Kaarle Ritvanen
4e03d41342 sendmail: use FQDN in default envelope sender
RFC 5321 requires the return path to be supplied with a proper domain
name.

Signed-off-by: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-09 09:49:36 +01:00
Denys Vlasenko
744ee5db1c udhcpc: in comments, explain the kind of raw socket we create
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-07 17:38:52 +01:00
Bartosz Golaszewski
3ba2df874c grep: properly handle grep -w "^str" in !EXTRA_COMPAT case too
function                                             old     new   delta
grep_file                                           1267    1288     +21

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-07 17:15:56 +01:00
Denys Vlasenko
07f417b6ab sendmail: make -f optional, document its default value
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-05 15:01:39 +01:00
Denys Vlasenko
e4785ca653 udhcpc: don't use BPF filter, users report problems (bugs 4598, 6746)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-03 18:03:42 +01:00
Kaarle Ritvanen
fe8390e0fe ifupdown: support 'link' address family
Does not configure anything. L2 configuration hook scripts should do
their job on receiving ADDRFAM=link. Configuration will be done only
once, irrespective of L3 protocols used.

Using the 'link' family in the interfaces file conforms to the Debian
implementation:

http://sources.debian.net/src/ifupdown/0.7.47.1/link.defn

function                                             old     new   delta
link_methods                                           -      12     +12
addr_link                                              -      12     +12
link_up_down                                           -       6      +6
static.addr_fams                                      12      16      +4
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 1/0 up/down: 34/0)               Total: 34 bytes

Signed-off-by: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-03 15:56:20 +01:00
Denys Vlasenko
d353bfff46 wget: fix use-after-free of ->user. Closes 6836
function                                             old     new   delta
wget_main                                           2207    2223     +16
parse_url                                            339     353     +14

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-03 14:09:42 +01:00
Denys Vlasenko
69a12fa790 catv: suppress compiler warning
The warning was:
warning: typedef 'BUG_const_mismatch' locally defined but not used [-Wunused-local-typedefs]

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-03 03:27:53 +01:00
Denys Vlasenko
640ce3de07 zcat: complain if input is not compressed
function                                             old     new   delta
buffer_fill_and_print                                178     191     +13
varvalue                                             735     743      +8
bbunpack                                             747     755      +8
open_zipped                                           85      89      +4
xmalloc_open_zipped_read_close                        61      63      +2
get_addr_1                                           240     242      +2
fbsplash_main                                       1228    1230      +2
pstree_main                                          322     321      -1
builtin_type                                         121     119      -2
do_load                                              954     926     -28
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 7/3 up/down: 39/-31)              Total: 8 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-02 02:06:38 +01:00
Mike Frysinger
f1999b5a9d appletlib: fix set-but-unused warning
When you build with FEATURE_INSTALLER disabled, you get a build
warning like so:

libbb/appletlib.c: In function 'busybox_main':
libbb/appletlib.c:691:7: warning: variable 'use_symbolic_links' set but
                                  not used [-Wunused-but-set-variable]
   int use_symbolic_links;
       ^

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-01-31 00:29:47 -05:00
Mike Frysinger
29ed580668 uname: fix up usage documentation
The -i/-o options were missing, and the -r/-s/-v options were
incorrectly labeled as "OS" instead of "kernel".

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-01-31 00:28:42 -05:00
Michael Tokarev
922fdf6527 init: do not fail build if SIGPWR is not defined
Apparently, some *BSD variants (and maybe some other OSes) does not define
SIGPWR signal.  So since commit 760fc6debc, busybox fails to build on
such platforms.  Fix this.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-30 13:22:04 +01:00
Denys Vlasenko
b664f740d9 libbb: open_zipped() should not fail on non-compressed files
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-27 13:02:18 +01:00
Michael Tokarev
bf2f2229bb testsuite: fix last "which" change
In commit afa63b2dcd I replaced `type -p' with
`command -pv'.  But actually it is wrong, the right
substitution is `command -v'.  We need to find our
busybox which is in the first directory in $PATH, so
`command -p' should not be used because it uses
default PATH, not current value of PATH where our
busybox binary resides.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-23 14:41:53 +01:00
Denys Vlasenko
821e64316a less: accept and ignore -s
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-22 16:36:22 +01:00
John Spencer
ff65061311 man: parse "DEFINE pager" in config
function                                             old     new   delta
man_main                                             789     844     +55

Signed-off-by: John Spencer <maillist-busybox@barfooze.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-22 15:31:10 +01:00
Eugene Rudoy
731f596175 iplink: fix build with kernel versions prior to 2.6.23
Signed-off-by: Eugene Rudoy <gene.devel@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-22 11:49:46 +01:00
Denys Vlasenko
fa6ab56353 libbb: if opening /dev/loopN returns ENXIO, don't try N++.
function                                             old     new   delta
set_loop                                             639     635      -4

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-21 13:44:21 +01:00
Denys Vlasenko
3b394781b5 libbb: fix parsing of "10101010" date/time form
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-21 07:58:18 +01:00
Bartosz Golaszewski
2de232da53 top.c: fix compilation warnings
pfd[1] is unused

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-20 03:26:34 +01:00
Denys Vlasenko
c009d35f00 ntpd: remove now unnecessary check for IP_PKTINFO definition
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-20 03:24:51 +01:00
Bartosz Golaszewski
76ad7481b1 ntpd: fix compilation warnings
GCC complained about since_last_update being set but not used.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-20 03:21:08 +01:00