Commit Graph

12605 Commits

Author SHA1 Message Date
Denys Vlasenko
d38ca03946 udhcpc: reuse string constant; remove unneeded memset(0)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-11-05 01:25:03 +01:00
Denys Vlasenko
2017d48c0d udhcpc: deprecate --hostname NAME
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-11-05 01:24:14 +01:00
Denys Vlasenko
c0cae52662 lineedit: fix build failure
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-11-04 01:09:09 +01:00
Denys Vlasenko
9ce09bc9cb lineedit: add support for M-b, M-f, M-d, M-Backspace
function                                             old     new   delta
ctrl_left                                              -      96     +96
ctrl_right                                             -      76     +76
static.esccmds                                        81      93     +12
read_line_input                                     3876    3885      +9
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 2/0 up/down: 193/0)             Total: 193 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-11-03 13:28:22 +01:00
Daniel Fandrich
45cdf166dc android build system updates
Signed-off-by: Daniel Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-11-03 11:20:07 +01:00
Denys Vlasenko
f3efd3c2a0 rx: code shrink
function                                             old     new   delta
rx_main                                              961     947     -14

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-11-03 10:19:53 +01:00
Dan Fandrich
f808e777db rx: Fix file corruption with duplicate blocks
Rather than dropping the dupe, rx was appending it to the file.

Signed-off-by: Dan Fandrich <dan@coneharvesters.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-11-03 10:18:33 +01:00
Karol Lewandowski
b5ebe5fdb3 mount: handle list of comma-separated fs types in -t option
Allows one to specify list of filesystem types to be
tried when mounting particular device. E.g.

 mount -t vfat,ext2 ...
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-11-03 10:02:31 +01:00
Denys Vlasenko
f85554c265 mount: free commented /etc/filesystems lines when we read it
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-11-03 09:54:53 +01:00
Denys Vlasenko
3b1603410a nmeter: fix block i/o count on newer Linux kernels
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-11-01 23:34:46 +01:00
Denys Vlasenko
f8a5b792ba cttyhack: move /sys/class/tty/console/active check to the front
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-31 16:57:04 +01:00
Alexander Shishkin
156840c249 cttyhack: print detected ctty name when called without parameters
Sometimes there's a need to figure out the controlling tty from a shell
script, for example, to obtain a line for getty. In this case it's easier
to call cttyhack than trying to repeat some of the cttyhack's logic.

function                                             old     new   delta
cttyhack_main                                        283     327     +44
packed_usage                                       28911   28915      +4

Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-31 13:18:44 +01:00
Denys Vlasenko
bcdae63875 testsuite: merge bzcat2.tests into bzcat.tests
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-31 01:10:47 +01:00
Denys Vlasenko
c0e37b4340 testsuite: fix the mishap in the previous commit
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-31 01:08:35 +01:00
Denys Vlasenko
c531b9a3e4 bzcat: fix unpacking of more than one file, and unpacking of zero-size bz2. Closes 4393
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-31 01:05:16 +01:00
Denys Vlasenko
b076193f74 modinfo: make it select PLATFORM_LINUX. Closes 4411
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-30 22:07:36 +01:00
Denys Vlasenko
e504c245f7 getty: Hurd has no CBAUD, work around that
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-30 21:27:33 +01:00
Denys Vlasenko
83e34ac4b5 makemime: fix -a option not taking parameter
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-28 18:25:38 +02:00
Christian Engelmayer
8de2e42201 syslogd: work around rename() not renaming hardlinks to themselves
Function log_locally() within the syslogd can potentially lock up when
restarting the daemon after a power loss in case the unplanned shutdown hit the
rename operation during logfile rotation.

While POSIX requires the rename operation to be atomic, many file systems such
as JFFS2 implement the rename operation in 2 steps by linking the new name
followed by unlinking the original name. In case of a power loss during the
rename the system can end up with /var/log/messages and /var/log/messages.0
being 2 hard links to the same file.

When the syslog daemon restarts in such a situation it will rediscover the need
to rotate the log files, however, POSIX also requires that rename does nothing
and reports success in case oldpath and newpath are existing hard links to the
same file. Looping through reopen: by (O_CREAT | O_APPEND), the daemon
eternally reopens the same file without succeeding to rotate.

Signed-off-by: Christian Engelmayer <christian.engelmayer@frequentis.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-28 18:12:42 +02:00
Denys Vlasenko
e6094d95b5 libbb: shrink base64 decoding a bit
function                                             old     new   delta
bb_uuenc_tbl_base64                                   67      66      -1
decode_base64                                        182     161     -21

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-28 16:15:00 +02:00
Denys Vlasenko
73d249e704 whitespace fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-28 14:07:44 +02:00
Leonid Lisovskiy
328f27fe44 libbb: split decode_base64 off read_base64
function                                             old     new   delta
decode_base64                                          -     182    +182
read_base64                                          378     255    -123
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 182/-123)           Total: 59 bytes

Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-28 13:59:55 +02:00
Denys Vlasenko
ec447c7f01 libbb.h: remove unused defines
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-24 04:06:18 +02:00
Denys Vlasenko
e9dc354df8 getty: fix a minor problem of Ctrl-D not printing '\n'
Also removed defines for control chars which are never changed,
and added login/getty README.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-23 23:58:59 +02:00
Denys Vlasenko
ee320c6d9c getty: reset tty attrs on Ctrl-C and Ctrl-D too
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-23 18:05:58 +02:00
Denys Vlasenko
e206a4de4c getty: add O_NONBLOCK to open which is used to drop ctty
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-22 08:19:42 +02:00
Denys Vlasenko
a241069004 remove duplicate include <sys/swap.h>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-22 06:39:00 +02:00
Denys Vlasenko
94354154c4 getty: remove now not needed resetting of ALRM to to SIG_DFL
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-22 06:30:48 +02:00
Denys Vlasenko
7449e18190 getty,login: tighten up handling of ctty, pgrp, and tty attr restoring on timeout
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-22 06:27:41 +02:00
Denys Vlasenko
ef5a2d757a getty: shrink help text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-22 03:16:23 +02:00
Denys Vlasenko
5dd1f472a4 stty: trim too verbose error messages (-40 bytes)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-21 19:45:13 +02:00
Denys Vlasenko
17fb598dc2 docs/ctty.htm: add a useful URL to
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-21 18:44:33 +02:00
Denys Vlasenko
2af2acf9b5 udhcpc: add comment about server IP
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-20 14:47:41 +02:00
Denys Vlasenko
fbca0c68a7 udhcpc: in fill_envp, export BOOTP fields first
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-20 14:24:18 +02:00
Denys Vlasenko
cd4d78f525 dhcpc: fix the case where we might add extra space at the end of envvar.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-20 13:21:55 +02:00
Denys Vlasenko
1dff672335 udhcpc: fix 6rd option formatting (was using 4 more bytes than there is)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-20 12:29:18 +02:00
Denys Vlasenko
42816c204d udhcpc: remove unused argument in sprint_nip6
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-20 10:52:07 +02:00
Denys Vlasenko
7981d79ef0 udhcpc: small code shrink
function                                             old     new   delta
udhcp_recv_raw_packet                                430     425      -5

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-20 10:34:05 +02:00
Denys Vlasenko
f461385521 typo fix in comment
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-20 08:54:16 +02:00
Denys Vlasenko
1f56e51ca1 udhcpc: add support for DHCP option 212 (RFC 5969)
The patch is from OpenWRT people.

function                                             old     new   delta
xmalloc_optname_optval                               637     874    +237
dhcp_option_strings                                  237     243      +6
dhcp_optflags                                         68      70      +2
len_of_option_as_string                               12      13      +1
dhcp_option_lengths                                   12      13      +1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/0 up/down: 247/0)             Total: 247 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-19 22:40:35 +02:00
Denys Vlasenko
2ea73b513d nc: small code shrink
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-19 22:31:01 +02:00
Denys Vlasenko
4ea37d62c2 gen_build_files.sh: simplify "print everything up to INSERT line" part
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-19 21:17:20 +02:00
Denys Vlasenko
efd08bfa0a gen_build_files: don't pass 200k+ strings as params. Closes 4321
Also removes one grep per generated file.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-19 17:54:42 +02:00
Denys Vlasenko
f74f280a14 get_header_tar: shrink 6->64 sign extension code
function                                             old     new   delta
getOctal                                             125     107     -18

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-19 14:51:12 +02:00
Denys Vlasenko
9c28fb8d28 ifupdown: code shrink
function                                             old     new   delta
keywords_up_down                                       -      43     +43
set_environ                                          371     259    -112
ifupdown_main                                       2194    2073    -121
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/2 up/down: 43/-233)          Total: -190 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-19 02:37:08 +02:00
Peter Korsgaard
dd82443b92 ifupdown: support post-up / pre-down hooks
function                                             old     new   delta
set_environ                                          330     371     +41
ifupdown_main                                       2156    2194     +38
iface_up                                              97     113     +16
iface_down                                            97     113     +16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 111/0)             Total: 111 bytes

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-19 02:35:54 +02:00
Denys Vlasenko
ce8c4cf37f TODO: all another location with bbox patches (OpenWRT)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-19 01:55:08 +02:00
Denys Vlasenko
5f92043c3f uudecode: fix buggy check for empty filename
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-18 12:07:05 +02:00
Vladislav Grishenko
6464f15ddb udhcpc: on SIGUSR1, limit renew attempts time to 20 seconds; then do total reconfig
Scenario:

1. udhcpc gets lease for 86400 secs and sleeps for 43200 before renew attempt

2. PC gets physically disconnected and connected to another network

3. some phy control software sends SIGUSR1 to renew the lease, SIGUSR2 isn't
used because newly connected network could be the same as before

4. udhcpc sends unicast renew requests until lease timeout fall to 60 sec.
They are ignored by new network dhcp servers

5. udhcpc sends broadcast rebind requests for 60 seconds, which are NAKed
or ignored too

6. udhcpc deconfigs and starting from discover state, gets new lease for the
new network

So, pt.4+5 it could take up to 86400 secs without correct lease, which is
too long and not acceptable.

Second SIGUSR1 will immediately run into deconfig/discover state, which is
not preferable in case of the same subnet replugged.

This patch makes sure after SIGUSR1 timeout is no more than -A NUM
(usually 20 sec). It means that renew will be requested via broadcast,
and if no replies come back, full deconf/reconf cycle will be initiated
in 20 seconds.

Signed-off-by: Vladislav Grishenko <themiron@mail.ru>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-18 01:37:47 +02:00
Leonid Lisovskiy
6c9c0a1dc9 udhcp: IF_UDHCP_VERBOSE() macro - improve code readability
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-18 00:35:47 +02:00