Hi,

busybox v1.24.1 crashes here with glibc-2.22 upon this invocation:

% busybox truncate -s 1 /tmp/whatever
*** invalid open64 call: O_CREAT or O_TMPFILE without mode ***: busybox 
terminated
======= Backtrace: =========
/usr/lib/libc.so.6(+0x71e76)[0x7fa878384e76]
/usr/lib/libc.so.6(__fortify_fail+0x37)[0x7fa87840cd17]
/usr/lib/libc.so.6(+0xdc3bf)[0x7fa8783ef3bf]
busybox(+0x6d49e)[0x55f69d7f749e]
busybox(+0xaed3)[0x55f69d794ed3]
busybox(+0xafde)[0x55f69d794fde]
busybox(+0xb157)[0x55f69d795157]
busybox(+0xab13)[0x55f69d794b13]
/usr/lib/libc.so.6(__libc_start_main+0xf0)[0x7fa878333680]
busybox(+0xab79)[0x55f69d794b79]
...

And indeed, without -c this is bound to happen:

        if (!(opts & OPT_NOCREATE))
                flags |= O_CREAT;
...
                int fd = open(*argv, flags);

In conformance with GNU coreutils, this open(2) call should pass mode
0666 as a third argument.

Thanks,
-- 
Christian Neukirchen  <[email protected]>  http://chneukirchen.org
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to