同步操作将从 OpenCloudOS Stream/pam 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From ecaaf4456e5aeacae1acdb1775bb5aadd3b19e13 Mon Sep 17 00:00:00 2001From: Iker Pedrosa <ipedrosa@redhat.com>Date: 2024年10月16日 12:41:09 +0200Subject: [PATCH] pam_access: always match local address* modules/pam_access/pam_access.c: match the local address regardless ofthe IP version in use.In some circumstances the `localhost` may be translated to IPv4 or IPv6,but the configuration file only indicated the address for one of the twoversions. Since the originating value is set in `PAM_RHOST` and PAM hasno control over it, let's match the local addresses regardless of the IPversion in use.Resolves: https://issues.redhat.com/browse/RHEL-23018Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>---modules/pam_access/pam_access.c | 30 ++++++++++++++++++++++++++++--1 file changed, 28 insertions(+), 2 deletions(-)diff --git a/modules/pam_access/pam_access.c b/modules/pam_access/pam_access.cindex bfbc6d574..48e7c7e97 100644--- a/modules/pam_access/pam_access.c+++ b/modules/pam_access/pam_access.c@@ -306,6 +306,23 @@ isipaddr (const char *string, int *addr_type,return is_ip;}+/* is_local_addr - checks if the IP address is local */+static int+is_local_addr (const char *string, int addr_type)+{+ if (addr_type == AF_INET) {+ if (strcmp(string, "127.0.0.1") == 0) {+ return YES;+ }+ } else if (addr_type == AF_INET6) {+ if (strcmp(string, "::1") == 0) {+ return YES;+ }+ }++ return NO;+}+/* are_addresses_equal - translate IP address strings to real IP* addresses and compare them to find out if they are equal.@@ -327,9 +344,18 @@ are_addresses_equal (const char *ipaddr0, const char *ipaddr1,if (isipaddr (ipaddr1, &addr_type1, &addr1) == NO)return NO;- if (addr_type0 != addr_type1)- /* different address types */+ if (addr_type0 != addr_type1) {+ /* different address types, but there is still a possibility that they are+ * both local addresses+ */+ int local1 = is_local_addr(ipaddr0, addr_type0);+ int local2 = is_local_addr(ipaddr1, addr_type1);++ if (local1 == YES && local2 == YES)+ return YES;+return NO;+ }if (netmask != NULL) {/* Got a netmask, so normalize addresses? */
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。