[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    `sleep` fails if called with an end-of-options delimiter `--`
From:       Lucas Larson <lucas.larson () gmail ! com>
Date:       2023-06-25 14:19:03
Message-ID: CAJqTUYyKvwTGBLqXzUi5wWbqorMqYX2t=hOVhXhJ3ybv8Dgcyw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


package: busybox
version: 1.36.1

Bug description:
When using the `sleep` command with the end-of-options delimiter `--` (that
is, `sleep -- 1` or `busybox sleep -- 1`), the command fails to execute
properly. However, both `sleep 1` and `busybox sleep 1` commands work as
expected. According to the POSIX standard, both constructions should be
permitted.

Minimal steps to reproduce:
$ docker pull alpine
$ docker run -it alpine
$ busybox --help | head -1
  BusyBox v1.36.1 (2023-06-02 00:42:02 UTC) multi-call binary.
$ cat /etc/os-release
  NAME="Alpine Linux"
  ID=alpine
  VERSION_ID=3.18.2
  PRETTY_NAME="Alpine Linux v3.18"
  HOME_URL="https://alpinelinux.org/"
  BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"

$ *sleep 1* # sleeps for a second
$ *sleep -- 1*
  sh: invalid number '--' # and container exits
$ busybox sleep 1 # sleeps for a second
$ *busybox sleep -- 1*
  *sleep: invalid number '--'* # container does not exit

$ apk add coreutils # install coreutils on Alpine Linux
$ *coreutils --coreutils-prog=sleep 1* # sleeps for a second
$ *coreutils --coreutils-prog=sleep -- 1* # also sleeps for a second

Thank you,

Lucas Larson

[Attachment #5 (text/html)]

<div dir="ltr">package: busybox<br>version: 1.36.1<br><div><br></div><div>Bug \
description:<br>When using the `sleep` command with the end-of-options delimiter `--` \
(that is, `sleep -- 1` or `busybox sleep -- 1`), the command fails to execute \
properly. However, both `sleep 1` and `busybox sleep 1` commands work as expected. \
According to the POSIX standard, both constructions should be \
permitted.</div><div><br></div><div>Minimal steps to reproduce:</div><div><font \
face="monospace">$ docker pull alpine</font></div><div><span \
style="font-family:monospace">$ docker run -it alpine</span></div><div><span \
style="font-family:monospace">$ busybox --help | head -1</span><br></div><div><font \
face="monospace">    BusyBox v1.36.1 (2023-06-02 00:42:02 UTC) multi-call \
binary.</font></div><div><font face="monospace">$ cat /etc/os-release<br>   \
NAME=&quot;Alpine Linux&quot;<br>   ID=alpine<br>   VERSION_ID=3.18.2<br>   \
PRETTY_NAME=&quot;Alpine Linux v3.18&quot;<br>   HOME_URL=&quot;<a \
href="https://alpinelinux.org/">https://alpinelinux.org/</a>&quot;<br>   \
BUG_REPORT_URL=&quot;<a \
href="https://gitlab.alpinelinux.org/alpine/aports/-/issues">https://gitlab.alpinelinux.org/alpine/aports/-/issues</a>&quot;<br></font></div><br \
class="gmail-Apple-interchange-newline"><div><font face="monospace">$ <b>sleep 1</b> \
</font><font face="arial, sans-serif"># sleeps for a \
second</font><br></div><div><font face="monospace">$ <b>sleep -- \
1</b></font></div><div><font face="monospace" style="font-weight:bold">   sh: invalid \
number &#39;--&#39;</font><font face="arial, sans-serif" style=""> #  and container \
exits</font><br></div><div><span style="font-family:monospace">$ </span><span \
style="font-weight:bold;font-family:monospace">busybox sleep 1</span><font \
face="monospace" style="">  </font><font face="arial, sans-serif" style=""># sleeps \
for a second</font></div><div><span style="font-family:monospace">$ <b>busybox sleep \
-- 1</b></span><br></div><font face="monospace" style="font-weight:bold">    \
</font><span style="font-family:monospace"><b>sleep: invalid number &#39;--&#39;</b> \
</span><font face="arial, sans-serif" style=""># container does not \
exit</font><div><font face="arial, sans-serif"><br></font></div><div><font \
face="monospace">$ apk add coreutils  </font># install coreutils on Alpine \
Linux<br></div><div><div><font face="monospace">$  <b>coreutils \
--coreutils-prog=sleep 1</b>  </font># sleeps for a second<font \
face="monospace"><br></font><font face="monospace">$  <b>coreutils \
--coreutils-prog=sleep -- 1</b>  </font># also sleeps for a second<font \
face="monospace"><br></font></div></div><div><br></div><div>Thank you,<br><br>Lucas \
Larson</div></div>



_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic