[Toybox] [PATCH] test.c: [ 10 -eq 010 ] but [[ 10 -ne 010 ]]
Oliver Webb
aquahobbyist at proton.me
Sun Apr 21 09:01:36 PDT 2024
[Issue 498](https://github.com/landley/toybox/issues/498)
Apparently a "Security Issue" when dealing with 0 padded numbers
like strftime %m. (Which only matters on some BSD systems where toybox
test is being used but toybox date is not).
I'm not entirely convinced this is a good idea since this removes the
ability to do [ 100M -lt 10G ], A cool extension toybox provides.
"And for what?": The ability to interoperate with the OpenBSD (The only
utility set that I found that we care about which doesn't have it) utility
set when dealing with 0 padded time numbers apparently. but if you do care
about this fairly minor edge case enough to remove cool functionality for it.
The patch is attached for you.
- Oliver Webb <aquahobbyist at proton.me>
P.S. Have you thought about making "[[" a MAYFORK instead of
a NOFORK like busybox does.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-test.c-Only-use-atolx-if-calling-under-so-that-10-eq.patch
Type: text/x-patch
Size: 1057 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20240421/82c5c48d/attachment.bin>
More information about the Toybox
mailing list