| Summary: | xargs: Allow running interactive commands with -o [PATCH] | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | Mallory <malloryadams> |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | enhancement | CC: | busybox-cvs, malloryadams |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: | Patch to add -o support https://github.com/MalloryA/busybox/commit/2b66ae249d87c3b1c427cc87862ad6612b27c271 | ||
|
Description
Mallory
2022-11-26 17:59:57 UTC
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.
Fixed in git. |