[Toybox] netcat -f bug

Rob Landley rob at landley.net
Wed May 15 11:52:10 PDT 2024


On 5/11/24 02:11, Yi-Yo Chiang wrote:
> On Sat, May 11, 2024 at 1:30 AM Rob Landley <rob at landley.net
> <mailto:rob at landley.net>> wrote:
> 
>     What's your use case triggering this patch? Because without that, I go off on
>     various design tangents, as seen below:
> 
> I just wanted some tool to communicate with a pty or socket node on android.
> Wanted a program to be able to send/recv towards a duplex data stream. (more
> precisely I want a command that does exactly what pollinate() does)
> Since socat nor minicom is available on Android, I'm just using `stty raw -echo
> && nc -f` to "talk" to my pty.
> 
> Why didn't I use <> redirector? Because I wasn't aware of that feature before
> reading this mail...
> Let me fiddle with it a bit:
> 
> cat <>/dev/pts/0
>> Shows the pts output, but my input doesn't get passed back

Sorry for sitting on this, my confusion here is I don't know what /dev/pts/0
means in your test, and the pts man page isn't illuminating. It doesn't seem to
be special, it just seems to be the first one allocated? (So who allocated it on
android?)

According to "tty" in a random command line tab that one's using /dev/pts/17,
and ps ax | grep pts/0 says it's PID 14597 a random bash instance, so I don't
think the test lines up on a debian+xfce laptop.

What is your test trying to _do_? (What process are you talking to?)

> yeah like you said it should had fall through and be like -l. 
> However digging the git history the fall through line got removed
> here https://github.com/landley/toybox/commit/67bf48c1cb3ed55249c27e6f02f5c938b20e027d
> which is unintentional I think?

Yeah, lack of automated regression testing for this, which is why I want to
understand and fix the test...

Rob


More information about the Toybox mailing list