Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libressl: netcat doesn't work on macos #101601

Closed
sdier opened this issue Oct 24, 2020 · 9 comments
Closed

libressl: netcat doesn't work on macos #101601

sdier opened this issue Oct 24, 2020 · 9 comments
Labels
0.kind: bug 2.status: wait-for-upstream Waiting for upstream fix (or their other action). 6.topic: darwin Running or building packages on Darwin

Comments

@sdier
Copy link
Contributor

sdier commented Oct 24, 2020

Describe the bug
netcat from libressl doesn't work on macos

To Reproduce
Steps to reproduce the behavior:

  1. as root: dtruss -W nc
  2. nc localhost 22
  3. note that the socket open shown in dtruss shows error 41

Expected behavior
Connects.

Additional context
I have opened libressl/portable#631

I don't think anyone actually ever used this successfully on macos. I suspect it should be disabled from building for this platform if possible until its fixed so nobody else has to go through the debugging.

Notify maintainers
@fpletz
@thoughtpolice

Metadata

  • system: "x86_64-darwin"
  • host os: Darwin 19.6.0, macOS
  • multi-user?: no
  • sandbox: yes
  • version: nix-env (Nix) 2.3.6
  • channels(sdier): "home-manager, nixpkgs-21.03pre246624.cfed29bfcb2"
  • nixpkgs: /Users/sdier/.nix-defexpr/channels/nixpkgs

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module: libressl.nc
@sdier
Copy link
Contributor Author

sdier commented Oct 24, 2020

"I don't think anyone actually ever used this successfully on macos"

Actually I do not know if error 41 was always returned for this combination of options.

@veprbl veprbl added 6.topic: darwin Running or building packages on Darwin 2.status: wait-for-upstream Waiting for upstream fix (or their other action). labels Oct 24, 2020
@stale
Copy link

stale bot commented Apr 26, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 26, 2021
@risicle
Copy link
Contributor

risicle commented Aug 5, 2021

A painful one.

If we were to disable this for macos, might we have another means of providing macos users with a bsd-style netcat?

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 5, 2021
@risicle
Copy link
Contributor

risicle commented Aug 5, 2021

Alternatively if we were to patch it, would it be enough to pick higher bits for SOCK_CLOEXEC and SOCK_NONBLOCK in https://github.com/libressl-portable/portable/blob/c054aaea36b0b797dbcc65b5c49bf69b921e1e08/include/compat/sys/socket.h in the hopes of avoiding collisions?

@risicle
Copy link
Contributor

risicle commented Aug 9, 2021

The other route for BSD netcat on macos is of course https://opensource.apple.com/tarballs/netcat/, but nobody has yet built an apple-source-releases derivation for it.

@risicle
Copy link
Contributor

risicle commented Aug 9, 2021

Oh and I tried a naive switch of the SOCK_CLOEXEC/SOCK_NONBLOCK bits the other day (up to.. 0x4000000 and 0x2000000 i think?) and it didn't seem to work.

@Gabriella439
Copy link
Contributor

If somebody running across this issue needs a work-around: you can use pkgs.netcat-gnu instead of pkgs.netcat. pkgs.netcat-gnu works on macOS

@risicle
Copy link
Contributor

risicle commented Nov 5, 2021

The issue is that netcat-gnu isn't quite the same. It doesn't support e.g. SOCKS5 in the same way.

@sebastianblunt
Copy link
Member

This should be fixed by the update to libressl 3.5.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug 2.status: wait-for-upstream Waiting for upstream fix (or their other action). 6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

No branches or pull requests

5 participants