Denys Vlasenko
35ae2ccb40
sync: add support for -d -f FILE
...
Based on the patch by Ari Sundholm <ari@tuxera.com >
function old new delta
sync_main 20 163 +143
packed_usage 30653 30673 +20
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 163/0) Total: 163 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-07-21 19:50:48 +02:00
Denys Vlasenko
ce193f809b
Remove old_e2fsprogs/*
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-07-19 23:12:51 +02:00
Denys Vlasenko
f54a487bb4
fix file mode
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-07-13 03:52:32 +02:00
Denys Vlasenko
c9091d8947
ps: fix SEGV on narrow screens. closes 8176
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-07-01 19:07:24 +02:00
Denys Vlasenko
db31c637fa
ipaddress: better formatting, no code changes
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-07-01 18:36:06 +02:00
Denys Vlasenko
7f4a49a96c
Print one less newline at the end of bb_show_usage()
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-05-25 14:30:52 +02:00
Denys Vlasenko
c4603fb09a
dc: fix "dc p" prinitng bogus data
...
function old new delta
check_under - 20 +20
print_no_pop 27 32 +5
pop 33 24 -9
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/1 up/down: 25/-9) Total: 16 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-05-25 13:31:25 +02:00
Denys Vlasenko
b878121e76
tc: fix print_rate
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-05-24 18:01:53 +02:00
Denys Vlasenko
9a595bb36d
hush: add recent ash tests to hush testsuite too (they all pass for hush)
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-05-18 10:23:16 +02:00
Denys Vlasenko
e0a4e107aa
ash: explain what "local -" does
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-05-13 02:20:14 +02:00
Denys Vlasenko
bdb540e04f
tar: do not try to decode GNU extended headers as pax headers
...
function old new delta
get_header_tar 1736 1692 -44
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-05-11 16:55:16 +02:00
Denys Vlasenko
c77a58fb2d
typo fix
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-05-03 18:24:33 +02:00
Denys Vlasenko
de5edadee2
special-case {true,false,test} --help
...
This also removes their help texts.
function old new delta
run_applet_no_and_exit 442 452 +10
packed_usage 30713 30625 -88
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-04-21 16:00:41 +02:00
Denys Vlasenko
ad795510d9
mdev: if a "future" mdev.seq is seen, do not overwrite it with ours
...
This was seen to happen if two mdevs are run in parallel,
mdev.seq is empty, and the "newer" one manages to write it first.
function old new delta
mdev_main 1366 1388 +22
atoll - 20 +20
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-04-19 18:55:12 +02:00
Denys Vlasenko
bd77e9d609
mdev: improve logging
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-04-19 18:54:49 +02:00
Denys Vlasenko
73327a048b
hush: document buggy handling of duplicate "local"
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-04-18 19:38:13 +02:00
Denys Vlasenko
0a0acb55db
ash: fix handling of duplicate "local"
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-04-18 19:36:38 +02:00
Denys Vlasenko
63f4d32c98
sed: implement ",+N" range end
...
function old new delta
add_cmd 1115 1173 +58
process_files 2226 2253 +27
sed_main 696 702 +6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 91/0) Total: 91 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-04-17 14:24:55 +02:00
Denys Vlasenko
71a5b67ba0
uevent: new applet
...
This applet listens on netlink socket with kernel's uevent messages.
Run-tested.
function old new delta
uevent_main - 416 +416
packed_usage 30671 30713 +42
applet_names 2531 2538 +7
applet_main 1468 1472 +4
RCVBUF - 4 +4
applet_nameofs 734 736 +2
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 4/0 up/down: 475/0) Total: 475 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-04-16 12:44:02 +02:00
Denys Vlasenko
e0ddb65cb2
build system: make CONFIG_EXTRA_LDFLAGS go to LDFLAGS, not EXTRA_LDFLAGS
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-04-14 14:15:15 +02:00
Denys Vlasenko
1186894f77
update example ntp.script
...
Handle an interesting corner case when NTP server is reachable...
but on a different IP now.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-03-31 22:00:55 +02:00
Denys Vlasenko
9472e8a86f
ftpd: change_identity() must be after chroot()
...
Otherwise chroot() doesn't work for non-root
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-03-31 21:46:26 +02:00
Denys Vlasenko
379e8e81af
typo fix
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-03-26 10:49:02 +01:00
Denys Vlasenko
1850d5ec0e
truncate: new applet
...
Add the actual new source file :(
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-03-22 18:00:32 +01:00
Denys Vlasenko
6d8ea1d50e
ifupdown: shrink a message
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-03-22 17:08:51 +01:00
Denys Vlasenko
49acc1a761
vi: make BACKSPACE and DELETE join lines at start/end of line
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-03-12 21:15:34 +01:00
Denys Vlasenko
8dff01d06a
libbb: introduce and use is_prefixed_with()
...
function old new delta
is_prefixed_with - 18 +18
complete_username 78 77 -1
man_main 737 735 -2
fsck_device 429 427 -2
unpack_ar_archive 80 76 -4
strip_unsafe_prefix 105 101 -4
singlemount 1054 1050 -4
rtc_adjtime_is_utc 90 86 -4
resolve_mount_spec 88 84 -4
parse_one_line 1029 1025 -4
parse_conf 1460 1456 -4
may_wakeup 83 79 -4
loadkmap_main 219 215 -4
get_irqs_from_stat 103 99 -4
get_header_cpio 913 909 -4
findfs_main 79 75 -4
fbsplash_main 1230 1226 -4
load_crontab 776 771 -5
expand_vars_to_list 1151 1146 -5
date_main 881 876 -5
skip_dev_pfx 30 24 -6
make_device 2199 2193 -6
complete_cmd_dir_file 773 767 -6
run_applet_and_exit 715 708 -7
uudecode_main 321 313 -8
pwdx_main 197 189 -8
execute 568 560 -8
i2cdetect_main 1186 1176 -10
procps_scan 1242 1230 -12
procps_read_smaps 1017 1005 -12
process_module 746 734 -12
patch_main 1903 1891 -12
nfsmount 3572 3560 -12
stack_machine 126 112 -14
process_timer_stats 449 435 -14
match_fstype 111 97 -14
do_ipaddr 1344 1330 -14
open_list_and_close 359 343 -16
get_header_tar 1795 1779 -16
prepend_new_eth_table 340 323 -17
fsck_main 1811 1794 -17
find_iface_state 56 38 -18
dnsd_main 1321 1303 -18
base_device 179 158 -21
find_keyword 104 82 -22
handle_incoming_and_exit 2785 2762 -23
parse_and_put_prompt 774 746 -28
modinfo 347 317 -30
find_action 204 171 -33
update_passwd 1470 1436 -34
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/49 up/down: 18/-540) Total: -522 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-03-12 17:48:34 +01:00
Denys Vlasenko
936c8809ca
deluser: also remove user from /etc/group
...
function old new delta
update_passwd 1270 1470 +200
deluser_main 310 332 +22
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-03-12 15:30:46 +01:00
Denys Vlasenko
fe8b5802ba
patch: segfault fix. Closes 7916
...
Fix segfault on this case (malformed --- line):
-- dwarves.orig 2015-02-25 01:45:27.753000000 +0000
+++ dwarves 2015-02-25 01:46:08.199000000 +0000
@@ -1,7 +1,7 @@
Bashful
Doc
Dopey
-Grouchy
+Grumpy
Happy
Sleepy
Sneezy
function old new delta
patch_main 1903 1957 +54
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-03-11 18:01:34 +01:00
Denys Vlasenko
3c31b092ac
ntpd: tweak help text
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-03-05 14:04:44 +01:00
Denys Vlasenko
2ec4f44225
inetd: fix order of array index check and array access
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-03-03 13:10:30 +01:00
Denys Vlasenko
3aef814c0b
ntpd: chnage help text about -l to say that it doesn't disable client code
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-03-02 20:59:13 +01:00
Denys Vlasenko
7db2a7c20e
runsvdir: if pid==1, also intercept SIGINT for -s SCRIPT
...
function old new delta
runsvdir_main 1057 1064 +7
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-03-02 17:39:13 +01:00
Denys Vlasenko
dac8d80f77
runsvdir: do not block SIGCHLD around poll/sleep
...
There is no reason to do so. We do not even have SIGCHLD handler.
function old new delta
runsvdir_main 1077 1057 -20
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-03-02 17:38:55 +01:00
Denys Vlasenko
fa535f3e48
runsvdir: (almost) close a signal race
...
We could lose a signal while processing previous one
function old new delta
runsvdir_main 1088 1077 -11
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-03-02 17:37:31 +01:00
Denys Vlasenko
c5beaa08eb
ls: heed compiler warning
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-23 15:25:58 +01:00
Denys Vlasenko
a88db5c1a9
modinfo: fix fallout from basename removal
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-21 17:08:35 +01:00
Denys Vlasenko
54e9585e10
trivial code shrink
...
function old new delta
rdate_main 246 251 +5
show_entry 291 287 -4
daytime_stream 44 39 -5
packed_usage 30176 30168 -8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/3 up/down: 5/-17) Total: -12 bytes
text data bss dec hex filename
929453 932 17684 948069 e7765 busybox_old
929411 932 17684 948027 e773b busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-18 13:47:46 +01:00
Denys Vlasenko
0cb981c5e2
ls: trivial code shrink
...
function old new delta
display_single 914 893 -21
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-18 11:29:07 +01:00
Denys Vlasenko
8e92df15b5
ls: fix year 9999 bug :)
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-16 15:36:25 +01:00
Denys Vlasenko
402afe1cc6
modprobe-small: fix thinko in previous commit
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-13 11:53:33 +01:00
Denys Vlasenko
1fd844267c
modprobe-small: if concurrent module load did not succeed, wait
...
usecase:
two sd cards are being mounted in parallel at same time on dual core. example
modules which are getting loaded is nls_cp437. While one module is being
loaded , it makes state in /proc/modules as 'coming' and then starts doing its
module init function (in our case - registering nls). meanwhile on other core,
if modprobe returns that is has already been loaded, then it will continue
and search for the nls list which is not yet finished from first module init.
This fails resulting in not mounting sd card.
function old new delta
process_module 667 746 +79
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-12 17:05:14 +01:00
Denys Vlasenko
8c06bc6ba1
unzip: prevent attacks via malicious filenames
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-10 01:30:43 +01:00
Denys Vlasenko
23cfaab47d
libpwdgrp: use getpwent() instead of getpwent_r()
...
function old new delta
massage_data_for_non_r_func - 90 +90
bb_internal_getpwent - 69 +69
getXXnam_r 94 162 +68
fill_bounds 131 128 -3
deluser_main 355 310 -45
complete_username 123 78 -45
getXXnam 163 90 -73
massage_data_for_r_func 103 - -103
bb_internal_getpwent_r 121 - -121
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 1/5 up/down: 227/-407) Total: -163 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-07 21:21:02 +01:00
Denys Vlasenko
68c048fb23
modprobe-small: fix and simplify rmmod
...
"rmmod OUT_OF_TREE_MODULE" was not working, because module is not in depmod file.
In general, rmmod doesn't need scanning, it simply unloads every argv[i].
function old new delta
rmmod - 63 +63
modprobe_main 449 465 +16
process_module 705 667 -38
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/1 up/down: 79/-38) Total: 41 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-07 20:44:46 +01:00
Denys Vlasenko
a03195941b
examples/mdev_fat.conf: document that newer mdev exposes path
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-07 18:14:39 +01:00
Denys Vlasenko
7e66102f76
ash: fix a SEGV case in an invalid heredoc
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-05 21:00:17 +01:00
Denys Vlasenko
a14fa79592
deluser: implement --remove-home
...
function old new delta
deluser_main 308 355 +47
packed_usage 30149 30156 +7
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 54/0) Total: 54 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-05 18:35:52 +01:00
Denys Vlasenko
3c5d133c7d
fstrim: fix help text
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-04 15:19:38 +01:00
Denys Vlasenko
a75dcd4353
route: fix bogus read error when route table is empty
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-04 10:40:10 +01:00
Denys Vlasenko
09020b1aa8
route: improve -A inet6
...
Upstream route command shows non-up routes, it shows reject and nonexthop flags.
And we had "ref" and "use" values mixed up...
function old new delta
flagvals 32 44 +12
flagchars 9 12 +3
INET_setroute 767 768 +1
INET6_setroute 495 496 +1
set_flags 43 39 -4
flags_ipvx 16 8 -8
route_main 632 623 -9
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/3 up/down: 17/-21) Total: -4 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-03 19:32:44 +01:00
Denys Vlasenko
b62d4d9d57
gzip: trivial code shrink -5 bytes
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-03 15:25:17 +01:00
Denys Vlasenko
a977778893
ifconfig: fix double free fatal error in INET_sprint
...
Based on the patch by Zheng Junling <zhengjunling@huawei.com >
and Chen Gang <cg.chen@huawei.com >
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-03 12:11:30 +01:00
Denys Vlasenko
8e74adab01
libbb: make INET[6]_rresolve use sockaddr2{host,dotted}_noport
...
function old new delta
INET_rresolve 274 214 -60
INET6_rresolve 168 85 -83
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-03 12:07:40 +01:00
Denys Vlasenko
f7f70bf1b3
gzip: speed up and shrink put_16bit()
...
function old new delta
put_16bit 104 98 -6
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-02 16:07:07 +01:00
Denys Vlasenko
5104645cf8
platform.h: enable mempcpy for FreeBSD
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-02-02 03:51:47 +01:00
Denys Vlasenko
08f9ffc3f7
dpkg: update supported compression methods
...
Based on a patch by Ron Yorston <rmy@tigress.co.uk >
function old new delta
get_header_tar_xz - 60 +60
filter_accept_list_reassign 128 188 +60
unpack_package 585 621 +36
init_archive_deb_control 52 76 +24
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 3/0 up/down: 180/0) Total: 180 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-30 15:15:38 +01:00
Denys Vlasenko
8c05a74f7e
platform.h: mempcpy needs <string.h>
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-29 16:41:48 +01:00
Denys Vlasenko
ff3f3accc6
ntpd: get rid of G.initial_poll_complete
...
This speeds up syncing - now happens only just
two replies from a peer. Especially useful for "ntpd -q".
Shouldn't have ill effects: if we chose a bad peer,
we will discover it later and switch to another one.
The code is even smaller this way.
Suggested by Miroslav Lichvar <mlichvar@redhat.com >
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-29 16:31:36 +01:00
Denys Vlasenko
936c401077
dhcpd: fix an improper widening conversion
...
We wanted to detect when tv_sec = unsigned1 - unsigned2
underflows by looking at tv_sec's sign. But if tv_sec
is long and it is wider than unsigned, we get unsigned -> long
conversion which is in this case never negative.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-27 21:59:40 +01:00
Denys Vlasenko
64b744997e
ftpd: prevent zombies. closes 7832
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-26 15:45:48 +01:00
Denys Vlasenko
50a6d86520
platform.h: add compat mempcpy
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-25 22:08:46 +01:00
Denys Vlasenko
cc70b6f8b6
depmod: simple memory optimization
...
function old new delta
filename2modname 67 86 +19
parse_module 374 351 -23
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-24 22:30:30 +01:00
Denys Vlasenko
86031a5ffd
trim extra newlines in help texts
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-24 19:46:45 +01:00
Denys Vlasenko
76b2262b9b
modprobe: fix "modprobe devname:snd/timer" case (alias with a slash)
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-15 03:04:23 +01:00
Denys Vlasenko
e998b08f11
modprobe: fix recent breakage: modules.dep reading code needs to strip dirname
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-15 02:49:59 +01:00
Denys Vlasenko
1b6715345f
modprobe-small: code shrink
...
function old new delta
pathname_matches_modname 80 42 -38
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-11 17:46:56 +01:00
Denys Vlasenko
3c75b1c34e
modprobe-small: fix recent breakage: modprobe -r was using full path
...
"modprobe -r MODNAME", after it found the full module pathname,
should strip dirpath before trying to remove the module.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-11 17:40:30 +01:00
Denys Vlasenko
39f017293a
diff: fix a bug in diffing against stdin. Closes 7784
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-11 16:41:54 +01:00
Denys Vlasenko
08364dab75
depmod: fix recent breakage in modules.dep generation
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-07 14:39:01 +01:00
Denys Vlasenko
1ec49732e2
mpstat: code shrink
...
function old new delta
get_uptime 134 129 -5
get_irqs_from_stat 110 103 -7
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-05 18:39:23 +01:00
Denys Vlasenko
da9212667c
libbb: code shrink by factoring out common update_utmp_DEAD_PROCESS
...
function old new delta
update_utmp_DEAD_PROCESS - 17 +17
telnetd_main 1685 1674 -11
mark_terminated 56 45 -11
handle_sigchld 74 63 -11
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-05 15:37:58 +01:00
Denys Vlasenko
08b90a9d10
deleting unused ntpd_simple.c
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-05 15:12:37 +01:00
Denys Vlasenko
c5d4a04e45
libpwdgrp: fixes suggested by Tito, comment tweaks
...
function old new delta
bb_internal_getpwent_r 100 121 +21
parse_common 202 203 +1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-05 15:09:04 +01:00
Denys Vlasenko
db4d1051ca
libpwdgrp: another code shrink
...
function old new delta
massage_data_for_r_func - 110 +110
bb_internal_getpwent_r 173 100 -73
getXXnam_r 176 95 -81
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/2 up/down: 110/-154) Total: -44 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-04 02:34:52 +01:00
Denys Vlasenko
5acf1346b4
libpwdgrp: code shrink
...
function old new delta
parse_common 206 205 -1
getgrouplist_internal 229 225 -4
bb_internal_getpwent_r 182 173 -9
getXXnam 232 222 -10
getXXnam_r 216 176 -40
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/5 up/down: 0/-64) Total: -64 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-04 02:02:39 +01:00
Denys Vlasenko
12fc869560
libpwdgrp: getgrXXX: empty string is not a member name, do not store it
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-03 21:16:18 +01:00
Denys Vlasenko
402451aa19
fix a SEGV in previous commit
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-03 21:11:27 +01:00
Denys Vlasenko
f9936676bb
libpwdgrp: fix counting of commas in group list
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-03 21:03:39 +01:00
Denys Vlasenko
134c53098b
libpwdgrp: store getXXnam result in a single malloc block
...
This saves a bit of memory but more importantly, allows to create
xmalloc_getpwnam() API where result can be deleted simply using free().
function old new delta
getXXnam 134 173 +39
parse_common 188 212 +24
convert_to_struct 277 290 +13
get_S 90 88 -2
tokenize 129 126 -3
bb_internal_getpwent_r 175 172 -3
getXXnam_r 208 198 -10
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/4 up/down: 76/-18) Total: 58 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-03 20:47:47 +01:00
Denys Vlasenko
20c0a16334
libpwdgrp: make db->def[] one byte shorter
...
In the future I will need another uint8_t, want to fit it
w/o using another word on 32 bits.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-03 19:12:49 +01:00
Denys Vlasenko
5e62a3d016
libpwdgrp: use a better estimate of max struct size
...
Previous code's trick with bitwise OR was giving this on 32-bit x86:
sizeof(struct passwd):28
sizeof(struct group):16
sizeof(struct spwd):36
sizeof(struct_result):60
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-03 17:53:49 +01:00
Denys Vlasenko
9dca6acaac
libpwdgrp: reinstate Tito's optional atexit freeing
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-03 16:09:05 +01:00
Denys Vlasenko
8d547aca75
libpwdgrp: fix a memory leak in getXXnam (we did not save address of string buf)
...
function old new delta
convert_to_struct 261 269 +8
const_sp_db 20 24 +4
const_pw_db 20 24 +4
const_gr_db 20 24 +4
tokenize 144 147 +3
parse_common 185 188 +3
get_S 82 85 +3
bb_internal_getpwent_r 188 185 -3
gr_off 4 - -4
getXXnam 171 165 -6
pw_off 7 - -7
getgrouplist_internal 237 229 -8
getXXnam_r 215 207 -8
sp_off 9 - -9
------------------------------------------------------------------------------
(add/remove: 0/3 grow/shrink: 7/4 up/down: 29/-45) Total: -16 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-03 15:54:04 +01:00
Denys Vlasenko
31d6734457
libpwdgrp: tweak comments, replace one xmalloc with xzalloc
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-03 15:15:47 +01:00
Denys Vlasenko
908b6e5dfd
libpwdgrp: use FAST_FUNC to make "matching ABI" optimization more likely to succeed
...
See bb_internal_get*nam_r size reduction:
function old new delta
bb_internal_getpwent_r 167 176 +9
getXXnam_r 204 206 +2
sulogin_main 326 325 -1
su_main 471 470 -1
read_line_input 3832 3831 -1
print_stat 865 864 -1
prepare_socket_fd 283 282 -1
load_crontab 777 776 -1
fork_job 456 455 -1
do_shm 884 883 -1
do_sem 637 636 -1
do_msg 783 782 -1
complete_username 124 123 -1
bb_internal_getgrouplist 71 70 -1
xgetpwuid 27 25 -2
xgetpwnam 27 25 -2
xgetgrnam 27 25 -2
xgetgrgid 27 25 -2
uid2uname 18 16 -2
login_main 980 978 -2
gid2group 18 16 -2
get_shell_name 54 52 -2
change_identity 50 48 -2
bb_internal_initgroups 50 48 -2
argstr 1261 1259 -2
print_perms 177 174 -3
inetd_main 2077 2074 -3
run_applet_no_and_exit 446 442 -4
fileaction_setowngrp 89 85 -4
deluser_main 312 308 -4
bb_internal_getpwuid 19 15 -4
bb_internal_getpwnam 11 7 -4
bb_internal_getgrnam 14 10 -4
bb_internal_getgrgid 19 15 -4
adduser_main 865 861 -4
passwd_main 989 984 -5
get_passwd 97 92 -5
data_extract_all 887 882 -5
check_user_passwd 490 485 -5
get_groups 81 75 -6
ftpd_main 2178 2171 -7
bb_internal_getspnam_r 42 18 -24
bb_internal_getpwnam_r 39 15 -24
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/41 up/down: 11/-153) Total: -142 bytes
text data bss dec hex filename
923167 928 17676 941771 e5ecb busybox_old
923023 928 17676 941627 e5e3b busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-02 22:31:07 +01:00
Denys Vlasenko
78854520eb
modprobe: revert checking for /, stop doing basename() on modprobe args
...
function old new delta
process_module 726 719 -7
filename2modname 81 67 -14
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-21) Total: -21 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2015-01-01 19:02:40 +01:00
Denys Vlasenko
c76236fd7d
ash: fix a SEGV in ${#1}
...
function old new delta
varvalue 760 805 +45
evalvar 648 603 -45
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2014-12-29 00:04:18 +01:00
Denys Vlasenko
b9965077e5
Start 1.24.0 development cycle
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2014-12-24 02:06:02 +01:00
Denys Vlasenko
6968e08123
Bump version to 1.23.0
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2014-12-24 01:48:20 +01:00
Denys Vlasenko
ca9c4653a9
libbb: add sanity check in bb_arg_max()
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2014-12-24 01:46:29 +01:00
Denys Vlasenko
11775edbfc
randomconfig fixes
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2014-12-22 19:37:05 +01:00
Denys Vlasenko
28634924f0
udhcpc: account for script run time
...
Based on the following user report:
I ran into an issue where I was seeing a long delay in the scripts called
in udhcp_run_script. I was using an old version of OpenWrt (kamikaze)
and a satellite modem. An NTP script was being called and the modem
would sometimes take a long time to respond to the DNS lookup when
it was offline.
This delay started affecting my lease time. The lease that I would
get from my satellite modem before it was online would be short:
only 60 seconds. The delay with NTP and the modem would typically
be about 18 seconds. This would cause the first DHCP renew request
from dhcpc to be a little late. Under certain circumstances,
I could even see the first DHCP renew to occur after the lease
had expired!
function old new delta
udhcpc_main 2816 2837 +21
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2014-12-21 16:10:22 +01:00
Denys Vlasenko
acb8be7217
tar: fix "tar -cJ" ignoring -J option. closes 7706
...
function old new delta
tar_main 895 938 +43
vfork_compressor 206 191 -15
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 43/-15) Total: 28 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2014-12-11 15:34:02 +01:00
Denys Vlasenko
d598a8d4e6
lineedit: don't fall back to simple line input if tty is in raw mode
...
Testcase: shell command input after python ^Z should still work
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2014-12-10 17:22:13 +01:00
Denys Vlasenko
cfcd2399b2
make xmalloc_open_zipped_read_close result NUL terminated
...
Compat with xmalloc_open_read_close
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2014-12-07 00:49:55 +01:00
Denys Vlasenko
b4c11c1397
libarchive: add capability to unpack to mem.buffer
...
The performance and number of processes for a "depmod -a" with gzipped
modules was abysmal. This patch adds a code path without fork,
benefiting all users of xmalloc_open_zipped_read_close.
"modinfo radeon.ko.gz", a single-file reader, got 30% faster.
"depmod -a", which used to fork over 800 times, got 20% faster.
Heavily based on a patch by Lauri Kasanen <curaga@operamail.com >
function old new delta
setup_transformer_on_fd - 159 +159
transformer_write - 122 +122
fork_transformer - 112 +112
xmalloc_open_zipped_read_close 63 118 +55
read_bunzip 1866 1896 +30
xtransformer_write - 19 +19
unzip_main 2449 2462 +13
bbunpack 755 766 +11
unpack_lzma_stream 2717 2723 +6
unpack_xz_stream 2393 2397 +4
unpack_Z_stream 1173 1175 +2
inflate_unzip 111 105 -6
check_signature16 70 63 -7
unpack_bz2_stream 359 349 -10
unpack_unxz 12 - -12
unpack_unlzma 12 - -12
unpack_uncompress 12 - -12
unpack_gunzip 12 - -12
unpack_bunzip2 12 - -12
open_transformer 106 92 -14
inflate_unzip_internal 1945 1916 -29
unpack_gz_stream 693 655 -38
open_zipped 89 47 -42
setup_unzip_on_fd 142 53 -89
------------------------------------------------------------------------------
(add/remove: 4/5 grow/shrink: 7/8 up/down: 533/-295) Total: 238 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2014-12-07 00:44:00 +01:00
Denys Vlasenko
e7800f351a
Rename transformer_aux_data_t -> transformer_state_t
...
No code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2014-12-07 00:42:49 +01:00
Denys Vlasenko
476654cdbe
man: do not mangle $MANPATH in memory
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2014-11-30 19:39:58 +01:00
Denys Vlasenko
ee41094b80
man: accept a list of dirs in $MANPATH
...
function old new delta
add_MANPATH - 143 +143
man_main 852 731 -121
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 143/-121) Total: 22 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com >
2014-11-27 00:40:08 +01:00