7 Star 0 Fork 16

src-openEuler/quota

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-Limit-maximum-of-RPC-port.patch 1019 Bytes
一键复制 编辑 原始数据 按行查看 历史
From f73a0e2c031a482683f39fd8a6aa122186b67a99 Mon Sep 17 00:00:00 2001
From: kangenbo <[email protected]>
Date: Sat, 11 Jan 2020 13:08:08 +0800
Subject: Limit maximum of RPC port
Limit maximum of RPC port
---
rquota_svc.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/rquota_svc.c b/rquota_svc.c
index 6e856bb..d0be63f 100644
--- a/rquota_svc.c
+++ b/rquota_svc.c
@@ -53,6 +53,12 @@ int deny_severity, allow_severity; /* Needed by some versions of libwrap */
char *progname;
/*
+ * Port upper and lower limits
+ */
+#define PORT_UPPER 0xFFFF
+#define PORT_LOWER 0
+
+/*
* Global authentication credentials.
*/
struct authunix_parms *unix_cred;
@@ -140,7 +146,7 @@ static void parse_options(int argc, char **argv)
break;
case 'p':
port = strtol(optarg, &endptr, 0);
- if (*endptr || port <= 0) {
+ if (*endptr || port <= PORT_LOWER || port > PORT_UPPER) {
errstr(_("Illegal port number: %s\n"), optarg);
show_help();
exit(1);
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/quota.git
[email protected]:src-openeuler/quota.git
src-openeuler
quota
quota
master

搜索帮助