[Bug 15146] xargs: Allow running interactive commands with -o [PATCH]

bugzilla at busybox.net bugzilla at busybox.net
Tue Dec 20 14:31:51 UTC 2022


https://bugs.busybox.net/show_bug.cgi?id=15146

--- Comment #1 from Denys Vlasenko <vda.linux at googlemail.com> ---
Buggy. You must not dup2 to stdin, you lose the original input.


+               if (dup2(*fd, STDIN_FILENO) != 0)
+                       bb_error_msg_and_die("can't read from /dev/tty");

The error message is wrong. Anyway, use xdup2() which never returns failure.



+               if ((fd = xopen("/dev/tty", O_RDONLY)) == -1)
+                       bb_error_msg_and_die("can't open /dev/tty");

xopen() never returns -1.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list