[Toybox] [Patches] - Issue fixes
Ashwini Sharma
ak.ashwini1981 at gmail.com
Wed Oct 15 23:31:15 PDT 2014
Hi Rob, List,
Few more issues observed. Please find attached the fix patches.
ln.c : with __-f__ with an existing destination unlink was done,
but in case where the requested operation failed, the original
file is not restored.
e.g. ln -f dir/ lnk, where source is dir and dest lnk existed.
login.c : >> On a timeout, the terminal settings were not restored.
>> Long username was not validated. The remaining data on
stdin was taken for password.
>> few static analysis fixes too.
ls.c: the grouping of options _o_, _g_, _n_ was not working. It preferred
the last one on cmdline.
mountpoint.c : a clean-up pass.
rm.c : No error message was thrown for deleting __.__ and __..__ mentioned
on cmdline.
As per rm posix spec [ If either of the files dot or dot-dot are
specified as the basename portion of an operand (that is, the final
pathname component) or if an operand resolves to the root directory, *rm* shall
write a diagnostic message to standard error and do nothing more with such
operands.]
rmmod.c: loop through all the modules passed on cmdline.
sort.c: >> -t <val>, error case for <val> as string or empty string.
>> -k <key>, key value with negative range, e.g. "sort -k 5.-1
data1.txt"
>> -f had an issue as the condition check was expecting all the
flags b, d, i, bb to be present.
>> in get_key_data(), __Skip body of key__, end was not advancing
on space and sorting was happening on wrong field.
>> enabling __-s__ for __-u__.
tail.c : added support for __-f__ option, i.e. keep listing on the fds for
more data.
uniq.c : >> sigsegv for large values of __-f__, skip() was looping beyond
the str.
>> accepting __-__ as input or output files.
>> checking for FLAG_w instead of TT.maxchars, as the input
for _-w_ can be supplied as _0_.
umount.c : __-n__ GNU version mentions not to update /etc/mtab, but in
toybox /proc/mounts is ignored instead.
For touch a patch was delivered earlier also. There are more improvisations
over that.
touch.c : >> A file to be touched must be there as cmdline input.
>> __-d__ option. strptime() adjusts and parses the input and
fits it to the format specified. As per the spec each field in the format
is two chars wide. it aligned the date to as it could fit
but not to the desired date specified on cmdline.
Now the input is validated to be in right format before the
strptime() is called.
>> __-t__ option, as for the _-d_ strptime() behavior was
fitting the requirement. The format used to fit the date into YY or yy first
whereas the mandatory fields are *MMDDhhmm.*
* >> *touching the already existing file of another user, this
was causing infinite loop, as open was successful.
On Tue, Oct 7, 2014 at 5:17 PM, Ashwini Sharma <ak.ashwini1981 at gmail.com>
wrote:
> Hi Rob, List,
>
> While verifying toybox on one of our products, came across few issues.
> Attached are the patches to those.
>
> 1. cp.c : For __mv__ with __-f__ and __-i__ user was prompted.
>
> 2. date.c: added support for additional date format parsing, a SIGSEGV for
> setdate, output in __-u__.
>
> 3. df.c: Output format and strings as specified in Posix and a correction
> when a
> device name is given. e.g. df /dev/sda1
>
> 4. du.c: stop the traversal on a self pointing link.
>
> 5. expr.c: Added '==' sign into list of operations. Also added support for
> regex pattern match.
>
> 6. ifconfig.c: stop parsing if interface name is encountered first.
>
> 7. killall.c: output formatting corrected. It was right justifying 4000
> places.
>
> 8. kill.c: printing signal numbers along with names while listing.
> Also listing the signals on command line, if name is given
> list the number
> and vice-versa.
> e.g $ ./toybox kill -l ABRT 2 ILL
> 6
> INT
> 4
> 9 lib.c: A static analysis issue fix for retrun value check.
> supporting change for kill.c.
> A Change in string_to_mode, while parsing sticky/suid bit for u, g, o.
> e.g chmod u+s,o+s,g+s file
> And a correction in human_readable().
>
> Few more will follow..
>
> rgds,
> Ashwini
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20141016/99bb17e4/attachment-0002.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ln.c.patch
Type: application/octet-stream
Size: 1445 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20141016/99bb17e4/attachment-0024.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: login.c.patch
Type: application/octet-stream
Size: 2141 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20141016/99bb17e4/attachment-0025.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ls.c.patch
Type: application/octet-stream
Size: 536 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20141016/99bb17e4/attachment-0026.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mountpoint.c.patch
Type: application/octet-stream
Size: 1917 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20141016/99bb17e4/attachment-0027.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rm.c.patch
Type: application/octet-stream
Size: 534 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20141016/99bb17e4/attachment-0028.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rmmod.c.patch
Type: application/octet-stream
Size: 1134 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20141016/99bb17e4/attachment-0029.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sort.c.patch
Type: application/octet-stream
Size: 2270 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20141016/99bb17e4/attachment-0030.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tail.c.patch
Type: application/octet-stream
Size: 6764 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20141016/99bb17e4/attachment-0031.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c.patch
Type: application/octet-stream
Size: 1067 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20141016/99bb17e4/attachment-0032.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: touch.c.patch
Type: application/octet-stream
Size: 3932 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20141016/99bb17e4/attachment-0033.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: umount.c.patch
Type: application/octet-stream
Size: 552 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20141016/99bb17e4/attachment-0034.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: uniq.c.patch
Type: application/octet-stream
Size: 1783 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20141016/99bb17e4/attachment-0035.obj>
More information about the Toybox
mailing list