From fd932f9cbded47c64ead43baefb0f7a0da260e02 Mon Sep 17 00:00:00 2001 From: zhangxingrong Date: Mon, 13 May 2024 14:47:18 +0800 Subject: [PATCH] allow 60 seconds for authorization --- ...t-allow-60-seconds-for-authorization.patch | 31 +++++++++++++++++++ firewalld.spec | 9 +++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 backport-allow-60-seconds-for-authorization.patch diff --git a/backport-allow-60-seconds-for-authorization.patch b/backport-allow-60-seconds-for-authorization.patch new file mode 100644 index 0000000..b89def7 --- /dev/null +++ b/backport-allow-60-seconds-for-authorization.patch @@ -0,0 +1,31 @@ +From 4869a439f267364fab6d55ef48315b8111d6a0cc Mon Sep 17 00:00:00 2001 +From: Eric Garver +Date: Mon, 6 May 2024 16:04:12 -0400 +Subject: [PATCH] fix(polkit): allow 60 seconds for authorization + +Allow up to 60 seconds for polkit authorization. The current default is +25 seconds which can be a bit short for a user to type a password. + +Fixes: #1328 + +Conflict:The number of lines in decorators.py for the modified content is different. +Reference:https://github.com/firewalld/firewalld/pull/1335/commits/4869a439f267364fab6d55ef48315b8111d6a0cc + +--- + src/firewall/server/decorators.py | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/firewall/server/decorators.py b/src/firewall/server/decorators.py +index 99b30306c..e532c6b88 100644 +--- a/src/firewall/server/decorators.py ++++ b/src/firewall/server/decorators.py +@@ -182,7 +182,7 @@ class dbus_polkit_require_auth: + if type(self)._interface_polkit: + (result, _, _) = type(self)._interface_polkit.CheckAuthorization( + ("system-bus-name", {"name": sender}), +- action_id, {}, 1, "") ++ action_id, {}, 1, "", timeout=60,) + if not result: + raise NotAuthorizedException(action_id, "polkit") + # fallback to checking UID + diff --git a/firewalld.spec b/firewalld.spec index 4e620ac..5adae08 100644 --- a/firewalld.spec +++ b/firewalld.spec @@ -1,6 +1,6 @@ Name: firewalld Version: 1.2.6 -Release: 2 +Release: 3 Summary: A firewall daemon with D-Bus interface providing a dynamic firewall License: GPLv2+ URL: http://www.firewalld.org @@ -12,6 +12,7 @@ Patch2: add-Restart-on-failure-on-firewalld.service.patch Patch3: 0001-fix-config-Specify-the-translation-encoding-format-a.patch Patch4: backport-chore-nftables-add-delete-table-helper.patch Patch5: backport-fix-nftables-always-flush-main-table-on-start.patch +Patch6: backport-allow-60-seconds-for-authorization.patch BuildArch: noarch BuildRequires: autoconf automake desktop-file-utils gettext intltool glib2 glib2-devel systemd-units docbook-style-xsl @@ -233,6 +234,12 @@ fi %{_datadir}/firewalld/testsuite/python/firewalld_test.py %changelog +* Mon May 13 2024 zhangxingrong - 1.2.6-3 +- Type:requirement +- ID:NA +- SUG:NA +- DESC:allow 60 seconds for authorization + * Sun Apr 28 2024 zhouyihang - 1.2.6-2 - Type:bugfix - ID:NA -- Gitee