10 Star 0 Fork 16

src-openEuler/nmap

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Ncat-server-UDP-do-not-quit-after-EOF-on-STDIN.-Fixe.patch 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
xingwei 提交于 2023-09-12 15:43 +08:00 . Ncat server UDP: do not quit after EOF on STDIN
From d4e769197afccf425ec16dae5faeece72e8a5130 Mon Sep 17 00:00:00 2001
From: dmiller <dmiller@e0a8ed71-7df4-0310-8962-fdc924857419>
Date: Thu, 27 Jul 2023 17:31:48 +0000
Subject: [PATCH] Ncat server UDP: do not quit after EOF on STDIN. Fixes #2685
Conflict: NA
Reference: https://github.com/nmap/nmap/commit/d4e769197afccf425ec16dae5faeece72e8a5130
diff --git a/ncat/ncat_listen.c b/ncat/ncat_listen.c
index 3cecb64f8..c307c68c4 100644
--- a/ncat/ncat_listen.c
+++ b/ncat/ncat_listen.c
@@ -376,13 +376,13 @@ restart_fd_loop:
} else {
/* Read from stdin and write to all clients. */
rc = read_stdin();
- if (rc == 0) {
+ if (rc == 0 && type == SOCK_STREAM) {
if (o.proto != IPPROTO_TCP || (o.proto == IPPROTO_TCP && o.sendonly)) {
/* There will be nothing more to send. If we're not
receiving anything, we can quit here. */
return 0;
}
- if (!o.noshutdown && type == SOCK_STREAM) shutdown_sockets(SHUT_WR);
+ if (!o.noshutdown) shutdown_sockets(SHUT_WR);
}
if (rc < 0)
return 1;
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/nmap.git
[email protected]:src-openeuler/nmap.git
src-openeuler
nmap
nmap
master

搜索帮助