Bug 845005

Summary: ncat: fails to transfer files from stdin
Product: [Fedora] Fedora Reporter: Enrico Scholz <rh-bugzilla>
Component: nmapAssignee: Michal Hlavinka <mhlavink>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 17CC: athmanem, dsmith, fche, mhlavink, psabata
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nmap-6.01-5.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-01 18:45:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Enrico Scholz 2012-08-01 12:55:45 UTC
Description of problem:

Because ncat is going to replace nc:

A common use case which transfers files read from stdin does not work anymore:

$ nc -l 1234 &       # just a listening server; works with remote ones too

$ touch /tmp/foo
$ ncat `hostname` 1234 < /tmp/foo
Unable to register IOD #2: Operation not permitted


strace shows

connect(4, {sa_family=AF_INET, sin_port=htons(1234), ...) = -1 EINPROGRESS (Operation now in progress)
epoll_ctl(3, EPOLL_CTL_ADD, 4, {...})   = 0
epoll_wait(3, {?} 0x8b22d0, 128, 10000) = 1
getsockopt(4, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
epoll_ctl(3, EPOLL_CTL_MOD, 4, {...})   = 0
epoll_ctl(3, EPOLL_CTL_MOD, 4, {...})   = 0
epoll_ctl(3, EPOLL_CTL_ADD, 0, {...})   = -1 EPERM (Operation not permitted)
write(2, "Unable to register IOD #2: Opera"..., 50Unable to register IOD #2: Operation not permitted) = 50


Version-Release number of selected component (if applicable):

nmap-6.00-1.fc17.x86_64

Comment 1 Michal Hlavinka 2012-08-02 11:26:23 UTC
Thanks for the report, I can reproduce this

Comment 2 Michal Hlavinka 2012-08-03 10:23:43 UTC
Note: option --nsock-engine=select can be used as a workaround

Comment 3 Frank Ch. Eigler 2012-08-12 21:01:47 UTC
This affects the systemtap testsuite also (causing a hang midstream).

Comment 4 Frank Ch. Eigler 2012-08-12 21:04:37 UTC
In systemtap's case, stdin is sometimes a pipe as opposed to a file; same symptoms.

Comment 5 Frank Ch. Eigler 2012-08-12 22:07:00 UTC
(In reply to comment #2)
> Note: option --nsock-engine=select can be used as a workaround

In my test, changing /bin/nc to

- exec ncat "$@"
+ exec ncat --nsock-engine=select "$@"

does not appear to fix it; maybe an EOF-detection problem too?

Comment 6 Michal Hlavinka 2012-08-13 10:12:18 UTC
(In reply to comment #5)
> (In reply to comment #2)
> > Note: option --nsock-engine=select can be used as a workaround
> 
> In my test, changing /bin/nc to
> 
> - exec ncat "$@"
> + exec ncat --nsock-engine=select "$@"
> 
> does not appear to fix it; maybe an EOF-detection problem too?

That is bug #845075. I have patch for that, but I'm still waiting for upstream comments.

Comment 7 Fedora End Of Life 2013-07-04 07:02:34 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 Fedora End Of Life 2013-08-01 18:46:05 UTC
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 9 Michal Hlavinka 2013-08-02 07:31:35 UTC
fixed in Fedora 18+