Commit Graph

17620 Commits

Author SHA1 Message Date
Chris Renshaw
2e11b46a8d fix hush, add glob and sigisemptyset
Patch by Tias Guns <tias@ulyssis.org>, based on 'glob' by Dan Drown
http://dan.drown.org/android/src/busybox/
Rebased for busybox 1.26.1 by Chris Renshaw <osm0sis@outlook.com>
2024-04-25 15:48:06 -07:00
Chris Renshaw
52cb97b856 fix hush: add missing definitions on Android API 21+
platform FAST_FUNC adjustment to support NDK unified headers by John Wu <topjohnwu@gmail.com>

issetugid is required for hush via glob.c; add the hacky pre-API 21 definition back

Rebased for busybox 1.34.1 by Chris Renshaw <osm0sis@outlook.com>
2024-04-25 15:48:06 -07:00
Chris Renshaw
5e22115078 fix udhcpc6: add missing ifaddrs.h and getifaddrs/freeifaddrs functions
ifaddrs implementation from 'android-ifaddrs' by Kenneth MacKay:
https://github.com/morristech/android-ifaddrs
2024-04-25 15:48:06 -07:00
Chris Renshaw
9b7a89681a additional fix-up for IPV6 on Android API 21+
fixes: networking/interface.c:62:8: error: redefinition of 'struct in6_ifreq'

and:
error: field 'ifru_addr' has incomplete type
  struct sockaddr ifru_addr;
error: field 'ifru_dstaddr' has incomplete type
  struct sockaddr ifru_dstaddr;
...
since sockaddr was moved from linux/socket.h to sys/socket.h in newer NDK revisions
2024-04-25 15:48:06 -07:00
Tias Guns
e0565bde5f fix ipv6, add ipv6_route.h
from 'in6_rtmsg' by Dan Drown
"in6_rtmsg defined in linux/ipv6_route.h"
http://dan.drown.org/android/src/busybox/
2024-04-25 15:48:06 -07:00
Chris Renshaw
d4d38041c2 fix fsck.minix, mkfs.minix: undef HAVE_SETBIT, MINIX2_SUPER_MAGIC, MINIX2_SUPER_MAGIC
"there is no setbit/clrbit in bionic"
"MINIX2_SUPER_MAGIC / MINIX2_SUPER_MAGIC2 defined in sys/vfs.h, undefine
it to use it in the enum"

Patch by Tias Guns <tias@ulyssis.org>, based on 'no-setbit' and
'undefine-minix2-magic-to-use-in-enum' by Dan Drown
http://dan.drown.org/android/src/busybox/
Rebased for busybox 1.28.1 by Chris Renshaw <osm0sis@outlook.com>
2024-04-25 15:48:06 -07:00
Tias Guns
187cfa9753 fix ipcs, ipcrm no sys/sem-shm-msg, etc
patch from 'no-sys-shm,msg,sem' by Dan Drown
http://dan.drown.org/android/src/busybox/

Signed-off-by: Tias Guns <tias@ulyssis.org>
2023-09-02 04:53:16 -07:00
Umakanthan Chandran
24a899b575 missing_syscalls/semctl: fix missing definitions on x86 and MIPS NDK cross-compiles
Signed-off-by: Umakanthan Chandran <cumakt@gmail.com>
2023-09-02 04:53:16 -07:00
Tias Guns
f8f14deeff android syscall (non-trivial): semctl
needed by ipcs and ipcrm, also needed (but not sufficient) for syslogd and logread

semctl from glibc
patch from 'no-sys-shm,msg,sem' by Dan Drown
http://dan.drown.org/android/src/busybox/

Signed-off-by: Tias Guns <tias@ulyssis.org>
2023-09-02 04:53:16 -07:00
Chris Renshaw
8f4de5081b android syscalls: shmdt shmat sembuf
Patch by Tias Guns <tias@ulyssis.org>
Rebased for busybox 1.25.0 by Chris Renshaw <osm0sis@outlook.com>
2023-09-02 04:53:16 -07:00
Chris Renshaw
8ba5becb43 android syscalls: msgctl shmctl
Patch by Tias Guns <tias@ulyssis.org>
Rebased for busybox 1.25.0 by Chris Renshaw <osm0sis@outlook.com>
2023-09-02 04:53:16 -07:00
Chris Renshaw
9f36b941ea android syscalls: shmget/msgget/semget
Patch modified by Tias Guns <tias@ulyssis.org> from 'no-sys-shm,msg,sem' by Dan Drown
http://dan.drown.org/android/src/busybox/
Rebased for busybox 1.25.0 by Chris Renshaw <osm0sis@outlook.com>
2023-09-02 04:53:16 -07:00
Chris Renshaw
048f41aea9 loadfont/setfont/conspy: add missing header
Imported from dorimanx's combined ported header toolchain:
https://github.com/dorimanx/android-busybox-ndk
2023-09-02 04:53:16 -07:00
Chris Renshaw
fa9b786d8c fix ether-wake, avoid ether_hostton and include if_ether
Patch by Tias Guns <tias@ulyssis.org>, based on 'no-ether_hostton' by Dan Drown
"there is no /etc/ethers or ether_hostton on bionic"
http://dan.drown.org/android/src/busybox/
Rebased for busybox 1.24.1 by Chris Renshaw <osm0sis@outlook.com>
2023-09-02 04:53:16 -07:00
Chris Renshaw
b454f64305 fix udhcpd and nameif, add ether_ntoa_r and ether_aton_r from glibc
this patch also fixes part of arping and ether-wake, but not sufficiently yet

Patch modified by Tias Guns <tias@ulyssis.org> from 'ether_XtoY-from-glibc' by Dan Drown
http://dan.drown.org/android/src/busybox/
Rebased for busybox 1.26.1 by Chris Renshaw <osm0sis@outlook.com>
2023-09-02 04:53:16 -07:00
Chris Renshaw
f753b7bd2c eject: add missing headers
Imported from dorimanx's combined ported header toolchain:
https://github.com/dorimanx/android-busybox-ndk
2023-09-02 04:53:16 -07:00
Chris Renshaw
00804b71ea android: fix 'mount', 'umount', 'fsck', 'df'
Patch by Tias Guns <tias@ulyssis.org>, based on 'Bionic Patch V1.0' by Vitaly Greck
https://code.google.com/p/busybox-android/downloads/detail?name=patch
Rebased for busybox 1.33.1 by Chris Renshaw <osm0sis@outlook.com>
2023-09-02 04:53:16 -07:00
Chris Renshaw
a84db18ef7 Fix direct mount .img (auto loopback) and losetup for Android /dev/block/loop 2023-09-02 04:53:16 -07:00
Chris Renshaw
534ef9f1b0 Fix mconf/lkc host "warning statement with no effect" 2023-09-02 04:53:16 -07:00
Denys Vlasenko
1a64f6a20a Bump version to 1.36.1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-19 00:31:04 +02:00
Akos Somfai
38d2d26a5f lineedit: fix crash when icanon set with -echo
When icanon is set with -echo (e.g. ssh from an emacs shell) then
S.state will remain null but later it will be deferenced causing ash to
crash. Fix: additional check on state.

Signed-off-by: Akos Somfai <akos.somfai@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-25 16:47:22 +02:00
Denys Vlasenko
384cd2e436 sleep: fix error exit when called as "sh" builtin
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-25 16:47:22 +02:00
Denys Vlasenko
ce839dea92 ash: fix sleep built-in not running INT trap immediately on ^C
function                                             old     new   delta
sleep_for_duration                                   169     149     -20

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-25 16:47:22 +02:00
Denys Vlasenko
d661cb1977 ash: sleep builtin with no arguments should not exit
function                                             old     new   delta
sleep_main                                           116     143     +27
.rodata                                           105245  105268     +23
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 50/0)               Total: 50 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-25 16:47:22 +02:00
Denys Vlasenko
515adcc9f3 hush: printf builtin with no arguments should not exit
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-25 16:47:22 +02:00
Denys Vlasenko
90f5f2a190 ash: fix still-broken new mail detection
padvance() exit condition is return value < 0, not == 0.
After MAIL changing twice, the logic erroneously
concluded that "you have new mail".

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-25 16:47:22 +02:00
Denys Vlasenko
07bc5de67b ash: fix broken new mail detection
Mea culpa, in "Do not allocate stack string in padvance" commit
(I left an extraneous "break" statement).

function                                             old     new   delta
cmdloop                                              329     398     +69

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-25 16:47:22 +02:00
Ron Yorston
64e967fabb lineedit: fix matching of directories when searching PATH
Commit 8baa643a3 (lineedit: match local directories when searching
PATH) included subdirectories of the current directory in the search
when tab-completing commands.

Unfortunately a short time later commit 1d180cd74 (lineedit: use
strncmp instead of is_prefixed_with (we know the length)) broke
this feature by returning an incorrect length for the array of paths.

Fix the length and reinstate matching of subdirectories.

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-25 16:47:22 +02:00
Denys Vlasenko
8d198665a0 libbb/sha: fix sha-NI instruction detection
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-03-29 15:50:40 +02:00
Denys Vlasenko
c0bb90e2fe unzip: clear SUID/GID bits, implement -K to not clear them
function                                             old     new   delta
unzip_main                                          2656    2715     +59
packed_usage                                       34517   34552     +35
.rodata                                           105250  105251      +1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 95/0)               Total: 95 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-03-28 17:42:00 +02:00
Sören Tempel
f15dfd86c4 ed: don't use memcpy with overlapping memory regions
The memcpy invocations in the subCommand function, modified by this
commit, previously used memcpy with overlapping memory regions. This is
undefined behavior. On Alpine Linux, it causes BusyBox ed to crash since
we compile BusyBox with -D_FORTIFY_SOURCE=2 and our fortify-headers
implementation catches this source of undefined behavior [0]. The issue
can only be triggered if the replacement string is the same size or
shorter than the old string.

Looking at the code, it seems to me that a memmove(3) is what was
actually intended here, this commit modifies the code accordingly.

[0]: https://gitlab.alpinelinux.org/alpine/aports/-/issues/13504

Signed-off-by: Sören Tempel <soeren+git@soeren-tempel.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-01-05 16:26:49 +01:00
Denys Vlasenko
70f77e4617 Bump version to 1.36.0
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-01-03 15:15:41 +01:00
Denys Vlasenko
969e008168 hush: code shrink
function                                             old     new   delta
run_list                                            1032    1012     -20

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-01-03 14:08:18 +01:00
Denys Vlasenko
d488a5218b ash: trivial code shrink
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-01-03 13:39:14 +01:00
Denys Vlasenko
bcb90b9c41 xxd: use bb_simple_perror_msg... where appropriate
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-01-03 08:30:12 +01:00
Denys Vlasenko
27be0e8cfe shell: fix compile failures in some configs
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-01-03 08:28:16 +01:00
Denys Vlasenko
8ed57db65b Makefile.flags: add resolv to LDLIBS for linux compilers too (not only gnu ones)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-01-02 17:10:04 +01:00
Denys Vlasenko
9b2d766e0e sed: fix double-free in FEATURE_CLEAN_UP=y configs
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-01-02 17:05:55 +01:00
Denys Vlasenko
cadf57b3af mv: fix error in !VERBOSE configs
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-01-02 17:04:44 +01:00
Denys Vlasenko
e7977df2ca libbb/loop: fix compile failure (name collision)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-01-02 17:03:44 +01:00
Denys Vlasenko
fb0c000567 testsuite/sha1sum.tests: fix false positive failure
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-01-02 17:02:17 +01:00
Denys Vlasenko
dc068abad5 testsuite/tree.tests: fix false positive failure
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-01-02 17:01:14 +01:00
Denys Vlasenko
adb1c7dcfe xxd: fix use of non-initialized data
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-01-02 16:59:40 +01:00
Denys Vlasenko
c4d296aa7c xargs: implement -o, closes 15146
function                                             old     new   delta
.rodata                                           105225  105259     +34
d6_listen_socket                                     150     180     +30
packed_usage                                       34512   34532     +20
d6_read_interface                                    595     581     -14
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/1 up/down: 84/-14)             Total: 70 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-12-22 10:38:08 +01:00
Denys Vlasenko
02ca565646 udhcpc6: fix binding to network aliases
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-12-15 23:57:27 +01:00
Denys Vlasenko
6c2ddf808e udhcp: add a few comments, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-12-15 13:34:52 +01:00
Denys Vlasenko
242d056230 udhcpc6: use a different default config script
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-12-15 11:51:16 +01:00
Denys Vlasenko
301ef96892 udhcpc6: align FF02__1_2[]
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-12-15 11:49:00 +01:00
Natanael Copa
3636d52cbe more: accept and ignore -e
Accept and ignore -e which is specified in POSIX.
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/more.html

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-12-14 16:05:43 +01:00
Denys Vlasenko
e977853e70 udhcpc6: add some comments
RFCs for DHCPv6 are written rather badly...

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2022-12-14 00:36:59 +01:00