Closed Kibouo closed 3 years ago
Good report! Yeah the udp is a little bit weird at the moment. And I will try to fix it as soon as I got the time for it :)
Had a look at this today. It is not a problem with the implementation! Instead, it seems to be a problem with bash
itself.
This SO response explains (not sourced sadly) that bash handles UDP file descriptors "wrong" by reading only 1 byte.
Testing confirms this: Ncat 7.92
as listener behaves the same as rustcat
.
GNU Netcat 0.7.1
"fixes" this by silently refusing the connection. :upside_down_face: I'll just close this issue :sweat_smile:
ISSUE TYPE:
OS / ENVIRONMENT:
5.14.5-arch1-1
rustcat 1.2.0
STEPS TO REPRODUCE:
rc -ul localhost 1337
bash -c 'bash -i >& /dev/udp/localhost/1337 0>&1'
>>
prompt withEXPECTED BEHAVIOUR:
Normal shell behavior we all know.
ACTUAL BEHAVIOUR:
The 1st typed character is being "locked in". Meaning, to actually execute a command (e.g.
pwd
) one must:p
) and enterw
) and enterd
) and enter