I've update the description. Feel free to adjust if you feel I'm
misrepresenting the issue.

** Description changed:

- Binary package hint: netcat-openbsd
+ netcat-openbsd's -q setting defaults to 0. This means that as soon as
+ stdin is closed, it will terminate.
  
- On Lucid Lynx (Beta 1):
+ For instance, this manifests itself by giving no output used like this:
  
- When piping input to netcat-openbsd (the pre-installed netcat on the
- Amazon EC2 AMIs), standard output is broken.
- 
- The following has no output at all:
  $ printf 'GET / HTTP/1.0\r\n\r\n' | nc www.google.com 80
  
- It works when typing the input on the terminal, but that's not feasible in 
scripts:
- $ nc www.google.com 80
- GET / HTTP/1.0
+ because printf terminates, causing nc to terminate before Google
+ responds.
  
- HTTP/1.0 302 Found
- [...]
- $
+ However, running nc without the pipe and typing the GET request works.
  
- It should look like this:
- $ printf 'GET / HTTP/1.0\r\n\r\n' | nc www.google.com 80
- HTTP/1.0 302 Found
- [...]
+ netcat-traditional defaults to not quitting on stdin closing (ie a
+ default value of -1).
  
- netcat-traditional is not affected. Neither is netcat on OpenBSD, nor
- the "netcat-openbsd" package on Debian.
+ The original netcat from OpenBSD does not have a -q option if I (Soren)
+ remember correctly and behaves similarly to netcat-traditional.
+ 
+ netcat-openbsd in Debian is not affected either, since this is caused by
+ a patch carried by Ubuntu (which I honestly forget whether I wrote or
+ took from Fedora (it's been more than two years)).
+ 
+ This default value, FWIW, was chosen because libvirt (at least at the
+ time) would do something like "ssh somehost nc -U /var/lib/libvirt/sock"
+ (not passing a -q option) when connecting to remote hosts over ssh.
+ Terminating the ssh session left the stale nc around (because it did not
+ care that stdin had been close) around, making it impossible for others
+ to connect to the same libvirt instance. Patching libvirt to pass -q was
+ not sufficient, because others could be using a stock libvirt and
+ inadvertently cause a Denial of Service of libvirt (because their nc
+ process would stick around indefinitely).

** Changed in: netcat-openbsd (Ubuntu)
   Importance: Undecided => Wishlist

-- 
netcat-openbsd exits too soon
https://bugs.launchpad.net/bugs/544935
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to