Fix crash with unix sockets.

This commit is contained in:
Pavel Zhukov 2021-05-06 06:44:01 +02:00
parent 8ff6f85b18
commit 99f8747bdb
2 changed files with 41 additions and 1 deletions

32
nmap-unix_crash.patch Normal file
View File

@ -0,0 +1,32 @@
From f6b40614e4a8131394792d590965f8af3c635323 Mon Sep 17 00:00:00 2001
From: nnposter <nnposter@e0a8ed71-7df4-0310-8962-fdc924857419>
Date: Fri, 16 Oct 2020 02:54:52 +0000
Subject: [PATCH] Fix a Unix domain socket crash. Fixes #2154
---
CHANGELOG | 2 ++
ncat/ncat_main.c | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/ncat/ncat_main.c b/ncat/ncat_main.c
index 8942d83cb9..2792a6ac24 100644
--- a/ncat/ncat_main.c
+++ b/ncat/ncat_main.c
@@ -846,7 +846,7 @@ int main(int argc, char *argv[])
targetaddrs->addr.un.sun_family = AF_UNIX;
strncpy(targetaddrs->addr.un.sun_path, argv[optind], sizeof(targetaddrs->addr.un.sun_path));
targetaddrs->addrlen = SUN_LEN(&targetaddrs->addr.un);
- o.target = argv[optind];
+ o.sslservername = o.target = argv[optind];
optind++;
} else
#endif
@@ -865,7 +865,7 @@ int main(int argc, char *argv[])
targetaddrs->addr.vm.svm_cid = long_cid;
targetaddrs->addrlen = sizeof(targetaddrs->addr.vm);
- o.target = argv[optind];
+ o.sslservername = o.target = argv[optind];
optind++;
}
} else

View File

@ -7,7 +7,7 @@ Name: nmap
Epoch: 3
Version: 7.91
#global prerelease TEST5
Release: 1%{?dist}
Release: 7%{?dist}
Summary: Network exploration tool and security scanner
URL: http://nmap.org/
# Uses combination of licenses based on GPL license, but with extra modification
@ -33,6 +33,8 @@ Patch7: nmap_resolve_config.patch
## https://github.com/nmap/nmap/commit/28bfe0dfd26dbc4e9917db9ad5457ab496769d24.patch
Patch9: nmap-safe_fd_functions.patch
## https://github.com/nmap/nmap/commit/f6b40614e4a8131394792d590965f8af3c635323.patch
Patch10: nmap-unix_crash.patch
BuildRequires: automake make
BuildRequires: autoconf
@ -155,6 +157,12 @@ fi
%{_mandir}/man1/ncat.1.gz
%changelog
* Wed May 5 2021 Pavel Zhukov <pzhukov@redhat.com> - 3:7.91-7
- Fix crash with unix sockets
* Fri Apr 16 2021 Pavel Zhukov <pzhukov@redhat.com> - 3:7.91-6
- Bumping release because brew doesn't work with Epoch
* Thu Apr 8 2021 Pavel Zhukov <pzhukov@redhat.com> - 3:7.91-1
- Bring 7.91 back