platform/upstream/busybox.git
12 years agoarchival/libarchive/decompress_unzip.c -> decompress_gunzip.c. no code changes
Denys Vlasenko [Tue, 6 Mar 2012 15:26:20 +0000 (16:26 +0100)]
archival/libarchive/decompress_unzip.c -> decompress_gunzip.c. no code changes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agopreparatory cleanups for seamless uncompression improvements
Denys Vlasenko [Tue, 6 Mar 2012 15:23:50 +0000 (16:23 +0100)]
preparatory cleanups for seamless uncompression improvements

unpack_gz_stream_with_info: fix buggy error check
man: fix possible accesses past the end of a string
move seamless uncompression helpers from read_printf.c to open_transformer.c

function                                             old     new   delta
show_manpage                                         153     212     +59
unpack_gz_stream_with_info                           520     539     +19

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agossd: compat: match -x EXECUTABLE by /proc/pid/exe too
Denys Vlasenko [Mon, 5 Mar 2012 15:28:07 +0000 (16:28 +0100)]
ssd: compat: match -x EXECUTABLE by /proc/pid/exe too

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agouudecode: tweak help text
Denys Vlasenko [Mon, 5 Mar 2012 13:23:26 +0000 (14:23 +0100)]
uudecode: tweak help text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agouuencode: tweak help text
Denys Vlasenko [Mon, 5 Mar 2012 13:22:33 +0000 (14:22 +0100)]
uuencode: tweak help text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agontpd: fix a case when discipline_jitter = 0 if we step
Denys Vlasenko [Mon, 5 Mar 2012 09:18:00 +0000 (10:18 +0100)]
ntpd: fix a case when discipline_jitter = 0 if we step

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agocp: trim help text
Denys Vlasenko [Mon, 5 Mar 2012 09:09:18 +0000 (10:09 +0100)]
cp: trim help text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agodu: trim help text a bit more
Denys Vlasenko [Mon, 5 Mar 2012 08:59:56 +0000 (09:59 +0100)]
du: trim help text a bit more

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agodu: remove stray whitespace in help text
Denys Vlasenko [Mon, 5 Mar 2012 08:52:19 +0000 (09:52 +0100)]
du: remove stray whitespace in help text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agontpd: experimental code to correct frequency a bit more aggressively
Denys Vlasenko [Sun, 4 Mar 2012 23:51:48 +0000 (00:51 +0100)]
ntpd: experimental code to correct frequency a bit more aggressively

function                                             old     new   delta
update_local_clock                                   730     792     +62
recv_and_process_peer_pkt                            850     835     -15

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoblkid: if parameters are given, do not scan /dev
Denys Vlasenko [Sat, 3 Mar 2012 14:09:07 +0000 (15:09 +0100)]
blkid: if parameters are given, do not scan /dev

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agontpd: fix the "are we a server" check in previous commit
Denys Vlasenko [Sat, 3 Mar 2012 12:50:31 +0000 (13:50 +0100)]
ntpd: fix the "are we a server" check in previous commit

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agontpd: avoid printing messages between send and recv. good for fast networks
Denys Vlasenko [Sat, 3 Mar 2012 11:15:46 +0000 (12:15 +0100)]
ntpd: avoid printing messages between send and recv. good for fast networks

function                                             old     new   delta
ntpd_main                                            887     929     +42

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agontpd: log clock drift with three digits after decimal point
Denys Vlasenko [Fri, 2 Mar 2012 14:51:43 +0000 (15:51 +0100)]
ntpd: log clock drift with three digits after decimal point

+15 bytes.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agontpd: log jitter on update too; increase assumed clock precision x2 - to 2ms
Denys Vlasenko [Fri, 2 Mar 2012 00:22:40 +0000 (01:22 +0100)]
ntpd: log jitter on update too; increase assumed clock precision x2 - to 2ms

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agodate: extend help text to explain compat date format. Closes 4820
Denys Vlasenko [Thu, 1 Mar 2012 07:36:07 +0000 (08:36 +0100)]
date: extend help text to explain compat date format. Closes 4820

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agofbsplash: use line_length instead of xres * bytes_per_pixel
Yin Kangkai [Thu, 23 Feb 2012 07:56:36 +0000 (15:56 +0800)]
fbsplash: use line_length instead of xres * bytes_per_pixel

In some system (e.g. my "strange" device), line_length is not equal xres *
bytes_per_pixel, so we need to use line_length in scr_fix to mmap and draw
rectangle etc.

My "strange" device output this:
bytes_per_pixel: 4
xres: 600, yres: 1024
yoffset: 0, xoffset: 0, line_length: 2432
G.addr: b74da000

Signed-off-by: Yin Kangkai <kangkai.yin@intel.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agolibbb/procps.c: make fast_strtoul_10() stop on '\n' too
Denys Vlasenko [Tue, 28 Feb 2012 10:16:21 +0000 (11:16 +0100)]
libbb/procps.c: make fast_strtoul_10() stop on '\n' too

This time for real :)

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agogrep: support for -x, match whole line
Natanael Copa [Thu, 23 Feb 2012 14:20:22 +0000 (14:20 +0000)]
grep: support for -x, match whole line

Specified in POSIX.
http://pubs.opengroup.org/onlinepubs/009604499/utilities/grep.html

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agolibbb/procps.c: make fast_strtoul_10() stop on '\n' too
Denys Vlasenko [Tue, 28 Feb 2012 02:36:49 +0000 (03:36 +0100)]
libbb/procps.c: make fast_strtoul_10() stop on '\n' too

This is needed for parsing /proc data on linux 2.4

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agodu: use long long for size field
Ian Wienand [Tue, 28 Feb 2012 02:10:31 +0000 (03:10 +0100)]
du: use long long for size field

du has issues with files reporting large block counts on
32-bit systems with 4 byte longs.  From looking at the stat.c code, it
seems the preference is to use 'long long', rather than blkcnt_t.

function                                             old     new   delta
du                                                   420     444     +24
du_main                                              317     321      +4
print                                                 43      41      -2
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 28/-2)              Total: 26 bytes

Signed-off-by: Ian Wienand <ianw@vmware.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agontpd: fix offset adjustment after step; better step printing
Denys Vlasenko [Tue, 28 Feb 2012 01:45:00 +0000 (02:45 +0100)]
ntpd: fix offset adjustment after step; better step printing

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agontpd: increase OPT_qq constant to not collide with -L
Denys Vlasenko [Thu, 23 Feb 2012 13:28:47 +0000 (14:28 +0100)]
ntpd: increase OPT_qq constant to not collide with -L

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agotar: add support for PAX-encoded path=LONGFILENAME
Denys Vlasenko [Thu, 23 Feb 2012 12:45:18 +0000 (13:45 +0100)]
tar: add support for PAX-encoded path=LONGFILENAME

function                                             old     new   delta
get_header_tar                                      1478    1759    +281

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agomkdir: fix permissions on 64-bit platforms
Timo Teras [Fri, 10 Feb 2012 07:55:24 +0000 (09:55 +0200)]
mkdir: fix permissions on 64-bit platforms

sizeof(long) != sizeof(mode_t), this causes the compare in
bb_make_directory of (long)-1 != (mode_t)-1 to fail and mess up
the permissions of final directory by doing chmod((mode_t) -1).

Signed-off-by: Timo Teras <timo.teras@iki.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoifupdown: support metric for static default gw
Natanael Copa [Fri, 17 Feb 2012 19:36:26 +0000 (19:36 +0000)]
ifupdown: support metric for static default gw

This is useful when you have multiple ISPs with failover. It allows
setting the priority of the static gateway and makes it possible
to specify multiple static gateways.

The ubuntu ifupdown supports it.

function                                             old     new   delta
.rodata                                           116725  116797     +72
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 72/0)               Total: 72 bytes
   text    data     bss     dec     hex filename
 953343    7313    8984  969640   ecba8 busybox_old
 953415    7313    8984  969712   ecbf0 busybox_unstripped

Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agohttpd: make byte ranges which start at 0 work too. Closes 4766
Denys Vlasenko [Sun, 19 Feb 2012 16:18:45 +0000 (17:18 +0100)]
httpd: make byte ranges which start at 0 work too. Closes 4766

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agomodprobe-small: add comment about aliased commands' help text
Denys Vlasenko [Sun, 19 Feb 2012 15:57:08 +0000 (16:57 +0100)]
modprobe-small: add comment about aliased commands' help text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agodepmod: supply help text
Lauri Kasanen [Sun, 19 Feb 2012 15:33:37 +0000 (16:33 +0100)]
depmod: supply help text

Signed-off-by: Lauri Kasanen <curaga@operamail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agogetopt: trim help text
Denys Vlasenko [Thu, 9 Feb 2012 17:39:16 +0000 (18:39 +0100)]
getopt: trim help text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoapplets_sh/*: Add a few more examples of "shell applets"
Pere Orga [Thu, 9 Feb 2012 17:23:33 +0000 (18:23 +0100)]
applets_sh/*: Add a few more examples of "shell applets"

Signed-off-by: Pere Orga <gotrunks@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agogetopt: simple code shrink; expand help text
Denys Vlasenko [Thu, 9 Feb 2012 17:17:29 +0000 (18:17 +0100)]
getopt: simple code shrink; expand help text

function                                             old     new   delta
packed_usage                                       28978   29184    +206
getopt_main                                          656     632     -24

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoMake unix (local) sockets work without IPv6 enabled
Jonh Wendell [Thu, 9 Feb 2012 14:14:33 +0000 (15:14 +0100)]
Make unix (local) sockets work without IPv6 enabled

The xsocket_type() function had an optional "family" argument
that was enabled only if IPv6 is enabled. In the case of the
function was called with a valid AF_UNIX argument, and IPv6 is
disabled, this argument was silently ignored.

This patch makes the "family" argument mandatory, while keeping
the old behavior i.e., if AF_UNSPEC is passed, we try first IPv6
(if it's enabled) and fallback to IPv4.

Also I changed all callers of xsocket_type() to reflect its new
interface.

Signed-off-by: Jonh Wendell <jonh.wendell@vexcorp.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agomdev: add a comment. no code changes
Denys Vlasenko [Mon, 6 Feb 2012 00:00:00 +0000 (01:00 +0100)]
mdev: add a comment. no code changes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoacpid: do not install handlers for fatal signals
Denys Vlasenko [Sun, 5 Feb 2012 14:08:08 +0000 (15:08 +0100)]
acpid: do not install handlers for fatal signals

For acpid, it's ok to die at once.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agocttyhack: handle multiple consoles found in sysfs
Aaro Koskinen [Sat, 4 Feb 2012 20:55:01 +0000 (21:55 +0100)]
cttyhack: handle multiple consoles found in sysfs

If multiple consoles are found from the sysfs file, cttyhack fails:

cttyhack: can't open '/dev/tty0 ttyS0': No such file or directory

In such cases take the last one as the kernel will use that one for
/dev/console.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agohttpd: fix sendfile of files larger than 2 Gb. Closes 4754
Denys Vlasenko [Sat, 4 Feb 2012 20:37:17 +0000 (21:37 +0100)]
httpd: fix sendfile of files larger than 2 Gb. Closes 4754

When built with "sendfile" support, httpd was unable to send large files
(>2 GB) in one single connection, terminating it before the full file
has been sent.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agotweak comment, no code changes
Denys Vlasenko [Thu, 2 Feb 2012 10:29:43 +0000 (11:29 +0100)]
tweak comment, no code changes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agohttpd: fix MD5-encrypted-in-httpd.conf password logic
Denys Vlasenko [Wed, 1 Feb 2012 01:42:54 +0000 (02:42 +0100)]
httpd: fix MD5-encrypted-in-httpd.conf password logic

function                                             old     new   delta
check_user_passwd                                    467     492     +25

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agomodprobe: accept -b even if blacklist functionality is disabled
Felipe Contreras [Tue, 31 Jan 2012 13:55:15 +0000 (14:55 +0100)]
modprobe: accept -b even if blacklist functionality is disabled

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agovi: add ":prev" command support
Dennis Groenen [Tue, 31 Jan 2012 13:12:38 +0000 (14:12 +0100)]
vi: add ":prev" command support

function                                             old     new   delta
colon                                               2844    2891     +47
vi_main                                              243     255     +12
text_yank                                             54      56      +2
refresh                                              780     774      -6

Signed-off-by: Dennis Groenen <tj.groenen@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agovi: move mark[i] pointers if text[] moves after realloc
Denys Vlasenko [Tue, 31 Jan 2012 13:10:26 +0000 (14:10 +0100)]
vi: move mark[i] pointers if text[] moves after realloc

While at it, optimized :s/find/repl/ a bit

function                                             old     new   delta
text_hole_make                                       120     150     +30
colon                                               2848    2844      -4

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agologin: -f should not ask for password even with PAM
Sergey Naumov [Mon, 30 Jan 2012 11:52:56 +0000 (12:52 +0100)]
login: -f should not ask for password even with PAM

Signed-off-by: Sergey Naumov <sknaumov@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoinit: add a segv debugging aid, disabled by default
Denys Vlasenko [Mon, 30 Jan 2012 11:15:22 +0000 (12:15 +0100)]
init: add a segv debugging aid, disabled by default

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agogen_build_files.sh: exclude hidden directories
Paulius Zaleckas [Mon, 30 Jan 2012 01:34:56 +0000 (02:34 +0100)]
gen_build_files.sh: exclude hidden directories

I am using quilt to manage patches internally. Quilt creates dir .pc
and stores unmodified files there. Since I made change in one of
Config.src quilt made a copy in .pc/xxx.patch/xxx/Config.src. When
I run make it calls gen_build_files.sh and it generates
.pc/xxx.patch/xxx/Config.in. Now when I want to pop patch quilt
thinks I have made changes to original xxx/Config.in.

IMO the best solution is just to ignore hidden directories in
gen_build_files.sh. This also results in shorter build time in case
busybox is under git/svn versioning, since it avoids searching
many directories for Config.src.

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agomdev: fix wrong sizeof
Javier Viguera [Fri, 27 Jan 2012 17:30:20 +0000 (18:30 +0100)]
mdev: fix wrong sizeof

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agobootchartd: add process accounting feature
Quentin Casasnovas [Wed, 18 Jan 2012 01:12:13 +0000 (02:12 +0100)]
bootchartd: add process accounting feature

function                                             old     new   delta
bootchartd_main                                      962    1088    +126
finalize                                             294     357     +63
acct                                                   -      33     +33
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 2/0 up/down: 222/0)             Total: 222 bytes

Signed-off-by: Quentin Casasnovas <quentin.casasnovas@mathembedded.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agofind_mount_point: fix find_mount_point for char devices
Javier Viguera [Wed, 18 Jan 2012 00:49:11 +0000 (01:49 +0100)]
find_mount_point: fix find_mount_point for char devices

This allows to find mount points of 'char' devices such as UBI volumes
which otherwise fail for example with 'df' command:

/ # df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root             72091984  12360980  56068924  18% /
devtmpfs                115236         4    115232   0% /dev
tmpfs                    28672        32     28640   0% /tmp
/dev/ubi0_0             360268     18348    341920   5% /tmp/mnt/userfs

/ # df /dev/ubi0_0
Filesystem           1K-blocks      Used Available Use% Mounted on
devtmpfs                115236         4    115232   0% /dev

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agovconfig: fix help text; small code shrink. Closes 4658
Denys Vlasenko [Mon, 16 Jan 2012 03:00:37 +0000 (04:00 +0100)]
vconfig: fix help text; small code shrink. Closes 4658

function                                             old     new   delta
xfind_str                                             45      46      +1
vconfig_main                                         228     223      -5
packed_usage                                       28980   28954     -26

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years ago*: better comments on termios manipulations. No code changes.
Denys Vlasenko [Sun, 15 Jan 2012 22:00:13 +0000 (23:00 +0100)]
*: better comments on termios manipulations. No code changes.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoshell_builtin_read: set cc[VMIN] to 1; lineedit: don't clear c_cc[VINTR]
Denys Vlasenko [Sun, 15 Jan 2012 21:58:06 +0000 (22:58 +0100)]
shell_builtin_read: set cc[VMIN] to 1; lineedit: don't clear c_cc[VINTR]

First change fixes "read -n NUM". Apparently poll() won't report
data availability if cc[VMIN] > 1 until there are at least cc[VMIN] bytes.

function                                             old     new   delta
read_line_input                                     3885    3877      -8
shell_builtin_read                                  1097    1087     -10
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-18)             Total: -18 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agosed: fix possible case of signed char bug; expand debugging printouts
Denys Vlasenko [Sun, 15 Jan 2012 19:06:03 +0000 (20:06 +0100)]
sed: fix possible case of signed char bug; expand debugging printouts

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agomke2fs: do not zero out first kilobyte. Closes 3247
Denys Vlasenko [Wed, 11 Jan 2012 00:02:31 +0000 (01:02 +0100)]
mke2fs: do not zero out first kilobyte. Closes 3247

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agomdev: do not treat non-leading '#' chars as start of comment. Closes 4676
Denys Vlasenko [Tue, 10 Jan 2012 23:37:17 +0000 (00:37 +0100)]
mdev: do not treat non-leading '#' chars as start of comment. Closes 4676

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoacpid: close fds which are reported as dead (POLLERR/POLLHUP/POLLNVAL) by poll.
Denys Vlasenko [Mon, 9 Jan 2012 04:01:25 +0000 (05:01 +0100)]
acpid: close fds which are reported as dead (POLLERR/POLLHUP/POLLNVAL) by poll.

function                                             old     new   delta
acpid_main                                          1159    1229     +70
packed_usage                                       28977   28980      +3

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agopasswd,cryptpw: make default encryption algorithm configurable
Denys Vlasenko [Sun, 8 Jan 2012 15:44:37 +0000 (16:44 +0100)]
passwd,cryptpw: make default encryption algorithm configurable

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoMove include <shadow.h> close to pwd.h and grp.h includes
Denys Vlasenko [Sun, 8 Jan 2012 15:13:55 +0000 (16:13 +0100)]
Move include <shadow.h> close to pwd.h and grp.h includes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoMove Adroid endgrent() and endpwent() NOPS to libbb.h
Denys Vlasenko [Sun, 8 Jan 2012 15:11:38 +0000 (16:11 +0100)]
Move Adroid endgrent() and endpwent() NOPS to libbb.h

They should be after includes of pwd.h and grp.h

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agolibpwdgrp/pwd_grp.c: use same static buffer for all getpwXX functions
Denys Vlasenko [Fri, 6 Jan 2012 15:24:56 +0000 (16:24 +0100)]
libpwdgrp/pwd_grp.c: use same static buffer for all getpwXX functions

This should save more than 0.5k of malloced memory in applets
which use those functions.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agolibpwdgrp/pwd_grp.c: set opened /etc/{passwd,group,shadow} fds CLOEXEC
Denys Vlasenko [Fri, 6 Jan 2012 15:23:42 +0000 (16:23 +0100)]
libpwdgrp/pwd_grp.c: set opened /etc/{passwd,group,shadow} fds CLOEXEC

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoplatform.h: define endgrent() and endpwent() as no-ops on Android
Denys Vlasenko [Fri, 6 Jan 2012 15:23:18 +0000 (16:23 +0100)]
platform.h: define endgrent() and endpwent() as no-ops on Android

Surprisingly, bionic libc seems to lack these functions.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agolibbb/bb_strtonum: always set end ptr, even on error return
Denys Vlasenko [Thu, 22 Dec 2011 12:00:32 +0000 (13:00 +0100)]
libbb/bb_strtonum: always set end ptr, even on error return

function                                             old     new   delta
handle_errors                                         69      61      -8

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agokill: fix segfault in arguments parsing
Alexey Fomenko [Thu, 22 Dec 2011 10:38:57 +0000 (11:38 +0100)]
kill: fix segfault in arguments parsing

Signed-off-by: Alexey Fomenko <ext-alexey.fomenko@nokia.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoash: in standalone mode, search in $PATH if /proc/self/exe doesn't exist
Denys Vlasenko [Tue, 20 Dec 2011 05:10:35 +0000 (06:10 +0100)]
ash: in standalone mode, search in $PATH if /proc/self/exe doesn't exist

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agomakemime: tweak help text: -a HDR can be repeated
Denys Vlasenko [Tue, 20 Dec 2011 01:15:19 +0000 (02:15 +0100)]
makemime: tweak help text: -a HDR can be repeated

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agohttpd: don't drop/abuse QUERY_STRING when /cgi-bin/index.cgi is used
Denys Vlasenko [Mon, 19 Dec 2011 11:30:34 +0000 (12:30 +0100)]
httpd: don't drop/abuse QUERY_STRING when /cgi-bin/index.cgi is used

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agowget: fix use-after-free on redirect
Denys Vlasenko [Sun, 18 Dec 2011 04:11:56 +0000 (05:11 +0100)]
wget: fix use-after-free on redirect

function                                             old     new   delta
wget_main                                           2153    2168     +15

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agolibbb: remove is_directory's argument which is always NULL
Denys Vlasenko [Sun, 18 Dec 2011 02:27:46 +0000 (03:27 +0100)]
libbb: remove is_directory's argument which is always NULL

function                                             old     new   delta
send_cgi_and_exit                                    892     890      -2
ln_main                                              447     445      -2
handle_incoming_and_exit                            2784    2780      -4
is_directory                                          66      59      -7
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/6 up/down: 2/-19)             Total: -15 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agohttpd: remove redundant NULL assignment and save one strrchr. -8 bytes
Denys Vlasenko [Sun, 18 Dec 2011 02:22:36 +0000 (03:22 +0100)]
httpd: remove redundant NULL assignment and save one strrchr. -8 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoudhcp: finish support of classless static routes (now the correct patch!)
Michael McTernan [Fri, 16 Dec 2011 16:10:09 +0000 (17:10 +0100)]
udhcp: finish support of classless static routes (now the correct patch!)

Signed-off-by: Michael McTernan <Michael.McTernan.2001@cs.bris.ac.uk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoudhcp: finish support of classless static routes
Michael McTernan [Fri, 16 Dec 2011 16:05:52 +0000 (17:05 +0100)]
udhcp: finish support of classless static routes

function                                             old     new   delta
udhcp_str2optset                                     415     532    +117

Signed-off-by: Michael McTernan <Michael.McTernan.2001@cs.bris.ac.uk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agovconfig: remove /proc/net/vlan/config check
Paulius Zaleckas [Fri, 16 Dec 2011 00:42:55 +0000 (01:42 +0100)]
vconfig: remove /proc/net/vlan/config check

In original implementation /proc/net/vlan/config check only prints warning
and does not exit. Busybox version exits if this file is not found and this
prevents kernel module autoloading to work.
I think it is safe to remove this check since ioctl() call will fail
(with proper
error code) anyway if 802.1q module is not loaded (or autoloading is off).

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agohttpd: fix /../ sanitization (had one extra semicolon). rewrote it
Denys Vlasenko [Fri, 16 Dec 2011 00:37:02 +0000 (01:37 +0100)]
httpd: fix /../ sanitization (had one extra semicolon). rewrote it

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoash: document bash's exit code too. No code changes
Denys Vlasenko [Thu, 15 Dec 2011 23:44:36 +0000 (00:44 +0100)]
ash: document bash's exit code too. No code changes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoash: add comment about bash's ENOEXEC handling. No code changes
Denys Vlasenko [Thu, 15 Dec 2011 23:25:17 +0000 (00:25 +0100)]
ash: add comment about bash's ENOEXEC handling. No code changes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years ago*: style fixes. no code changes
Denys Vlasenko [Thu, 15 Dec 2011 11:39:25 +0000 (12:39 +0100)]
*: style fixes. no code changes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoifupdown: remove interface from state_list if iface_up fails
Lauri Hintsala [Wed, 14 Dec 2011 14:49:58 +0000 (16:49 +0200)]
ifupdown: remove interface from state_list if iface_up fails

Fix the issue where interface is set to the configured state even if
configuration has failed. Add error check to state setting logic.

Signed-off-by: Lauri Hintsala <lauri.hintsala@bluegiga.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoconfigs/android_defconfig: update
Daniel Fandrich [Thu, 15 Dec 2011 09:14:51 +0000 (10:14 +0100)]
configs/android_defconfig: update

Signed-off-by: Daniel Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agotouch: add new option FEATURE_TOUCH_SUSV3
walter harms [Wed, 14 Dec 2011 07:48:59 +0000 (08:48 +0100)]
touch: add new option FEATURE_TOUCH_SUSV3

This options -d -t -r where hidden under DESKTOP.
This option allows the user to enable these options for (only) touch.

The patch only changes DESKTOP to FEATURE_TOUCH_SUSV3.

Signed-off-by: walter harms <wharms@bfs.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agotouch: document -t DT option in help text
Denys Vlasenko [Tue, 13 Dec 2011 15:56:47 +0000 (16:56 +0100)]
touch: document -t DT option in help text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoudhcpc: sanitize hostnames in incoming packets. Closes 3979.
Denys Vlasenko [Thu, 8 Dec 2011 15:41:05 +0000 (16:41 +0100)]
udhcpc: sanitize hostnames in incoming packets. Closes 3979.

The following options are replaced with string "bad" if they
contain malformed hostname:
HOST_NAME, DOMAIN_NAME, NIS_DOMAIN, TFTP_SERVER_NAME

function                                             old     new   delta
xmalloc_optname_optval                               850     888     +38
attach_option                                        440     443      +3
len_of_option_as_string                               13      14      +1
dhcp_option_lengths                                   13      14      +1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 43/0)               Total: 43 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoiproute: fix help text
Denys Vlasenko [Tue, 6 Dec 2011 17:59:55 +0000 (18:59 +0100)]
iproute: fix help text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoblkid: make help text show [BLOCKDEV]...
Denys Vlasenko [Tue, 6 Dec 2011 14:09:27 +0000 (15:09 +0100)]
blkid: make help text show [BLOCKDEV]...

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agovolume_id/get_devname: trivial code shrink
Denys Vlasenko [Tue, 6 Dec 2011 14:06:59 +0000 (15:06 +0100)]
volume_id/get_devname: trivial code shrink

function                                             old     new   delta
uuidcache_init                                        36      41      +5
get_devname_from_uuid                                 55      51      -4
get_devname_from_label                                61      57      -4
display_uuid_cache                                   109     105      -4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/3 up/down: 5/-12)              Total: -7 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agosuppress a "integer overflow in expression" waring on big endian. Closes 4405
Denys Vlasenko [Mon, 5 Dec 2011 03:54:14 +0000 (04:54 +0100)]
suppress a "integer overflow in expression" waring on big endian. Closes 4405

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoFix link failure on some platforms when PAM is enabled
Tristan Schmelcher [Mon, 5 Dec 2011 03:38:58 +0000 (04:38 +0100)]
Fix link failure on some platforms when PAM is enabled

Signed-off-by: Tristan Schmelcher <tristan_schmelcher@alumni.uwaterloo.ca>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoinit: code shrink -4 bytes
Denys Vlasenko [Mon, 5 Dec 2011 02:54:28 +0000 (03:54 +0100)]
init: code shrink -4 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoinit: utmp update of DEAD_PROCESS was misplaced, and could be skipped. Fixing.
Denys Vlasenko [Mon, 5 Dec 2011 02:31:05 +0000 (03:31 +0100)]
init: utmp update of DEAD_PROCESS was misplaced, and could be skipped. Fixing.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agohttpd: small fixes to previous change
Pascal Bellard [Tue, 29 Nov 2011 19:54:30 +0000 (20:54 +0100)]
httpd: small fixes to previous change

Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agohttpd: make it possible to use system passwords for auth
Pascal Bellard [Tue, 29 Nov 2011 12:51:11 +0000 (13:51 +0100)]
httpd: make it possible to use system passwords for auth

function                                             old     new   delta
check_user_passwd                                    320     467    +147
httpd_main                                           760     757      -3

Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoold_e2fsprogs/blkid: close the fd after we are done with it
Denys Vlasenko [Mon, 28 Nov 2011 17:57:04 +0000 (18:57 +0100)]
old_e2fsprogs/blkid: close the fd after we are done with it

Some people have HUGE /dev/*...

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agovi: fix [end] key handling
Denys Vlasenko [Mon, 28 Nov 2011 03:55:48 +0000 (04:55 +0100)]
vi: fix [end] key handling

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agorx: fix file corruption on block checksum failure
Daniel Fandrich [Wed, 23 Nov 2011 11:07:31 +0000 (12:07 +0100)]
rx: fix file corruption on block checksum failure

Rather than dropping the bad block, rx was appending it
to the file.

Signed-off-by: Daniel Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agonommu: fix cases where we mangle argv[0][0]
Denys Vlasenko [Tue, 22 Nov 2011 16:19:26 +0000 (17:19 +0100)]
nommu: fix cases where we mangle argv[0][0]

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoAdded a few more features to android_defconfig
Daniel Fandrich [Sun, 6 Nov 2011 23:06:16 +0000 (15:06 -0800)]
Added a few more features to android_defconfig

Signed-off-by: Daniel Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agoMerge branch 'master' of git+ssh://busybox.net/var/lib/git/busybox
Denys Vlasenko [Mon, 21 Nov 2011 13:25:15 +0000 (14:25 +0100)]
Merge branch 'master' of git+ssh://busybox.net/var/lib/git/busybox

12 years agomakemime: document our current behavior. Tweak help text
Denys Vlasenko [Sat, 19 Nov 2011 13:43:02 +0000 (14:43 +0100)]
makemime: document our current behavior. Tweak help text

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agomakemime: content-type should default to application/octet-stream
Denys Vlasenko [Sat, 19 Nov 2011 12:55:46 +0000 (13:55 +0100)]
makemime: content-type should default to application/octet-stream

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agosendmail: fix a mistake in previous commit
Denys Vlasenko [Sat, 19 Nov 2011 12:54:50 +0000 (13:54 +0100)]
sendmail: fix a mistake in previous commit

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 years agosendmail: stop doing -t unconditionally; makemime: generate 76 char base64 lines
Denys Vlasenko [Fri, 18 Nov 2011 21:25:35 +0000 (22:25 +0100)]
sendmail: stop doing -t unconditionally; makemime: generate 76 char base64 lines

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>