[Bug 16024] New: ash: sleep as a builtin may abort the shell
bugzilla at busybox.net
bugzilla at busybox.net
Tue Apr 9 14:51:46 UTC 2024
https://bugs.busybox.net/show_bug.cgi?id=16024
Bug ID: 16024
Summary: ash: sleep as a builtin may abort the shell
Product: Busybox
Version: unspecified
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P5
Component: Other
Assignee: unassigned at busybox.net
Reporter: sinbad_4273 at yahoo.com
CC: busybox-cvs at busybox.net
Target Milestone: ---
For ash builtin sleep, the following aborts the shell
sleep --help // if help isn't on
sleep 0.5 // if float duration isn't on
sleep 1n // typo should have been 1m with fancy sleep on
This is known to busybox developers as shown by this comment in sleep.c
//FIXME: in ash, "sleep 123qwerty" as a builtin aborts the shell
https://git.busybox.net/busybox/tree/coreutils/sleep.c#n91
If any sleep argument is deemed invalid, bb_error_msg_and_die() is called but
in the case of a builtin the entire ash shell is what dies not sleep as
intended.
https://git.busybox.net/busybox/tree/libbb/xatonum_template.c#n74
This was noticed in the dd-wrt project as discussed here:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=336142
Workaround:
Use /bin/sleep instead of builtin sleep so bb_error_msg_and_die() will
terminate the sleep process not the terminate the ash process.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the busybox-cvs
mailing list