Skip to content

ncat: multiple-connections listen mode: client exiting causes Ncat: Program bug: fd (4) not on list. QUITTING. #2827

@pabs3

Description

@pabs3

Describe the bug

When ncat is in multiple-connection listen send-only mode, if a client disconnects then ncat quits too.

To Reproduce

In the first terminal start ncat in multiple-connection listen mode, start ncat in connect recieve-only mode in two other terminals, enter foo in the listen ncat, kill the second connect ncat and finally enter bar in the listen ncat, which will then quit with an error:

$ ncat --listen --unixsock sock --keep-open --send-only
foo
bar
Ncat: Program bug: fd (4) not on list. QUITTING.

$ echo $?
2
$ ncat --unixsock sock --recv-only
foo
bar
$ 
$ ncat --unixsock sock --recv-only
foo
^C
$ 

Expected behavior

I would expect that a socket client closing would cause the listen ncat to forget about that client and continue sending to other clients.

Version info (please complete the following information):

  • OS: Debian GNU/Linux 6.7.12-1
  • Output of ncat --version: Ncat: Version 7.94SVN ( https://nmap.org/ncat )

Additional context
If I remove the --send-only option from the listen ncat, the problem doesn't happen.
In my current use-case, I prefer not to have ncat read any data clients write to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions