From 2446aac18b3ac649d762ef51b810afba274bb0e1 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Wed, 2 Aug 2023 15:40:50 +0300 Subject: [PATCH] Apply 0001-Fix-typo-in-ipapwpolicy.py.patch and 0002-pwpolicy-test-Fix-maxsequence-test.patch patches --- SOURCES/0001-Fix-typo-in-ipapwpolicy.py.patch | 30 ++++++++++++ ...2-pwpolicy-test-Fix-maxsequence-test.patch | 48 +++++++++++++++++++ SPECS/ansible-freeipa.spec | 15 +++++- 3 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 SOURCES/0001-Fix-typo-in-ipapwpolicy.py.patch create mode 100644 SOURCES/0002-pwpolicy-test-Fix-maxsequence-test.patch diff --git a/SOURCES/0001-Fix-typo-in-ipapwpolicy.py.patch b/SOURCES/0001-Fix-typo-in-ipapwpolicy.py.patch new file mode 100644 index 0000000..ea2f089 --- /dev/null +++ b/SOURCES/0001-Fix-typo-in-ipapwpolicy.py.patch @@ -0,0 +1,30 @@ +From 1a7b279d78374598d0330718c81c93048d54dd7c Mon Sep 17 00:00:00 2001 +From: Jacob Cutright +Date: Wed, 26 Apr 2023 17:32:50 -0400 +Subject: [PATCH] Fix typo in ipapwpolicy.py + +The 'maxsequence' attribute was never applied as there was a typo when +it was set. By fixing the field name, 'maxsequence' is correclty set. + +The failure was not seen before due to missing tests. The tests will be +added in a separate PR. +--- + plugins/modules/ipapwpolicy.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/modules/ipapwpolicy.py b/plugins/modules/ipapwpolicy.py +index 3a3eeed..557702f 100644 +--- a/plugins/modules/ipapwpolicy.py ++++ b/plugins/modules/ipapwpolicy.py +@@ -197,7 +197,7 @@ def gen_args(module, + if maxrepeat is not None: + _args["ipapwdmaxrepeat"] = maxrepeat + if maxsequence is not None: +- _args["ipapwdmaxrsequence"] = maxsequence ++ _args["ipapwdmaxsequence"] = maxsequence + if dictcheck is not None: + if module.ipa_check_version("<", "4.9.10"): + # Allowed values: "TRUE", "FALSE", "" +-- +2.39.2 + diff --git a/SOURCES/0002-pwpolicy-test-Fix-maxsequence-test.patch b/SOURCES/0002-pwpolicy-test-Fix-maxsequence-test.patch new file mode 100644 index 0000000..9e75d15 --- /dev/null +++ b/SOURCES/0002-pwpolicy-test-Fix-maxsequence-test.patch @@ -0,0 +1,48 @@ +From d04a12e522e4ef9d23673916afb9e57ed032c56e Mon Sep 17 00:00:00 2001 +From: Thomas Woerner +Date: Thu, 27 Apr 2023 09:15:09 +0200 +Subject: [PATCH] pwpolicy test: Fix maxsequence test + +The maxsequence test was testing maxrepeat. Therefore the typo reported +with https://github.com/freeipa/ansible-freeipa/pull/1081 was never +seen. + +The test has been fixed. +--- + tests/pwpolicy/test_pwpolicy.yml | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/pwpolicy/test_pwpolicy.yml b/tests/pwpolicy/test_pwpolicy.yml +index 871406f..83f1763 100644 +--- a/tests/pwpolicy/test_pwpolicy.yml ++++ b/tests/pwpolicy/test_pwpolicy.yml +@@ -223,7 +223,7 @@ + ipapwpolicy: + ipaadmin_password: SomeADMINpassword + ipaapi_context: "{{ ipa_context | default(omit) }}" +- maxrepeat: 4 ++ maxsequence: 4 + register: result + failed_when: not result.changed or result.failed + +@@ -231,7 +231,7 @@ + ipapwpolicy: + ipaadmin_password: SomeADMINpassword + ipaapi_context: "{{ ipa_context | default(omit) }}" +- maxrepeat: 4 ++ maxsequence: 4 + register: result + failed_when: result.changed or result.failed + +@@ -239,7 +239,7 @@ + ipapwpolicy: + ipaadmin_password: SomeADMINpassword + ipaapi_context: "{{ ipa_context | default(omit) }}" +- maxrepeat: 0 ++ maxsequence: 0 + register: result + failed_when: not result.changed or result.failed + +-- +2.39.2 + diff --git a/SPECS/ansible-freeipa.spec b/SPECS/ansible-freeipa.spec index 3685070..325205e 100644 --- a/SPECS/ansible-freeipa.spec +++ b/SPECS/ansible-freeipa.spec @@ -8,13 +8,19 @@ Summary: Roles and playbooks to deploy FreeIPA servers, replicas and clients Name: ansible-freeipa Version: 1.9.2 -Release: 2%{?dist} +Release: 3%{?dist}.alma URL: https://github.com/freeipa/ansible-freeipa License: GPLv3+ Source: https://github.com/freeipa/ansible-freeipa/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Patch1: ansible-freeipa-1.9.2-paclient-Fix-allow_repair-with-removed-krb5.conf-an_RHBZ#2189229.patch Patch2: ansible-freeipa-1.9.2-ipaclient-Defer-creating-the-final-krb5.conf-on-clients_RHBZ#2189232.patch Patch3: ansible-freeipa-1.9.2-ipaclient-Defer-krb5-configuration-fix_RHBZ#2189232.patch + +# Patches was generated from upstream commits: +# https://github.com/freeipa/ansible-freeipa/commit/d04a12e522e4ef9d23673916afb9e57ed032c56e +# https://github.com/freeipa/ansible-freeipa/commit/1a7b279d78374598d0330718c81c93048d54dd7c +Patch1001: 0001-Fix-typo-in-ipapwpolicy.py.patch +Patch1002: 0002-pwpolicy-test-Fix-maxsequence-test.patch BuildArch: noarch %if 0%{?fedora} >= 35 || 0%{?rhel} >= 9 Requires: ansible-core @@ -123,6 +129,10 @@ to get the needed requrements to run the tests. %patch2 -p1 %patch3 -p1 +%patch1001 -p1 +%patch1002 -p1 + + # Fix python modules and module utils: # - Remove shebang # - Remove execute flag @@ -185,6 +195,9 @@ cp -rp tests %{buildroot}%{_datadir}/ansible-freeipa/ %{_datadir}/ansible-freeipa/requirements-tests.txt %changelog +* Wed Aug 02 2023 Eduard Abdullin - 1.9.2-3.alma +- Apply 0001-Fix-typo-in-ipapwpolicy.py.patch and 0002-pwpolicy-test-Fix-maxsequence-test.patch patches + * Mon Apr 24 2023 Thomas Woerner - 1.9.2-2 - ipaclient: Fix allow_repair with removed krb5.conf and DNS lookup Resolves: RHBZ#2189229