diff options
author | tb <> | 2024-08-05 07:16:30 +0000 |
---|---|---|
committer | tb <> | 2024-08-05 07:16:30 +0000 |
commit | 9d394c7780687b920ba0b1d0c64ec49d7a5a1772 (patch) | |
tree | 9bade2d207dcdff94a2dae29a7c7cbac616d5669 /src | |
parent | f0d8118e648fa05b333079032ff12334fa5e8194 (diff) | |
download | openbsd-9d394c7780687b920ba0b1d0c64ec49d7a5a1772.tar.gz openbsd-9d394c7780687b920ba0b1d0c64ec49d7a5a1772.tar.bz2 openbsd-9d394c7780687b920ba0b1d0c64ec49d7a5a1772.zip |
Remove bogus connect(s, NULL, 0) call
The only thing it does is error because of a check added in sockargs() in
uipc_syscalls r1.155. As guenther pointed out, this may have been added
because of a misreading of the last sentence of the first paragraph of the
connect(2) manual.
Instead of erroring, this will keep listening if -k is given and otherwise
it will close the socket and exit with success.
ok guenther jeremy
Diffstat (limited to 'src')
-rw-r--r-- | src/usr.bin/nc/netcat.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/usr.bin/nc/netcat.c b/src/usr.bin/nc/netcat.c index 856a01c2b4..a25c4f175a 100644 --- a/src/usr.bin/nc/netcat.c +++ b/src/usr.bin/nc/netcat.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: netcat.c,v 1.227 2024/08/02 21:08:47 jan Exp $ */ | 1 | /* $OpenBSD: netcat.c,v 1.228 2024/08/05 07:16:30 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> | 3 | * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> |
4 | * Copyright (c) 2015 Bob Beck. All rights reserved. | 4 | * Copyright (c) 2015 Bob Beck. All rights reserved. |
@@ -644,10 +644,6 @@ main(int argc, char *argv[]) | |||
644 | close(connfd); | 644 | close(connfd); |
645 | tls_free(tls_cctx); | 645 | tls_free(tls_cctx); |
646 | } | 646 | } |
647 | if (family == AF_UNIX && uflag) { | ||
648 | if (connect(s, NULL, 0) == -1) | ||
649 | err(1, "connect"); | ||
650 | } | ||
651 | 647 | ||
652 | if (!kflag) | 648 | if (!kflag) |
653 | break; | 649 | break; |