public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/freeipa] rawhide: Update patches to track ipa-4-13 branch upstream
@ 2026-10-26 20:25 Alexander Bokovoy
0 siblings, 0 replies; only message in thread
From: Alexander Bokovoy @ 2026-10-26 20:25 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/freeipa
Branch : rawhide
Commit : 0ee83d08756fe84b670b5cf68dd234d368a70ba9
Author : Alexander Bokovoy <abokovoy@redhat.com>
Date : 2026-10-26T20:05:51+02:00
Stats : +5791/-1968 in 9 file(s)
URL : https://src.fedoraproject.org/rpms/freeipa/c/0ee83d08756fe84b670b5cf68dd234d368a70ba9?branch=rawhide
Log:
Update patches to track ipa-4-13 branch upstream
All patches we had are now merged upstream, replace them with cumulative
patchset from ipa-4-13 branch without translation files which were
reformatted by the Weblate tooling and conflict with the release
tarball's version. Updates to translation will come with the next
release.
Rebuild against Samba 4.25.1 release.
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
---
diff --git a/freeipa-4.13.4-updates.patch b/freeipa-4.13.4-updates.patch
new file mode 100644
index 0000000..84a6192
--- /dev/null
+++ b/freeipa-4.13.4-updates.patch
@@ -0,0 +1,5785 @@
+From c16ffb834789426d8522ea4695dcb16fdfe0b0cc Mon Sep 17 00:00:00 2001
+From: Alexander Bokovoy <abokovoy@redhat.com>
+Date: Mon, 7 Sep 2026 16:12:33 +0300
+Subject: [PATCH 01/55] Allow fine tuned privilege check
+
+Let users pass through the privilege check if either
+- whole entry read granted ('v' in the GER response)
+- at least one attribute read granted
+
+This is enough to allow LDAPRetrieve to pass, because the rest is
+controlled by the explicit ACIs in LDAP.
+
+Remove permission checks from member-management commands as they apply
+those ACI checks per each individual member (some might fail, some will
+succeed). The partial success is supported and expected by tests.
+
+Related: CVE-2026-79678
+
+Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
+Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
+---
+ ipaserver/plugins/baseldap.py | 98 ++++++++++++++++++++++++++--------
+ ipaserver/plugins/privilege.py | 29 +++++++---
+ 2 files changed, 98 insertions(+), 29 deletions(-)
+
+diff --git a/ipaserver/plugins/baseldap.py b/ipaserver/plugins/baseldap.py
+index d693c7112..122a279f2 100644
+--- a/ipaserver/plugins/baseldap.py
++++ b/ipaserver/plugins/baseldap.py
+@@ -1001,7 +1001,10 @@ last, after all sets and adds."""),
+ enforce_managed_permission_operations = []
+
+ def enforce_managed_permissions(self, *keys, **options):
+- from ipaserver.plugins.privilege import principal_has_privilege
++ # avoid circular import through explicit plugin reference
++ principal_has_privilege = (
++ self.api.packages[0].privilege.principal_has_privilege
++ )
+ mp = getattr(self.obj, 'managed_permissions', None)
+ if not mp:
+ return
+@@ -1024,23 +1027,31 @@ last, after all sets and adds."""),
+ self.api, op_account, priv)
+ return priv_cache[priv]
+
+- # Effective rights, if needed at all, are fetched once in a single
+- # get-effective-rights round trip shared by every permission below.
+- # probe['res'] is (entry_rights, {attr: rights}) or None (no entry).
+- probe = {}
++ # LDAPDelete and other LDAPMultiQuery commands pass the trailing
++ # primary key as a *list* of pkeys and act on each target entry in
++ # turn (see LDAPDelete.execute). get_dn and the effective-rights probes
++ # below operate on a single entry, so expand the operation into its
++ # individual targets and require the right on every one of them.
++ target_keys = self._expand_target_keys(keys)
+
+- def rights_allow(right, perm, touched):
++ # Effective rights, if needed at all, are fetched at most once per
++ # target in a single get-effective-rights round trip shared by every
++ # permission checked for that target. probes[i]['res'] is
++ # (entry_rights, {attr: rights}) or None (no entry).
++ probes = [{} for _ in target_keys]
++
++ def right_allowed_for(right, perm, touched, probe, tkeys):
+ if right == 'add':
+ # The target does not exist yet and target-scoped/SELFDN add
+ # ACIs cannot be evaluated through a get-effective-rights
+ # template probe, so detect the right with a trial add of the
+ # real target entry (see _can_add_target).
+ if 'add' not in probe:
+- probe['add'] = self._can_add_target(*keys, **options)
++ probe['add'] = self._can_add_target(*tkeys, **options)
+ return probe['add']
+ if 'res' not in probe:
+ probe['res'] = self._probe_effective_rights(
+- mp, enforce_mp, *keys, **options)
++ mp, enforce_mp, *tkeys, **options)
+ res = probe['res']
+ if res is None:
+ # Entry does not exist; let the operation report it properly.
+@@ -1054,11 +1065,31 @@ last, after all sets and adds."""),
+ if not attrs:
+ return True
+ return any('w' in attr_rights.get(a, '') for a in attrs)
+- # read / search / compare
+- attrs = {a.lower() for a in perm.get('ipapermdefaultattr', ())}
+- if not attrs:
++ # read / search / compare: a read is never denied wholesale by
++ # 389-ds -- it returns the entry and silently filters out the
++ # individual attributes the caller may not see. Permit the
++ # operation whenever the caller can view the entry (entry-level
++ # 'v') or read *any* of its attributes. IPA's read ACIs are
++ # attribute-scoped, so an unprivileged caller reading its own entry
++ # gets 'entryLevelRights: none' yet can still read cn/sn/mail/...;
++ # requiring read on this permission's specific attributes would
++ # wrongly turn such a legitimate partial read into a total denial.
++ # Attribute-level confidentiality (e.g. the admin-only Kerberos
++ # login attributes) stays enforced by 389-ds on the read that
++ # follows. The probe always requests '*' (see
++ # _probe_effective_rights), so attr_rights reflects every attribute.
++ if 'v' in entry_rights:
+ return True
+- return any('r' in attr_rights.get(a, '') for a in attrs)
++ return any('r' in r for r in attr_rights.values())
++
++ def rights_allow(right, perm, touched):
++ # Permit only if the caller may perform the operation on *every*
++ # target entry the command names (a batch delete/retrieve must be
++ # authorised for all of its pkeys).
++ return all(
++ right_allowed_for(right, perm, touched, probe, tkeys)
++ for probe, tkeys in zip(probes, target_keys)
++ )
+
+ modified_attrs = None # computed lazily, only for 'write'
+ for m in mp.keys():
+@@ -1106,6 +1137,20 @@ last, after all sets and adds."""),
+ raise errors.ACIError(
+ info=_("not allowed to perform this operation"))
+
++ def _expand_target_keys(self, keys):
++ """Expand an operation's keys into one key-tuple per target entry.
++
++ LDAPDelete and other LDAPMultiQuery commands pass the trailing primary
++ key as a list of pkeys and iterate over it, calling get_dn once per
++ entry (see LDAPDelete.execute). get_dn and the effective-rights probes
++ expect a single pkey, so mirror that expansion here. For ordinary
++ single-target commands the keys are returned unchanged as one tuple.
++ """
++ if keys and self.obj.primary_key and isinstance(
++ keys[-1], (list, tuple)):
++ return [keys[:-1] + (pkey,) for pkey in keys[-1]]
++ return [tuple(keys)]
++
+ def _modified_attributes(self, **options):
+ """Best-effort set of LDAP attributes an update operation changes.
+
+@@ -1214,8 +1259,14 @@ last, after all sets and adds."""),
+ continue
+ needed.update(a.lower() for a in perm.get('ipapermdefaultattr', ()))
+
++ # Always include '*' so the effective rights cover every attribute of
++ # the entry, not only the gated ones. The read/search/compare check
++ # needs to know whether the caller can read *any* attribute (an
++ # unprivileged caller may read its own entry without holding the
++ # object's read privilege), which cannot be answered from the gated
++ # attributes alone.
+ try:
+- rights = ldap.get_effective_rights(dn, sorted(needed) or ['*'])
++ rights = ldap.get_effective_rights(dn, sorted(needed | {'*'}))
+ except errors.NotFound:
+ return None
+
+@@ -2020,7 +2071,9 @@ class LDAPAddMember(LDAPModMember):
+ member_param_doc = _('%s to add')
+ member_count_out = ('%i member added.', '%i members added.')
+ allow_same = False
+- enforce_managed_permission_operations = ['write']
++ # Member writes are enforced per-member by 389-ds and reported gracefully
++ # in the command's `failed` output, so no API-level gate is applied here
++ # (an up-front ACIError would abort the whole batch instead).
+
+ has_output = (
+ output.Entry('result'),
+@@ -2037,8 +2090,6 @@ class LDAPAddMember(LDAPModMember):
+ has_output_params = global_output_params
+
+ def execute(self, *keys, **options):
+- self.enforce_managed_permissions(*keys, **options)
+-
+ ldap = self.obj.backend
+
+ (member_dns, failed) = self.get_member_dns(**options)
+@@ -2121,7 +2172,9 @@ class LDAPRemoveMember(LDAPModMember):
+ """
+ member_param_doc = _('%s to remove')
+ member_count_out = ('%i member removed.', '%i members removed.')
+- enforce_managed_permission_operations = ['write']
++ # Member writes are enforced per-member by 389-ds and reported gracefully
++ # in the command's `failed` output, so no API-level gate is applied here
++ # (an up-front ACIError would abort the whole batch instead).
+
+ has_output = (
+ output.Entry('result'),
+@@ -2138,8 +2191,6 @@ class LDAPRemoveMember(LDAPModMember):
+ has_output_params = global_output_params
+
+ def execute(self, *keys, **options):
+- self.enforce_managed_permissions(*keys, **options)
+-
+ ldap = self.obj.backend
+
+ (member_dns, failed) = self.get_member_dns(**options)
+@@ -2715,8 +2766,6 @@ class BaseLDAPModAttribute(LDAPQuery):
+ )
+
+ def execute(self, *keys, **options):
+- self.enforce_managed_permissions(*keys, **options)
+-
+ ldap = self.obj.backend
+ try:
+ index = tuple(self.args).index(self.attribute)
+@@ -2725,6 +2774,13 @@ class BaseLDAPModAttribute(LDAPQuery):
+ else:
+ obj_keys = keys[:index]
+
++ # Enforce on the target entry's own keys. For the arg-based variants
++ # the attribute value is a trailing positional arg that is not part of
++ # the entry's DN (see obj_keys), so it must be excluded here: passing
++ # the full keys would make the effective-rights probe's get_dn target a
++ # bogus DN and silently bypass the check.
++ self.enforce_managed_permissions(*obj_keys, **options)
++
+ dn = self.obj.get_dn(*obj_keys, **options)
+ entry_attrs = ldap.make_entry(dn, self.args_options_2_entry(
+ *keys, **options))
+diff --git a/ipaserver/plugins/privilege.py b/ipaserver/plugins/privilege.py
+index 47f27f12c..65199adc0 100644
+--- a/ipaserver/plugins/privilege.py
++++ b/ipaserver/plugins/privilege.py
+@@ -92,11 +92,28 @@ def principal_has_privilege(api, principal, privilege):
+ privilege_dn = api.Object.privilege.get_dn(privilege)
+ ldap = api.Backend.ldap2
+ if principal is None:
+- dn_or_princ = DN(ldap.conn.whoami_s()[4:])
+- if dn_or_princ == DN('cn=Directory Manager'):
++ # whoami reports the bound identity as an entry DN, not a Kerberos
++ # principal name. Check its privilege membership directly by DN: a
++ # 'krbprincipalname=<DN>' filter can never match and would always
++ # (wrongly) report the caller as lacking the privilege.
++ bound_dn = DN(ldap.conn.whoami_s()[4:])
++ if bound_dn == DN('cn=Directory Manager'):
+ return True
+- else:
+- dn_or_princ = principal
++ filter = ldap.make_filter(
++ {'memberof': privilege_dn}, rules=ldap.MATCH_ALL)
++ try:
++ ldap.find_entries(base_dn=bound_dn, scope=ldap.SCOPE_BASE,
++ filter=filter)
++ return True
++ except errors.ExecutionError:
++ # NotFound is the normal negative result (not a member, or the
++ # bound entry does not exist). Any other execution error (database
++ # error, limits, ...) cannot positively confirm the privilege
++ # either, and there is no Kerberos principal to fall back on for
++ # the ID override check below, so fail closed: not privileged.
++ return False
++
++ dn_or_princ = principal
+
+ # First try: Check if there is a principal that has the needed
+ # privilege.
+@@ -110,10 +127,6 @@ def principal_has_privilege(api, principal, privilege):
+ except errors.NotFound:
+ pass
+
+- # Do not run ID override check for the user that has no Kerberos principal
+- if principal is None:
+- return False
+-
+ # Second try: Check if there is an idoverride for the principal as
+ # ipaOriginalUid that has the needed privilege.
+ filter = ldap.make_filter(
+--
+2.56.0
+
+
+From a8d9fdebcc1072f751b772fdd5bd37e072cb2669 Mon Sep 17 00:00:00 2001
+From: Alexander Bokovoy <abokovoy@redhat.com>
+Date: Tue, 8 Sep 2026 09:54:57 +0300
+Subject: [PATCH 02/55] ipatests: fix XMLRPC test expecations
+
+Two classes of behavior changes:
+
+ - permission baseline is now 'read', not 'write'
+ - self-service LDAP ACI is slightly different
+
+Related: CVE-2026-79678
+
+Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
+Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
+---
+ .../test_xmlrpc/test_permission_plugin.py | 46 ++++++++++++-------
+ .../test_xmlrpc/test_selfservice_plugin.py | 8 ++--
+ 2 files changed, 33 insertions(+), 21 deletions(-)
+
+diff --git a/ipatests/test_xmlrpc/test_permission_plugin.py b/ipatests/test_xmlrpc/test_permission_plugin.py
+index dbcd1173d..84b88e0c7 100644
+--- a/ipatests/test_xmlrpc/test_permission_plugin.py
++++ b/ipatests/test_xmlrpc/test_permission_plugin.py
+@@ -3182,6 +3182,18 @@ class test_permission_bindtype(Declarative):
+ expected=dict(
+ value=permission1,
+ summary=u'Added permission "%s"' % permission1,
++ messages=(
++ {
++ 'message': ('The permission has read rights but no '
++ 'attributes are set.'),
++ 'code': 13032,
++ 'type': 'warning',
++ 'name': 'MissingTargetAttributesinPermission',
++ 'data': {
++ 'right': 'read',
++ }
++ },
++ ),
+ result=dict(
+ dn=permission1_dn,
+ cn=[permission1],
+@@ -3245,13 +3257,13 @@ class test_permission_bindtype(Declarative):
+ summary=u'Modified permission "%s"' % permission1,
+ messages=(
+ {
+- 'message': ('The permission has write rights but no '
++ 'message': ('The permission has read rights but no '
+ 'attributes are set.'),
+ 'code': 13032,
+ 'type': 'warning',
+ 'name': 'MissingTargetAttributesinPermission',
+ 'data': {
+- 'right': 'write',
++ 'right': 'read',
+ }
+ },
+ ),
+@@ -3260,7 +3272,7 @@ class test_permission_bindtype(Declarative):
+ cn=[permission1],
+ objectclass=objectclasses.permission,
+ type=[u'user'],
+- ipapermright=[u'write'],
++ ipapermright=[u'read'],
+ ipapermbindruletype=[u'all'],
+ ipapermissiontype=[u'SYSTEM', u'V2'],
+ ipapermlocation=[users_dn],
+@@ -3272,7 +3284,7 @@ class test_permission_bindtype(Declarative):
+ permission1, users_dn,
+ '(targetfilter = "(objectclass=posixaccount)")' +
+ '(version 3.0;acl "permission:%s";' % permission1 +
+- 'allow (write) userdn = "ldap:///all";)',
++ 'allow (read) userdn = "ldap:///all";)',
+ ),
+
+ dict(
+@@ -3301,7 +3313,7 @@ class test_permission_bindtype(Declarative):
+ dn=permission1_dn,
+ cn=[permission1],
+ type=[u'user'],
+- ipapermright=[u'write'],
++ ipapermright=[u'read'],
+ ipapermbindruletype=[u'all'],
+ objectclass=objectclasses.permission,
+ ipapermissiontype=[u'SYSTEM', u'V2'],
+@@ -3348,13 +3360,13 @@ class test_permission_bindtype(Declarative):
+ summary=u'Modified permission "%s"' % permission1,
+ messages=(
+ {
+- 'message': ('The permission has write rights but no '
++ 'message': ('The permission has read rights but no '
+ 'attributes are set.'),
+ 'code': 13032,
+ 'type': 'warning',
+ 'name': 'MissingTargetAttributesinPermission',
+ 'data': {
+- 'right': 'write',
++ 'right': 'read',
+ }
+ },
+ ),
+@@ -3363,7 +3375,7 @@ class test_permission_bindtype(Declarative):
+ cn=[permission1_renamed],
+ type=[u'user'],
+ objectclass=objectclasses.permission,
+- ipapermright=[u'write'],
++ ipapermright=[u'read'],
+ ipapermbindruletype=[u'all'],
+ ipapermissiontype=[u'SYSTEM', u'V2'],
+ ipapermlocation=[users_dn],
+@@ -3375,7 +3387,7 @@ class test_permission_bindtype(Declarative):
+ permission1_renamed, users_dn,
+ '(targetfilter = "(objectclass=posixaccount)")' +
+ '(version 3.0;acl "permission:%s";' % permission1_renamed +
+- 'allow (write) userdn = "ldap:///all";)',
++ 'allow (read) userdn = "ldap:///all";)',
+ ),
+
+ dict(
+@@ -3391,13 +3403,13 @@ class test_permission_bindtype(Declarative):
+ summary=u'Modified permission "%s"' % permission1_renamed,
+ messages=(
+ {
+- 'message': ('The permission has write rights but no '
++ 'message': ('The permission has read rights but no '
+ 'attributes are set.'),
+ 'code': 13032,
+ 'type': 'warning',
+ 'name': 'MissingTargetAttributesinPermission',
+ 'data': {
+- 'right': 'write',
++ 'right': 'read',
+ }
+ },
+ ),
+@@ -3406,7 +3418,7 @@ class test_permission_bindtype(Declarative):
+ cn=[permission1_renamed],
+ objectclass=objectclasses.permission,
+ type=[u'user'],
+- ipapermright=[u'write'],
++ ipapermright=[u'read'],
+ ipapermbindruletype=[u'permission'],
+ ipapermissiontype=[u'SYSTEM', u'V2'],
+ ipapermlocation=[users_dn],
+@@ -3418,7 +3430,7 @@ class test_permission_bindtype(Declarative):
+ permission1_renamed, users_dn,
+ '(targetfilter = "(objectclass=posixaccount)")' +
+ '(version 3.0;acl "permission:%s";' % permission1_renamed +
+- 'allow (write) groupdn = "ldap:///%s";)' % permission1_renamed_dn,
++ 'allow (read) groupdn = "ldap:///%s";)' % permission1_renamed_dn,
+ ),
+
+ dict(
+@@ -3432,13 +3444,13 @@ class test_permission_bindtype(Declarative):
+ summary=u'Modified permission "%s"' % permission1_renamed,
+ messages=(
+ {
+- 'message': ('The permission has write rights but no '
++ 'message': ('The permission has read rights but no '
+ 'attributes are set.'),
+ 'code': 13032,
+ 'type': 'warning',
+ 'name': 'MissingTargetAttributesinPermission',
+ 'data': {
+- 'right': 'write',
++ 'right': 'read',
+ }
+ },
+ ),
+@@ -3447,7 +3459,7 @@ class test_permission_bindtype(Declarative):
+ cn=[permission1],
+ type=[u'user'],
+ objectclass=objectclasses.permission,
+- ipapermright=[u'write'],
++ ipapermright=[u'read'],
+ ipapermbindruletype=[u'permission'],
+ ipapermissiontype=[u'SYSTEM', u'V2'],
+ ipapermlocation=[users_dn],
+@@ -3459,7 +3471,7 @@ class test_permission_bindtype(Declarative):
+ permission1, users_dn,
+ '(targetfilter = "(objectclass=posixaccount)")' +
+ '(version 3.0;acl "permission:%s";' % permission1 +
+- 'allow (write) groupdn = "ldap:///%s";)' % permission1_dn,
++ 'allow (read) groupdn = "ldap:///%s";)' % permission1_dn,
+ ),
+
+ dict(
+diff --git a/ipatests/test_xmlrpc/test_selfservice_plugin.py b/ipatests/test_xmlrpc/test_selfservice_plugin.py
+index 3ce043e46..be86c5a67 100644
+--- a/ipatests/test_xmlrpc/test_selfservice_plugin.py
++++ b/ipatests/test_xmlrpc/test_selfservice_plugin.py
+@@ -803,7 +803,7 @@ class test_selfservice_cli_add_del(Declarative):
+ r'(version 3.0;acl '
+ r'\22selfservice:selfservice_add_1002\22;'
+ r'allow (write) (userdn = \22ldap:///self\22 '
+- r'and userdn = \22ldap:///all\22;)',
++ r'and userdn = \22ldap:///all\22);)',
+ ),
+ ),
+
+@@ -881,7 +881,7 @@ class test_selfservice_cli_add_del(Declarative):
+ r'(version 3.0;acl '
+ r'\22selfservice:selfservice_add_1005\22;'
+ r'allow (write) (userdn = \22ldap:///self\22 '
+- r'and userdn = \22ldap:///all\22;)',
++ r'and userdn = \22ldap:///all\22);)',
+ ),
+ ),
+
+@@ -1591,7 +1591,7 @@ class test_selfservice_mod_cli(Declarative):
+ r'(version 3.0;acl '
+ r'\22selfservice:%s\22;'
+ r'allow (write) (userdn = \22ldap:///self\22 '
+- r'and userdn = \22ldap:///all\22;)'
++ r'and userdn = \22ldap:///all\22);)'
+ ) % SS_CLI_MOD,
+ ),
+ ),
+@@ -1658,7 +1658,7 @@ class test_selfservice_mod_cli(Declarative):
+ r'(version 3.0;acl '
+ r'\22selfservice:%s\22;'
+ r'allow (write) (userdn = \22ldap:///self\22 '
+- r'and userdn = \22ldap:///all\22;)'
++ r'and userdn = \22ldap:///all\22);)'
+ ) % SS_CLI_MOD,
+ ),
+ ),
+--
+2.56.0
+
+
+From ea93fdaab334da4863c81a78ad33b1d176ebeee6 Mon Sep 17 00:00:00 2001
+From: Alexander Bokovoy <abokovoy@redhat.com>
+Date: Tue, 8 Sep 2026 12:57:44 +0300
+Subject: [PATCH 03/55] permission enforcement: allow services to define keys
+ to enforce
+
+service_add_smb constructs cifs/hostname out of hostname. We need to
+adjust what the permission check is using for an ADD test per command.
+
+Related: CVE-2026-79678
+
+Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
+Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
+---
+ ipaserver/plugins/baseldap.py | 16 ++++++++++++++++
+ ipaserver/plugins/service.py | 7 +++++++
+ 2 files changed, 23 insertions(+)
+
+diff --git a/ipaserver/plugins/baseldap.py b/ipaserver/plugins/baseldap.py
+index 122a279f2..926afb17e 100644
+--- a/ipaserver/plugins/baseldap.py
++++ b/ipaserver/plugins/baseldap.py
+@@ -1027,6 +1027,11 @@ last, after all sets and adds."""),
+ self.api, op_account, priv)
+ return priv_cache[priv]
+
++ # Some commands construct the real target principal/DN only later (in
++ # pre_callback), so let them supply the keys the probes should target
++ # (e.g. service-add-smb builds cifs/<hostname> from a bare hostname).
++ keys = self._enforcement_keys(*keys, **options)
++
+ # LDAPDelete and other LDAPMultiQuery commands pass the trailing
+ # primary key as a *list* of pkeys and act on each target entry in
+ # turn (see LDAPDelete.execute). get_dn and the effective-rights probes
+@@ -1137,6 +1142,17 @@ last, after all sets and adds."""),
+ raise errors.ACIError(
+ info=_("not allowed to perform this operation"))
+
++ def _enforcement_keys(self, *keys, **options):
++ """Keys identifying the target entry for permission enforcement.
++
++ Defaults to the command's own keys. Commands whose real target DN is
++ derived only later -- e.g. service-add-smb, which takes a bare hostname
++ and constructs the ``cifs/<hostname>`` principal in pre_callback --
++ override this so the effective-rights/trial-add probes target the
++ actual entry rather than a DN built from the raw key.
++ """
++ return keys
++
+ def _expand_target_keys(self, keys):
+ """Expand an operation's keys into one key-tuple per target entry.
+
+diff --git a/ipaserver/plugins/service.py b/ipaserver/plugins/service.py
+index cba917787..8318ff03c 100644
+--- a/ipaserver/plugins/service.py
++++ b/ipaserver/plugins/service.py
+@@ -810,6 +810,13 @@ class service_add_smb(LDAPCreate):
+ if check:
+ yield arg
+
++ def _enforcement_keys(self, *keys, **options):
++ # The primary key here is a bare hostname; the real target principal
++ # (cifs/<hostname>) is only built in pre_callback. Enforce the add
++ # against that actual principal so the "Hosts can add own services"
++ # ACI (target krbprincipalname=*/($dn)@$REALM) is matched correctly.
++ return ('cifs/{}'.format(keys[0]),)
++
+ def pre_callback(self, ldap, dn, entry_attrs, attrs_list,
+ *keys, **options):
+ assert isinstance(dn, DN)
+--
+2.56.0
+
+
+From 885c4f3df31121c7fadc674a04460a45375421b8 Mon Sep 17 00:00:00 2001
+From: Alexander Bokovoy <abokovoy@redhat.com>
+Date: Tue, 8 Sep 2026 18:04:52 +0300
+Subject: [PATCH 04/55] ipa-pwd-extop: allow password expiration override on
+ create
+
+Permit to create accounts with a limited principal password expiration
+but not beyond what Kerberos password policy defines for this account.
+
+Additionally, fix timezone-related bugs in setting password expiration.
+
+Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
+Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
+---
+ .../ipa-slapi-plugins/ipa-pwd-extop/common.c | 2 +-
+ .../ipa-slapi-plugins/ipa-pwd-extop/prepost.c | 50 +++++++++++
+ ipapython/ipaldap.py | 21 ++++-
+ ipatests/test_integration/test_commands.py | 86 +++++++++++++++++++
+ 4 files changed, 154 insertions(+), 5 deletions(-)
+
+diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/common.c b/daemons/ipa-slapi-plugins/ipa-pwd-extop/common.c
+index 71642540a..ebae0465b 100644
+--- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/common.c
++++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/common.c
+@@ -799,7 +799,7 @@ int ipapwd_setdate(Slapi_Entry *source, Slapi_Mods *smods, const char *attr,
+ Slapi_Attr *t;
+ bool exists;
+
+- exists = (slapi_entry_attr_find(source, attr, &t) == 0);
++ exists = (source != NULL && slapi_entry_attr_find(source, attr, &t) == 0);
+
+ if (remove) {
+ if (exists) {
+diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/prepost.c b/daemons/ipa-slapi-plugins/ipa-pwd-extop/prepost.c
+index 4bfd60e7c..71ccc5f07 100644
+--- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/prepost.c
++++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/prepost.c
+@@ -400,6 +400,40 @@ static int ipapwd_pre_add(Slapi_PBlock *pb)
+ goto done;
+ }
+
++ /* If the entry being added already carries a krbPasswordExpiration, treat
++ * it as an explicit request. An explicit request overrides the default
++ * expiration derived by ipapwd_CheckPolicy (which, for an admin-set
++ * password, force-expires the account), but is still capped at the policy
++ * maximum lifetime -- a password must never outlive policy. A
++ * max_pwd_life of 0 means "never expire".
++ *
++ * This is only meaningful on LDAP ADD, where the attribute value is the
++ * request; on a password change it holds the previous expiration and must
++ * not constrain the new one. */
++ {
++ char *req_exp_str;
++ time_t req_exp;
++
++ req_exp_str = slapi_entry_attr_get_charptr(e, "krbPasswordExpiration");
++ req_exp = ipapwd_gentime_to_time_t(req_exp_str);
++ slapi_ch_free_string(&req_exp_str);
++
++ if (req_exp != 0) {
++ time_t policy_max = 0;
++
++ if (pwdop->pwdata.policy.max_pwd_life > 0) {
++ policy_max = pwdop->pwdata.timeNow +
++ pwdop->pwdata.policy.max_pwd_life;
++ }
++
++ if (policy_max != 0 && req_exp > policy_max) {
++ pwdop->pwdata.expireTime = policy_max;
++ } else {
++ pwdop->pwdata.expireTime = req_exp;
++ }
++ }
++ }
++
+ if (is_krb || is_smb || is_ipant) {
+
+ Slapi_Value **svals = NULL;
+@@ -1150,6 +1184,22 @@ static int ipapwd_post_modadd(Slapi_PBlock *pb)
+ }
+ }
+
++ /* The date-setting and grace-time logic below needs the current entry to
++ * detect already-present single-valued attributes (e.g. a client-supplied
++ * krbPasswordExpiration on add) so ipapwd_setdate can REPLACE rather than
++ * append a duplicate value. On add -- and on password changes that skipped
++ * history -- pwdata.target is still NULL, so fetch the just-committed entry
++ * (freed with the mod path's entry at 'done'). */
++ if (pwdop->pwdata.target == NULL) {
++ Slapi_DN *tmp_dn = slapi_sdn_new_dn_byref(pwdop->pwdata.dn);
++ if (tmp_dn) {
++ (void)slapi_search_internal_get_entry(tmp_dn, 0,
++ &pwdop->pwdata.target,
++ ipapwd_plugin_id);
++ slapi_sdn_free(&tmp_dn);
++ }
++ }
++
+ /* we assume that krb attributes are properly updated too if keys were
+ * passed in */
+ if (!pwdop->skip_keys) {
+diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py
+index f4630bae2..ab0699149 100644
+--- a/ipapython/ipaldap.py
++++ b/ipapython/ipaldap.py
+@@ -23,7 +23,7 @@ import binascii
+ import errno
+ import logging
+ import time
+-from datetime import datetime
++from datetime import datetime, timezone
+ from decimal import Decimal
+ from copy import deepcopy
+ import contextlib
+@@ -972,6 +972,20 @@ class LDAPClient:
+
+ return None
+
++ @staticmethod
++ def _encode_datetime(val):
++ """Translate a datetime to an LDAP GeneralizedTime string.
++
++ The GeneralizedTime format used here (``...Z``) denotes UTC, so a
++ timezone-aware value must be converted to UTC first; otherwise its
++ wall-clock components would be emitted verbatim and mislabelled as
++ UTC. A naive datetime is assumed to already be in UTC (the convention
++ used throughout IPA).
++ """
++ if val.tzinfo is not None:
++ val = val.astimezone(timezone.utc)
++ return val.strftime(LDAP_GENERALIZED_TIME_FORMAT)
++
+ def encode(self, val):
+ """
+ Encode attribute value to LDAP representation (str/bytes).
+@@ -999,7 +1013,7 @@ class LDAPClient:
+ dct = dict((k, self.encode(v)) for k, v in val.items())
+ return dct
+ elif isinstance(val, datetime):
+- return val.strftime(LDAP_GENERALIZED_TIME_FORMAT).encode('utf-8')
++ return self._encode_datetime(val).encode('utf-8')
+ elif isinstance(val, x509.IPACertificate):
+ return val.public_bytes(x509.Encoding.DER)
+ elif val is None:
+@@ -1389,8 +1403,7 @@ class LDAPClient:
+ value = u'\\'.join(
+ value[i:i+2] for i in six.moves.range(-2, len(value), 2))
+ elif isinstance(value, datetime):
+- value = value.strftime(
+- LDAP_GENERALIZED_TIME_FORMAT)
++ value = cls._encode_datetime(value)
+ value = ldap.filter.escape_filter_chars(value)
+ else:
+ value = str(value)
+diff --git a/ipatests/test_integration/test_commands.py b/ipatests/test_integration/test_commands.py
+index 89381f535..b9102587b 100644
+--- a/ipatests/test_integration/test_commands.py
++++ b/ipatests/test_integration/test_commands.py
+@@ -471,6 +471,92 @@ class TestIPACommand(IntegrationTest):
+ tasks.ldappasswd_sysaccount_change(sysuser, original_passwd,
+ new_passwd, master)
+
++ def test_user_add_password_expiration_bounded_by_policy(self):
++ """user-add with --password and an explicit --password-expiration.
++
++ The ipa-pwd-extop DS plugin must:
++ * store a single value of the single-valued krbPasswordExpiration
++ attribute (it used to append a second, policy-derived value on add,
++ failing the operation with a schema violation), and
++ * honor an explicitly requested expiration but bound it by the
++ effective password policy, so a password never outlives policy.
++ """
++ master = self.master
++ tasks.kinit_admin(master)
++ base_dn = str(master.domain.basedn)
++
++ # Effective global policy maximum password lifetime, in seconds
++ # (krbMaxPwdLife is stored in seconds; 0 means "never expire").
++ result = master.run_command(['ipa', 'pwpolicy-show', '--raw'])
++ match = re.search(r'krbmaxpwdlife:\s*(\d+)', result.stdout_text)
++ max_life_secs = int(match.group(1)) if match else 0
++
++ def add_user(user, exp_dt):
++ master.run_command(
++ ['ipa', 'user-add', user, '--first', user, '--last', user,
++ '--password', '--password-expiration',
++ exp_dt.strftime('%Y%m%d%H%M%SZ')],
++ stdin_text='Secret123\nSecret123\n')
++
++ def stored_expirations(user):
++ result = tasks.ldapsearch_dm(
++ master,
++ 'uid={user},cn=users,cn=accounts,{base_dn}'.format(
++ user=user, base_dn=base_dn),
++ ['krbpasswordexpiration'],
++ scope='base')
++ values = re.findall(r'krbpasswordexpiration: (\S+)',
++ result.stdout_text.lower())
++ return [datetime.strptime(v.strip().upper(), '%Y%m%d%H%M%SZ')
++ for v in values]
++
++ # A request comfortably within policy must be honored verbatim.
++ within_user = 'pwdexpwithin'
++ if max_life_secs:
++ within_delta = timedelta(seconds=min(max_life_secs // 2, 86400))
++ else:
++ within_delta = timedelta(days=1)
++ requested = datetime.utcnow() + within_delta
++ # second precision only: krbPasswordExpiration has no sub-second part
++ requested = requested.replace(microsecond=0)
++ try:
++ add_user(within_user, requested)
++ stored = stored_expirations(within_user)
++ assert len(stored) == 1, (
++ 'krbPasswordExpiration must be single-valued, got %r' % stored)
++ assert abs((stored[0] - requested).total_seconds()) < 120, (
++ 'within-policy request %s not honored, stored %s'
++ % (requested, stored[0]))
++ finally:
++ master.run_command(['ipa', 'user-del', within_user],
++ raiseonerr=False)
++
++ # A request far beyond policy must be capped at the policy maximum
++ # (only meaningful when the policy actually sets a maximum lifetime).
++ if max_life_secs:
++ over_user = 'pwdexpover'
++ requested = (datetime.utcnow()
++ + timedelta(seconds=max_life_secs)
++ + timedelta(days=3650))
++ requested = requested.replace(microsecond=0)
++ try:
++ add_user(over_user, requested)
++ stored = stored_expirations(over_user)
++ assert len(stored) == 1, (
++ 'krbPasswordExpiration must be single-valued, got %r'
++ % stored)
++ assert stored[0] < requested - timedelta(days=1), (
++ 'beyond-policy request was not capped, stored %s'
++ % stored[0])
++ cap = (datetime.utcnow() + timedelta(seconds=max_life_secs)
++ + timedelta(days=1))
++ assert stored[0] <= cap, (
++ 'stored expiration %s exceeds policy cap %s'
++ % (stored[0], cap))
++ finally:
++ master.run_command(['ipa', 'user-del', over_user],
++ raiseonerr=False)
++
+ def get_krbinfo(self, user):
+ base_dn = str(self.master.domain.basedn)
+ result = tasks.ldapsearch_dm(
+--
+2.56.0
+
+
+From 815b696621c7194cde7a8fc95955479e8e422e5c Mon Sep 17 00:00:00 2001
+From: Julien Rische <jrische@redhat.com>
+Date: Mon, 7 Sep 2026 11:16:09 +0200
+Subject: [PATCH 05/55] kdb: rework cross-realm PAC validation and ID override
+ checks
+
+The cross-realm PAC validation code had several issues:
+
+The ID override check used the POSIX "uid" attribute instead of
+"ipaOriginalUid", and compared it against the ticket cname which is
+the service principal (not the user) in S4U2Self referral TGTs.
+
+The PAC cross-validation compared client_name directly against
+account_name using case-sensitive strcmp, which failed for S4U2Self
+referral TGTs where client_name is qualified ("username@userRealm"
+per MS-SFU 3.2.5.1.1) and for legitimate case differences.
+
+This commit reworks the validation to use PAC_CLIENT_INFO client_name
+as the reference for all name-based checks. MIT krb5 validates
+client_name against the correct non-PAC identity source (ticket cname,
+PA-FOR-USER, or PA-S4U-X509-USER) before the KDB plugin runs, making
+it the value IPA will use to identify the user, and the value we must
+cross-validate against canonical PAC attributes to detect alias-based
+identity fraud.
+
+Comparisons now handle the qualified ("user@REALM") and unqualified
+("user") forms of client_name: when both values are qualified, a full
+comparison including the realm is performed; otherwise only the name
+part is compared.
+
+The ID override check now compares ipaOriginalUid against client_name
+instead of the ticket cname, fixing S4U2Self flows.
+
+All comparisons are now case-insensitive, and all validation failures
+return KRB5KDC_ERR_POLICY as mandated by MS-SFU 3.2.5.1.
+
+Signed-off-by: Julien Rische <jrische@redhat.com>
+Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
+Reviewed-By: Alexander Bokovoy <abbra@users.noreply.github.com>
+---
+ daemons/ipa-kdb/ipa_kdb.h | 1 +
+ daemons/ipa-kdb/ipa_kdb_mspac_private.h | 6 +
+ daemons/ipa-kdb/ipa_kdb_mspac_trust.c | 288 ++++++++++++++----------
+ 3 files changed, 176 insertions(+), 119 deletions(-)
+
+diff --git a/daemons/ipa-kdb/ipa_kdb.h b/daemons/ipa-kdb/ipa_kdb.h
+index cbac54fec..1c6647b7d 100644
+--- a/daemons/ipa-kdb/ipa_kdb.h
++++ b/daemons/ipa-kdb/ipa_kdb.h
+@@ -93,6 +93,7 @@
+
+ #define IPA_KRB_AUTHZ_DATA_ATTR "ipaKrbAuthzData"
+ #define IPA_USER_AUTH_TYPE "ipaUserAuthType"
++#define IPA_ORIGINAL_UID_ATTR "ipaOriginalUid"
+
+ /* Virtual managed ticket flags like "-allow_tix", are always controlled by the
+ * "nsAccountLock" attribute, such flags should never be set in the database.
+diff --git a/daemons/ipa-kdb/ipa_kdb_mspac_private.h b/daemons/ipa-kdb/ipa_kdb_mspac_private.h
+index c76fb8e59..ccdcd6c59 100644
+--- a/daemons/ipa-kdb/ipa_kdb_mspac_private.h
++++ b/daemons/ipa-kdb/ipa_kdb_mspac_private.h
+@@ -23,6 +23,12 @@
+
+ #pragma once
+
++/* This is used as a global maximum length for:
++ * userPrincipalName: no explicit limit
++ * samAccountName: 20 for backward compatibility reasons
++ */
++#define MSPAC_ID_NAME_MAX_LENGTH (2048)
++
+ struct ipadb_mspac {
+ char *flat_domain_name;
+ char *flat_server_name;
+diff --git a/daemons/ipa-kdb/ipa_kdb_mspac_trust.c b/daemons/ipa-kdb/ipa_kdb_mspac_trust.c
+index a09dc2dfb..9dfda6633 100644
+--- a/daemons/ipa-kdb/ipa_kdb_mspac_trust.c
++++ b/daemons/ipa-kdb/ipa_kdb_mspac_trust.c
+@@ -18,6 +18,60 @@
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
++ *
++ *
++ * THREAT MODEL
++ *
++ * If Active Directory does not enforce uniqueness of principal aliases
++ * (UPN), a regular AD user could set their userPrincipalName to
++ * impersonate another user (e.g. "administrator@AD.TEST"). Since IPA
++ * resolves AD user identity from the ticket client name, a forged alias
++ * could lead to privilege escalation.
++ *
++ * However, other PAC attributes (account_name from PAC_LOGON_INFO, SAM
++ * name and SID from UPN_DNS_INFO extended format) always reflect the
++ * canonical AD identity regardless of aliases. Cross-validating these
++ * against client_name detects the inconsistency.
++ *
++ * PAC_CLIENT_INFO client_name
++ *
++ * Before the KDB plugin runs, MIT krb5 validates PAC_CLIENT_INFO
++ * client_name (MS-PAC 2.7) against the appropriate non-PAC identity
++ * source (tgs_policy.c:check_tgs_s4u2self, check_normal_tgs_pac):
++ * - ticket cname for regular TGS
++ * - PA-FOR-USER for S4U2Self
++ * - PA-S4U-X509-USER for certificate-based S4U2Self
++ * This makes client_name the value that IPA will use to identify the
++ * user, and the value we must cross-validate against canonical PAC
++ * attributes to detect alias-based identity fraud.
++ *
++ * client_name is bare ("username") in regular tickets, or qualified
++ * ("username@userRealm") in S4U2Self referral TGTs (MS-SFU 3.2.5.1.1).
++ * The name part (before '@') is used for cross-validation against bare
++ * attributes. When both client_name and the tested attribute are
++ * qualified, a full comparison including the realm is performed.
++ *
++ * CHECKS PERFORMED
++ *
++ * 1. PAC cross-validation: all PAC name attributes (account_name, UPN,
++ * SAM name) must match client_name. UPN extended SID must match the
++ * logon info SID. PAC_REQUESTER_SID is not checked because it may
++ * legitimately differ in S4U delegation scenarios (MS-PAC 2.12).
++ * AD is case-insensitive, so all string comparisons use
++ * case-insensitive functions.
++ *
++ * 2. ID override validation: if a Default Trust View override exists for
++ * the PAC SID, its ipaOriginalUid must match client_name.
++ *
++ * 3. UPN qualification: for enterprise principals, the UPN must be
++ * qualified (contain '@') unless constructed (U flag), per MS-KILE
++ * 3.3.5.2.
++ *
++ * ERROR HANDLING
++ *
++ * All validation failures return KRB5KDC_ERR_POLICY (KDC_ERR_POLICY,
++ * error code 12) as mandated by MS-SFU 3.2.5.1. The status string is
++ * included in the KRB-ERROR e-text field.
+ */
+
+ #include "ipa_kdb.h"
+@@ -40,7 +94,7 @@ struct crossrealm_tgt_info {
+ /* PAC_LOGON_INFO (Type 1) - mandatory
+ * Present since Windows 2000 */
+ bool logon_info_present;
+- const char *account_name;
++ const char *account_name; /* samAccountName, always bare */
+ struct dom_sid logon_info_sid;
+ char *logon_info_sid_string;
+
+@@ -48,15 +102,17 @@ struct crossrealm_tgt_info {
+ * Present since Windows 2000 */
+ bool client_info_present;
+ const char *client_name;
++ bool client_name_is_qualified;
++ size_t unqualified_cn_len; /* length of name part (before '@') */
+
+ /* PAC_UPN_DNS_INFO (Type 12) - optional
+ * Present since Windows Server 2008 */
+ bool upn_dns_info_present;
+- const char *upn;
++ const char *upn; /* always qualified ("user@REALM") */
+ bool upn_is_qualified;
+- bool upn_is_constructed;
+- bool upn_has_sam_and_sid;
+- const char *upn_sam_name;
++ bool upn_is_constructed; /* U flag: UPN built from samAccountName */
++ bool upn_has_sam_and_sid; /* S flag: extended format present */
++ const char *upn_sam_name; /* samAccountName from extended UPN, bare */
+ struct dom_sid upn_sid;
+
+ /* PAC_REQUESTER_SID (Type 18) - optional
+@@ -99,25 +155,25 @@ ipadb_validate_pac_attributes(krb5_context context,
+ /* PAC_LOGON_INFO is mandatory */
+ if (!info->logon_info_present) {
+ *status = "TRUST_PAC_MISSING_LOGON_INFO";
+- return ENOENT;
++ return KRB5KDC_ERR_POLICY;
+ }
+
+ /* Verify account_name was successfully extracted from LOGON_INFO */
+ if (!info->account_name) {
+ *status = "TRUST_PAC_MISSING_ACCOUNT_NAME";
+- return ENOENT;
++ return KRB5KDC_ERR_POLICY;
+ }
+
+ /* PAC_CLIENT_INFO is mandatory */
+ if (!info->client_info_present) {
+ *status = "TRUST_PAC_MISSING_CLIENT_INFO";
+- return ENOENT;
++ return KRB5KDC_ERR_POLICY;
+ }
+
+ /* Verify client_name was successfully extracted from CLIENT_INFO */
+ if (!info->client_name) {
+- *status = "TRUST_PAC_MISSING_CLIENT_NAME";
+- return ENOENT;
++ *status = "TRUST_PAC_CLIENT_NAME_MISSING";
++ return KRB5KDC_ERR_POLICY;
+ }
+
+ return 0;
+@@ -134,7 +190,7 @@ ipadb_extract_crtgt_info(krb5_context context,
+ struct crossrealm_tgt_info *info,
+ const char **status)
+ {
+- krb5_error_code kerr = EINVAL;
++ krb5_error_code kerr = KRB5KDC_ERR_POLICY;
+ krb5_data linfo_blob = {0}, upn_blob = {0}, cinfo_blob = {0};
+ krb5_data req_sid_blob = {0};
+ DATA_BLOB linfo_data, upn_data, cinfo_data, req_sid_data;
+@@ -170,22 +226,22 @@ ipadb_extract_crtgt_info(krb5_context context,
+
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ *status = "TRUST_PAC_CANNOT_PARSE_LOGON_INFO";
+- kerr = EINVAL;
++ kerr = KRB5KDC_ERR_POLICY;
+ goto end;
+ }
+
+ /* Check if logon_info structure is valid */
+ if (!logon_info.info) {
+ *status = "TRUST_PAC_LOGON_INFO_UNDEFINED";
+- kerr = EINVAL;
++ kerr = KRB5KDC_ERR_POLICY;
+ goto end;
+ }
+
+ /* Store pointer to account name */
+ info->account_name = logon_info.info->info3.base.account_name.string;
+ if (!info->account_name) {
+- *status = "TRUST_PAC_ACCOUNT_NAME_UNDEFINED";
+- kerr = EINVAL;
++ *status = "TRUST_PAC_ACCOUNT_NAME_MISSING";
++ kerr = KRB5KDC_ERR_POLICY;
+ goto end;
+ }
+
+@@ -225,8 +281,18 @@ ipadb_extract_crtgt_info(krb5_context context,
+ (ndr_pull_flags_fn_t)ndr_pull_PAC_INFO);
+ krb5_free_data_contents(context, &cinfo_blob);
+
+- if (NDR_ERR_CODE_IS_SUCCESS(ndr_err))
++ if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
++ const char *at_sign;
++
+ info->client_name = client_info.logon_name.account_name;
++ if (info->client_name) {
++ at_sign = strchr(info->client_name, '@');
++ info->client_name_is_qualified = (at_sign != NULL);
++ info->unqualified_cn_len = at_sign ?
++ (size_t)(at_sign - info->client_name) :
++ strlen(info->client_name);
++ }
++ }
+ }
+
+ /* Extract Type 12 - PRIMARY UPN SOURCE
+@@ -248,14 +314,18 @@ ipadb_extract_crtgt_info(krb5_context context,
+
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ *status = "TRUST_PAC_CANNOT_PARSE_UPN_DNS_INFO";
+- kerr = EINVAL;
++ kerr = KRB5KDC_ERR_POLICY;
+ goto end;
+ }
+
+ /* Store pointer to UPN string */
+ info->upn = upn_info.upn_dns_info.upn_name;
+- if (info->upn)
+- info->upn_is_qualified = (NULL != strchr(info->upn, '@'));
++ if (!info->upn) {
++ *status = "TRUST_PAC_UPN_MISSING";
++ kerr = KRB5KDC_ERR_POLICY;
++ goto end;
++ }
++ info->upn_is_qualified = (NULL != strchr(info->upn, '@'));
+
+ /* Extract U flag - indicates constructed UPN */
+ info->upn_is_constructed =
+@@ -309,119 +379,100 @@ end:
+ return kerr;
+ }
+
+-/* Cross-validate PAC attributes for consistency
+- * All available attributes must match across different PAC buffers.
+- * LOGON_INFO and CLIENT_INFO must be present (asserted).
+- */
++/* Compare a PAC name attribute against client_name (case-insensitive).
++ * If both are qualified, compare fully. Otherwise compare name parts only,
++ * expecting '@' (qualified) or '\0' (bare) after the matched prefix.
++ * Returns true if the names differ. */
++static bool
++client_name_differs(const struct crossrealm_tgt_info *info,
++ const char *tested, bool qualified)
++{
++ return (qualified && info->client_name_is_qualified)
++ ? (0 != strcasecmp(info->client_name, tested))
++ : (0 != strncasecmp(info->client_name, tested,
++ info->unqualified_cn_len)
++ || tested[info->unqualified_cn_len] != (qualified ? '@' : '\0'));
++}
++
++/* Cross-validate PAC name attributes and SIDs against client_name.
++ * See file header for design rationale. */
+ static krb5_error_code
+ ipadb_cross_validate_pac_attributes(krb5_context context,
+ const struct crossrealm_tgt_info *info,
+ const char **status)
+ {
+- krb5_error_code kerr = EINVAL;
+- const char *at_sign = NULL;
+- char *ticket_cname = NULL;
+- size_t name_len;
++ krb5_error_code kerr = KRB5KDC_ERR_POLICY;
+
+ /* Mandatory PAC attributes must have been validated already */
+ assert(info->logon_info_present);
+ assert(info->client_info_present);
+
+- /* Validate UPN matches ticket cname (for enterprise principals) */
+- if (info->is_enterprise_princ && info->upn_dns_info_present) {
+- /* Unparse client principal name (without realm) */
+- kerr = krb5_unparse_name_flags(context, info->client_princ,
+- KRB5_PRINCIPAL_UNPARSE_NO_REALM,
+- &ticket_cname);
+- if (kerr) {
+- *status = "TRUST_CANNOT_UNPARSE_CNAME";
+- goto end;
+- }
+-
+- /* Find the @ sign in UPN */
+- at_sign = strchr(info->upn, '@');
+- if (at_sign) {
+- name_len = at_sign - info->upn;
+-
+- /* Compare UPN name part with ticket cname */
+- if (0 != strncmp(info->upn, ticket_cname, name_len) ||
+- ticket_cname[name_len] != '\0') {
+- *status = "TRUST_PAC_UPN_CNAME_MISMATCH";
+- kerr = EINVAL;
+- goto end;
+- }
+- }
+-
+- krb5_free_unparsed_name(context, ticket_cname);
+- ticket_cname = NULL;
++ /* account_name (bare) vs client_name */
++ if (client_name_differs(info, info->account_name, false)) {
++ *status = "TRUST_PAC_ACCOUNT_NAME_MISMATCH";
++ kerr = KRB5KDC_ERR_POLICY;
++ goto end;
+ }
+
+- /* Cross-validate account names if extended UPN format is available */
+- if (info->upn_has_sam_and_sid) {
+- if (!info->account_name || !info->upn_sam_name ||
+- 0 != strcmp(info->account_name, info->upn_sam_name)) {
+- *status = "TRUST_PAC_ACCOUNT_NAME_MISMATCH";
+- kerr = EINVAL;
++ /* UPN (qualified) vs client_name, enterprise principals only.
++ * For enterprise principals, the AD KDC looks up the user by UPN
++ * (MS-KILE 3.3.5.6.1), so a forged UPN alias could produce a
++ * client_name that differs from account_name. For regular principals
++ * the lookup is by samAccountName, and the UPN may legitimately
++ * differ, so this check would cause false positives. */
++ if (info->is_enterprise_princ && info->upn_dns_info_present) {
++ if (client_name_differs(info, info->upn, true)) {
++ *status = "TRUST_PAC_UPN_MISMATCH";
++ kerr = KRB5KDC_ERR_POLICY;
+ goto end;
+ }
+ }
+
+- /* Cross-validate client name matches account name */
+- if (info->client_info_present) {
+- if (!info->client_name || !info->account_name ||
+- 0 != strcmp(info->client_name, info->account_name)) {
+- *status = "TRUST_PAC_CLIENT_NAME_MISMATCH";
+- kerr = EINVAL;
++ /* UPN SAM name (bare) vs client_name */
++ if (info->upn_has_sam_and_sid) {
++ if (!info->upn_sam_name ||
++ client_name_differs(info, info->upn_sam_name, false)) {
++ *status = "TRUST_PAC_UPN_SAM_NAME_MISMATCH";
++ kerr = KRB5KDC_ERR_POLICY;
+ goto end;
+ }
+ }
+
+- /* Cross-validate SIDs if extended UPN format is available */
++ /* UPN SID vs logon info SID */
+ if (info->upn_has_sam_and_sid) {
+ if (!dom_sid_check(&info->logon_info_sid,
+ &info->upn_sid, true)) {
+ *status = "TRUST_PAC_UPN_SID_MISMATCH";
+- kerr = EINVAL;
++ kerr = KRB5KDC_ERR_POLICY;
+ goto end;
+ }
+ }
+
+- /* Cross-validate SID from REQUESTER_SID buffer if present */
+- if (info->requester_sid_present) {
+- if (!dom_sid_check(&info->logon_info_sid,
+- &info->requester_sid, true)) {
+- *status = "TRUST_PAC_REQUESTER_SID_MISMATCH";
+- kerr = EINVAL;
+- goto end;
+- }
+- }
++ /* PAC_REQUESTER_SID is not checked against logon_info_sid because
++ * in S4U delegation scenarios, the requester SID is the service's
++ * SID, not the impersonated user's (MS-PAC 2.12). */
+
+ kerr = 0;
+
+ end:
+- if (ticket_cname)
+- krb5_free_unparsed_name(context, ticket_cname);
+-
+ return kerr;
+ }
+
+-/* Check Default Trust View override username consistency
+- * If a user override exists for this SID in the Default Trust View,
+- * verify that the override username matches the ticket cname.
+- * LOGON_INFO and CLIENT_INFO must be present (asserted).
+- */
++/* If a Default Trust View override exists for this SID, verify that
++ * ipaOriginalUid (always qualified) matches client_name. */
+ static krb5_error_code
+ ipadb_check_trust_view_override(krb5_context context,
+ const struct crossrealm_tgt_info *info,
+ const char **status)
+ {
+ struct ipadb_context *ipactx = NULL;
+- krb5_error_code kerr = EINVAL;
+- char *basedn = NULL, *filter = NULL, *attrs[] = {"uid", NULL};
++ krb5_error_code kerr = KRB5KDC_ERR_POLICY;
++ char *basedn = NULL, *filter = NULL;
++ char *attrs[] = {IPA_ORIGINAL_UID_ATTR, NULL};
+ LDAPMessage *res = NULL, *entry = NULL;
+ struct berval **uid_values = NULL;
+- char *ticket_cname = NULL;
+ int count;
++ bool mismatch;
+
+ /* Mandatory PAC attributes must have been validated already */
+ assert(info->logon_info_present);
+@@ -470,35 +521,45 @@ ipadb_check_trust_view_override(krb5_context context,
+ goto end;
+ }
+
+- /* Override exists - verify the username matches the ticket cname */
++ /* Override exists - verify the username matches client_name */
+ entry = ldap_first_entry(ipactx->lcontext, res);
+ if (!entry) {
+ *status = "TRUST_CANNOT_READ_OVERRIDE_ENTRY";
+- kerr = EINVAL;
++ kerr = KRB5KDC_ERR_POLICY;
+ goto end;
+ }
+
+- uid_values = ldap_get_values_len(ipactx->lcontext, entry, "ipaOriginalUid");
++ uid_values = ldap_get_values_len(ipactx->lcontext, entry,
++ IPA_ORIGINAL_UID_ATTR);
+ if (!uid_values || !uid_values[0]) {
+ *status = "TRUST_OVERRIDE_UID_UNDEFINED";
+- kerr = EINVAL;
++ kerr = KRB5KDC_ERR_POLICY;
+ goto end;
+ }
+
+- /* Unparse client principal name (without realm) */
+- kerr = krb5_unparse_name_flags(context, info->client_princ,
+- KRB5_PRINCIPAL_UNPARSE_NO_REALM,
+- &ticket_cname);
+- if (kerr) {
+- *status = "TRUST_CANNOT_UNPARSE_CNAME";
+- goto end;
++ /* Compare ipaOriginalUid (always qualified) against client_name.
++ * When client_name is qualified, compare full value including realm.
++ * When bare, compare name part only and verify ipaOriginalUid
++ * continues with '@' at that position. */
++ if (info->client_name_is_qualified) {
++ /* Full comparison: client_name length must match bv_len */
++ mismatch = (strlen(info->client_name) != uid_values[0]->bv_len ||
++ 0 != strncasecmp(info->client_name,
++ uid_values[0]->bv_val,
++ uid_values[0]->bv_len));
++ } else {
++ /* Name part only: unqualified_cn_len must be less than bv_len,
++ * the name part must match, and bv_val must have '@' at that
++ * position */
++ mismatch = (info->unqualified_cn_len >= uid_values[0]->bv_len ||
++ 0 != strncasecmp(info->client_name,
++ uid_values[0]->bv_val,
++ info->unqualified_cn_len) ||
++ uid_values[0]->bv_val[info->unqualified_cn_len] != '@');
+ }
+
+- /* Compare override username with ticket cname */
+- if (0 != strncmp(uid_values[0]->bv_val, ticket_cname,
+- uid_values[0]->bv_len) ||
+- '\0' != ticket_cname[uid_values[0]->bv_len]) {
+- *status = "TRUST_OVERRIDE_UID_CNAME_MISMATCH";
++ if (mismatch) {
++ *status = "TRUST_OVERRIDE_UID_MISMATCH";
+ kerr = KRB5KDC_ERR_POLICY;
+ goto end;
+ }
+@@ -508,8 +569,6 @@ ipadb_check_trust_view_override(krb5_context context,
+ end:
+ if (uid_values)
+ ldap_value_free_len(uid_values);
+- if (ticket_cname)
+- krb5_free_unparsed_name(context, ticket_cname);
+ if (res)
+ ldap_msgfree(res);
+ if (filter)
+@@ -520,10 +579,8 @@ end:
+ return kerr;
+ }
+
+-/* Check that enterprise principal has qualified UPN in PAC
+- * UPN MUST be qualified if it is NOT constructed (U flag not set).
+- * LOGON_INFO and CLIENT_INFO must be present (asserted).
+- */
++/* For enterprise principals, UPN must be qualified unless constructed
++ * (U flag set), per MS-KILE 3.3.5.2. */
+ static krb5_error_code
+ ipadb_check_upn_qualified(krb5_context context,
+ const struct crossrealm_tgt_info *info,
+@@ -558,14 +615,7 @@ ipadb_check_upn_qualified(krb5_context context,
+ return 0;
+ }
+
+-/* Main function to check trust PAC content
+- *
+- * Performs security checks on trust TGS-REQ:
+- * 1. Cross-validation - verify PAC attributes consistency
+- * 2. User registration - requester SID must exist in Default Trust View
+- * 3. UPN qualification - enterprise principals must have qualified UPN
+- * (if not constructed)
+- */
++/* Entry point for trust PAC content checks. See file header. */
+ krb5_error_code
+ ipadb_check_trust_pac_content(krb5_context context,
+ const krb5_kdc_req *request,
+@@ -574,7 +624,7 @@ ipadb_check_trust_pac_content(krb5_context context,
+ const char **status)
+ {
+ struct crossrealm_tgt_info info;
+- krb5_error_code kerr = EINVAL;
++ krb5_error_code kerr = KRB5KDC_ERR_POLICY;
+
+ /* Initialize PAC check info structure and create talloc context */
+ kerr = ipadb_trust_pac_info_init(&info);
+--
+2.56.0
+
+
+From 8ef907327b569b3cc9c782881ee95de8ef7b180c Mon Sep 17 00:00:00 2001
+From: David Hanina <dhanina@redhat.com>
+Date: Mon, 31 Aug 2026 14:43:32 +0200
+Subject: [PATCH 06/55] ipa-join: increase argv array size for ipa-getkeytab
+
+Make room for an additional argument by enlarging the argv array
+from 12 to 13 elements.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10044
+Signed-off-by: David Hanina <dhanina@redhat.com>
+Reviewed-By: Sudhir Menon <sumenon@redhat.com>
+---
+ client/ipa-join.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/client/ipa-join.c b/client/ipa-join.c
+index a8d4a82cc..7c16919a4 100644
+--- a/client/ipa-join.c
++++ b/client/ipa-join.c
+@@ -1196,7 +1196,7 @@ join(const char *server, const char *hostname, const char *bindpw, const char *b
+ }
+
+ if (childpid == 0) {
+- char *argv[12];
++ char *argv[13];
+ char *path = "/usr/sbin/ipa-getkeytab";
+ int arg = 0;
+ int err;
+--
+2.56.0
+
+
+From b8ba3e83e70347e49dd5040b4fa4963539c8b95f Mon Sep 17 00:00:00 2001
+From: PRANAV THUBE <pthube@redhat.com>
+Date: Mon, 31 Aug 2026 12:21:08 +0530
+Subject: [PATCH 07/55] ipatests: allow resolver restore after NetworkManager
+ rewrite
+
+On RHEL, NetworkManager may rewrite /etc/resolv.conf during replica
+or client uninstall. That makes uninstall_master/uninstall_client
+fail check_state_expected() even though IPA is already uninstalled.
+Accept the current resolver state before restore so teardown can
+put the backup back.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10061
+Reviewed-By: Anuja More <amore@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+Reviewed-By: Sudhir Menon <sumenon@redhat.com>
+---
+ ipatests/pytest_ipa/integration/resolver.py | 8 ++++++++
+ ipatests/pytest_ipa/integration/tasks.py | 6 ++++++
+ 2 files changed, 14 insertions(+)
+
+diff --git a/ipatests/pytest_ipa/integration/resolver.py b/ipatests/pytest_ipa/integration/resolver.py
+index d433169dd..175a8d045 100644
+--- a/ipatests/pytest_ipa/integration/resolver.py
++++ b/ipatests/pytest_ipa/integration/resolver.py
+@@ -82,6 +82,14 @@ class Resolver(abc.ABC):
+ """Checks if stack of backups is not empty"""
+ return bool(self.backups)
+
++ def resync_state(self):
++ """Treat the host's current resolver config as expected.
++
++ Use when NetworkManager or IPA install/uninstall rewrote DNS
++ configuration outside Resolver, so restore() can proceed.
++ """
++ self.current_state = self._get_state()
++
+ def check_state_expected(self):
+ """Checks if resolver configuration has not changed.
+
+diff --git a/ipatests/pytest_ipa/integration/tasks.py b/ipatests/pytest_ipa/integration/tasks.py
+index 9e9fdd2a6..733b8d79e 100755
+--- a/ipatests/pytest_ipa/integration/tasks.py
++++ b/ipatests/pytest_ipa/integration/tasks.py
+@@ -1154,6 +1154,9 @@ def uninstall_master(host, ignore_topology_disconnect=True,
+ host.run_command("find /run/ipa -name 'krb5*' | xargs rm -fv",
+ raiseonerr=False)
+ while host.resolver.has_backups():
++ # Network Manager may rewrite resolv.conf during replica
++ # install/uninstall (RHEL)
++ host.resolver.resync_state()
+ host.resolver.restore()
+ if clean:
+ unapply_fixes(host)
+@@ -1163,6 +1166,9 @@ def uninstall_client(host):
+ host.run_command(['ipa-client-install', '--uninstall', '-U'],
+ raiseonerr=False)
+ while host.resolver.has_backups():
++ # Network Manager may rewrite resolv.conf during client
++ # install/uninstall (RHEL)
++ host.resolver.resync_state()
+ host.resolver.restore()
+ unapply_fixes(host)
+
+--
+2.56.0
+
+
+From dbe1e198b9fc15727599d9ac1409ef00240e98be Mon Sep 17 00:00:00 2001
+From: David Hanina <dhanina@redhat.com>
+Date: Mon, 31 Aug 2026 14:43:16 +0200
+Subject: [PATCH 08/55] ipa-kdb: fix NULL pointer dereference when freeing
+ credential type values
+
+Guard the loop that frees individual `cvals` entries with a NULL check
+before dereferencing the array.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10045
+Signed-off-by: David Hanina <dhanina@redhat.com>
+Reviewed-By: Sudhir Menon <sumenon@redhat.com>
+---
+ daemons/ipa-kdb/ipa_kdb.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/daemons/ipa-kdb/ipa_kdb.c b/daemons/ipa-kdb/ipa_kdb.c
+index 531ee223e..36be5e5a2 100644
+--- a/daemons/ipa-kdb/ipa_kdb.c
++++ b/daemons/ipa-kdb/ipa_kdb.c
+@@ -437,8 +437,10 @@ int ipadb_get_enc_salt_types(struct ipadb_context *ipactx,
+
+ done:
+ ldap_value_free_len(vals);
+- for (i = 0; i < c && cvals[i]; i++) {
+- free(cvals[i]);
++ if (cvals) {
++ for (i = 0; i < c && cvals[i]; i++) {
++ free(cvals[i]);
++ }
+ }
+ free(cvals);
+ return ret;
+--
+2.56.0
+
+
+From f0555f2413952dc4257221dd612c83b0647e601d Mon Sep 17 00:00:00 2001
+From: David Hanina <dhanina@redhat.com>
+Date: Tue, 15 Sep 2026 17:18:25 +0200
+Subject: [PATCH 09/55] ipatests: fix SSH password login tests in test_commands
+
+Generate RSA keys in test_sss_ssh_authorizedkeys because STIG crypto
+policy omits ssh-ed25519 from PubkeyAcceptedAlgorithms, and disable
+GSSAPI so the login uses the uploaded public key.
+
+In test_login_wrong_password and test_proxycommand_invalid_shell, wait
+until SSSD is online and the IPA user is resolvable via NSS before SSH.
+Otherwise sshd treats the account as invalid and authentication never
+reaches pam_sss.
+
+Take journalctl --since from the master's clock so controller time skew
+does not miss sshd logs.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10060
+Signed-off-by: David Hanina <dhanina@redhat.com>
+Reviewed-By: Anuja More <amore@redhat.com>
+Reviewed-By: Rafael Guterres Jeffman <rjeffman@redhat.com>
+Reviewed-By: Sudhir Menon <sumenon@redhat.com>
+---
+ ipatests/test_integration/test_commands.py | 39 ++++++++++++++++------
+ 1 file changed, 29 insertions(+), 10 deletions(-)
+
+diff --git a/ipatests/test_integration/test_commands.py b/ipatests/test_integration/test_commands.py
+index b9102587b..0ac7b2b18 100644
+--- a/ipatests/test_integration/test_commands.py
++++ b/ipatests/test_integration/test_commands.py
+@@ -1375,9 +1375,10 @@ class TestIPACommand(IntegrationTest):
+ tasks.create_active_user(self.master, user, passwd, extra_args=[
+ '--homedir', '/home/{}'.format(user)])
+ tasks.kinit_admin(self.master)
++ # STIG crypto policy omits ssh-ed25519 from PubkeyAcceptedAlgorithms.
+ tasks.run_command_as_user(
+- self.master, user, ['ssh-keygen', '-N', '',
+- '-f', user_key])
++ self.master, user, ['ssh-keygen', '-t', 'rsa', '-b', '2048',
++ '-N', '', '-f', user_key])
+ ssh_pub_key = self.master.get_file_contents('{}.pub'.format(
+ user_key), encoding='utf-8')
+ openssl_cmd = [
+@@ -1403,6 +1404,7 @@ class TestIPACommand(IntegrationTest):
+ # login to the system
+ self.master.run_command(
+ ['ssh', '-v', '-o', 'PasswordAuthentication=no',
++ '-o', 'GSSAPIAuthentication=no',
+ '-o', 'IdentitiesOnly=yes', '-o', 'StrictHostKeyChecking=no',
+ '-o', 'ConnectTimeout=10', '-l', user, '-i', user_key,
+ self.master.hostname, 'true'])
+@@ -1534,15 +1536,25 @@ class TestIPACommand(IntegrationTest):
+ pytest.xfail('Fix is part of sssd 2.3.0 and is'
+ ' available from fedora32 onwards')
+
+- # start to look at logs a bit before "now"
+- # https://pagure.io/freeipa/issue/8432
+- since = time.strftime(
+- '%Y-%m-%d %H:%M:%S',
+- (datetime.now() - timedelta(seconds=10)).timetuple()
+- )
+-
+ password = 'WrongPassword'
+
++ # SSSD may be offline after dirsrv restarts (e.g. ipa-adtrust-install
++ # in FIPS). Without a resolvable user, sshd treats the account as
++ # invalid and auth never reaches pam_sss.
++ tasks.wait_for_sssd_domain_status_online(self.master)
++ tasks.run_repeatedly(
++ self.master,
++ command=['getent', 'passwd', self.testuser],
++ test=lambda stdout: self.testuser in stdout,
++ timeout=120,
++ )
++
++ # Use master clock: controller time can be ahead of the host and
++ # make journalctl --since miss sshd logs (codeberg #8432).
++ since = self.master.run_command(
++ ['date', '-d', '10 seconds ago', '+%Y-%m-%d %H:%M:%S']
++ ).stdout_text.strip()
++
+ tasks.run_ssh_cmd(
+ to_host=self.master.external_hostname, username=self.testuser,
+ auth_method="password", password=password,
+@@ -1560,7 +1572,7 @@ class TestIPACommand(IntegrationTest):
+
+ # sshd don't flush its logs to syslog immediately
+ cmd = ["journalctl", "-u", "sshd", f"--since={since}"]
+- tasks.run_repeatedly(self.master, command=cmd, test=test_cb)
++ tasks.run_repeatedly(self.master, command=cmd, test=test_cb, timeout=60)
+
+ def get_dirsrv_id(self):
+ serverid = realm_to_serverid(self.master.domain.realm)
+@@ -1760,6 +1772,13 @@ class TestIPACommand(IntegrationTest):
+ 'kinit', restricted_user],
+ stdin_text=user_kinit)
+ tasks.kdestroy_all(self.clients[0])
++ tasks.clear_sssd_cache(self.clients[0])
++ tasks.run_repeatedly(
++ self.clients[0],
++ command=['getent', 'passwd', restricted_user],
++ test=lambda stdout: restricted_user in stdout,
++ timeout=120,
++ )
+
+ # ssh as a restricted user to a user with a valid shell should
+ # work
+--
+2.56.0
+
+
+From 8153cec7d5d62e1bee862b7705002427dd813e66 Mon Sep 17 00:00:00 2001
+From: Stanislav Levin <slev@altlinux.org>
+Date: Thu, 20 Aug 2026 17:03:07 +0300
+Subject: [PATCH 10/55] ipatests: skip test_drop_privileges if run as
+ unprivileged user
+
+https://codeberg.org/freeipa/freeipa/src/commit/b16f3b80dc5969c303ea71fe5d5080977d2c50c4/ipaclient/install/ipa_epn.py#L113-L118
+
+`drop_privileges` does nothing if run as non-root while test
+`test_drop_privileges` expects it to raise an exception. So skip
+this test in unprivileged environments.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10035
+Signed-off-by: Stanislav Levin <slev@altlinux.org>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+---
+ ipatests/test_ipaclient/test_epn.py | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/ipatests/test_ipaclient/test_epn.py b/ipatests/test_ipaclient/test_epn.py
+index 226d0c319..5b9ff8e3a 100644
+--- a/ipatests/test_ipaclient/test_epn.py
++++ b/ipatests/test_ipaclient/test_epn.py
+@@ -1,6 +1,7 @@
+ #
+ # Copyright (C) 2026 FreeIPA Contributors see COPYING for license
+ #
++import os
+
+ import pytest
+ import ipatests.util
+@@ -11,6 +12,10 @@ from ipaclient.install.ipa_epn import drop_privileges
+ from ipapython import admintool
+
+
++@pytest.mark.skipif(
++ os.geteuid() != 0,
++ reason="Must have root privileges to run this test",
++)
+ @pytest.mark.parametrize(
+ "user,group", [
+ ("unknown_user", "daemon"),
+--
+2.56.0
+
+
+From be850e475d0e0b285a8e2cfab99dfcca16d97407 Mon Sep 17 00:00:00 2001
+From: Florence Blanc-Renaud <flo@redhat.com>
+Date: Thu, 17 Sep 2026 10:13:36 +0200
+Subject: [PATCH 11/55] Topologies: fix test_trust_functional topology
+
+The test_trust_functional requires AD root + child
+but does not need any AD tree (all the classes define
+num_ad_treedomains = 0).
+
+Fix the memory and CPU requirements.
+The topology is defined in freeipa-pr-ci repo, in
+templates/vagrantfiles/Vagrantfile.adroot_adchild_master_2client
+
+Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
+Reviewed-By: Anuja More <amore@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+---
+ ipatests/prci_definitions/nightly_ipa-4-13_latest.yaml | 10 +++++-----
+ .../nightly_ipa-4-13_latest_selinux.yaml | 10 +++++-----
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/ipatests/prci_definitions/nightly_ipa-4-13_latest.yaml b/ipatests/prci_definitions/nightly_ipa-4-13_latest.yaml
+index 8057843d3..10c6ed100 100644
+--- a/ipatests/prci_definitions/nightly_ipa-4-13_latest.yaml
++++ b/ipatests/prci_definitions/nightly_ipa-4-13_latest.yaml
+@@ -39,10 +39,10 @@ topologies:
+ name: adroot_adchild_adtree_master_1client
+ cpu: 8
+ memory: 14466
+- adroot_adchild_adtree_master_2client: &adroot_adchild_adtree_master_2client
+- name: adroot_adchild_adtree_master_2client
+- cpu: 9
+- memory: 15000
++ adroot_adchild_master_2client: &adroot_adchild_master_2client
++ name: adroot_adchild_master_2client
++ cpu: 8
++ memory: 12644
+ ad_master_1repl_1client: &ad_master_1repl_1client
+ name: ad_master_1repl_1client
+ cpu: 6
+@@ -2285,7 +2285,7 @@ jobs:
+ test_suite: test_integration/test_trust_functional.py
+ template: *ci-ipa-4-13-latest
+ timeout: 14400
+- topology: *adroot_adchild_adtree_master_2client
++ topology: *adroot_adchild_master_2client
+
+ fedora-latest-ipa-4-13/test_hbac_functional:
+ requires: [fedora-latest-ipa-4-13/build]
+diff --git a/ipatests/prci_definitions/nightly_ipa-4-13_latest_selinux.yaml b/ipatests/prci_definitions/nightly_ipa-4-13_latest_selinux.yaml
+index ead933338..f9e406dbd 100644
+--- a/ipatests/prci_definitions/nightly_ipa-4-13_latest_selinux.yaml
++++ b/ipatests/prci_definitions/nightly_ipa-4-13_latest_selinux.yaml
+@@ -39,10 +39,10 @@ topologies:
+ name: adroot_adchild_adtree_master_1client
+ cpu: 8
+ memory: 14466
+- adroot_adchild_adtree_master_2client: &adroot_adchild_adtree_master_2client
+- name: adroot_adchild_adtree_master_2client
+- cpu: 9
+- memory: 15000
++ adroot_adchild_master_2client: &adroot_adchild_master_2client
++ name: adroot_adchild_master_2client
++ cpu: 8
++ memory: 12644
+ ad_master_1repl_1client: &ad_master_1repl_1client
+ name: ad_master_1repl_1client
+ cpu: 6
+@@ -2468,7 +2468,7 @@ jobs:
+ test_suite: test_integration/test_trust_functional.py
+ template: *ci-ipa-4-13-latest
+ timeout: 14400
+- topology: *adroot_adchild_adtree_master_2client
++ topology: *adroot_adchild_master_2client
+
+ fedora-latest-ipa-4-13/test_hbac_functional:
+ requires: [fedora-latest-ipa-4-13/build]
+--
+2.56.0
+
+
+From ade4a6bb8b85c5fddc11a1c5e3226a5f2de068ae Mon Sep 17 00:00:00 2001
+From: Florence Blanc-Renaud <flo@redhat.com>
+Date: Thu, 17 Sep 2026 16:03:16 +0200
+Subject: [PATCH 12/55] ipatests: remove trailing space in test_commands.py
+
+In order to fix lint checks
+
+Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
+Reviewed-By: Anuja More <amore@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+---
+ ipatests/test_integration/test_commands.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ipatests/test_integration/test_commands.py b/ipatests/test_integration/test_commands.py
+index 0ac7b2b18..094eb4883 100644
+--- a/ipatests/test_integration/test_commands.py
++++ b/ipatests/test_integration/test_commands.py
+@@ -1548,7 +1548,7 @@ class TestIPACommand(IntegrationTest):
+ test=lambda stdout: self.testuser in stdout,
+ timeout=120,
+ )
+-
++
+ # Use master clock: controller time can be ahead of the host and
+ # make journalctl --since miss sshd logs (codeberg #8432).
+ since = self.master.run_command(
+--
+2.56.0
+
+
+From 53cd83b270df6afdfaae4f8407e7b1f573a6c3db Mon Sep 17 00:00:00 2001
+From: Stanislav Levin <slev@altlinux.org>
+Date: Fri, 21 Aug 2026 18:25:03 +0300
+Subject: [PATCH 13/55] ipatests: add missing tests for i18n_messages endpoint
+
+- endpoint rejects a body that is not valid JSON
+- endpoint rejects a body over MAX_REQUEST_BODY_SIZE
+- endpoint accepts a valid Referer
+- endpoint rejects a bad Referer (200 + body's RefererError)
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10037
+Signed-off-by: Stanislav Levin <slev@altlinux.org>
+Reviewed-By: Sudhir Menon <sumenon@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+---
+ ipatests/test_ipaserver/test_i18n_messages.py | 25 +++++++++
+ ipatests/test_ipaserver/test_referer.py | 56 ++++++++++++++++---
+ 2 files changed, 73 insertions(+), 8 deletions(-)
+
+diff --git a/ipatests/test_ipaserver/test_i18n_messages.py b/ipatests/test_ipaserver/test_i18n_messages.py
+index 345e5ff49..844076dea 100644
+--- a/ipatests/test_ipaserver/test_i18n_messages.py
++++ b/ipatests/test_ipaserver/test_i18n_messages.py
+@@ -15,6 +15,7 @@ from ipatests.util import (assert_equal, assert_deepequal, raises,
+
+ from ipapython.version import API_VERSION
+ from ipaserver.plugins.internal import i18n_messages
++from ipaserver.rpcserver import MAX_REQUEST_BODY_SIZE
+
+
+ @pytest.mark.tier1
+@@ -81,6 +82,30 @@ class test_i18n_messages(XMLRPC_test, Unauthorized_HTTP_test):
+ assert_equal(response_data, b'Invalid RPC command')
+ raises(ValueError, json.loads, response_data)
+
++ def test_invalid_payload(self):
++ """
++ Test if end point rejects a body that is not valid JSON
++ """
++ response = self.send_request(params="{invalid_json")
++
++ assert_equal(response.status, 400)
++ assert_equal(response.reason, "Bad Request")
++
++ response_data = response.read()
++ raises(ValueError, json.loads, response_data)
++
++ def test_too_large_payload(self):
++ """
++ Test if end point rejects a body over MAX_REQUEST_BODY_SIZE
++ """
++ response = self.send_request(params="x" * (MAX_REQUEST_BODY_SIZE + 1))
++
++ assert_equal(response.status, 413)
++ assert_equal(response.reason, "Request Entity Too Large")
++
++ response_data = response.read()
++ raises(ValueError, json.loads, response_data)
++
+ def test_only_post_serves(self):
+ """
+ Test if end point fulfills only POST method
+diff --git a/ipatests/test_ipaserver/test_referer.py b/ipatests/test_ipaserver/test_referer.py
+index 15db4525b..8e46b37ac 100644
+--- a/ipatests/test_ipaserver/test_referer.py
++++ b/ipatests/test_ipaserver/test_referer.py
+@@ -14,6 +14,7 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
+
++import json
+ import os
+ import pytest
+ import uuid
+@@ -23,6 +24,7 @@ from ipatests.test_xmlrpc.xmlrpc_test import XMLRPC_test
+ from ipatests.util import assert_equal
+ from ipalib import api, errors
+ from ipapython.ipautil import run
++from ipapython.version import API_VERSION
+
+ testuser = u'tuser'
+ password = u'password'
+@@ -91,14 +93,6 @@ class test_referer(XMLRPC_test, Unauthorized_HTTP_test):
+ 'password': 'password'})
+ assert_equal(response.status, 200, self.app_uri)
+
+- def test_i18n_messages_valid(self):
+- # i18n_messages requires a valid JSON request and we send
+- # nothing. If we get a 400 error then it got past the
+- # referer check.
+- self.app_uri = "/ipa/i18n_messages"
+- response = self._request()
+- assert_equal(response.status, 400, self.app_uri)
+-
+ # /ipa/session/login_x509 is not tested yet as it requires
+ # significant additional setup.
+ # This can be manually verified by adding
+@@ -134,3 +128,49 @@ class test_referer(XMLRPC_test, Unauthorized_HTTP_test):
+ response = self._request(host="attacker.test")
+
+ assert_equal(response.status, 400, self.app_uri)
++
++ def test_i18n_messages_valid(self):
++ """Valid Referer: the request is served"""
++ self.app_uri = "/ipa/i18n_messages"
++ self.content_type = "application/json"
++ response = self._request(
++ params=json.dumps(
++ {
++ "method": "i18n_messages",
++ "params": [[], {"version": API_VERSION}],
++ },
++ ),
++ )
++
++ assert_equal(response.status, 200, self.app_uri)
++
++ # no errors
++ jsondata = json.loads(response.read())
++ assert_equal(jsondata["error"], None)
++ assert jsondata["result"] is not None
++
++ def test_i18n_messages_invalid(self):
++ """
++ Pass in a bad Referer, expect a RefererError.
++
++ This endpoint is served by WSGIExecutioner, which reports every
++ PublicError through the JSON-RPC envelope, so the HTTP status stays 200
++ and the rejection is in the body.
++ """
++ self.app_uri = "/ipa/i18n_messages"
++ self.content_type = "application/json"
++ response = self._request(
++ params=json.dumps(
++ {
++ "method": "i18n_messages",
++ "params": [[], {"version": API_VERSION}],
++ },
++ ),
++ host="attacker.test",
++ )
++
++ assert_equal(response.status, 200, self.app_uri)
++
++ jsondata = json.loads(response.read())
++ assert_equal(jsondata["error"]["code"], errors.RefererError.errno)
++ assert_equal(jsondata["result"], None)
+--
+2.56.0
+
+
+From 65f058a2c01d5c9707ef3cfdaa265a8a16492bf4 Mon Sep 17 00:00:00 2001
+From: Florence Blanc-Renaud <flo@redhat.com>
+Date: Mon, 21 Sep 2026 19:52:44 +0200
+Subject: [PATCH 14/55] Azure CI: force m2r2 version
+
+With the new version of m2r2, the azure pipeline Docs is failing.
+Force version < 1.0.0
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10068
+
+Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+---
+ doc/requirements.txt | 4 +++-
+ ipasphinx/setup.py | 4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/doc/requirements.txt b/doc/requirements.txt
+index 8d91b893f..f9d7236bf 100644
+--- a/doc/requirements.txt
++++ b/doc/requirements.txt
+@@ -6,7 +6,9 @@ sphinx-book-theme
+ # convert markdown to rest
+ # m2r2 fork is active in development and works with
+ # newer sphinx versions
+-m2r2
++# Do not use recent m2r2 version because of
++# https://codeberg.org/freeipa/freeipa/issues/10068
++m2r2 < 1.0.0
+
+ ## ipa dependencies
+ dnspython
+diff --git a/ipasphinx/setup.py b/ipasphinx/setup.py
+index e35ec33a2..41a01283f 100644
+--- a/ipasphinx/setup.py
++++ b/ipasphinx/setup.py
+@@ -16,5 +16,7 @@ if __name__ == "__main__":
+ doc=__doc__,
+ package_dir={"ipasphinx": ""},
+ packages=["ipasphinx"],
+- install_requires=["ipaserver", "ipalib", "sphinx > 3.0", "m2r2"],
++ install_requires=[
++ "ipaserver", "ipalib",
++ "sphinx > 3.0", "m2r2 < 1.0.0"],
+ )
+--
+2.56.0
+
+
+From 14a10ab60d434f33aa083701d24834fac86ec589 Mon Sep 17 00:00:00 2001
+From: Florence Blanc-Renaud <flo@redhat.com>
+Date: Tue, 22 Sep 2026 12:57:09 +0200
+Subject: [PATCH 15/55] ipatests: adapt the expected output of ipa
+ trustdomain-find
+
+PRCI now configures a DNS conditional forwarder between the AD root domain controller and AD tree domain controller.
+The direct consequence is that the command ipa trustdomain-find returns 3 domains:
+
+- AD root domain ad.test
+- AD child domain child.ad.test
+- AD tree domain (NEW) adtree.test
+
+Adapt the test expected output.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10069
+Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
+Reviewed-By: Anuja More <amore@redhat.com>
+---
+ ipatests/test_integration/test_ipahealthcheck.py | 12 ++++++++----
+ ipatests/test_integration/test_trust.py | 9 ++++++---
+ 2 files changed, 14 insertions(+), 7 deletions(-)
+
+diff --git a/ipatests/test_integration/test_ipahealthcheck.py b/ipatests/test_integration/test_ipahealthcheck.py
+index a9e791074..c43d1b294 100644
+--- a/ipatests/test_integration/test_ipahealthcheck.py
++++ b/ipatests/test_integration/test_ipahealthcheck.py
+@@ -1854,13 +1854,16 @@ class TestIpaHealthCheckWithADtrust(IntegrationTest):
+ self.master, "ipahealthcheck.ipa.trust", "IPATrustDomainsCheck"
+ )
+ assert returncode == 0
+- trust_domains = ', '.join((self.ad_domain, self.ad_subdomain,))
++ trust_domains = sorted(
++ (self.ad_domain, self.ad_subdomain, self.ad_treedomain))
+ for check in data:
+ if check["kw"]["key"] == "domain-list":
+ assert check["result"] == "SUCCESS"
++ sssd_domains = check["kw"]["sssd_domains"].split(", ")
++ domains = check["kw"]["trust_domains"].split(", ")
+ assert (
+- check["kw"]["sssd_domains"] == trust_domains
+- and check["kw"]["trust_domains"] == trust_domains
++ sorted(sssd_domains) == trust_domains
++ and sorted(domains) == trust_domains
+ )
+ elif check["kw"]["key"] == "domain-status":
+ assert check["result"] == "SUCCESS"
+@@ -1876,7 +1879,8 @@ class TestIpaHealthCheckWithADtrust(IntegrationTest):
+ self.master, "ipahealthcheck.ipa.trust", "IPATrustCatalogCheck"
+ )
+ assert returncode == 0
+- trust_domains = ', '.join((self.ad_domain, self.ad_subdomain,))
++ trust_domains = ', '.join(
++ (self.ad_domain, self.ad_subdomain, self.ad_treedomain))
+ for check in data:
+ if check["kw"]["key"] == "AD Global Catalog":
+ assert check["result"] == "SUCCESS"
+diff --git a/ipatests/test_integration/test_trust.py b/ipatests/test_integration/test_trust.py
+index 9e0f720c6..f84211c1c 100644
+--- a/ipatests/test_integration/test_trust.py
++++ b/ipatests/test_integration/test_trust.py
+@@ -375,7 +375,8 @@ class TestTrust(BaseTestTrust):
+
+ def test_trustdomains_found_in_nonposix_trust(self):
+ self.check_trustdomains(
+- self.ad_domain, [self.ad_domain, self.ad_subdomain])
++ self.ad_domain,
++ [self.ad_domain, self.ad_subdomain, self.ad_treedomain])
+
+ def test_range_properties_in_nonposix_trust(self):
+ self.check_range_properties(self.ad_domain, 'ipa-ad-trust', 200000)
+@@ -763,7 +764,8 @@ class TestTrust(BaseTestTrust):
+ def test_trustdomains_found_in_posix_trust(self):
+ """Tests that all trustdomains can be found."""
+ self.check_trustdomains(
+- self.ad_domain, [self.ad_domain, self.ad_subdomain])
++ self.ad_domain,
++ [self.ad_domain, self.ad_subdomain, self.ad_treedomain])
+
+ def test_range_properties_in_posix_trust(self):
+ """Check the properties of the created range"""
+@@ -1096,7 +1098,8 @@ class TestTrust(BaseTestTrust):
+ raiseonerr=False)
+ assert result.returncode == 1
+ self.check_trustdomains(
+- self.ad_domain, [self.ad_domain, self.ad_subdomain])
++ self.ad_domain,
++ [self.ad_domain, self.ad_subdomain, self.ad_treedomain])
+
+ @skip_in_fips_mode_due_to_issue_8715
+ def test_user_gid_uid_resolution_in_forest_trust_with_shared_secret(self):
+--
+2.56.0
+
+
+From e5da6501c58ce2438063734c34e18c0f2f52704d Mon Sep 17 00:00:00 2001
+From: Florence Blanc-Renaud <flo@redhat.com>
+Date: Tue, 22 Sep 2026 21:03:13 +0200
+Subject: [PATCH 16/55] ipatests: add xfail for
+ test_ipahealthcheck_trust_catalogcheck
+
+The test is calling
+ipa-healthcheck --source ipahealthcheck.ipa.trust --check IPATrustCatalogCheck
+and the command returns a WARNING when looking for sid-500 in the
+child and tree domains.
+
+Mark xfail for now
+
+Related: https://codeberg.org/freeipa/freeipa/issues/10069
+Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
+Reviewed-By: Anuja More <amore@redhat.com>
+---
+ ipatests/test_integration/test_ipahealthcheck.py | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/ipatests/test_integration/test_ipahealthcheck.py b/ipatests/test_integration/test_ipahealthcheck.py
+index c43d1b294..37c35696e 100644
+--- a/ipatests/test_integration/test_ipahealthcheck.py
++++ b/ipatests/test_integration/test_ipahealthcheck.py
+@@ -23,6 +23,7 @@ from ipapython.dn import DN
+ from ipapython.ipaldap import realm_to_serverid
+ from ipapython.certdb import NSS_SQL_FILES
+ from ipatests.pytest_ipa.integration import tasks
++from ipatests.util import xfail_context
+ from ipaplatform.paths import paths
+ from ipaplatform.osinfo import osinfo
+ from ipaserver.install.installutils import resolve_ip_addresses_nss
+@@ -1878,7 +1879,11 @@ class TestIpaHealthCheckWithADtrust(IntegrationTest):
+ returncode, data = run_healthcheck(
+ self.master, "ipahealthcheck.ipa.trust", "IPATrustCatalogCheck"
+ )
+- assert returncode == 0
++ with xfail_context(
++ True,
++ reason="https://codeberg.org/freeipa/freeipa/issues/10069"
++ ):
++ assert returncode == 0
+ trust_domains = ', '.join(
+ (self.ad_domain, self.ad_subdomain, self.ad_treedomain))
+ for check in data:
+--
+2.56.0
+
+
+From 59b6b7c4ae0307c37c6636a6e44ba5c2a8929571 Mon Sep 17 00:00:00 2001
+From: Alexander Bokovoy <abokovoy@redhat.com>
+Date: Fri, 3 Jul 2026 18:38:27 +0300
+Subject: [PATCH 17/55] CVE-2026-14612: ipa-otpd/oauth2: fix memory safety and
+ error handling bugs
+
+Fix several pre-existing bugs in the OAuth2 device code flow:
+
+- Use-after-free: otpd_queue_item_free() was called before the retry
+ check in oauth2_on_child_writable(). On EAGAIN, the freed saved_item
+ would be dereferenced on the next callback invocation.
+
+- CVE-2026-14612: buffer overflow: read() into a 10240-byte buffer could
+ return exactly 10240 bytes, causing buf[10240]='\0' to write past the
+ end. Use sizeof(buf)-1 instead.
+
+- Memory leaks: saved_item was leaked on strndup failure and on
+ child_ctx allocation failure. The done: label now cleans up
+ saved_item, pipe fds, and child_ctx on error paths.
+
+- NULL dereference: ipaidpSub was dereferenced without a NULL check in
+ check_access_token_reply().
+
+- verto_add_child() return was not checked for NULL, leading to a NULL
+ dereference on verto_set_private().
+
+- set_fd_nonblocking() return values were silently ignored; a failure
+ would leave pipes in blocking mode, hanging the daemon.
+
+- Off-by-one in memchr length calculation for second newline.
+
+- Avoid logging full oidc_child output (may contain tokens); log byte
+ count instead.
+
+- Fix error message for reader event (was copy-pasted as "writer").
+
+- Fix uninitialized loop variable in disabled debug block.
+
+Fixes: CVE-2026-14612
+Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
+Reviewed-By: Rafael Guterres Jeffman <rjeffman@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+Reviewed-By: Carla Martinez <carlmart@redhat.com>
+---
+ daemons/ipa-otpd/oauth2.c | 95 ++++++++++++++++++++++++++++++++-------
+ 1 file changed, 80 insertions(+), 15 deletions(-)
+
+diff --git a/daemons/ipa-otpd/oauth2.c b/daemons/ipa-otpd/oauth2.c
+index 0eb43b237..1fb07141a 100644
+--- a/daemons/ipa-otpd/oauth2.c
++++ b/daemons/ipa-otpd/oauth2.c
+@@ -31,7 +31,10 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <sys/random.h>
++#include <signal.h>
++#include <string.h>
+ #include <sys/uio.h>
++#include <sys/wait.h>
+
+ #include "internal.h"
+
+@@ -125,8 +128,6 @@ static void oauth2_on_child_writable(verto_ctx *vctx, verto_ev *ev)
+ idx++;
+ io = writev(verto_get_fd(ev), iov, idx);
+ }
+- otpd_queue_item_free(child_ctx->saved_item);
+-
+ if (io < 0) {
+ switch (errno) {
+ #if defined(EWOULDBLOCK) && (!defined(EAGAIN) || EAGAIN - EWOULDBLOCK != 0)
+@@ -146,6 +147,14 @@ static void oauth2_on_child_writable(verto_ctx *vctx, verto_ev *ev)
+ otpd_log_err(errno, "Failed to send to child");
+ }
+
++ if (child_ctx->item->idp.ipaidpClientSecret != NULL) {
++ explicit_bzero(child_ctx->item->idp.ipaidpClientSecret,
++ strlen(child_ctx->item->idp.ipaidpClientSecret));
++ }
++ if (child_ctx->saved_item != NULL) {
++ otpd_queue_item_free(child_ctx->saved_item);
++ child_ctx->saved_item = NULL;
++ }
+ verto_del(ev);
+ }
+
+@@ -173,6 +182,7 @@ static int handle_device_code_reply(struct child_ctx *child_ctx,
+
+ state_item->oauth2.device_code_reply = strdup(dc_reply);
+ if (state_item->oauth2.device_code_reply == NULL) {
++ ret = ENOMEM;
+ otpd_log_req(child_ctx->item->req, "Failed to copy device code reply.");
+ goto done;
+ }
+@@ -188,6 +198,7 @@ static int handle_device_code_reply(struct child_ctx *child_ctx,
+
+ state_item->oauth2.state.data = strdup(dc_reply);
+ if (state_item->oauth2.state.data == NULL) {
++ ret = ENOMEM;
+ otpd_log_req(child_ctx->item->req,
+ "Failed to copy device code reply to krad.");
+ goto done;
+@@ -242,6 +253,12 @@ static int check_access_token_reply(struct child_ctx *child_ctx,
+ {
+ int ret;
+
++ if (child_ctx->item->user.ipaidpSub == NULL) {
++ otpd_log_req(child_ctx->item->req,
++ "Missing ipaidpSub for access token verification");
++ return EPERM;
++ }
++
+ if (strlen(child_ctx->item->user.ipaidpSub) != len
+ || memcmp(child_ctx->item->user.ipaidpSub, buf, len) != 0) {
+ return EPERM;
+@@ -279,17 +296,22 @@ static void oauth2_on_child_readable(verto_ctx *vctx, verto_ev *ev)
+ child_ctx->item->rsp = NULL;
+ child_ctx->item->sent = 0;
+
+- io = read(verto_get_fd(ev), buf, 10240);
++ io = read(verto_get_fd(ev), buf, sizeof(buf) - 1);
+ if (io < 0) {
+ otpd_log_err(errno, "Failed to read from child");
+ goto done;
+ }
+
+- if (io >= 0) {
+- buf[io] = '\0';
+- otpd_log_req(child_ctx->item->req, "Received: [%s]", buf);
++ if (io == 0) {
++ otpd_log_req(child_ctx->item->req,
++ "oidc_child closed stdout without producing output");
++ verto_del(ev);
++ goto done;
+ }
+
++ buf[io] = '\0';
++ otpd_log_req(child_ctx->item->req, "Received: [%zu bytes]", (size_t)io);
++
+ verto_del(ev);
+
+ if (child_ctx->oauth2_state == OAUTH2_GET_DEVICE_CODE) {
+@@ -302,7 +324,7 @@ static void oauth2_on_child_readable(verto_ctx *vctx, verto_ev *ev)
+ if (rad_reply != NULL) {
+ *rad_reply = '\0';
+ rad_reply++;
+- end = memchr(rad_reply, '\n', io - (rad_reply - 1 - buf));
++ end = memchr(rad_reply, '\n', io - (rad_reply - buf));
+ if (end == NULL) {
+ otpd_log_req(child_ctx->item->req, "Missing second new-line.");
+ goto done;
+@@ -328,6 +350,7 @@ static void oauth2_on_child_readable(verto_ctx *vctx, verto_ev *ev)
+ }
+
+ done:
++ explicit_bzero(buf, sizeof(buf));
+ otpd_queue_push(&ctx.stdio.responses, child_ctx->item);
+ verto_set_flags(ctx.stdio.writer, VERTO_EV_FLAG_PERSIST |
+ VERTO_EV_FLAG_IO_ERROR |
+@@ -387,16 +410,20 @@ int oauth2(struct otpd_queue_item **item, enum oauth2_state oauth2_state)
+
+ saved_item = calloc(sizeof(struct otpd_queue_item), 1);
+ if (saved_item == NULL) {
+- otpd_log_req((*item)->req, "No matching saved state found");
+- return EINVAL;
++ otpd_log_req((*item)->req,
++ "Failed to allocate saved state item");
++ krb5_free_data_contents(NULL, &data_state);
++ return ENOMEM;
+ }
+ saved_item->oauth2.device_code_reply = strndup(data_state.data,
+ data_state.length);
++ krb5_free_data_contents(NULL, &data_state);
+ if (saved_item->oauth2.device_code_reply == NULL) {
+ otpd_log_req((*item)->req, "Failed to copy device code reply");
+- return EINVAL;
++ free(saved_item);
++ saved_item = NULL;
++ return ENOMEM;
+ }
+- krb5_free_data_contents(NULL, &data_state);
+ }
+
+ child_ctx = calloc(sizeof(struct child_ctx), 1);
+@@ -406,6 +433,7 @@ int oauth2(struct otpd_queue_item **item, enum oauth2_state oauth2_state)
+ }
+ child_ctx->item = (*item);
+ child_ctx->saved_item = saved_item;
++ saved_item = NULL; /* ownership transferred to child_ctx */
+ child_ctx->oauth2_state = oauth2_state;
+
+ otpd_log_req((*item)->req, "oauth2 start: %s",
+@@ -466,7 +494,7 @@ int oauth2(struct otpd_queue_item **item, enum oauth2_state oauth2_state)
+ }
+
+ #if 0
+- for (int i; args[i]; i++) {
++ for (int i = 0; args[i]; i++) {
+ otpd_log_req((*item)->req, "oidc_child exec: %s", args[i]);
+ }
+ #endif
+@@ -501,11 +529,21 @@ int oauth2(struct otpd_queue_item **item, enum oauth2_state oauth2_state)
+ exit(EXIT_FAILURE);
+ } else if (child_pid > 0) { /* parent */
+ close(pipefd_to_child[0]);
+- set_fd_nonblocking(pipefd_to_child[1]);
++ pipefd_to_child[0] = -1;
++ ret = set_fd_nonblocking(pipefd_to_child[1]);
++ if (ret != 0) {
++ otpd_log_err(ret, "Failed to set write pipe non-blocking");
++ goto done;
++ }
+ child_ctx->write_to_child = pipefd_to_child[1];
+
+ close(pipefd_from_child[1]);
+- set_fd_nonblocking(pipefd_from_child[0]);
++ pipefd_from_child[1] = -1;
++ ret = set_fd_nonblocking(pipefd_from_child[0]);
++ if (ret != 0) {
++ otpd_log_err(ret, "Failed to set read pipe non-blocking");
++ goto done;
++ }
+ child_ctx->read_from_child = pipefd_from_child[0];
+
+ child_ctx->write_ev = verto_add_io(ctx.vctx, VERTO_EV_FLAG_PERSIST |
+@@ -519,6 +557,8 @@ int oauth2(struct otpd_queue_item **item, enum oauth2_state oauth2_state)
+ otpd_log_err(ret, "Unable to initialize oauth2 writer event");
+ goto done;
+ }
++ /* verto owns the fd now (IO_CLOSE_FD) */
++ pipefd_to_child[1] = -1;
+ verto_set_private(child_ctx->write_ev, child_ctx, NULL);
+
+ child_ctx->read_ev = verto_add_io(ctx.vctx, VERTO_EV_FLAG_PERSIST |
+@@ -529,14 +569,29 @@ int oauth2(struct otpd_queue_item **item, enum oauth2_state oauth2_state)
+ child_ctx->read_from_child);
+ if (child_ctx->read_ev == NULL) {
+ ret = ENOMEM;
+- otpd_log_err(ret, "Unable to initialize oauth2 writer event");
++ otpd_log_err(ret, "Unable to initialize oauth2 reader event");
++ verto_del(child_ctx->write_ev);
++ child_ctx->write_ev = NULL;
+ goto done;
+ }
++ /* verto owns the fd now (IO_CLOSE_FD) */
++ pipefd_from_child[0] = -1;
+ verto_set_private(child_ctx->read_ev, child_ctx, NULL);
+
+ child_ctx->child_ev = verto_add_child(ctx.vctx, VERTO_EV_FLAG_NONE,
+ oauth2_on_child_exit, child_pid);
++ if (child_ctx->child_ev == NULL) {
++ ret = ENOMEM;
++ otpd_log_err(ret, "Unable to initialize oauth2 child event");
++ verto_del(child_ctx->read_ev);
++ verto_del(child_ctx->write_ev);
++ kill(child_pid, SIGKILL);
++ waitpid(child_pid, NULL, 0);
++ goto done;
++ }
+ verto_set_private(child_ctx->child_ev, child_ctx, free_child_ctx);
++ /* child_ctx is now owned by verto via free_child_ctx */
++ child_ctx = NULL;
+
+ } else { /* error */
+ ret = errno;
+@@ -548,6 +603,16 @@ int oauth2(struct otpd_queue_item **item, enum oauth2_state oauth2_state)
+ done:
+ if (ret == 0) {
+ *item = NULL;
++ } else {
++ if (saved_item != NULL) {
++ free(saved_item->oauth2.device_code_reply);
++ free(saved_item);
++ }
++ if (pipefd_to_child[0] >= 0) close(pipefd_to_child[0]);
++ if (pipefd_to_child[1] >= 0) close(pipefd_to_child[1]);
++ if (pipefd_from_child[0] >= 0) close(pipefd_from_child[0]);
++ if (pipefd_from_child[1] >= 0) close(pipefd_from_child[1]);
++ free(child_ctx);
+ }
+
+ return ret;
+--
+2.56.0
+
+
+From d4b7685b0da54f568e33f89a0ef201d77d516e4c Mon Sep 17 00:00:00 2001
+From: David Hanina <dhanina@redhat.com>
+Date: Wed, 16 Sep 2026 14:01:57 +0200
+Subject: [PATCH 18/55] webui: remove redirect from password reset page
+
+Remove the ability to redirect to an arbitrary URL after a successful
+password reset. This drops the automatic delayed redirect countdown,
+the manual "Continue to next page" link, and the associated i18n
+strings and Web UI tests.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10063
+Assisted-by: Cursor <cursoragent@cursor.com>
+Signed-off-by: David Hanina <dhanina@redhat.com>
+Reviewed-By: Anuja More <amore@redhat.com>
+---
+ install/ui/src/freeipa/widgets/LoginScreen.js | 78 -------------------
+ ipaserver/plugins/internal.py | 2 -
+ ipatests/test_webui/test_loginscreen.py | 67 +---------------
+ 3 files changed, 3 insertions(+), 144 deletions(-)
+
+diff --git a/install/ui/src/freeipa/widgets/LoginScreen.js b/install/ui/src/freeipa/widgets/LoginScreen.js
+index 6d236927f..585362e4a 100644
+--- a/install/ui/src/freeipa/widgets/LoginScreen.js
++++ b/install/ui/src/freeipa/widgets/LoginScreen.js
+@@ -70,8 +70,6 @@ define(['dojo/_base/declare',
+ "<strong>certificate</strong>, please make sure you have valid " +
+ "personal certificate. ",
+
+- continue_msg: "Continue to next page",
+-
+ form_auth_failed: "Login failed due to an unknown reason",
+
+ krb_auth_failed: "Authentication with Kerberos failed",
+@@ -83,8 +81,6 @@ define(['dojo/_base/declare',
+
+ password_change_complete: "Password change complete",
+
+- redirect_msg: "You will be redirected in ${count}s",
+-
+ krbprincipal_expired: "Kerberos Principal you entered is expired",
+
+ invalid_password: "The password or username you entered is incorrect",
+@@ -301,69 +297,6 @@ define(['dojo/_base/declare',
+ }.bind(this));
+ },
+
+- parse_uri: function() {
+- var opts = {};
+- if (window.location.search.length > 1) {
+- var couples = window.location.search.substr(1).split("&");
+- for (var i=0,l=couples.length; i < l; i++) {
+- var couple = couples[i].split("=");
+- var key = decodeURIComponent(couple[0]);
+- var value = couple.length > 1 ? decodeURIComponent(couple[1]) : '';
+- opts[key] = value;
+- }
+- }
+- return opts;
+- },
+-
+- redir_count_down: function(redir_url, redir_delay) {
+- var val_summary = this.get_widget('validation');
+- val_summary.add_info('redirect',
+- this.redirect_msg.replace('${count}', Math.max(redir_delay, 0)));
+-
+- if (redir_delay <= 0) {
+- window.location = redir_url;
+- return;
+- }
+- window.setTimeout(this.redir_count_down.bind(this), 1000,
+- redir_url, redir_delay-1);
+- },
+-
+- /* If password reset was initiated due to a failed log in to some
+- * external application one could use a redirection to the desired URL
+- * after a successfull password reset.
+- *
+- * The next uri components are supported:
+- * - 'url' destination URL, which must be URI encoded
+- * - 'delay' time in seconds to delay before redirection
+- *
+- * For example,
+- * https://ipa.demo1.freeipa.org/ipa/ui/reset_password.html?url=http%3A%2F%2Fpvoborni.fedorapeople.org%2Fdoc%2F%23!%2Fguide%2FDebugging&delay=5
+- */
+- redirect: function() {
+- var opts = this.parse_uri();
+- var url = opts['url'];
+- var delay = parseInt(opts['delay'], 10);
+-
+- var val_summary = this.get_widget('validation');
+- // button for manual redirection
+- if (url) {
+- val_summary.add_success(
+- 'login',
+- "".concat(
+- this.password_change_complete,
+- ' <a href="', url, '">',
+- this.continue_msg, '</a>'
+- )
+- );
+- } else {
+- return;
+- }
+-
+- if (delay <= 0 || delay > 0) { // NaN check
+- this.redir_count_down(url, delay);
+- }
+- },
+-
+ reset_password: function() {
+
+ var psw_f = this.get_field('password');
+@@ -434,7 +367,6 @@ define(['dojo/_base/declare',
+ new_f.set_value('');
+ ver_f.set_value('');
+ val_summary.add_success('login', this.password_change_complete);
+- this.redirect();
+ } else {
+ val_summary.add_error('login', result.message);
+ }
+@@ -582,16 +514,6 @@ define(['dojo/_base/declare',
+ this.cert_msg
+ );
+
+- this.redirect_msg = text.get(
+- spec.redirect_msg || '@i18n:login.redirect_msg',
+- this.redirect_msg
+- );
+-
+- this.continue_msg = text.get(
+- spec.continue_msg || '@i18n:login.continue_msg',
+- this.continue_msg
+- );
+-
+ this.kerberos_msg = this.kerberos_msg
+ .replace('${protocol}', window.location.protocol)
+ .replace('${host}', window.location.hostname);
+diff --git a/ipaserver/plugins/internal.py b/ipaserver/plugins/internal.py
+index c26cf6d1d..4e1de05cc 100644
+--- a/ipaserver/plugins/internal.py
++++ b/ipaserver/plugins/internal.py
+@@ -388,7 +388,6 @@ class i18n_messages(Command):
+ "<strong>certificate</strong>, please make sure you have "
+ "valid personal certificate. "
+ ),
+- "continue_msg": _("Continue to next page"),
+ "form_auth": _(
+ "<i class=\"fa fa-info-circle\"></i> To log in with "
+ "<strong>username and password</strong>, enter them in the "
+@@ -417,7 +416,6 @@ class i18n_messages(Command):
+ "try it out!</a>"),
+ "password": _("Password"),
+ "password_and_otp": _("Password or Password+One-Time Password"),
+- "redirect_msg": _("You will be redirected in ${count}s"),
+ "sync_otp_token": _("Sync OTP Token"),
+ "synchronizing": _("Synchronizing"),
+ "username": _("Username"),
+diff --git a/ipatests/test_webui/test_loginscreen.py b/ipatests/test_webui/test_loginscreen.py
+index 5b3e419cb..58c522298 100644
+--- a/ipatests/test_webui/test_loginscreen.py
++++ b/ipatests/test_webui/test_loginscreen.py
+@@ -5,8 +5,6 @@
+ """
+ Test LoginScreen widget and all it's views
+ """
+-import urllib
+-
+ from ipatests.test_webui.ui_driver import UI_driver
+ from ipatests.test_webui.ui_driver import screenshot
+ import ipatests.test_webui.data_loginscreen as loginscreen
+@@ -60,8 +58,7 @@ class TestLoginScreen(UI_driver):
+ self.add_record(loginscreen.ENTITY, loginscreen.DATA_ITEST_USER,
+ navigate=False)
+
+- def assert_notification(self, type='success', assert_text=None,
+- link_text=None, link_url=None):
++ def assert_notification(self, type='success', assert_text=None):
+ """
+ Assert whether we have a notification of particular type
+ """
+@@ -87,13 +84,6 @@ class TestLoginScreen(UI_driver):
+ )
+ assert assert_text in is_present.text
+
+- if link_text and link_url:
+- link = self.find_xelement(".//a", is_present)
+- # Text on link placed on validation widget
+- assert link_text == link.text
+- # URL of link placed on validation widget
+- assert link_url == link.get_attribute('href')
+-
+ def find_xelement(self, expression, parent, strict=True):
+ """
+ Find element by xpath related to a given parent
+@@ -153,7 +143,7 @@ class TestLoginScreen(UI_driver):
+ assert self.logged_in()
+
+ def reset_password(self, username=None, current_password=None,
+- new_password=None, link_text=None, link_url=None):
++ new_password=None):
+ """
+ Reset password with the given one
+ """
+@@ -171,8 +161,7 @@ class TestLoginScreen(UI_driver):
+ new_pass_field.send_keys(new_password)
+ verify_pass_field.send_keys(new_password)
+ verify_pass_field.send_keys(Keys.RETURN)
+- self.assert_notification(assert_text='Password change complete',
+- link_text=link_text, link_url=link_url)
++ self.assert_notification(assert_text='Password change complete')
+
+ def get_data_from_form_row(self, form_row):
+ """
+@@ -321,56 +310,6 @@ class TestLoginScreen(UI_driver):
+ self.reset_password(username, current_password, new_password)
+ self.relogin_with_new_password()
+
+- @screenshot
+- def test_reset_password_view_with_redirect(self):
+-
+- redir_url = self.get_base_url().lower()
+- encoded_redir_url = urllib.parse.urlencode({'url': redir_url})
+- target_url = '/'.join((self.get_base_url(), 'reset_password.html?{}'))
+- self.load_url(target_url.format(encoded_redir_url))
+- assert self.login_screen_visible()
+-
+- self.check_elements_of_form(loginscreen.RESET_PASSWORD_FORM)
+- self.check_alerts(loginscreen.RESET_PASSWORD_FORM)
+-
+- username = loginscreen.PKEY
+- current_password = loginscreen.PASSWD_ITEST_USER
+- new_password = loginscreen.PASSWD_ITEST_USER_NEW
+- self.reset_password(username, current_password, new_password,
+- link_text='Continue to next page',
+- link_url=redir_url,
+- )
+- self.relogin_with_new_password()
+-
+- @screenshot
+- def test_reset_password_view_with_delayed_redirect(self):
+-
+- redir_url = self.get_base_url().lower() + '/'
+- encoded_redir_url = urllib.parse.urlencode(
+- {'url': redir_url, 'delay': 5}
+- )
+- target_url = '/'.join((self.get_base_url(), 'reset_password.html?{}'))
+- self.load_url(target_url.format(encoded_redir_url))
+- assert self.login_screen_visible()
+-
+- self.check_elements_of_form(loginscreen.RESET_PASSWORD_FORM)
+- self.check_alerts(loginscreen.RESET_PASSWORD_FORM)
+- username = loginscreen.PKEY
+- current_password = loginscreen.PASSWD_ITEST_USER
+- new_password = loginscreen.PASSWD_ITEST_USER_NEW
+- self.reset_password(username, current_password, new_password,
+- link_text='Continue to next page',
+- link_url=redir_url,
+- )
+- self.assert_notification(type='info',
+- assert_text='You will be redirected in ')
+- self.wait(3)
+- # check url after start delay timer, but before end
+- assert self.driver.current_url != redir_url
+- self.wait(5)
+- assert self.driver.current_url == redir_url
+- self.relogin_with_new_password()
+-
+ @screenshot
+ def test_reset_password_and_login_view(self):
+
+--
+2.56.0
+
+
+From 7108c91602d85d0544a7706d93b0508e366144c1 Mon Sep 17 00:00:00 2001
+From: PRANAV THUBE <pthube@redhat.com>
+Date: Tue, 22 Sep 2026 18:03:05 +0530
+Subject: [PATCH 19/55] ipatests: skip test_external_ca_with_too_small_key in
+ FIPS mode
+
+In FIPS mode, OpenSSL enforces a minimum RSA key size of 2048 bits
+at the crypto layer. The test attempts to create a root CA certificate
+with a 1024-bit RSA key, which causes OpenSSL to raise
+"ValueError: Unable to sign/verify with this key" before IPA ever
+gets to validate the certificate.
+
+Since FIPS already guarantees rejection of sub-2048-bit RSA keys,
+the security property this test validates is inherently enforced
+by the environment. Skipping the test in FIPS mode.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/9987
+Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
+Reviewed-By: Anuja More <amore@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+Reviewed-By: PRANAV THUBE <pthube@redhat.com>
+---
+ ipatests/test_integration/test_external_ca.py | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/ipatests/test_integration/test_external_ca.py b/ipatests/test_integration/test_external_ca.py
+index 2241e8fb8..1127e3fcc 100644
+--- a/ipatests/test_integration/test_external_ca.py
++++ b/ipatests/test_integration/test_external_ca.py
+@@ -26,7 +26,7 @@ from cryptography.hazmat.backends import default_backend
+ from cryptography.x509.oid import ObjectIdentifier, NameOID
+ from cryptography.hazmat.primitives import hashes, serialization
+
+-from ipatests.pytest_ipa.integration import tasks
++from ipatests.pytest_ipa.integration import tasks, skip_if_fips
+ from ipatests.test_integration.base import IntegrationTest
+ from ipalib import x509 as ipa_x509
+ from ipaplatform.paths import paths
+@@ -679,6 +679,13 @@ class TestExternalCAInvalidCert(IntegrationTest):
+ result = self.master.run_command(cmd, raiseonerr=False)
+ assert result.returncode == 1
+
++ @skip_if_fips(
++ reason='FIPS mode enforces minimum 2048-bit RSA keys at the '
++ 'OpenSSL layer, preventing creation of 1024-bit test '
++ 'certificates. The security property this test validates '
++ '(rejection of too-small CA keys) is already guaranteed '
++ 'by FIPS itself.'
++ )
+ def test_external_ca_with_too_small_key(self):
+ # reuse the existing deployment and renewal CSR
+ root_ca_fname, ipa_ca_fname = tasks.sign_ca_and_transport(
+--
+2.56.0
+
+
+From 95c32f3f8e3804e41d62fa36825eec78707aa292 Mon Sep 17 00:00:00 2001
+From: Florence Blanc-Renaud <flo@redhat.com>
+Date: Fri, 25 Sep 2026 17:58:27 +0200
+Subject: [PATCH 20/55] Spec file: bump samba version
+
+Require the following versions:
+fedora 43: 4.23.12
+fedora 44: 4.24.7
+fedora 45+: 4.25.0
+
+Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+---
+ freeipa.spec.in | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/freeipa.spec.in b/freeipa.spec.in
+index 0bf8e0c1a..6f46c579c 100644
+--- a/freeipa.spec.in
++++ b/freeipa.spec.in
+@@ -104,9 +104,11 @@
+ # Require 4.7.0 which brings Python 3 bindings
+ # Require 4.12 which has DsRGetForestTrustInformation access rights fixes
+ %if 0%{?fedora} < 44
+-%global samba_version 2:4.23.11
++%global samba_version 2:4.23.12
++%elif 0%{?fedora} < 45
++%global samba_version 2:4.24.7
+ %else
+-%global samba_version 2:4.24.5
++%global samba_version 2:4.25.0
+ %endif
+
+ # 3.14.5-45 or later includes a number of interfaces fixes for IPA interface
+--
+2.56.0
+
+
+From 22edf28d5e5512469f40334ed687eaa611ba96fe Mon Sep 17 00:00:00 2001
+From: Florence Blanc-Renaud <flo@redhat.com>
+Date: Mon, 28 Sep 2026 11:30:25 +0200
+Subject: [PATCH 21/55] ipatests: remove userspace fake FIPS mode
+
+The steps required for creating a userspace fake FIPS mode
+do not work with fedora 45+. Simply remove them as FIPS mode
+is tested downstream with a real FIPS configuration.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10055
+Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+---
+ ipatests/pytest_ipa/integration/config.py | 2 -
+ ipatests/pytest_ipa/integration/env_config.py | 2 -
+ ipatests/pytest_ipa/integration/fips.py | 44 ------
+ ipatests/pytest_ipa/integration/host.py | 40 +-----
+ ipatests/test_integration/base.py | 20 ---
+ ipatests/test_integration/test_fips.py | 130 ------------------
+ ipatests/test_integration/test_testconfig.py | 2 -
+ 7 files changed, 1 insertion(+), 239 deletions(-)
+ delete mode 100644 ipatests/test_integration/test_fips.py
+
+diff --git a/ipatests/pytest_ipa/integration/config.py b/ipatests/pytest_ipa/integration/config.py
+index 33ac8a47f..3cd3ddd10 100644
+--- a/ipatests/pytest_ipa/integration/config.py
++++ b/ipatests/pytest_ipa/integration/config.py
+@@ -43,7 +43,6 @@ class Config(pytest_multihost.config.Config):
+ 'dns_forwarder',
+ 'domain_level',
+ 'log_journal_since',
+- 'fips_mode',
+ 'token_name',
+ 'token_password',
+ 'token_library',
+@@ -76,7 +75,6 @@ class Config(pytest_multihost.config.Config):
+ self.log_journal_since = kwargs.get('log_journal_since') or '-1h'
+ if self.domain_level is None:
+ self.domain_level = MAX_DOMAIN_LEVEL
+- self.fips_mode = kwargs.get('fips_mode', False)
+ self.token_name = kwargs.get('token_name', None)
+ self.token_password = kwargs.get('token_password', None)
+ self.token_library = kwargs.get('token_library', None)
+diff --git a/ipatests/pytest_ipa/integration/env_config.py b/ipatests/pytest_ipa/integration/env_config.py
+index efbfbf054..19f0a2af9 100644
+--- a/ipatests/pytest_ipa/integration/env_config.py
++++ b/ipatests/pytest_ipa/integration/env_config.py
+@@ -63,8 +63,6 @@ _setting_infos = (
+ _SettingInfo('domain_level', 'DOMAINLVL', MAX_DOMAIN_LEVEL),
+
+ _SettingInfo('log_journal_since', 'LOG_JOURNAL_SINCE', '-1h'),
+- # userspace FIPS mode
+- _SettingInfo('fips_mode', 'IPA_FIPS_MODE', False),
+ )
+
+
+diff --git a/ipatests/pytest_ipa/integration/fips.py b/ipatests/pytest_ipa/integration/fips.py
+index 2ea9f4c79..a1464b9e6 100644
+--- a/ipatests/pytest_ipa/integration/fips.py
++++ b/ipatests/pytest_ipa/integration/fips.py
+@@ -9,13 +9,8 @@ Userspace FIPS mode fakes a Kernel in FIPS enforcing mode. User space
+ programs behave like the Kernel was booted in FIPS enforcing mode. Kernel
+ space code still runs in standard mode.
+ """
+-import os
+ from ipaplatform.paths import paths
+
+-FIPS_OVERLAY_DIR = "/var/tmp/userspace-fips"
+-FIPS_OVERLAY = os.path.join(FIPS_OVERLAY_DIR, "fips_enabled")
+-SYSTEM_FIPS = "/etc/system-fips"
+-
+
+ def is_fips_enabled(host):
+ """Check if host has """
+@@ -31,45 +26,6 @@ def is_fips_enabled(host):
+ raise RuntimeError(result.stderr_text)
+
+
+-def enable_userspace_fips(host):
+- # create /etc/system-fips
+- host.put_file_contents(SYSTEM_FIPS, "# userspace fips\n")
+- # fake Kernel FIPS mode with bind mount
+- host.run_command(["mkdir", "-p", FIPS_OVERLAY_DIR])
+- host.put_file_contents(FIPS_OVERLAY, "1\n")
+- host.run_command(
+- ["chcon", "-t", "sysctl_crypto_t", "-u", "system_u", FIPS_OVERLAY]
+- )
+- host.run_command(
+- ["mount", "--bind", FIPS_OVERLAY, paths.PROC_FIPS_ENABLED]
+- )
+- # set crypto policy to FIPS mode
+- host.run_command(["update-crypto-policies", "--show"])
+- host.run_command(["update-crypto-policies", "--set", "FIPS"])
+- # sanity check
+- assert is_fips_enabled(host)
+- result = host.run_command(
+- ["openssl", "md5", "/dev/null"], raiseonerr=False
+- )
+- assert result.returncode == 1
+- assert "Error setting digest" in result.stderr_text
+-
+-
+-def disable_userspace_fips(host):
+- host.run_command(["rm", "-f", SYSTEM_FIPS])
+- host.run_command(["update-crypto-policies", "--set", "DEFAULT"])
+- result = host.run_command(
+- ["umount", paths.PROC_FIPS_ENABLED], raiseonerr=False
+- )
+- host.run_command(["rm", "-rf", FIPS_OVERLAY_DIR])
+- if result.returncode != 0:
+- raise RuntimeError(result.stderr_text)
+-
+- # sanity check
+- assert not is_fips_enabled(host)
+- host.run_command(["openssl", "md5", "/dev/null"])
+-
+-
+ def enable_crypto_subpolicy(host, subpolicy):
+ result = host.run_command(["update-crypto-policies", "--show"])
+ policy = result.stdout_text.strip() + ":" + subpolicy
+diff --git a/ipatests/pytest_ipa/integration/host.py b/ipatests/pytest_ipa/integration/host.py
+index a9758e7dc..f38c0006b 100644
+--- a/ipatests/pytest_ipa/integration/host.py
++++ b/ipatests/pytest_ipa/integration/host.py
+@@ -28,9 +28,7 @@ import pytest_multihost.host
+ from ipaplatform.paths import paths
+ from ipapython import ipaldap
+
+-from .fips import (
+- is_fips_enabled, enable_userspace_fips, disable_userspace_fips
+-)
++from .fips import is_fips_enabled
+ from .transport import IPAOpenSSHTransport
+ from .resolver import resolver
+
+@@ -89,42 +87,6 @@ class Host(pytest_multihost.host.Host):
+ self._fips_mode = is_fips_enabled(self)
+ return self._fips_mode
+
+- @property
+- def is_userspace_fips(self):
+- """Check if host uses fake userspace FIPS
+- """
+- return self._userspace_fips
+-
+- def enable_userspace_fips(self):
+- """Enable fake userspace FIPS mode
+-
+- The call has no effect if the system is already in FIPS mode.
+-
+- :return: True if system was modified, else None
+- """
+- if not self.is_fips_mode:
+- enable_userspace_fips(self)
+- self._fips_mode = True
+- self._userspace_fips = True
+- return True
+- else:
+- return False
+-
+- def disable_userspace_fips(self):
+- """Disable fake userspace FIPS mode
+-
+- The call has no effect if userspace FIPS mode is not enabled.
+-
+- :return: True if system was modified, else None
+- """
+- if self.is_userspace_fips:
+- disable_userspace_fips(self)
+- self._userspace_fips = False
+- self._fips_mode = False
+- return True
+- else:
+- return False
+-
+ @staticmethod
+ def _make_host(domain, hostname, role, ip, external_hostname):
+ # We need to determine the type of the host, this depends on the domain
+diff --git a/ipatests/test_integration/base.py b/ipatests/test_integration/base.py
+index cb34067d4..9681cce09 100644
+--- a/ipatests/test_integration/base.py
++++ b/ipatests/test_integration/base.py
+@@ -39,7 +39,6 @@ class IntegrationTest:
+ required_extra_roles = []
+ topology = None
+ domain_level = None
+- fips_mode = None
+ random_serial = False
+ token_password = None
+
+@@ -61,18 +60,6 @@ class IntegrationTest:
+ def get_domains(cls):
+ return [cls.domain] + cls.ad_domains
+
+- @classmethod
+- def enable_fips_mode(cls):
+- for host in cls.get_all_hosts():
+- if not host.is_fips_mode:
+- host.enable_userspace_fips()
+-
+- @classmethod
+- def disable_fips_mode(cls):
+- for host in cls.get_all_hosts():
+- if host.is_userspace_fips:
+- host.disable_userspace_fips()
+-
+ @classmethod
+ def install(cls, mh):
+ extra_args = []
+@@ -81,11 +68,6 @@ class IntegrationTest:
+ else:
+ domain_level = cls.master.config.domain_level
+
+- if cls.master.config.fips_mode:
+- cls.fips_mode = True
+- if cls.fips_mode:
+- cls.enable_fips_mode()
+-
+ if cls.topology is None:
+ return
+ else:
+@@ -112,8 +94,6 @@ class IntegrationTest:
+ tasks.uninstall_master(cls.master)
+ for client in cls.clients:
+ tasks.uninstall_client(client)
+- if cls.fips_mode:
+- cls.disable_fips_mode()
+
+
+ @ordered
+diff --git a/ipatests/test_integration/test_fips.py b/ipatests/test_integration/test_fips.py
+deleted file mode 100644
+index 4c8e5465a..000000000
+--- a/ipatests/test_integration/test_fips.py
++++ /dev/null
+@@ -1,130 +0,0 @@
+-#
+-# Copyright (C) 2019 FreeIPA Contributors see COPYING for license
+-#
+-"""Smoke tests for FreeIPA installation in (fake) userspace FIPS mode
+-"""
+-import pytest
+-
+-from ipapython.dn import DN
+-from ipapython.ipautil import ipa_generate_password, realm_to_suffix
+-
+-from ipatests.pytest_ipa.integration import tasks
+-from ipatests.pytest_ipa.integration import fips
+-from ipatests.test_integration.base import IntegrationTest
+-
+-from .test_dnssec import (
+- test_zone,
+- dnssec_install_master,
+- dnszone_add_dnssec,
+- wait_until_record_is_signed,
+-)
+-
+-
+-def check_version(host):
+- if tasks.get_pki_version(host) < tasks.parse_version('11.6.0'):
+- raise pytest.skip("PKI replica FIPS support is not available, "
+- "https://github.com/dogtagpki/pki/issues/4847")
+-
+-
+-class TestInstallFIPS(IntegrationTest):
+- num_replicas = 1
+- num_clients = 1
+- fips_mode = True
+-
+- @classmethod
+- def install(cls, mh):
+- check_version(cls.replicas[0])
+- super(TestInstallFIPS, cls).install(mh)
+- # sanity check
+- for host in cls.get_all_hosts():
+- assert host.is_fips_mode
+- assert fips.is_fips_enabled(host)
+- # master with CA, KRA, DNS+DNSSEC
+- tasks.install_master(cls.master, setup_dns=True, setup_kra=True)
+- # replica with CA, KRA, DNS
+- tasks.install_replica(
+- cls.master,
+- cls.replicas[0],
+- setup_dns=True,
+- setup_ca=True,
+- setup_kra=True,
+- )
+- tasks.install_clients([cls.master] + cls.replicas, cls.clients)
+-
+- @classmethod
+- def uninstall(cls, mh):
+- check_version(cls.replicas[0])
+- super(TestInstallFIPS, cls).uninstall(mh)
+-
+- def test_basic(self):
+- client = self.clients[0]
+- tasks.kinit_admin(client)
+- client.run_command(["ipa", "ping"])
+-
+- @pytest.mark.xfail(reason='freeipa ticket 9785', strict=True)
+- def test_dnssec(self):
+- dnssec_install_master(self.master)
+- # DNSSEC zone
+- dnszone_add_dnssec(self.master, test_zone)
+- assert wait_until_record_is_signed(
+- self.master.ip, test_zone, timeout=100
+- ), ("Zone %s is not signed (master)" % test_zone)
+-
+- # test replica
+- assert wait_until_record_is_signed(
+- self.replicas[0].ip, test_zone, timeout=200
+- ), ("DNS zone %s is not signed (replica)" % test_zone)
+-
+- def test_vault_basic(self):
+- vault_name = "testvault"
+- vault_password = ipa_generate_password()
+- vault_data = "SSBsb3ZlIENJIHRlc3RzCg=="
+- # create vault
+- self.master.run_command(
+- [
+- "ipa",
+- "vault-add",
+- vault_name,
+- "--password",
+- vault_password,
+- "--type",
+- "symmetric",
+- ]
+- )
+-
+- # archive secret
+- self.master.run_command(
+- [
+- "ipa",
+- "vault-archive",
+- vault_name,
+- "--password",
+- vault_password,
+- "--data",
+- vault_data,
+- ]
+- )
+- self.master.run_command(
+- [
+- "ipa",
+- "vault-retrieve",
+- vault_name,
+- "--password",
+- vault_password,
+- ]
+- )
+-
+- def test_krb_enctypes(self):
+- realm = self.master.domain.realm
+- suffix = realm_to_suffix(realm)
+- dn = DN(("cn", realm), ("cn", "kerberos")) + suffix
+- args = ["krbSupportedEncSaltTypes", "krbDefaultEncSaltTypes"]
+- for host in [self.master] + self.replicas:
+- result = tasks.ldapsearch_dm(host, str(dn), args, scope="base")
+- assert "camellia" not in result.stdout_text
+- assert "aes256-cts" in result.stdout_text
+- assert "aes128-cts" in result.stdout_text
+- # test that update does not add camellia
+- self.master.run_command(["ipa-server-upgrade"])
+- result = tasks.ldapsearch_dm(self.master, str(dn), args, scope="base")
+- assert "camellia" not in result.stdout_text
+diff --git a/ipatests/test_integration/test_testconfig.py b/ipatests/test_integration/test_testconfig.py
+index defbf00ec..fae8b694b 100644
+--- a/ipatests/test_integration/test_testconfig.py
++++ b/ipatests/test_integration/test_testconfig.py
+@@ -46,7 +46,6 @@ DEFAULT_OUTPUT_DICT = {
+ "admin_password": "Secret123",
+ "domain_level": MAX_DOMAIN_LEVEL,
+ "log_journal_since": "-1h",
+- "fips_mode": False,
+ "token_name": None,
+ "token_password": None,
+ "token_library": None,
+@@ -74,7 +73,6 @@ DEFAULT_OUTPUT_ENV = {
+ "IPADEBUG": "",
+ "DOMAINLVL": str(MAX_DOMAIN_LEVEL),
+ "LOG_JOURNAL_SINCE": "-1h",
+- "IPA_FIPS_MODE": "",
+ }
+
+ DEFAULT_INPUT_ENV = {
+--
+2.56.0
+
+
+From c1030c9bd86f592d991fb71e5997936b535ba899 Mon Sep 17 00:00:00 2001
+From: Florence Blanc-Renaud <flo@redhat.com>
+Date: Wed, 30 Sep 2026 11:07:17 +0200
+Subject: [PATCH 22/55] Nightly definitions: remove test_fips.py
+
+Related: https://codeberg.org/freeipa/freeipa/issues/10055
+Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+---
+ .../prci_definitions/nightly_ipa-4-13_latest.yaml | 12 ------------
+ .../nightly_ipa-4-13_latest_selinux.yaml | 13 -------------
+ 2 files changed, 25 deletions(-)
+
+diff --git a/ipatests/prci_definitions/nightly_ipa-4-13_latest.yaml b/ipatests/prci_definitions/nightly_ipa-4-13_latest.yaml
+index 10c6ed100..db5c1896e 100644
+--- a/ipatests/prci_definitions/nightly_ipa-4-13_latest.yaml
++++ b/ipatests/prci_definitions/nightly_ipa-4-13_latest.yaml
+@@ -189,18 +189,6 @@ jobs:
+ timeout: 7200
+ topology: *ad_master_2client
+
+- fedora-latest-ipa-4-13/test_fips:
+- requires: [fedora-latest-ipa-4-13/build]
+- priority: 50
+- job:
+- class: RunPytest
+- args:
+- build_url: '{fedora-latest-ipa-4-13/build_url}'
+- test_suite: test_integration/test_fips.py
+- template: *ci-ipa-4-13-latest
+- timeout: 7200
+- topology: *master_1repl_1client
+-
+ fedora-latest-ipa-4-13/test_forced_client_enrolment:
+ requires: [fedora-latest-ipa-4-13/build]
+ priority: 50
+diff --git a/ipatests/prci_definitions/nightly_ipa-4-13_latest_selinux.yaml b/ipatests/prci_definitions/nightly_ipa-4-13_latest_selinux.yaml
+index f9e406dbd..62c1c432b 100644
+--- a/ipatests/prci_definitions/nightly_ipa-4-13_latest_selinux.yaml
++++ b/ipatests/prci_definitions/nightly_ipa-4-13_latest_selinux.yaml
+@@ -199,19 +199,6 @@ jobs:
+ timeout: 7200
+ topology: *ad_master_2client
+
+- fedora-latest-ipa-4-13/test_fips:
+- requires: [fedora-latest-ipa-4-13/build]
+- priority: 50
+- job:
+- class: RunPytest
+- args:
+- build_url: '{fedora-latest-ipa-4-13/build_url}'
+- selinux_enforcing: True
+- test_suite: test_integration/test_fips.py
+- template: *ci-ipa-4-13-latest
+- timeout: 7200
+- topology: *master_1repl_1client
+-
+ fedora-latest-ipa-4-13/test_forced_client_enrolment:
+ requires: [fedora-latest-ipa-4-13/build]
+ priority: 50
+--
+2.56.0
+
+
+From b26506059b82368079092fb83a7fcbd283b5b56a Mon Sep 17 00:00:00 2001
+From: Priyanka Doiphode <pdoiphod@redhat.com>
+Date: Tue, 8 Sep 2026 20:03:14 +0530
+Subject: [PATCH 23/55] rpcserver: resolve user@REALM and aliases in
+ change_password
+
+Parse the username with kerberos.Principal and look up krbprincipalname
+before bind so aliases can resolve. Fix W504 lint in _user_bind_dn.
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10050
+Signed-off-by: Priyanka Doiphode <pdoiphod@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+Reviewed-By: Sudhir Menon <sumenon@redhat.com>
+---
+ ipaserver/rpcserver.py | 46 ++++++++++++++++++-
+ ipatests/test_ipaserver/test_changepw.py | 9 ++++
+ .../test_ipaserver/test_login_password.py | 7 +++
+ 3 files changed, 60 insertions(+), 2 deletions(-)
+
+diff --git a/ipaserver/rpcserver.py b/ipaserver/rpcserver.py
+index 16fce40d1..10577412d 100644
+--- a/ipaserver/rpcserver.py
++++ b/ipaserver/rpcserver.py
+@@ -1236,6 +1236,49 @@ class change_password(Backend, HTTP_Status):
+ super(change_password, self)._on_finalize()
+ self.api.Backend.wsgi_dispatch.mount(self, self.key)
+
++ def _user_bind_dn(self, user):
++ """Resolve uid, uid@REALM, or a principal alias to the user DN.
++
++ login_password accepts user@IPA.REALM via kerberos.Principal.
++ ipa passwd finds the entry by krbprincipalname so aliases work.
++ """
++ container = DN(self.api.env.container_user, self.api.env.basedn)
++ try:
++ principal = kerberos.Principal(user)
++ except Exception:
++ principal = None
++
++ if principal is None:
++ lookup = user
++ uid = user
++ elif (principal.realm is None
++ or unicode(principal.realm).upper() == self.api.env.realm):
++ uid = principal.username
++ lookup = unicode(
++ kerberos.Principal(uid, realm=self.api.env.realm))
++ else:
++ uid = principal.username
++ lookup = unicode(principal)
++
++ search = None
++ try:
++ search = ldap2(self.api)
++ search.connect()
++ entry = search.find_entry_by_attr(
++ 'krbprincipalname', lookup, 'posixaccount', [''],
++ container,
++ )
++ return entry.dn
++ except Exception as e:
++ logger.debug(
++ "change_password: krbprincipalname lookup failed for "
++ "'%s': %s", user, e)
++ return DN((self.api.Object.user.primary_key.name, uid),
++ container)
++ finally:
++ if search is not None and search.isconnected():
++ search.disconnect()
++
+ def __call__(self, environ, start_response):
+ logger.info('WSGI change_password.__call__:')
+
+@@ -1281,8 +1324,7 @@ class change_password(Backend, HTTP_Status):
+ result = 'error'
+ policy_error = None
+
+- bind_dn = DN((self.api.Object.user.primary_key.name, data['user']),
+- self.api.env.container_user, self.api.env.basedn)
++ bind_dn = self._user_bind_dn(data['user'])
+
+ try:
+ pw = data['old_password']
+diff --git a/ipatests/test_ipaserver/test_changepw.py b/ipatests/test_ipaserver/test_changepw.py
+index df38ddb3d..37de24422 100644
+--- a/ipatests/test_ipaserver/test_changepw.py
++++ b/ipatests/test_ipaserver/test_changepw.py
+@@ -118,3 +118,12 @@ class test_changepw(XMLRPC_test, Unauthorized_HTTP_test):
+
+ # make sure that password IS changed
+ self._checkpw(testuser, new_password)
++
++ def test_pwpolicy_success_realm_principal(self):
++ principal = u'%s@%s' % (testuser, api.env.realm)
++ response = self._changepw(principal, old_password, new_password)
++
++ assert_equal(response.status, 200)
++ assert_equal(response.getheader('X-IPA-Pwchange-Result'), 'ok')
++
++ self._checkpw(testuser, new_password)
+diff --git a/ipatests/test_ipaserver/test_login_password.py b/ipatests/test_ipaserver/test_login_password.py
+index 9425cb797..452b7d0b3 100644
+--- a/ipatests/test_ipaserver/test_login_password.py
++++ b/ipatests/test_ipaserver/test_login_password.py
+@@ -86,3 +86,10 @@ class test_login_password(XMLRPC_test, Unauthorized_HTTP_test):
+
+ assert_equal(response.status, 200)
+ assert response.getheader('X-IPA-Rejection-Reason') is None
++
++ def test_success_realm_principal(self):
++ principal = u'%s@%s' % (testuser, api.env.realm)
++ response = self._login(principal, password)
++
++ assert_equal(response.status, 200)
++ assert response.getheader('X-IPA-Rejection-Reason') is None
+--
+2.56.0
+
+
+From b0c7a4205fc6234721a42ebc433bf4384cd4d1df Mon Sep 17 00:00:00 2001
+From: Akshay Sakure <asakure@redhat.com>
+Date: Wed, 30 Sep 2026 15:20:38 +0530
+Subject: [PATCH 24/55] Man: Correct SYNOPSIS in ipa-getkeytab man-page
+
+This PR removes PASSWORD keyword from SYNOPSIS as
+-P/--password flag prompts for the password and
+doesn't take password as argument.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10075
+
+Signed-off-by: Akshay Sakure <asakure@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+---
+ client/man/ipa-getkeytab.1 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/client/man/ipa-getkeytab.1 b/client/man/ipa-getkeytab.1
+index 07d2d73b3..d73c6831f 100644
+--- a/client/man/ipa-getkeytab.1
++++ b/client/man/ipa-getkeytab.1
+@@ -21,7 +21,7 @@
+ .SH "NAME"
+ ipa\-getkeytab \- Get a keytab for a Kerberos principal
+ .SH "SYNOPSIS"
+-ipa\-getkeytab \fB\-p\fR \fIprincipal\-name\fR \fB\-k\fR \fIkeytab\-file\fR [ \fB\-e\fR \fIencryption\-types\fR ] [ \fB\-s\fR \fIipaserver\fR ] [ \fB\-q\fR ] [ \fB\-D\fR|\fB\-\-binddn\fR \fIBINDDN\fR ] [ \fB\-w|\-\-bindpw\fR ] [ \fB-W\fR ] [ \fB\-P\fR|\fB\-\-password\fR \fIPASSWORD\fR ] [ \fB\-\-cacert \fICACERT\fR ] [ \fB\-H|\-\-ldapuri \fIURI\fR ] [ \fB\-Y|\-\-mech \fIGSSAPI|EXTERNAL\fR ] [ \fB\-r\fR ]
++ipa\-getkeytab \fB\-p\fR \fIprincipal\-name\fR \fB\-k\fR \fIkeytab\-file\fR [ \fB\-e\fR \fIencryption\-types\fR ] [ \fB\-s\fR \fIipaserver\fR ] [ \fB\-q\fR ] [ \fB\-D\fR|\fB\-\-binddn\fR \fIBINDDN\fR ] [ \fB\-w|\-\-bindpw\fR ] [ \fB-W\fR ] [ \fB\-P\fR|\fB\-\-password\fR ] [ \fB\-\-cacert \fICACERT\fR ] [ \fB\-H|\-\-ldapuri \fIURI\fR ] [ \fB\-Y|\-\-mech \fIGSSAPI|EXTERNAL\fR ] [ \fB\-r\fR ]
+
+ .SH "DESCRIPTION"
+ Retrieves a Kerberos \fIkeytab\fR.
+--
+2.56.0
+
+
+From af06633f9b11992a74f68b62453d9908b2c742c8 Mon Sep 17 00:00:00 2001
+From: PRANAV THUBE <pthube@redhat.com>
+Date: Wed, 30 Sep 2026 16:48:14 +0530
+Subject: [PATCH 25/55] ipatests: refresh SSSD cache on SSH target in
+ test_hbacsvc_master_035
+
+clients[1] SSSD cache was not refreshed after disabling allow_all
+and adding a new HBAC rule, causing stale rules to deny SSH access.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10077
+Reviewed-By: Anuja More <amore@redhat.com>
+---
+ ipatests/test_integration/test_hbac_functional.py | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/ipatests/test_integration/test_hbac_functional.py b/ipatests/test_integration/test_hbac_functional.py
+index 715a334d5..5c198755f 100644
+--- a/ipatests/test_integration/test_hbac_functional.py
++++ b/ipatests/test_integration/test_hbac_functional.py
+@@ -3228,9 +3228,10 @@ class TestHBACFunctional(IntegrationTest):
+ # Test SSH access from client0 to client1 and master
+ # --------------------------------------------------
+ tasks.clear_sssd_cache(self.master)
+- self.refresh_user_cache(
+- self.clients[0], [self.USER_1, self.USER_2], kdestroy=False
+- )
++ for client in self.clients:
++ self.refresh_user_cache(
++ client, [self.USER_1, self.USER_2], kdestroy=False
++ )
+ assert self.ssh_auth_success(
+ self.USER_1, self.USER_PASSWORD, self.clients[1], self.clients[0]
+ )
+--
+2.56.0
+
+
+From b97ed7b5d01e1198b40b48eabc956f1be5d6ea14 Mon Sep 17 00:00:00 2001
+From: Akshay Sakure <asakure@redhat.com>
+Date: Wed, 30 Sep 2026 15:43:42 +0530
+Subject: [PATCH 26/55] Man: Correct ipa command in ipa-getkeytab man-page
+
+This PR correct the incorrectly documented ipa command
+under EXAMPLES section:
+server-allow-create-keytab -> service-allow-create-keytab
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10076
+
+Signed-off-by: Akshay Sakure <asakure@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
+---
+ client/man/ipa-getkeytab.1 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/client/man/ipa-getkeytab.1 b/client/man/ipa-getkeytab.1
+index d73c6831f..bcc6a3e49 100644
+--- a/client/man/ipa-getkeytab.1
++++ b/client/man/ipa-getkeytab.1
+@@ -150,7 +150,7 @@ Add and retrieve a keytab for a clustered HTTP service deployed on client1.examp
+ # ipa host-add client-frontend.example.com --ip-address 10.1.2.3
+ # ipa service-add HTTP/client-frontend.example.com
+ # ipa service-allow-retrieve-keytab HTTP/client-frontend.example.com --hosts={client1.example.com,client2.example.com}
+- # ipa server-allow-create-keytab HTTP/client-frontend.example.com --hosts=client1.example.com
++ # ipa service-allow-create-keytab HTTP/client-frontend.example.com --hosts=client1.example.com
+ .fi
+
+ On client1, generate and retrieve a new keytab for client-frontend.example.com:
+--
+2.56.0
+
+
+From c03669219675b59fd807b4f91dbcec4afc885ad5 Mon Sep 17 00:00:00 2001
+From: Akshay Sakure <asakure@redhat.com>
+Date: Wed, 30 Sep 2026 15:46:59 +0530
+Subject: [PATCH 27/55] Man: Fix grammatical mistakes in ipa-getkeytab man
+
+This PR fixes a few grammatical mistakes in
+ipa-getkeytab man-page.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10076
+
+Signed-off-by: Akshay Sakure <asakure@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
+---
+ client/man/ipa-getkeytab.1 | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/client/man/ipa-getkeytab.1 b/client/man/ipa-getkeytab.1
+index bcc6a3e49..3726ead33 100644
+--- a/client/man/ipa-getkeytab.1
++++ b/client/man/ipa-getkeytab.1
+@@ -87,7 +87,7 @@ file.
+ Quiet mode. Only errors are displayed.
+ .TP
+ \fB\-\-permitted\-enctypes\fR
+-This options returns a description of the permitted encryption types, like this:
++This option returns a description of the permitted encryption types, like this:
+ Supported encryption types:
+ AES\-256 CTS mode with 96\-bit SHA\-1 HMAC
+ AES\-128 CTS mode with 96\-bit SHA\-1 HMAC
+@@ -96,7 +96,7 @@ AES\-256 CTS mode with 192\-bit SHA\-384 HMAC
+ ArcFour with HMAC/md5
+ .TP
+ \fB\-P, \-\-password\fR
+-Use this password for the key instead of one randomly generated. The length of the password is limited by 1024 characters. Note that MIT Kerberos also limits passwords entered through kpasswd and kadmin commands to the same length.
++Use this password for the key instead of one randomly generated. The length of the password is limited to 1024 characters. Note that MIT Kerberos also limits passwords entered through kpasswd and kadmin commands to the same length.
+ .TP
+ \fB\-D, \-\-binddn\fR
+ The LDAP DN to bind as when retrieving a keytab without Kerberos credentials. Generally used with the \fB\-w\fR or \fB\-W\fR options.
+@@ -121,7 +121,7 @@ GSSAPI or EXTERNAL.
+ \fB\-r\fR
+ Retrieve mode. Retrieve an existing key from the server instead of generating a
+ new one. This is incompatible with the \-\-password option, and will work only
+-against a IPA server more recent than version 3.3. The user requesting the
++against an IPA server more recent than version 3.3. The user requesting the
+ keytab must have access to the keys for this operation to succeed.
+ .SH "EXAMPLES"
+ Add and retrieve a keytab for the NFS service principal on
+--
+2.56.0
+
+
+From ccbe9fde08100bbe4894f75eb16cffcf9e3015ad Mon Sep 17 00:00:00 2001
+From: Akshay Sakure <asakure@redhat.com>
+Date: Thu, 1 Oct 2026 16:01:57 +0530
+Subject: [PATCH 28/55] Man: Improve desc for -P option in ipa-getkeytab man
+
+This commit improves the description for -P/--password
+argument in ipa-getkeytab man-page.
+
+Signed-off-by: Akshay Sakure <asakure@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
+---
+ client/man/ipa-getkeytab.1 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/client/man/ipa-getkeytab.1 b/client/man/ipa-getkeytab.1
+index 3726ead33..469eba03e 100644
+--- a/client/man/ipa-getkeytab.1
++++ b/client/man/ipa-getkeytab.1
+@@ -96,7 +96,7 @@ AES\-256 CTS mode with 192\-bit SHA\-384 HMAC
+ ArcFour with HMAC/md5
+ .TP
+ \fB\-P, \-\-password\fR
+-Use this password for the key instead of one randomly generated. The length of the password is limited to 1024 characters. Note that MIT Kerberos also limits passwords entered through kpasswd and kadmin commands to the same length.
++Prompt for a non-random password used as the key for the principal. The length of the password is limited to 1024 characters. Note that MIT Kerberos also limits passwords entered through kpasswd and kadmin commands to the same length.
+ .TP
+ \fB\-D, \-\-binddn\fR
+ The LDAP DN to bind as when retrieving a keytab without Kerberos credentials. Generally used with the \fB\-w\fR or \fB\-W\fR options.
+--
+2.56.0
+
+
+From a1877b437b5a9161a119910a26030c7ab2ff8cf5 Mon Sep 17 00:00:00 2001
+From: Akshay Sakure <asakure@redhat.com>
+Date: Mon, 5 Oct 2026 16:40:35 +0530
+Subject: [PATCH 29/55] Man: Fix grammatical mistakes in ipa-client-install man
+
+This PR fixes a few grammatical mistakes in
+ipa-client-install man-page.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10080
+
+Signed-off-by: Akshay Sakure <asakure@redhat.com>
+Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
+---
+ client/man/ipa-client-install.1 | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/client/man/ipa-client-install.1 b/client/man/ipa-client-install.1
+index 5432c48a9..30b35be47 100644
+--- a/client/man/ipa-client-install.1
++++ b/client/man/ipa-client-install.1
+@@ -9,7 +9,7 @@ ipa\-client\-install [\fIOPTION\fR]...
+ .SH "DESCRIPTION"
+ Configures a client machine to use IPA for authentication and identity services.
+
+-By default this configures SSSD to connect to an IPA server for authentication and authorization. Optionally one can instead configure PAM and NSS (Name Switching Service) to work with an IPA server over Kerberos and LDAP.
++By default this configures SSSD to connect to an IPA server for authentication and authorization. Optionally one can instead configure PAM and NSS (Name Service Switch) to work with an IPA server over Kerberos and LDAP.
+
+ An authorized account is required to join a client machine to IPA. This can take the form of a kerberos principal, a one\-time password associated with the machine, or PKINIT identity associated with the machine.
+
+@@ -31,7 +31,7 @@ When the client machine hostname is not in a subdomain of an IPA server, its dom
+ Client machine can also be configured without a DNS autodiscovery at all. When both \-\-server and \-\-domain options are used, client installer will use the specified server and domain directly. \-\-server option accepts multiple server hostnames which can be used for failover mechanism. Without DNS autodiscovery, Kerberos is configured with a fixed list of KDC and Admin servers. SSSD is still configured to either try to read domain's SRV records or the specified fixed list of servers. When \-\-fixed\-primary option is specified, SSSD will not try to read DNS SRV record at all (see sssd\-ipa(5) for details).
+
+ .SS "The Failover Mechanism"
+-When some of the IPA servers is not available, client components are able to fallback to other IPA replica and thus preserving a continued service. When client machine is configured to use DNS SRV record autodiscovery (no fixed server was passed to the installer), client components do the fallback automatically, based on the IPA server hostnames and priorities discovered from the DNS SRV records.
++When some of the IPA servers are not available, client components are able to fallback to other IPA replica and thus preserving a continued service. When client machine is configured to use DNS SRV record autodiscovery (no fixed server was passed to the installer), client components do the fallback automatically, based on the IPA server hostnames and priorities discovered from the DNS SRV records.
+
+ If DNS autodiscovery is not available, clients should be configured at least with a fixed list of IPA servers that can be used in case of a failure. When only one IPA server is configured, IPA client services will not be available in case of a failure of the IPA server. Please note, that in case of a fixed list of IPA servers, the fixed server lists in client components need to be updated when a new IPA server is enrolled or a current IPA server is decommissioned.
+
+@@ -49,7 +49,7 @@ Requirements:
+
+ If this has been the case, host can be re\-enrolled using the usual methods.
+
+-There are two method of authenticating a re\-enrollment:
++There are two methods of authenticating a re\-enrollment:
+
+ 1. You can use \-\-force\-join option with ipa\-client\-install command. This authenticates the re\-enrollment using the admin's credentials provided via the \-w/\-\-password option.
+ .br
+@@ -101,7 +101,7 @@ Prompt for the password for joining a machine to the IPA realm.
+ Path to backed up host keytab from previous enrollment. Joins the host even if it is already enrolled.
+ .TP
+ \fB\-\-mkhomedir\fR
+-Configure PAM to create a users home directory if it does not exist.
++Configure PAM to create a user's home directory if it does not exist.
+ .TP
+ \fB\-\-hostname\fR
+ The hostname of this machine (FQDN). If specified, the hostname will be set and the system configuration will be updated to persist over reboot. By default the result of getfqdn() call from Python's socket module is used.
+@@ -164,7 +164,7 @@ Unattended installation. The user will not be prompted.
+ .TP
+ \fB\-\-ca\-cert\-file\fR=\fICA_FILE\fR
+ Do not attempt to acquire the IPA CA certificate via automated means,
+-instead use the CA certificate found locally in in \fICA_FILE\fR. The
++instead use the CA certificate found locally in \fICA_FILE\fR. The
+ \fICA_FILE\fR must be an absolute path to a PEM formatted certificate
+ file. The CA certificate found in \fICA_FILE\fR is considered
+ authoritative and will be installed without checking to see if it's
+--
+2.56.0
+
+
+From 6e5cb2332ef8040bbcce9b82689322ae977550bc Mon Sep 17 00:00:00 2001
+From: apeddire-wq <apeddire@redhat.com>
+Date: Wed, 30 Sep 2026 00:37:37 +0530
+Subject: [PATCH 30/55] ipa-cert-fix: document confirmation prompt and exit
+ status 2
+
+Document the interactive confirmation prompt that ipa-cert-fix
+displays before renewing certificates, and the new exit status 2
+returned when IPA is not configured on the system.
+
+Assisted-by: Claude <noreply@anthropic.com>
+Signed-off-by: apeddire-wq <apeddire@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
+---
+ install/tools/man/ipa-cert-fix.1 | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/install/tools/man/ipa-cert-fix.1 b/install/tools/man/ipa-cert-fix.1
+index 2502efd7a..246010512 100644
+--- a/install/tools/man/ipa-cert-fix.1
++++ b/install/tools/man/ipa-cert-fix.1
+@@ -31,6 +31,12 @@ replication to other CA servers. Shared certificates include all
+ Dogtag system certificates except the HTTPS certificate, and the IPA
+ RA certificate.
+
++Before making any changes, \fIipa-cert-fix\fR prints details of the
++certificates it intends to renew and prompts for confirmation. Only
++an exact (case-insensitive) response of "yes" will cause the tool to
++proceed; any other response causes it to print "Not proceeding." and
++exit with status 0 without modifying any certificates.
++
+ To repair certificates across multiple CA servers, first ensure that
+ LDAP replication is working across the topology. Then run
+ \fIipa-cert-fix\fR on one CA server. Before running
+@@ -63,10 +69,12 @@ Output only errors (output from child processes may still be shown).
+ \fB\-\-log\-file\fR=\fIFILE\fR
+ Log to the given file.
+ .SH "EXIT STATUS"
+-0 if the command was successful
++0 if the command was successful, or if the user declined to proceed
+
+ 1 if an error occurred
+
++2 if IPA is not configured on this system
++
+ .SH "SEE ALSO"
+ .BR ipa-cacert-manage(1)
+ .BR ipa-server-certinstall(1)
+--
+2.56.0
+
+
+From 0f8df96d3ba100a411d9ce5662ca0ccbd24c3658 Mon Sep 17 00:00:00 2001
+From: apeddire-wq <apeddire@redhat.com>
+Date: Wed, 30 Sep 2026 16:40:11 +0530
+Subject: [PATCH 31/55] ipa-cert-fix: document root and Directory Server
+ prerequisites
+
+Note in the man page that ipa-cert-fix must be run as root and that
+the Directory Server (LDAP) must be running, and list common causes
+of exit status 1. Aligns the documentation with the behaviors covered
+by the tests in #8535.
+
+Assisted-by: Claude <noreply@anthropic.com>
+Signed-off-by: apeddire-wq <apeddire@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
+---
+ install/tools/man/ipa-cert-fix.1 | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/install/tools/man/ipa-cert-fix.1 b/install/tools/man/ipa-cert-fix.1
+index 246010512..8e451b5df 100644
+--- a/install/tools/man/ipa-cert-fix.1
++++ b/install/tools/man/ipa-cert-fix.1
+@@ -16,6 +16,12 @@ and keys, is \fBSTRONGLY RECOMMENDED\fR.
+ Do not use this program unless expired certificates are inhibiting
+ normal operation and renewal procedures.
+
++\fIipa-cert-fix\fR must be run as \fBroot\fR, and the IPA Directory
++Server (LDAP) must be running, as the tool reads the current
++certificate state from LDAP. If the Directory Server is stopped,
++\fIipa-cert-fix\fR exits with an error without modifying any
++certificates.
++
+ To renew the IPA CA certificate, use \fIipa-cacert-manage(1)\fR.
+
+ This tool cannot renew certificates signed by external CAs. To
+@@ -71,7 +77,8 @@ Log to the given file.
+ .SH "EXIT STATUS"
+ 0 if the command was successful, or if the user declined to proceed
+
+-1 if an error occurred
++1 if an error occurred (for example, not run as root, the Directory
++Server is not running, or the local CA is not installed)
+
+ 2 if IPA is not configured on this system
+
+--
+2.56.0
+
+
+From 70af0dd167994bc718d2cfa887755d8ac68e9277 Mon Sep 17 00:00:00 2001
+From: Rob Crittenden <rcritten@redhat.com>
+Date: Mon, 11 May 2026 14:20:48 -0400
+Subject: [PATCH 32/55] Increase the AJP proxy buffer size to handle large
+ certificates
+
+The key sizes of ML-DSA 65 and 87 generate very large certificates,
+CSRs, etc. These can be larger than the default mod_proxy AJP
+setting allows (8192).
+
+The equivalent value in PKI was updated to 65536 in dogtagpki
+change. See:
+
+https://github.com/dogtagpki/pki/commit/9d8d6d2
+https://github.com/dogtagpki/pki/commit/3007eda
+https://github.com/dogtagpki/pki/commit/8e667b2
+
+We do NOT want to increase the value if the tomcat packetSize
+attribute is not set in the AJP connector. If only one of these
+is set between Apache and Tomcat then one side is likely to
+send a packet too large which will be rejected by the other side.
+
+An upgrade script is used to ensure the environment is sane.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/9988
+
+Signed-off-by: Rob Crittenden <rcritten@redhat.com>
+Co-authored-by: Fraser Tweedale <ftweedal@redhat.com>
+Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+---
+ install/share/ipa-pki-proxy.conf.template | 4 ++-
+ ipaserver/install/cainstance.py | 1 -
+ ipaserver/install/dogtaginstance.py | 36 +++++++++++++++++++++++
+ ipaserver/install/server/upgrade.py | 22 +++++++++-----
+ 4 files changed, 53 insertions(+), 10 deletions(-)
+
+diff --git a/install/share/ipa-pki-proxy.conf.template b/install/share/ipa-pki-proxy.conf.template
+index c7f0bfc36..036b8118d 100644
+--- a/install/share/ipa-pki-proxy.conf.template
++++ b/install/share/ipa-pki-proxy.conf.template
+@@ -1,7 +1,9 @@
+-# VERSION 17 - DO NOT REMOVE THIS LINE
++# VERSION 18 - DO NOT REMOVE THIS LINE
+
+ ProxyRequests Off
+
++$DOGTAG_AJP_PACKET_SIZE
++
+ # matches for ee port
+ <LocationMatch "^/ca/ee/ca/checkRequest|^/ca/ee/ca/getCertChain|^/ca/ee/ca/getTokenInfo|^/ca/ee/ca/tokenAuthenticate|^/ca/ocsp|^/ca/ee/ca/updateNumberRange|^/ca/ee/ca/getCRL|^/ca/ee/ca/profileSubmit">
+ SSLOptions +StdEnvVars +ExportCertData +StrictRequire +OptRenegotiate
+diff --git a/ipaserver/install/cainstance.py b/ipaserver/install/cainstance.py
+index 9590e7716..5be9e782e 100644
+--- a/ipaserver/install/cainstance.py
++++ b/ipaserver/install/cainstance.py
+@@ -1014,7 +1014,6 @@ class CAInstance(DogtagInstance):
+
+ return publishdir
+
+-
+ def __enable_crl_publish(self):
+ """
+ Enable file-based CRL publishing and disable LDAP publishing.
+diff --git a/ipaserver/install/dogtaginstance.py b/ipaserver/install/dogtaginstance.py
+index aac8fb989..80e04890c 100644
+--- a/ipaserver/install/dogtaginstance.py
++++ b/ipaserver/install/dogtaginstance.py
+@@ -489,8 +489,39 @@ class DogtagInstance(service.Service):
+
+ return rewrite
+
++ def get_ajp_packet_size(self):
++ """Return packetSize if set in the AJP connectors
++
++ There are multiple connectors but the value should be the same.
++
++ We aren't trying to keep the values in sync between PKI and
++ Apache. They should both be 65536.
++
++ There are several opportunities for a user to mess this up:
++ * the attribute name is case-sensitive
++ * we only want the max possible value, nothing creative
++
++ Return the value if set, None if not.
++ """
++
++ server_xml = lxml.etree.parse(paths.PKI_TOMCAT_SERVER_XML)
++ doc = server_xml.getroot()
++
++ # no AJP connector is probably bad.
++ connectors = doc.xpath('//Connector[@protocol="AJP/1.3"]')
++ if len(connectors) == 0:
++ logger.debug("No AJP connectors found in get_ajp_packet_size")
++ return None
++
++ for connector in connectors:
++ if 'packetSize' in connector.attrib:
++ return connector.get('packetSize')
++
++ return None
++
+ def http_proxy(self):
+ """ Update the http proxy file """
++ ajp_packet_size = self.get_ajp_packet_size()
+ template_filename = (
+ os.path.join(paths.USR_SHARE_IPA_DIR,
+ "ipa-pki-proxy.conf.template"))
+@@ -499,9 +530,14 @@ class DogtagInstance(service.Service):
+ CLONE='' if self.clone else '#',
+ FQDN=self.fqdn,
+ DOGTAG_AJP_SECRET='',
++ DOGTAG_AJP_PACKET_SIZE='',
+ )
+ if self.ajp_secret:
+ sub_dict['DOGTAG_AJP_SECRET'] = "secret={}".format(self.ajp_secret)
++ if ajp_packet_size:
++ sub_dict['DOGTAG_AJP_PACKET_SIZE'] = (
++ "ProxyIOBufferSize {}".format(ajp_packet_size)
++ )
+ template = ipautil.template_file(template_filename, sub_dict)
+ with open(paths.HTTPD_IPA_PKI_PROXY_CONF, "w") as fd:
+ fd.write(template)
+diff --git a/ipaserver/install/server/upgrade.py b/ipaserver/install/server/upgrade.py
+index 3d731de19..1822d9293 100644
+--- a/ipaserver/install/server/upgrade.py
++++ b/ipaserver/install/server/upgrade.py
+@@ -1743,21 +1743,27 @@ def upgrade_configuration():
+ ca.add_ipa_wait()
+
+ # Handle upgrade of AJP connector configuration
+- rewrite = ca.secure_ajp_connector()
++ secret_needs_sync = ca.secure_ajp_connector()
+ if ca.ajp_secret:
+ sub_dict['DOGTAG_AJP_SECRET'] = "secret={}".format(
+ ca.ajp_secret)
+ else:
+ sub_dict['DOGTAG_AJP_SECRET'] = ''
+
++ ajp_packet_size = ca.get_ajp_packet_size()
++ if ajp_packet_size:
++ sub_dict['DOGTAG_AJP_PACKET_SIZE'] = (
++ "ProxyIOBufferSize {}".format(ajp_packet_size))
++ else:
++ sub_dict['DOGTAG_AJP_PACKET_SIZE'] = ''
++
+ # force=True will ensure the secret is updated if it changes
+- if rewrite:
+- upgrade_file(
+- sub_dict,
+- paths.HTTPD_IPA_PKI_PROXY_CONF,
+- os.path.join(paths.USR_SHARE_IPA_DIR,
+- "ipa-pki-proxy.conf.template"),
+- add=True, force=True)
++ upgrade_file(
++ sub_dict,
++ paths.HTTPD_IPA_PKI_PROXY_CONF,
++ os.path.join(paths.USR_SHARE_IPA_DIR,
++ "ipa-pki-proxy.conf.template"),
++ add=True, force=secret_needs_sync)
+ else:
+ if os.path.isfile(paths.HTTPD_IPA_PKI_PROXY_CONF):
+ os.remove(paths.HTTPD_IPA_PKI_PROXY_CONF)
+--
+2.56.0
+
+
+From 9e94d0d6d9fc50c8485d73acabbb9e0a8c373629 Mon Sep 17 00:00:00 2001
+From: Fraser Tweedale <ftweedal@redhat.com>
+Date: Wed, 15 Jul 2026 21:15:59 -0400
+Subject: [PATCH 33/55] Force rewrite of ipa-pki-proxy.conf on upgrade
+
+There are several conditions that require the updating of
+ipa-pki-proxy.conf, in addition to version bump:
+
+- AJP secret added or changed
+- Dogtag AJP packet size added or changed
+
+To avoid the complexity of checking these conditions, force a
+rewrite on every upgrade.
+
+Also add a comment to `ipa-pki-proxy.conf` to warn administrators
+and discourage customisation.
+
+Related: https://codeberg.org/freeipa/freeipa/issues/9988
+
+Signed-off-by: Fraser Tweedale <ftweedal@redhat.com>
+Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+---
+ install/share/ipa-pki-proxy.conf.template | 2 ++
+ ipaserver/install/server/upgrade.py | 14 +++++++++++---
+ 2 files changed, 13 insertions(+), 3 deletions(-)
+
+diff --git a/install/share/ipa-pki-proxy.conf.template b/install/share/ipa-pki-proxy.conf.template
+index 036b8118d..edd6c3f62 100644
+--- a/install/share/ipa-pki-proxy.conf.template
++++ b/install/share/ipa-pki-proxy.conf.template
+@@ -1,5 +1,7 @@
+ # VERSION 18 - DO NOT REMOVE THIS LINE
+
++# Do not customise this file; it gets rewritten on every upgrade
++
+ ProxyRequests Off
+
+ $DOGTAG_AJP_PACKET_SIZE
+diff --git a/ipaserver/install/server/upgrade.py b/ipaserver/install/server/upgrade.py
+index 1822d9293..0539c8eb8 100644
+--- a/ipaserver/install/server/upgrade.py
++++ b/ipaserver/install/server/upgrade.py
+@@ -1743,7 +1743,7 @@ def upgrade_configuration():
+ ca.add_ipa_wait()
+
+ # Handle upgrade of AJP connector configuration
+- secret_needs_sync = ca.secure_ajp_connector()
++ ca.secure_ajp_connector()
+ if ca.ajp_secret:
+ sub_dict['DOGTAG_AJP_SECRET'] = "secret={}".format(
+ ca.ajp_secret)
+@@ -1757,13 +1757,21 @@ def upgrade_configuration():
+ else:
+ sub_dict['DOGTAG_AJP_PACKET_SIZE'] = ''
+
+- # force=True will ensure the secret is updated if it changes
++ # There are several conditions that require the updating
++ # of ipa-pki-proxy.conf, in addition to version bump:
++ #
++ # - AJP secret added or changed
++ # - Dogtag AJP packet size added or changed
++ #
++ # Forcing a rewrite on every upgrade avoids the complexity
++ # to check for these conditions. Therefore: force=True
++ #
+ upgrade_file(
+ sub_dict,
+ paths.HTTPD_IPA_PKI_PROXY_CONF,
+ os.path.join(paths.USR_SHARE_IPA_DIR,
+ "ipa-pki-proxy.conf.template"),
+- add=True, force=secret_needs_sync)
++ add=True, force=True)
+ else:
+ if os.path.isfile(paths.HTTPD_IPA_PKI_PROXY_CONF):
+ os.remove(paths.HTTPD_IPA_PKI_PROXY_CONF)
+--
+2.56.0
+
+
+From ca56fa7f70519fd7295460c5a03f44ad5447a775 Mon Sep 17 00:00:00 2001
+From: Abhinay Reddy Peddireddy <apeddire@redhat.com>
+Date: Wed, 30 Sep 2026 18:05:30 +0530
+Subject: [PATCH 34/55] ipa-client-install man: drop docs for removed
+ --noac/--no-sssd options
+
+The --noac and -S/--no-sssd options were removed from ipa-client-install
+in commit c5cdd5a5f ("ipaclient: Remove --no-sssd and --no-ac options",
+pagure #5860 and #7671), but the man page was never updated and has
+documented them ever since.
+
+Because these options no longer exist as knobs, the installer framework
+does not expose them on the command line, so running ipa-client-install
+--noac or --no-sssd fails. Remove the two stale OPTIONS entries, the
+lingering --no-sssd reference in the --server description, and the FILES
+subsection describing the nss_ldap files that were only replaced when
+SSSD was not configured (which can no longer happen). Also drop the
+DESCRIPTION sentence saying PAM and NSS can be configured instead of
+SSSD, since SSSD is now always configured.
+
+Related: https://codeberg.org/freeipa/freeipa/issues/5860
+Assisted-by: Claude <noreply@anthropic.com>
+Signed-off-by: Abhinay Reddy Peddireddy <apeddire@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
+---
+ client/man/ipa-client-install.1 | 22 ++--------------------
+ 1 file changed, 2 insertions(+), 20 deletions(-)
+
+diff --git a/client/man/ipa-client-install.1 b/client/man/ipa-client-install.1
+index 30b35be47..b7ce0ea42 100644
+--- a/client/man/ipa-client-install.1
++++ b/client/man/ipa-client-install.1
+@@ -9,7 +9,7 @@ ipa\-client\-install [\fIOPTION\fR]...
+ .SH "DESCRIPTION"
+ Configures a client machine to use IPA for authentication and identity services.
+
+-By default this configures SSSD to connect to an IPA server for authentication and authorization. Optionally one can instead configure PAM and NSS (Name Service Switch) to work with an IPA server over Kerberos and LDAP.
++This configures SSSD to connect to an IPA server for authentication and authorization.
+
+ An authorized account is required to join a client machine to IPA. This can take the form of a kerberos principal, a one\-time password associated with the machine, or PKINIT identity associated with the machine.
+
+@@ -76,7 +76,7 @@ When no \-\-server option is specified, this domain will be used by the installe
+ The default value used by the installer is the domain part of the hostname. This option needs to be specified if the primary IPA DNS domain is different from the default value.
+ .TP
+ \fB\-\-server\fR=\fISERVER\fR
+-Set the FQDN of the IPA server to connect to. May be specified multiple times to add multiple servers to ipa_server value in sssd.conf or krb5.conf. Only the first value is considered when used with \-\-no\-sssd. When this option is used, DNS autodiscovery for Kerberos is disabled and a fixed list of KDC and Admin servers is configured.
++Set the FQDN of the IPA server to connect to. May be specified multiple times to add multiple servers to ipa_server value in sssd.conf or krb5.conf. When this option is used, DNS autodiscovery for Kerberos is disabled and a fixed list of KDC and Admin servers is configured.
+
+ Under normal circumstances, this option is not needed as the list of servers is retrieved from the primary IPA DNS domain.
+ .TP
+@@ -142,9 +142,6 @@ Configure SSSD as data source for subid.
+ \fB\-\-no\-dns\-sshfp\fR
+ Do not automatically create DNS SSHFP records.
+ .TP
+-\fB\-\-noac\fR
+-Do not use Authconfig to modify the nsswitch.conf and PAM configuration.
+-.TP
+ \fB\-f\fR, \fB\-\-force\fR
+ Force the settings even if errors occur
+ .TP
+@@ -223,9 +220,6 @@ unauthenticated nsupdates instead.
+ \fB\-\-no\-krb5\-offline\-passwords\fR
+ Configure SSSD not to store user password when the server is offline.
+ .TP
+-\fB\-S\fR, \fB\-\-no\-sssd\fR
+-Do not configure the client to use SSSD for authentication, use nss_ldap instead.
+-.TP
+ \fB\-\-preserve\-sssd\fR
+ Disabled by default. When enabled, preserves old SSSD configuration if it is
+ not possible to merge it with a new one. Effectively, if the merge is not
+@@ -271,18 +265,6 @@ Files that will be replaced if SSSD is configured (default):
+
+ /etc/sssd/sssd.conf
+ .TP
+-Files that will be replaced if they exist and SSSD is not configured (\-\-no\-sssd):
+-
+-/etc/ldap.conf
+-.br
+-/etc/nss_ldap.conf
+-.br
+-/etc/libnss\-ldap.conf
+-.br
+-/etc/pam_ldap.conf
+-.br
+-/etc/nslcd.conf
+-.TP
+ Files replaced if NTP client (chronyd) configuration is enabled:
+
+ /etc/chrony.conf
+--
+2.56.0
+
+
+From 4bb098fcbb6a3407060cb49770e2ccd2a2732b69 Mon Sep 17 00:00:00 2001
+From: Rakesh Kumar <rakkumar@redhat.com>
+Date: Tue, 6 Oct 2026 01:12:37 +0530
+Subject: [PATCH 35/55] Man: Improve documentation issues in ipa and ipactl man
+
+This patch corrects two issues in man pages:
+
+- ipa.1: Replace 'formerly know as' with 'formerly known as'
+
+- ipactl.8: Replace 'an administer' with 'an administrator'
+
+Signed-off-by: Rakesh Kumar <rakkumar@redhat.com>
+Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
+---
+ client/man/ipa.1 | 2 +-
+ install/tools/man/ipactl.8 | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/client/man/ipa.1 b/client/man/ipa.1
+index b3ac572c3..b5dcdd844 100644
+--- a/client/man/ipa.1
++++ b/client/man/ipa.1
+@@ -24,7 +24,7 @@ ipa \- IPA command\-line interface
+ \fBipa\fR [options] [\fB\-c\fR \fIFILE\fR] [\fB\-e\fR \fIKEY=VAL\fR] \fICOMMAND\fR [parameters]
+ .fi
+ .SH "DESCRIPTION"
+-IPA is an integrated security information management solution based on 389 Directory Server (formerly know as Fedora Directory Server), MIT Kerberos, Dogtag Certificate System and DNS. It includes a web interface and command\-line administration tools for managing identity data.
++IPA is an integrated security information management solution based on 389 Directory Server (formerly known as Fedora Directory Server), MIT Kerberos, Dogtag Certificate System and DNS. It includes a web interface and command\-line administration tools for managing identity data.
+
+ This manual page focuses on the \fIipa\fR script that serves as the main command\-line interface (CLI) for IPA administration.
+
+diff --git a/install/tools/man/ipactl.8 b/install/tools/man/ipactl.8
+index 8fdc09632..140d99845 100644
+--- a/install/tools/man/ipactl.8
++++ b/install/tools/man/ipactl.8
+@@ -22,7 +22,7 @@ ipactl \- IPA Server Control Interface
+ .SH "SYNOPSIS"
+ ipactl \fIcommand\fR
+ .SH "DESCRIPTION"
+-A tool to help an administer control an IPA environment.
++A tool to help an administrator control an IPA environment.
+
+ IPA glues several discrete services together to work in concert and the order that these services are started and stopped is important. ipactl ensures that they are started and stopped in the correct order.
+
+--
+2.56.0
+
+
+From a63db4a860bf286aa4922cd49d13c99ebdd565dc Mon Sep 17 00:00:00 2001
+From: Akshay Sakure <asakure@redhat.com>
+Date: Mon, 5 Oct 2026 17:12:47 +0530
+Subject: [PATCH 36/55] Man: Correct the file-name in ipa-join man
+
+This PR fixes the file-name in ipa-join man-page.
+/etc/krb5.conf -> /etc/krb5.keytab
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10081
+
+Signed-off-by: Akshay Sakure <asakure@redhat.com>
+Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
+---
+ client/man/ipa-join.1 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/client/man/ipa-join.1 b/client/man/ipa-join.1
+index 5eaf68f9d..b5a9fcd0f 100644
+--- a/client/man/ipa-join.1
++++ b/client/man/ipa-join.1
+@@ -41,7 +41,7 @@ If a client host has already been joined to the IPA realm the ipa\-join command
+
+ This command is normally executed by the ipa\-client\-install command as part of the enrollment process.
+
+-The reverse is unenrollment. Unenrolling a host removes the Kerberos key on the IPA server. This prepares the host to be re\-enrolled. This uses the host principal stored in /etc/krb5.conf to authenticate to the IPA server to perform the unenrollment.
++The reverse is unenrollment. Unenrolling a host removes the Kerberos key on the IPA server. This prepares the host to be re\-enrolled. This uses the host principal stored in /etc/krb5.keytab to authenticate to the IPA server to perform the unenrollment.
+
+ Please note, that while the ipa\-join option removes the client from the domain, it does not actually uninstall the client or properly remove all of the IPA\-related configuration. The only way to uninstall a client completely is to use ipa\-client\-install \-\-uninstall
+ (see
+--
+2.56.0
+
+
+From 002572e1517526ee4172f1b0ed8880c22e9659ac Mon Sep 17 00:00:00 2001
+From: Akshay Sakure <asakure@redhat.com>
+Date: Mon, 5 Oct 2026 17:16:26 +0530
+Subject: [PATCH 37/55] Man: Correct a typo in SYNOPSIS in ipa-join man
+
+This PR fixes a minor typo under SYNOPSIS section
+of ipa-join man-page.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10081
+
+Signed-off-by: Akshay Sakure <asakure@redhat.com>
+Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
+---
+ client/man/ipa-join.1 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/client/man/ipa-join.1 b/client/man/ipa-join.1
+index b5a9fcd0f..a6392e3df 100644
+--- a/client/man/ipa-join.1
++++ b/client/man/ipa-join.1
+@@ -20,7 +20,7 @@
+ .SH "NAME"
+ ipa\-join \- Join a machine to an IPA realm and get a keytab for the host service principal
+ .SH "SYNOPSIS"
+-ipa\-join [\fB\-d\fR|\fB\-\-debug\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-u\fR|\fB\-\-unenroll\fR] [\fB\-h\fR|\fB\-\-hostname\fR hostname] [\fB\-s\fR|\fB\-\-server\fR hostname] [\fB\-k\fR|\fB\-\-keytab\fR filename] [\fB\-w\fR|\fB\-\-bindpw\fR password] [\fB-b\fR|\-\-\fBbasedn basedn\fR] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR]
++ipa\-join [\fB\-d\fR|\fB\-\-debug\fR] [\fB\-q\fR|\fB\-\-quiet\fR] [\fB\-u\fR|\fB\-\-unenroll\fR] [\fB\-h\fR|\fB\-\-hostname\fR hostname] [\fB\-s\fR|\fB\-\-server\fR hostname] [\fB\-k\fR|\fB\-\-keytab\fR filename] [\fB\-w\fR|\fB\-\-bindpw\fR password] [\fB-b\fR|\-\-\fBbasedn\fR basedn] [\fB\-?\fR|\fB\-\-help\fR] [\fB\-\-usage\fR]
+
+ .SH "DESCRIPTION"
+ Joins a host to an IPA realm and retrieves a kerberos \fIkeytab\fR for the host service principal, or unenrolls an enrolled host from an IPA server.
+--
+2.56.0
+
+
+From 451ddc67f7e49f4b257686e5cbb0c5cdb5192051 Mon Sep 17 00:00:00 2001
+From: Akshay Sakure <asakure@redhat.com>
+Date: Mon, 5 Oct 2026 17:20:26 +0530
+Subject: [PATCH 38/55] Man: Replace ipa-join by --unenroll in ipa-join man
+
+This commit replaces 'ipa-join' by '--unenroll' in
+ipa-join man-page as the intent was to document the
+-u|--unenroll option.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10081
+
+Signed-off-by: Akshay Sakure <asakure@redhat.com>
+Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
+---
+ client/man/ipa-join.1 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/client/man/ipa-join.1 b/client/man/ipa-join.1
+index a6392e3df..c899a1daa 100644
+--- a/client/man/ipa-join.1
++++ b/client/man/ipa-join.1
+@@ -43,7 +43,7 @@ This command is normally executed by the ipa\-client\-install command as part of
+
+ The reverse is unenrollment. Unenrolling a host removes the Kerberos key on the IPA server. This prepares the host to be re\-enrolled. This uses the host principal stored in /etc/krb5.keytab to authenticate to the IPA server to perform the unenrollment.
+
+-Please note, that while the ipa\-join option removes the client from the domain, it does not actually uninstall the client or properly remove all of the IPA\-related configuration. The only way to uninstall a client completely is to use ipa\-client\-install \-\-uninstall
++Please note that while the \-\-unenroll option removes the client from the domain, it does not actually uninstall the client or properly remove all of the IPA\-related configuration. The only way to uninstall a client completely is to use ipa\-client\-install \-\-uninstall
+ (see
+ .BR ipa\-client\-install (1)).
+
+--
+2.56.0
+
+
+From 8bd9c5957f41d856e29c78f451f2e4c5a9a78427 Mon Sep 17 00:00:00 2001
+From: Shajith Arul Simon <shas@redhat.com>
+Date: Mon, 21 Sep 2026 20:16:25 +0530
+Subject: [PATCH 39/55] ipa-getkeytab: document -v/--verbose in man page
+
+The option is implemented in ipa-getkeytab.c but was missing from
+the man page.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10067
+
+Signed-off-by: Shajith Arul Simon <shas@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
+---
+ client/man/ipa-getkeytab.1 | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/client/man/ipa-getkeytab.1 b/client/man/ipa-getkeytab.1
+index 469eba03e..afb3d1290 100644
+--- a/client/man/ipa-getkeytab.1
++++ b/client/man/ipa-getkeytab.1
+@@ -21,7 +21,7 @@
+ .SH "NAME"
+ ipa\-getkeytab \- Get a keytab for a Kerberos principal
+ .SH "SYNOPSIS"
+-ipa\-getkeytab \fB\-p\fR \fIprincipal\-name\fR \fB\-k\fR \fIkeytab\-file\fR [ \fB\-e\fR \fIencryption\-types\fR ] [ \fB\-s\fR \fIipaserver\fR ] [ \fB\-q\fR ] [ \fB\-D\fR|\fB\-\-binddn\fR \fIBINDDN\fR ] [ \fB\-w|\-\-bindpw\fR ] [ \fB-W\fR ] [ \fB\-P\fR|\fB\-\-password\fR ] [ \fB\-\-cacert \fICACERT\fR ] [ \fB\-H|\-\-ldapuri \fIURI\fR ] [ \fB\-Y|\-\-mech \fIGSSAPI|EXTERNAL\fR ] [ \fB\-r\fR ]
++ipa\-getkeytab \fB\-p\fR \fIprincipal\-name\fR \fB\-k\fR \fIkeytab\-file\fR [ \fB\-e\fR \fIencryption\-types\fR ] [ \fB\-s\fR \fIipaserver\fR ] [ \fB\-q\fR ] [ \fB\-v\fR ] [ \fB\-D\fR|\fB\-\-binddn\fR \fIBINDDN\fR ] [ \fB\-w|\-\-bindpw\fR ] [ \fB-W\fR ] [ \fB\-P\fR|\fB\-\-password\fR ] [ \fB\-\-cacert \fICACERT\fR ] [ \fB\-H|\-\-ldapuri \fIURI\fR ] [ \fB\-Y|\-\-mech \fIGSSAPI|EXTERNAL\fR ] [ \fB\-r\fR ]
+
+ .SH "DESCRIPTION"
+ Retrieves a Kerberos \fIkeytab\fR.
+@@ -86,6 +86,9 @@ file.
+ \fB\-q\fR
+ Quiet mode. Only errors are displayed.
+ .TP
++\fB\-v, \-\-verbose\fR
++Verbose mode. Print debugging information.
++.TP
+ \fB\-\-permitted\-enctypes\fR
+ This option returns a description of the permitted encryption types, like this:
+ Supported encryption types:
+--
+2.56.0
+
+
+From f39b6709f81ea6a1271b6c8ed9ad5b58ef26a290 Mon Sep 17 00:00:00 2001
+From: Florence Blanc-Renaud <flo@redhat.com>
+Date: Tue, 6 Oct 2026 15:40:06 +0200
+Subject: [PATCH 40/55] ipa ca, caacl and certprofile: handle the key as
+ case-insensitive
+
+The object name is stored in the cn attribute and must be handled
+as case-insensitive when performing comparisons.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10085
+Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+---
+ ipaserver/plugins/ca.py | 12 +++++++----
+ ipaserver/plugins/caacl.py | 3 ++-
+ ipaserver/plugins/certprofile.py | 3 ++-
+ ipatests/test_xmlrpc/test_ca_plugin.py | 19 ++++++++++++++++++
+ ipatests/test_xmlrpc/test_caacl_plugin.py | 20 +++++++++++++++++++
+ .../test_xmlrpc/test_certprofile_plugin.py | 14 +++++++++++++
+ 6 files changed, 65 insertions(+), 6 deletions(-)
+
+diff --git a/ipaserver/plugins/ca.py b/ipaserver/plugins/ca.py
+index 772ec0652..f0297adf5 100644
+--- a/ipaserver/plugins/ca.py
++++ b/ipaserver/plugins/ca.py
+@@ -195,7 +195,8 @@ class ca(LDAPObject):
+ # that automatically for users to hide that complexity.
+
+ def add_token_key(self, *keys):
+- if len(keys) == 0 or keys[0] == IPA_CA_CN:
++ # the ca name is stored in a cn attribute which is case-insensitive
++ if len(keys) == 0 or keys[0].lower() == IPA_CA_CN.lower():
+ return keys
+ config = api.Command['config_show']()['result']
+ if 'hsm_token_name' in config and not keys[-1].startswith(
+@@ -401,7 +402,8 @@ class ca_del(LDAPDelete):
+ # before contacting Dogtag
+ ensure_ca_administrator(_("Insufficient privilege to delete a CA."))
+
+- if keys[0] == IPA_CA_CN:
++ # the ca name is stored in a cn attribute which is case-insensitive
++ if keys[0].lower() == IPA_CA_CN.lower():
+ raise errors.ProtectedEntryError(
+ label=_("CA"),
+ key=keys[0],
+@@ -435,7 +437,8 @@ class ca_mod(LDAPUpdate):
+ ca_enabled_check(self.api)
+
+ if 'rename' in options or 'cn' in entry_attrs:
+- if keys[0] == IPA_CA_CN:
++ # the ca name is stored in a cn attribute which is case-insensitive
++ if keys[0].lower() == IPA_CA_CN.lower():
+ raise errors.ProtectedEntryError(
+ label=_("CA"),
+ key=keys[0],
+@@ -477,7 +480,8 @@ class ca_disable(CAQuery):
+ msg_summary = _('Disabled CA "%(value)s"')
+
+ def execute(self, cn, **options):
+- if cn == IPA_CA_CN:
++ # the ca name is stored in a cn attribute which is case-insensitive
++ if cn.lower() == IPA_CA_CN.lower():
+ raise errors.ProtectedEntryError(
+ label=_("CA"),
+ key=cn,
+diff --git a/ipaserver/plugins/caacl.py b/ipaserver/plugins/caacl.py
+index 81e0fc510..cfe021da4 100644
+--- a/ipaserver/plugins/caacl.py
++++ b/ipaserver/plugins/caacl.py
+@@ -258,7 +258,8 @@ class caacl_del(LDAPDelete):
+ msg_summary = _('Deleted CA ACL "%(value)s"')
+
+ def pre_callback(self, ldap, dn, *keys, **options):
+- if keys[0] == 'hosts_services_caIPAserviceCert':
++ # the caacl name is stored in a cn attribute which is case-insensitive
++ if keys[0].lower() == 'hosts_services_caIPAserviceCert'.lower():
+ raise errors.ProtectedEntryError(
+ label=_("CA ACL"),
+ key=keys[0],
+diff --git a/ipaserver/plugins/certprofile.py b/ipaserver/plugins/certprofile.py
+index 18e7c7595..55d51582b 100644
+--- a/ipaserver/plugins/certprofile.py
++++ b/ipaserver/plugins/certprofile.py
+@@ -345,7 +345,8 @@ class certprofile_del(LDAPDelete):
+ def pre_callback(self, ldap, dn, *keys, **options):
+ ca_enabled_check(self.api)
+
+- if keys[0] in [p.profile_id for p in INCLUDED_PROFILES]:
++ # the name is stored in a cn attribute which is case-insensitive
++ if keys[0].lower() in [p.profile_id.lower() for p in INCLUDED_PROFILES]:
+ raise errors.ValidationError(name='profile_id',
+ error=_("Predefined profile '%(profile_id)s' cannot be deleted")
+ % {'profile_id': keys[0]}
+diff --git a/ipatests/test_xmlrpc/test_ca_plugin.py b/ipatests/test_xmlrpc/test_ca_plugin.py
+index c94ef3010..db1677b22 100644
+--- a/ipatests/test_xmlrpc/test_ca_plugin.py
++++ b/ipatests/test_xmlrpc/test_ca_plugin.py
+@@ -44,6 +44,15 @@ def default_ca(request):
+ return tracker
+
+
++@pytest.fixture(scope='module')
++def default_ca_uppercase(request):
++ name = u'ipa'.upper()
++ desc = u'IPA CA'
++ tracker = CATracker(name, fuzzy_issuer, desc=desc)
++ tracker.track_create()
++ return tracker
++
++
+ @pytest.fixture(scope='class')
+ def crud_subca(request, xmlrpc_setup):
+ name = u'crud-subca'
+@@ -88,6 +97,16 @@ class TestDefaultCA(XMLRPC_test):
+ with pytest.raises(errors.ProtectedEntryError):
+ default_ca.delete()
+
++ def test_default_ca_disable_ignorecase(self, default_ca_uppercase):
++ """IPA CA cannot be disabled."""
++ with pytest.raises(errors.ProtectedEntryError):
++ default_ca_uppercase.disable()
++
++ def test_default_ca_delete_ignorecase(self, default_ca_uppercase):
++ """IPA CA cannot be deleted."""
++ with pytest.raises(errors.ProtectedEntryError):
++ default_ca_uppercase.delete()
++
+
+ @pytest.mark.tier1
+ class TestCAbasicCRUD(XMLRPC_test):
+diff --git a/ipatests/test_xmlrpc/test_caacl_plugin.py b/ipatests/test_xmlrpc/test_caacl_plugin.py
+index cc5278320..5c0cb75f8 100644
+--- a/ipatests/test_xmlrpc/test_caacl_plugin.py
++++ b/ipatests/test_xmlrpc/test_caacl_plugin.py
+@@ -36,6 +36,16 @@ def default_acl(request, xmlrpc_setup):
+ return tracker
+
+
++@pytest.fixture(scope='class')
++def default_acl_uppercase(request, xmlrpc_setup):
++ name = u'hosts_services_caIPAserviceCert'.upper()
++ tracker = CAACLTracker(name, service_category=u'all', host_category=u'all')
++ tracker.track_create()
++ tracker.attrs.update(
++ {u'ipamembercertprofile_certprofile': [u'caIPAserviceCert']})
++ return tracker
++
++
+ @pytest.fixture(scope='class')
+ def crud_acl(request, xmlrpc_setup):
+ name = u'crud-acl'
+@@ -74,6 +84,16 @@ class TestDefaultACL(XMLRPC_test):
+ def test_default_acl_present(self, default_acl):
+ default_acl.retrieve()
+
++ def test_delete_default_acl(self, default_acl):
++ """ Delete the default acl """
++ with pytest.raises(errors.ProtectedEntryError):
++ default_acl.delete()
++
++ def test_delete_default_acl_ignorecase(self, default_acl_uppercase):
++ """ Delete the default acl """
++ with pytest.raises(errors.ProtectedEntryError):
++ default_acl_uppercase.delete()
++
+
+ @pytest.mark.tier1
+ class TestCAACLbasicCRUD(XMLRPC_test):
+diff --git a/ipatests/test_xmlrpc/test_certprofile_plugin.py b/ipatests/test_xmlrpc/test_certprofile_plugin.py
+index 0e3004abe..63314d72e 100644
+--- a/ipatests/test_xmlrpc/test_certprofile_plugin.py
++++ b/ipatests/test_xmlrpc/test_certprofile_plugin.py
+@@ -52,6 +52,15 @@ def default_profile(request, xmlrpc_setup):
+ return tracker
+
+
++@pytest.fixture(scope='class')
++def def_profile_uppercase(request, xmlrpc_setup):
++ name = 'caIPAserviceCert'.upper()
++ desc = u'Standard profile for network services'
++ tracker = CertprofileTracker(name, store=True, desc=desc)
++ tracker.track_create()
++ return tracker
++
++
+ @pytest.fixture(scope='class')
+ def user_profile(request, xmlrpc_setup):
+ name = 'caIPAserviceCert_mod'
+@@ -109,6 +118,11 @@ class TestDefaultProfile(XMLRPC_test):
+ with pytest.raises(errors.ValidationError):
+ default_profile.delete()
+
++ def test_deleting_default_profile_ignorecase(self, def_profile_uppercase):
++ """ delete profile with UPPERCASE name """
++ with pytest.raises(errors.ValidationError):
++ def_profile_uppercase.delete()
++
+ def test_try_rename_by_setattr(self, default_profile):
+ command = default_profile.make_update_command(
+ updates=dict(setattr=u'cn=bogus'))
+--
+2.56.0
+
+
+From 8ac7a4069671b03a05e4510786ae8f4549429aa8 Mon Sep 17 00:00:00 2001
+From: Florence Blanc-Renaud <flo@redhat.com>
+Date: Wed, 30 Sep 2026 18:47:57 +0200
+Subject: [PATCH 41/55] ipatests: use powershell to establish local side of
+ trust
+
+With windows 2025, netdom.exe trust /add fails with the error
+Authentication failed because NTLM authentication has been disabled
+
+Use powershell instead of netdom utility.
+Related: https://codeberg.org/freeipa/freeipa/issues/10018
+Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+---
+ ipatests/test_integration/test_trust.py | 30 +++++++++++++++----------
+ 1 file changed, 18 insertions(+), 12 deletions(-)
+
+diff --git a/ipatests/test_integration/test_trust.py b/ipatests/test_integration/test_trust.py
+index f84211c1c..c9248f635 100644
+--- a/ipatests/test_integration/test_trust.py
++++ b/ipatests/test_integration/test_trust.py
+@@ -1148,11 +1148,13 @@ class TestTrust(BaseTestTrust):
+ tasks.configure_dns_for_trust(self.master, self.ad)
+ tasks.configure_windows_dns_for_trust(self.ad, self.master)
+
+- # create windows side of trust using netdom.exe utility
+- self.ad.run_command(
+- ['netdom.exe', 'trust', self.master.domain.name,
+- '/d:' + self.ad.domain.name,
+- '/passwordt:' + self.shared_secret, '/add', '/oneside:TRUSTED'])
++ # create windows side of trust using powershell
++ ps_cmd = (
++ '[System.DirectoryServices.ActiveDirectory.Forest]'
++ '::getCurrentForest()'
++ '.CreateLocalSideOfTrustRelationship("{}", 1, "{}")'.format(
++ self.master.domain.name, self.shared_secret))
++ self.ad.run_command(['powershell', '-c', ps_cmd])
+
+ # create ipa side of trust
+ tasks.establish_trust_with_ad(
+@@ -1189,13 +1191,17 @@ class TestTrust(BaseTestTrust):
+
+ @skip_in_fips_mode_due_to_issue_8715
+ def test_remove_external_trust_with_shared_secret(self):
+- self.ad.run_command(
+- ['netdom.exe', 'trust', self.master.domain.name,
+- '/d:' + self.ad.domain.name, '/remove', '/oneside:TRUSTED']
+- )
+- self.remove_trust(self.ad)
+- tasks.unconfigure_windows_dns_for_trust(self.ad, self.master)
+- tasks.unconfigure_dns_for_trust(self.master, self.ad)
++ try:
++ ps_cmd = (
++ '[System.DirectoryServices.ActiveDirectory.Forest]'
++ '::getCurrentForest()'
++ '.DeleteLocalSideOfTrustRelationship("{}")'.format(
++ self.master.domain.name))
++ self.ad.run_command(['powershell', '-c', ps_cmd])
++ self.remove_trust(self.ad)
++ finally:
++ tasks.unconfigure_windows_dns_for_trust(self.ad, self.master)
++ tasks.unconfigure_dns_for_trust(self.master, self.ad)
+
+ def test_upgrade_within_forest(self):
+ """
+--
+2.56.0
+
+
+From a3fe4bce0f5e458e33b8de22c2bf9b876b328906 Mon Sep 17 00:00:00 2001
+From: Florence Blanc-Renaud <flo@redhat.com>
+Date: Wed, 30 Sep 2026 18:51:44 +0200
+Subject: [PATCH 42/55] Trust: do not reuse stale keytab for
+ trust-fetch-domains
+
+The scenario establish non-posix trust / remove trust / establish
+posix trust fails with Windows 2025 because trust-fetch-domains fails
+to detect that the keytab is stale.
+Do not try to reuse the keytab, always generate a new one.
+
+When the helper is called with --server option to force a specific
+AD domain controller, a special KRB5_CONFIG file is generated and needs
+to be provided to the kinit_keytab call as environment variable.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10018
+Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+---
+ .../com.redhat.idm.trust-fetch-domains.in | 30 +++++++------------
+ 1 file changed, 11 insertions(+), 19 deletions(-)
+
+diff --git a/install/oddjob/com.redhat.idm.trust-fetch-domains.in b/install/oddjob/com.redhat.idm.trust-fetch-domains.in
+index b86be0212..e852096aa 100644
+--- a/install/oddjob/com.redhat.idm.trust-fetch-domains.in
++++ b/install/oddjob/com.redhat.idm.trust-fetch-domains.in
+@@ -219,25 +219,15 @@ with ipautil.private_krb5_config(trusted_domain, options.server) as cfg_file:
+
+ try:
+ have_ccache = False
+- try:
+- # The keytab may have stale key material (from older trust-add run)
+- cred = kinit_keytab(
+- oneway_principal,
+- oneway_keytab_name,
+- oneway_ccache_name,
+- )
+- if cred.lifetime > 0:
+- have_ccache = True
+- except (gssapi.exceptions.ExpiredCredentialsError, gssapi.raw.misc.GSSError):
+- pass
+- if not have_ccache:
+- if os.path.exists(oneway_ccache_name):
+- os.unlink(oneway_ccache_name)
+- kinit_keytab(
+- oneway_principal,
+- oneway_keytab_name,
+- oneway_ccache_name,
+- )
++ # The keytab may have stale key material (from older trust-add run)
++ if os.path.exists(oneway_ccache_name):
++ os.unlink(oneway_ccache_name)
++ kinit_keytab(
++ oneway_principal,
++ oneway_keytab_name,
++ oneway_ccache_name,
++ config=os.environ['KRB5_CONFIG'],
++ )
+ except (gssapi.exceptions.GSSError, gssapi.raw.misc.GSSError):
+ # If there was failure on using keytab, assume it is stale and retrieve again
+ retrieve_keytab(api, ccache_name, oneway_keytab_name, oneway_principal)
+@@ -247,6 +237,7 @@ with ipautil.private_krb5_config(trusted_domain, options.server) as cfg_file:
+ oneway_principal,
+ oneway_keytab_name,
+ oneway_ccache_name,
++ config=os.environ['KRB5_CONFIG'],
+ )
+ else:
+ cred = kinit_password(
+@@ -255,6 +246,7 @@ with ipautil.private_krb5_config(trusted_domain, options.server) as cfg_file:
+ oneway_ccache_name,
+ canonicalize=True,
+ enterprise=True,
++ config=os.environ['KRB5_CONFIG'],
+ )
+
+ if cred and cred.lifetime > 0:
+--
+2.56.0
+
+
+From 8369ef41eebae720ab6ee5e835655697ffa0755a Mon Sep 17 00:00:00 2001
+From: David Hanina <dhanina@redhat.com>
+Date: Thu, 8 Oct 2026 11:39:55 +0200
+Subject: [PATCH 43/55] kdb: fix password expiration exemptions for
+ passwordless-capable users
+
+Commit fffb93a83 deferred the password expiration check for users with
+passwordless authentication methods to the kdcpolicy plugin
+(ipa_kdcpolicy_check_as), but the plugin was missing exemptions that
+validate_as_request() in MIT krb5 normally provides:
+
+- The kadmin/changepw service (KRB5_KDB_PWCHANGE_SERVICE) was not
+ exempted, preventing users with expired passwords from changing
+ their password via kpasswd when a passwordless method was configured.
+
+- The KRB5_KDB_REQUIRES_PWCHANGE attribute was not checked, so users
+ flagged as requiring a password change were not properly restricted
+ to the password change service.
+
+Additionally, ipadb_check_pw_policy() was passing the cleared
+db_entry->pw_expiration (0) to ipapwd_check_policy() instead of the
+real value from ied->pw_expiration. This broke min_pwd_life
+admin-reset detection for passwordless-capable users, because the
+comparison pwd_expiration == last_pwd_change (used to detect admin
+resets and bypass minimum password age) would never match when
+pwd_expiration is 0.
+
+This commit:
+- Adds the KRB5_KDB_PWCHANGE_SERVICE exemption to the kdcpolicy
+ password expiration check.
+- Adds KRB5_KDB_REQUIRES_PWCHANGE enforcement to the kdcpolicy check.
+- Uses ied->pw_expiration in ipadb_check_pw_policy() so that
+ ipapwd_check_policy() sees the real expiration value.
+- Adds integration tests covering all affected paths.
+- Adds a design document describing the two-phase password expiration
+ approach.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10066
+
+Signed-off-by: Julien Rische <jrische@redhat.com>
+Assisted-by: Claude Opus 4.6 <noreply@anthropic.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+---
+ daemons/ipa-kdb/ipa_kdb_kdcpolicy.c | 36 ++-
+ daemons/ipa-kdb/ipa_kdb_passwords.c | 7 +-
+ ipatests/test_integration/test_krbtpolicy.py | 237 +++++++++++++++++++
+ 3 files changed, 270 insertions(+), 10 deletions(-)
+
+diff --git a/daemons/ipa-kdb/ipa_kdb_kdcpolicy.c b/daemons/ipa-kdb/ipa_kdb_kdcpolicy.c
+index 14c85336a..c43eb4cf2 100644
+--- a/daemons/ipa-kdb/ipa_kdb_kdcpolicy.c
++++ b/daemons/ipa-kdb/ipa_kdb_kdcpolicy.c
+@@ -169,18 +169,36 @@ ipa_kdcpolicy_check_as(krb5_context context, krb5_kdcpolicy_moddata moddata,
+ * entry->pw_expiration so the KDC does not reject the AS-REQ before
+ * pre-authentication. Now that pre-auth is complete and we know the
+ * actual method used, enforce password expiration for password-based
+- * authentication. */
+- if (!passwordless_auth && ied->pw_expiration != 0) {
+- krb5_timestamp now;
+- kerr = krb5_timeofday(context, &now);
+- if (kerr)
+- goto done;
+-
+- if ((uint32_t)now > (uint32_t)ied->pw_expiration) {
+- *status = "CLIENT KEY EXPIRED";
++ * authentication.
++ *
++ * Mirror the exemptions from validate_as_request() in kdc_util.c:
++ * - Skip if the server is a password change service (kadmin/changepw)
++ * - Reject if the client requires a password change and the server is
++ * not a password change service */
++ if (!passwordless_auth &&
++ !(server->attributes & KRB5_KDB_PWCHANGE_SERVICE)) {
++ /* Status strings match validate_as_request() in MIT krb5
++ * kdc_util.c for consistency with KDC log messages. */
++ if (client->attributes & KRB5_KDB_REQUIRES_PWCHANGE) {
++ *status = "REQUIRED PWCHANGE";
+ kerr = KRB5KDC_ERR_KEY_EXP;
+ goto done;
+ }
++
++ if (ied->pw_expiration != 0) {
++ krb5_timestamp now;
++ kerr = krb5_timeofday(context, &now);
++ if (kerr) {
++ *status = "CANNOT GET CURRENT TIME";
++ goto done;
++ }
++
++ if (now > ied->pw_expiration) {
++ *status = "CLIENT KEY EXPIRED";
++ kerr = KRB5KDC_ERR_KEY_EXP;
++ goto done;
++ }
++ }
+ }
+
+ /* If there were policy limits associated with the authentication indicators,
+diff --git a/daemons/ipa-kdb/ipa_kdb_passwords.c b/daemons/ipa-kdb/ipa_kdb_passwords.c
+index 4ee9dfe6b..b1469c0da 100644
+--- a/daemons/ipa-kdb/ipa_kdb_passwords.c
++++ b/daemons/ipa-kdb/ipa_kdb_passwords.c
+@@ -119,9 +119,14 @@ static krb5_error_code ipadb_check_pw_policy(krb5_context context,
+ if (kerr != 0) {
+ return kerr;
+ }
++ /* Use ied->pw_expiration rather than db_entry->pw_expiration because
++ * ipadb_parse_ldap_entry() clears the latter to 0 for users with
++ * passwordless auth methods. ipapwd_check_policy() needs the real
++ * value to detect admin password resets (where pw_expiration equals
++ * last_pwd_change) and bypass the min_pwd_life check. */
+ ret = ipapwd_check_policy(ied->pol, passwd, ied->user, time(NULL),
+ db_entry->expiration,
+- db_entry->pw_expiration,
++ ied->pw_expiration,
+ ied->last_pwd_change,
+ ied->pw_history);
+ return ipapwd_error_to_kerr(context, ret);
+diff --git a/ipatests/test_integration/test_krbtpolicy.py b/ipatests/test_integration/test_krbtpolicy.py
+index 269cfb0a1..22fe45793 100644
+--- a/ipatests/test_integration/test_krbtpolicy.py
++++ b/ipatests/test_integration/test_krbtpolicy.py
+@@ -4,6 +4,7 @@
+
+ """
+ Module provides tests for Kerberos ticket policy options
++and password expiration enforcement in the kdcpolicy plugin.
+ """
+
+ from __future__ import absolute_import
+@@ -20,10 +21,14 @@ from ipatests.test_integration.test_otp import add_otptoken, del_otptoken
+ from ipatests.pytest_ipa.integration import tasks
+
+ PASSWORD = "Secret123"
++ALT_PASSWORD = "AltSecret456"
+ USER1 = "testuser1"
+ USER2 = "testuser2"
+ MAXLIFE = 86400
+ LANG_PKG = ["langpacks-en"]
++PAST_EXPIRATION = "20200101000000Z"
++# Must stay before 2038 until MIT krb5 moves krb5_timestamp to 64-bit.
++FUTURE_EXPIRATION = "20370101000000Z"
+
+ def maxlife_within_policy(input, maxlife, slush=3600):
+ """Given klist output of the TGT verify that it is within policy
+@@ -314,3 +319,235 @@ class TestPWPolicy(IntegrationTest):
+ "ls -1 {0} | wc -l".format(paths.IPA_CCACHES)
+ )
+ assert int(result.stdout_text.strip()) == 5
++
++ # ----------------------------------------------------------------
++ # Password expiration enforcement in ipa_kdcpolicy_check_as()
++ #
++ # The IPA KDB plugin clears entry->pw_expiration for users with
++ # passwordless methods (PKINIT, etc.) so that validate_as_request()
++ # does not reject the AS-REQ before pre-auth. The kdcpolicy plugin
++ # re-checks expiration after pre-auth using ied->pw_expiration.
++ # ----------------------------------------------------------------
++
++ @pytest.fixture
++ def pkinituser(self):
++ """Create a user with password + PKINIT auth types."""
++ user = "pkinitexpuser"
++ tasks.kinit_admin(self.master)
++ tasks.create_active_user(
++ self.master, user, PASSWORD,
++ extra_args=["--user-auth-type=password",
++ "--user-auth-type=pkinit"])
++ yield user
++ tasks.kinit_admin(self.master)
++ tasks.user_del(self.master, user, raiseonerr=False)
++
++ def expire_user_password(self, user):
++ """Set password expiration to the past and clear SSSD cache."""
++ tasks.kinit_admin(self.master)
++ self.master.run_command([
++ "ipa", "user-mod", user,
++ "--password-expiration", PAST_EXPIRATION,
++ ])
++ tasks.clear_sssd_cache(self.master)
++
++ def unexpire_user_password(self, user):
++ """Set password expiration to the far future."""
++ tasks.kinit_admin(self.master)
++ self.master.run_command([
++ "ipa", "user-mod", user,
++ "--password-expiration", FUTURE_EXPIRATION,
++ ])
++ tasks.clear_sssd_cache(self.master)
++
++ def test_pw_expiration_pwonly_valid(self):
++ """Password-only user with valid password can kinit."""
++ tasks.kdestroy_all(self.master)
++ result = tasks.kinit_as_user(self.master, USER1, PASSWORD,
++ raiseonerr=False)
++ assert result.returncode == 0
++
++ def test_pw_expiration_pwonly_expired(self):
++ """Password-only user with expired password cannot kinit.
++
++ validate_as_request() enforces pw_expiration directly.
++ """
++ self.expire_user_password(USER1)
++ try:
++ tasks.kdestroy_all(self.master)
++ result = tasks.kinit_as_user(self.master, USER1, PASSWORD,
++ raiseonerr=False)
++ assert result.returncode != 0
++ finally:
++ self.unexpire_user_password(USER1)
++
++ def test_pw_expiration_pkinit_user_password_rejected(self, pkinituser):
++ """Passwordless-capable user with expired password cannot kinit
++ using password.
++
++ validate_as_request() skips the check (pw_expiration cleared to
++ 0 by ipadb_parse_ldap_entry), but ipa_kdcpolicy_check_as()
++ enforces it using ied->pw_expiration.
++ """
++ self.expire_user_password(pkinituser)
++ tasks.kdestroy_all(self.master)
++ result = tasks.kinit_as_user(self.master, pkinituser, PASSWORD,
++ raiseonerr=False)
++ assert result.returncode != 0, (
++ "kinit should fail for pkinit+password user with expired password"
++ )
++
++ def test_pw_expiration_pkinit_user_valid(self, pkinituser):
++ """Passwordless-capable user with valid password can kinit."""
++ tasks.kdestroy_all(self.master)
++ result = tasks.kinit_as_user(self.master, pkinituser, PASSWORD,
++ raiseonerr=False)
++ assert result.returncode == 0
++
++ def test_pw_expiration_pwonly_kpasswd(self):
++ """Password-only user with expired password can change it via
++ kpasswd.
++
++ validate_as_request() exempts KRB5_KDB_PWCHANGE_SERVICE.
++ """
++ tasks.kinit_admin(self.master)
++ self.master.run_command(["ipa", "pwpolicy-mod", "--minlife=0"],
++ raiseonerr=False)
++ self.expire_user_password(USER1)
++ try:
++ tasks.kdestroy_all(self.master)
++ with self.master.spawn_expect(
++ ["kpasswd", USER1], default_timeout=30
++ ) as e:
++ e.expect("Password for .+:")
++ e.sendline(PASSWORD)
++ e.expect_exact("Enter new password:")
++ e.sendline(ALT_PASSWORD)
++ e.expect_exact("Enter it again:")
++ e.sendline(ALT_PASSWORD)
++ e.expect_exit(ignore_remaining_output=True)
++
++ # Verify new password works
++ self.unexpire_user_password(USER1)
++ tasks.kdestroy_all(self.master)
++ result = tasks.kinit_as_user(self.master, USER1, ALT_PASSWORD,
++ raiseonerr=False)
++ assert result.returncode == 0
++ finally:
++ # Restore original password
++ tasks.kinit_admin(self.master)
++ self.master.run_command(
++ ["ipa", "passwd", USER1],
++ stdin_text="{0}\n{0}\n".format(PASSWORD),
++ )
++ self.unexpire_user_password(USER1)
++
++ def test_pw_expiration_pkinit_user_kpasswd(self, pkinituser):
++ """Passwordless-capable user with expired password can change it
++ via kpasswd.
++
++ validate_as_request() skips the check (pw_expiration cleared),
++ and ipa_kdcpolicy_check_as() must exempt PWCHANGE_SERVICE.
++ """
++ tasks.kinit_admin(self.master)
++ self.master.run_command(["ipa", "pwpolicy-mod", "--minlife=0"],
++ raiseonerr=False)
++ self.expire_user_password(pkinituser)
++ tasks.kdestroy_all(self.master)
++ with self.master.spawn_expect(
++ ["kpasswd", pkinituser], default_timeout=30
++ ) as e:
++ e.expect("Password for .+:")
++ e.sendline(PASSWORD)
++ e.expect_exact("Enter new password:")
++ e.sendline(ALT_PASSWORD)
++ e.expect_exact("Enter it again:")
++ e.sendline(ALT_PASSWORD)
++ e.expect_exit(ignore_remaining_output=True)
++
++ # Verify new password works
++ self.unexpire_user_password(pkinituser)
++ tasks.kdestroy_all(self.master)
++ result = tasks.kinit_as_user(self.master, pkinituser, ALT_PASSWORD,
++ raiseonerr=False)
++ assert result.returncode == 0
++
++ def test_min_pwd_life_admin_reset_pwonly(self):
++ """Admin password reset bypasses min_pwd_life for password-only
++ user.
++
++ When an admin resets a password, krbPasswordExpiration equals
++ krbLastPwdChange, signalling that minimum password age should
++ not apply.
++ """
++ tasks.kinit_admin(self.master)
++ self.master.run_command(["ipa", "pwpolicy-mod", "--minlife=1"],
++ raiseonerr=False)
++ try:
++ self.master.run_command(
++ ["ipa", "passwd", USER1],
++ stdin_text="{0}\n{0}\n".format(ALT_PASSWORD),
++ )
++ tasks.kdestroy_all(self.master)
++ # User can change password immediately despite minlife
++ with self.master.spawn_expect(
++ ["kinit", USER1], default_timeout=30
++ ) as e:
++ e.expect("Password for .+:")
++ e.sendline(ALT_PASSWORD)
++ e.expect("Password expired")
++ e.expect("Enter new password:")
++ e.sendline(PASSWORD)
++ e.expect("Enter it again:")
++ e.sendline(PASSWORD)
++ e.expect_exit(ignore_remaining_output=True)
++ finally:
++ tasks.kinit_admin(self.master)
++ self.master.run_command(["ipa", "pwpolicy-mod", "--minlife=0"],
++ raiseonerr=False)
++
++ def test_min_pwd_life_admin_reset_pkinit_user(self, pkinituser):
++ """Admin password reset bypasses min_pwd_life for
++ passwordless-capable user.
++
++ ipadb_check_pw_policy() must use ied->pw_expiration (real value
++ from LDAP) rather than db_entry->pw_expiration (cleared to 0
++ for passwordless-capable users) for admin-reset detection.
++ """
++ tasks.kinit_admin(self.master)
++ self.master.run_command(["ipa", "pwpolicy-mod", "--minlife=1"],
++ raiseonerr=False)
++ try:
++ self.master.run_command(
++ ["ipa", "passwd", pkinituser],
++ stdin_text="{0}\n{0}\n".format(ALT_PASSWORD),
++ )
++ tasks.kdestroy_all(self.master)
++ # User can change password immediately despite minlife
++ with self.master.spawn_expect(
++ ["kinit", pkinituser], default_timeout=30
++ ) as e:
++ e.expect("Password for .+:")
++ e.sendline(ALT_PASSWORD)
++ e.expect("Password expired")
++ e.expect("Enter new password:")
++ e.sendline(PASSWORD)
++ e.expect("Enter it again:")
++ e.sendline(PASSWORD)
++ e.expect_exit(ignore_remaining_output=True)
++ finally:
++ tasks.kinit_admin(self.master)
++ self.master.run_command(["ipa", "pwpolicy-mod", "--minlife=0"],
++ raiseonerr=False)
++
++ def test_pw_expiration_cleanup(self):
++ """Restore state after password expiration tests."""
++ tasks.kinit_admin(self.master)
++ self.master.run_command(["ipa", "pwpolicy-mod", "--minlife=0"],
++ raiseonerr=False)
++ self.master.run_command(
++ ["ipa", "passwd", USER1],
++ stdin_text="{0}\n{0}\n".format(PASSWORD),
++ raiseonerr=False,
++ )
++ self.unexpire_user_password(USER1)
+--
+2.56.0
+
+
+From 8e9055dfca513067ba9406df63d47e6edffb339b Mon Sep 17 00:00:00 2001
+From: Florence Blanc-Renaud <flo@redhat.com>
+Date: Mon, 12 Oct 2026 10:40:35 +0200
+Subject: [PATCH 44/55] ipatests: Fix uninstall options in test_installation.py
+
+The test test_replica_install_existing_agreement is using a non-existing
+option '--force' when calling --uninstall.
+Replace with --ignore-topology-disconnect --ignore-last-of-role
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10089
+Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+---
+ ipatests/test_integration/test_installation.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/ipatests/test_integration/test_installation.py b/ipatests/test_integration/test_installation.py
+index c654cdd09..6aba1b85e 100644
+--- a/ipatests/test_integration/test_installation.py
++++ b/ipatests/test_integration/test_installation.py
+@@ -1898,7 +1898,8 @@ class TestInstallReplicaAgainstSpecificServer(IntegrationTest):
+ # instead of replica-manage
+ self.replicas[0].run_command(['ipa-server-install',
+ '--uninstall',
+- '--force',
++ '--ignore-topology-disconnect',
++ '--ignore-last-of-role',
+ '-U'])
+ tasks.start_ipa_server(self.master)
+
+--
+2.56.0
+
+
+From 2ce06de7bf9daf3dd5c5535fe1da39e8d787982a Mon Sep 17 00:00:00 2001
+From: Stanislav Levin <slev@altlinux.org>
+Date: Tue, 13 Oct 2026 13:49:04 +0200
+Subject: [PATCH 45/55] ipatests: selfservice: use made-up login shells
+
+test_set_all_default_selfservice_attrs sets each attribute in turn,
+including loginshell='/bin/bash'. On platforms where the default
+shell is /bin/bash (e.g. ALT Linux), the user already has that value
+and user_mod fails with EmptyModlist. The loop stops there, so the
+remaining attributes (street, manager, ...) are never set, and
+test_verify_persisted_attrs and test_user_find_by_manager fail too.
+
+loginshell is a plain string with no checks on the server, so use
+made-up values that can never match any platform's default shell.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10092
+Signed-off-by: Stanislav Levin <slev@altlinux.org>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+---
+ ipatests/test_xmlrpc/test_selfservice_plugin.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/ipatests/test_xmlrpc/test_selfservice_plugin.py b/ipatests/test_xmlrpc/test_selfservice_plugin.py
+index be86c5a67..19985d31c 100644
+--- a/ipatests/test_xmlrpc/test_selfservice_plugin.py
++++ b/ipatests/test_xmlrpc/test_selfservice_plugin.py
+@@ -517,7 +517,7 @@ class test_selfservice_users(XMLRPC_test):
+ 'displayname': 'gooduser',
+ 'initials': 'GU',
+ 'gecos': 'gooduser@good.example.com',
+- 'loginshell': '/bin/bash',
++ 'loginshell': '/bin/good_shell',
+ 'street': 'Good_Street_Rd',
+ 'l': 'Good_City',
+ 'st': 'Goodstate',
+@@ -577,7 +577,7 @@ class test_selfservice_users(XMLRPC_test):
+ 'displayname': 'badluser',
+ 'initials': 'BL',
+ 'gecos': 'badluser@bad.example.com',
+- 'loginshell': '/bin/tcsh',
++ 'loginshell': '/bin/bad_shell',
+ 'street': 'Bad_Street_Av',
+ 'l': 'Bad_City',
+ 'st': 'Badstate',
+@@ -627,7 +627,7 @@ class test_selfservice_users(XMLRPC_test):
+ 'displayname': 'gooduser',
+ 'initials': 'GU',
+ 'gecos': 'gooduser@good.example.com',
+- 'loginshell': '/bin/bash',
++ 'loginshell': '/bin/good_shell',
+ 'street': 'Good_Street_Rd',
+ 'l': 'Good_City',
+ 'st': 'Goodstate',
+--
+2.56.0
+
+
+From d887b50cde55589deda04f8095fbf883a2f4c71e Mon Sep 17 00:00:00 2001
+From: Rakesh Kumar <rakkumar@redhat.com>
+Date: Thu, 8 Oct 2026 22:33:09 +0530
+Subject: [PATCH 46/55] ipa-csreplica-manage: blame correct host on bind
+ failure
+
+add_link() connects to replica2 but the generic exception
+reported replica1, which is misleading when diagnosing failures.
+
+Signed-off-by: Rakesh Kumar <rakkumar@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+---
+ install/tools/ipa-csreplica-manage.in | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/install/tools/ipa-csreplica-manage.in b/install/tools/ipa-csreplica-manage.in
+index 8f4daec88..18573caa0 100644
+--- a/install/tools/ipa-csreplica-manage.in
++++ b/install/tools/ipa-csreplica-manage.in
+@@ -305,7 +305,10 @@ def add_link(realm, replica1, replica2, dirman_passwd, options):
+ except errors.NetworkError as e:
+ sys.exit("Unable to connect to %s: %s" % (ipautil.format_netloc(replica2, 636), str(e)))
+ except Exception as e:
+- sys.exit("Failed to get data while trying to bind to '%s': %s" % (replica1, str(e)))
++ sys.exit(
++ "Failed to get data while trying to bind to '%s': %s"
++ % (replica2, str(e))
++ )
+
+ try:
+ repl1 = replication.get_cs_replication_manager(realm, replica1,
+--
+2.56.0
+
+
+From 7bb3a11017886f13fd208234b2c9c109fa08c523 Mon Sep 17 00:00:00 2001
+From: PRANAV THUBE <pthube@redhat.com>
+Date: Tue, 13 Oct 2026 14:22:11 +0530
+Subject: [PATCH 47/55] ipatests:test_ipa_join: fix resolve error assertion for
+ RHEL 9 vs RHEL 10
+
+The ERR_COULD_NOT_RESOLVE constant matches only the newer curl wording
+"Could not resolve hostname" (RHEL 10 / Fedora). On RHEL 9 the message
+is "Couldn't resolve host name", so 4 tests never passed there. Replace
+the exact match with a case-insensitive check that accepts both variants.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10091
+Signed-off-by: Pranav Thube <pthube@redhat.com>
+Reviewed-By: Anuja More <amore@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+---
+ ipatests/test_integration/test_ipa_join.py | 27 ++++++++++++++++++----
+ 1 file changed, 22 insertions(+), 5 deletions(-)
+
+diff --git a/ipatests/test_integration/test_ipa_join.py b/ipatests/test_integration/test_ipa_join.py
+index 81de7977c..9c27365c0 100644
+--- a/ipatests/test_integration/test_ipa_join.py
++++ b/ipatests/test_integration/test_ipa_join.py
+@@ -36,11 +36,28 @@ TEST_KEYTAB = "/tmp/ipajoin.test.keytab"
+ # Error messages
+ ERR_SASL_BIND_FAILED = "SASL Bind failed"
+ ERR_UNAUTHENTICATED_BIND = "Unauthenticated binds are not allowed"
+-ERR_COULD_NOT_RESOLVE = "JSON-RPC call failed: Could not resolve hostname"
+ ERR_UNABLE_ROOT_DN = "Unable to determine root DN"
+ ERR_NO_CONFIG = "Unable to determine IPA server from /etc/ipa/default.conf"
+ ERR_PREAUTH_FAILED = "Generic preauthentication failure"
+
++
++def _assert_could_not_resolve(result):
++ """Assert that stderr contains the 'could not resolve' error.
++
++ The exact wording depends on the libcurl version:
++ Old curl (RHEL 9): "Couldn't resolve host name"
++ New curl (Fedora / curl >= 8.9): "Could not resolve hostname"
++ """
++ stderr_lower = result.stderr_text.lower()
++ assert (
++ "could not resolve hostname" in stderr_lower
++ or "couldn't resolve host name" in stderr_lower
++ ), (
++ "Expected 'could not resolve hostname' or "
++ "'couldn't resolve host name' in stderr, "
++ "got: %s" % result.stderr_text
++ )
++
+ # Exit codes
+ EXIT_SUCCESS = 0
+ EXIT_GENERAL_ERROR = 1
+@@ -206,7 +223,7 @@ class TestIPAJoin(IntegrationTest):
+ )
+
+ assert result.returncode == EXIT_RESOLVE_ERROR
+- assert ERR_COULD_NOT_RESOLVE in result.stderr_text
++ _assert_could_not_resolve(result)
+ finally:
+ self.clients[0].run_command(['kdestroy', '-A'], raiseonerr=False)
+
+@@ -237,7 +254,7 @@ class TestIPAJoin(IntegrationTest):
+ )
+
+ assert result.returncode == EXIT_RESOLVE_ERROR
+- assert ERR_COULD_NOT_RESOLVE in result.stderr_text
++ _assert_could_not_resolve(result)
+ finally:
+ self.clients[0].run_command(['kdestroy', '-A'], raiseonerr=False)
+
+@@ -419,7 +436,7 @@ class TestIPAJoin(IntegrationTest):
+ )
+
+ assert result.returncode == EXIT_RESOLVE_ERROR
+- assert ERR_COULD_NOT_RESOLVE in result.stderr_text
++ _assert_could_not_resolve(result)
+ finally:
+ self.clients[0].run_command(['kdestroy', '-A'], raiseonerr=False)
+
+@@ -448,7 +465,7 @@ class TestIPAJoin(IntegrationTest):
+ )
+
+ assert result.returncode == EXIT_RESOLVE_ERROR
+- assert ERR_COULD_NOT_RESOLVE in result.stderr_text
++ _assert_could_not_resolve(result)
+ finally:
+ self.clients[0].run_command(['kdestroy', '-A'], raiseonerr=False)
+
+--
+2.56.0
+
+
+From 00465faa2fc23ad3b3a2835fb24397376b84908f Mon Sep 17 00:00:00 2001
+From: Rakesh Kumar <rakkumar@redhat.com>
+Date: Wed, 7 Oct 2026 21:29:49 +0530
+Subject: [PATCH 48/55] Improve error message when ldappasswd is called without
+ password specification.
+
+When ldappasswd is called without -S flags, the current error
+message 'Password generation not implemented' doesn't guide users on
+how to fix the issue.
+
+This commit improves the error message to:
+'Password generation is not supported. Please specify a password
+using the -S (interactive) option.'
+
+This helps users understand what they need to do to successfully
+change passwords.
+
+Signed-off-by: Rakesh Kumar <rakkumar@redhat.com>
+Reviewed-By: Carla Martinez <carlmart@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+Reviewed-By: Sudhir Menon <sumenon@redhat.com>
+---
+ daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
+index b50e4d5ca..29c821932 100644
+--- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
++++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
+@@ -337,7 +337,7 @@ parse_req_done:
+ * password generation yet.
+ */
+ if (newPasswd == NULL || *newPasswd == '\0') {
+- errMesg = "Password generation not implemented.\n";
++ errMesg = "Password generation is not supported. Please specify a password using the -S (interactive) option.\n";
+ rc = LDAP_UNWILLING_TO_PERFORM;
+ goto free_and_return;
+ }
+--
+2.56.0
+
+
+From f7bf1cee0a06f412b7c592bfcb1928588dfe68a8 Mon Sep 17 00:00:00 2001
+From: PRANAV THUBE <pthube@redhat.com>
+Date: Fri, 9 Oct 2026 14:26:58 +0530
+Subject: [PATCH 49/55] ipatests: fix passwd_change_with_retry failing to
+ detect successful password change
+
+On RHEL 9, passwd prints "all authentication tokens updated
+successfully" (Red Hat's PAM-based passwd). On RHEL 10, shadow-utils
+was rebased to upstream (4.14+) which prints "password updated
+successfully" instead (lib/pam_pass.c).
+
+The success check only matched "password updated successfully",
+so on RHEL 9 the password change was never detected as successful.
+The retry loop kept retrying with the original password, which AD
+rejected with "Old password not accepted" since it was already
+changed on the first attempt.
+
+Fix by checking for both success messages.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10088
+Reviewed-By: Anuja More <amore@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+Reviewed-By: Carla Martinez <carlmart@redhat.com>
+---
+ ipatests/test_integration/test_trust_functional.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/ipatests/test_integration/test_trust_functional.py b/ipatests/test_integration/test_trust_functional.py
+index 279db79a6..878b05806 100644
+--- a/ipatests/test_integration/test_trust_functional.py
++++ b/ipatests/test_integration/test_trust_functional.py
+@@ -130,10 +130,9 @@ def expect_password_change_prompts(test, current_password, new_password):
+ :param current_password: User's current password.
+ :param new_password: New password to set.
+ """
+- # (?i) ignores case, enabling flag this way is atypical.
+ test.expect(r'(?i)current password:')
+ test.sendline(current_password)
+- test.expect(r'(?i).*password.*:')
++ test.expect(r'(?i)new password:')
+ test.sendline(new_password)
+ test.expect(r'(?i).*password.*:')
+ test.sendline(new_password)
+@@ -160,8 +159,9 @@ def passwd_change_with_retry(host, user_fqdn, current_password,
+ )
+ e.expect_exit(ignore_remaining_output=True, raiseonerr=False)
+ last_output = e.before if e.before else ""
++ exitstatus = e.exitstatus
+
+- if "password updated successfully" in last_output:
++ if exitstatus == 0:
+ return
+ time.sleep(2)
+
+--
+2.56.0
+
+
+From c53f3e5105a4fb5ae78764c566bdfc1801628eb4 Mon Sep 17 00:00:00 2001
+From: Akshay Sakure <asakure@redhat.com>
+Date: Wed, 7 Oct 2026 13:36:44 +0530
+Subject: [PATCH 50/55] Man: Correct the file/dir path to ~/.ipa/ in
+ default.conf(5)
+
+This patch corrects the file path ~/.ipa/default.conf
+to directory path ~/.ipa/ in default(5) man-page. It
+also corrects the formatting in DESCRIPTION.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10086
+
+Signed-off-by: Akshay Sakure <asakure@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+Reviewed-By: Carla Martinez <carlmart@redhat.com>
+Reviewed-By: Sudhir Menon <sumenon@redhat.com>
+---
+ client/man/default.conf.5 | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/client/man/default.conf.5 b/client/man/default.conf.5
+index 59a6a1cfb..9c9a7a9ca 100644
+--- a/client/man/default.conf.5
++++ b/client/man/default.conf.5
+@@ -22,9 +22,9 @@ default.conf \- IPA configuration file
+ .SH "SYNOPSIS"
+ /etc/ipa/default.conf, ~/.ipa/default.conf, /etc/ipa/server.conf, /etc/ipa/cli.conf, /etc/ipa/installer.conf, /etc/ipa/cli_installer.conf
+ .SH "DESCRIPTION"
+-The \fIdefault.conf \fRconfiguration file is used to set system\-wide defaults to be applied when running IPA clients and servers.
++The \fIdefault.conf\fR configuration file is used to set system\-wide defaults to be applied when running IPA clients and servers.
+
+-Users may create an optional configuration file in \fI~/.ipa/default.conf\fR which will be merged into the system\-wide defaults file.
++Users may create an optional configuration file i.e., default.conf in the \fI~/.ipa/\fR directory which will be merged into the system\-wide defaults file.
+
+ The following files are read, in order:
+ .nf
+--
+2.56.0
+
+
+From 12f347f35240b23146808c5adccf9c9f2d9b8acf Mon Sep 17 00:00:00 2001
+From: Akshay Sakure <asakure@redhat.com>
+Date: Wed, 7 Oct 2026 13:39:17 +0530
+Subject: [PATCH 51/55] Man: Correct the type for rpc_protocol in
+ default.conf(5)
+
+This patch corrects the type for rpc_protocol option in
+defaults.conf(5) man-page. <URI> -> <protocol>
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10086
+
+Signed-off-by: Akshay Sakure <asakure@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+Reviewed-By: Carla Martinez <carlmart@redhat.com>
+Reviewed-By: Sudhir Menon <sumenon@redhat.com>
+---
+ client/man/default.conf.5 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/client/man/default.conf.5 b/client/man/default.conf.5
+index 9c9a7a9ca..41cba3b17 100644
+--- a/client/man/default.conf.5
++++ b/client/man/default.conf.5
+@@ -217,7 +217,7 @@ Specifies the URI of the XML\-RPC server for a client. This may be used by IPA,
+ .B jsonrpc_uri <URI>
+ Specifies the URI of the JSON server for a client. This is used by IPA. If not given, it is derived from xmlrpc_uri. Example: https://ipa.example.com/ipa/json
+ .TP
+-.B rpc_protocol <URI>
++.B rpc_protocol <protocol>
+ Specifies the type of RPC calls IPA makes: 'jsonrpc' or 'xmlrpc'. Defaults to 'jsonrpc'.
+ .TP
+ .B key_type_size TYPE:SIZE
+--
+2.56.0
+
+
+From 6d6a9bf55fe0bc7b6bf5edecd3aca64e5c61a93b Mon Sep 17 00:00:00 2001
+From: Akshay Sakure <asakure@redhat.com>
+Date: Wed, 7 Oct 2026 13:42:07 +0530
+Subject: [PATCH 52/55] Man: Correct the heading for log_logger_XXX option in
+ default.conf(5)
+
+This patch corrects the heading for log_logger_XXX option in
+default.conf(5) man-page from log_logger_XXX to
+log_logger_level_XXX.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10086
+
+Signed-off-by: Akshay Sakure <asakure@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+Reviewed-By: Carla Martinez <carlmart@redhat.com>
+Reviewed-By: Sudhir Menon <sumenon@redhat.com>
+---
+ client/man/default.conf.5 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/client/man/default.conf.5 b/client/man/default.conf.5
+index 41cba3b17..d02109788 100644
+--- a/client/man/default.conf.5
++++ b/client/man/default.conf.5
+@@ -125,7 +125,7 @@ Log details on hits, misses, etc. for the LDAP cache if the cache is enabled.
+ .B ldap_uri <URI>
+ Specifies the URI of the IPA LDAP server to connect to. The URI scheme may be one of \fBldap\fR or \fBldapi\fR. The default is to use ldapi, e.g. ldapi://%2fvar%2frun%2fslapd\-EXAMPLE\-COM.socket
+ .TP
+-.B log_logger_XXX <comma separated list of regexps>
++.B log_logger_level_XXX <comma separated list of regexps>
+ loggers matching regexp will be assigned XXX level.
+ .IP
+ Logger levels can be explicitly specified for specific loggers as
+--
+2.56.0
+
+
+From 09c2543c4409941017d74a4b2a6917c1f5e3273c Mon Sep 17 00:00:00 2001
+From: Akshay Sakure <asakure@redhat.com>
+Date: Wed, 7 Oct 2026 14:20:00 +0530
+Subject: [PATCH 53/55] Man: Correct grammatical mistakes/punctuations in
+ default.conf(5)
+
+This patch corrects several minor grammatical mistakes
+and punctuations in default.conf(5) man-page.
+
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10086
+
+Signed-off-by: Akshay Sakure <asakure@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+Reviewed-By: Carla Martinez <carlmart@redhat.com>
+Reviewed-By: Sudhir Menon <sumenon@redhat.com>
+---
+ client/man/default.conf.5 | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/client/man/default.conf.5 b/client/man/default.conf.5
+index d02109788..39aea9bc3 100644
+--- a/client/man/default.conf.5
++++ b/client/man/default.conf.5
+@@ -75,13 +75,13 @@ Specifies the hostname of the dogtag CA server. The default is the hostname of t
+ Specifies the insecure CA end user port. The default is 8080.
+ .TP
+ .B certmonger_wait_timeout <seconds>
+-The time to wait for a certmonger request to complete during installation. The default value is 300 seconds. To tune create/add to /etc/ipa/installer.conf.
++The time to wait for a certmonger request to complete during installation. The default value is 300 seconds. To tune this value, add it to /etc/ipa/installer.conf.
+ .TP
+ .B context <context>
+ Specifies the context that IPA is being executed in. IPA may operate differently depending on the context. The current defined contexts are cli, server and dns. Additionally this value is used to load /etc/ipa/\fBcontext\fR.conf to provide context\-specific configuration. For example, if you want to always perform client requests in verbose mode but do not want to have verbose enabled on the server, add the verbose option to \fI/etc/ipa/cli.conf\fR.
+ .TP
+ .B debug <boolean>
+-When True provides detailed information. Specifically this set the global log level to "debug". Default is False.
++When True, provides detailed information. Specifically this sets the global log level to "debug". Default is False.
+ .TP
+ .B dogtag_version <version>
+ Stores the version of Dogtag. Value 9 is assumed if not specified otherwise.
+@@ -117,13 +117,13 @@ Controls the lifetime of ticket obtained by users authenticating to the WebGUI u
+ Enable a per-request LDAP cache. The default is True.
+ .TP
+ .B ldap_cache_size <integer>
+-The maximum number of entries cached if ldap_cache is True. Since this cache is per-request it is not expected to be very large. The default is 100. Setting the value < 1 effectively disables the cache regardless of the ldap_cache setting
++The maximum number of entries cached if ldap_cache is True. Since this cache is per-request it is not expected to be very large. The default is 100. Setting the value < 1 effectively disables the cache regardless of the ldap_cache setting.
+ .TP
+ .B ldap_cache_debug <boolean>
+ Log details on hits, misses, etc. for the LDAP cache if the cache is enabled.
+ .TP
+ .B ldap_uri <URI>
+-Specifies the URI of the IPA LDAP server to connect to. The URI scheme may be one of \fBldap\fR or \fBldapi\fR. The default is to use ldapi, e.g. ldapi://%2fvar%2frun%2fslapd\-EXAMPLE\-COM.socket
++Specifies the URI of the IPA LDAP server to connect to. The URI scheme may be one of \fBldap\fR or \fBldapi\fR. The default is to use ldapi, e.g. ldapi://%2fvar%2frun%2fslapd\-EXAMPLE\-COM.socket.
+ .TP
+ .B log_logger_level_XXX <comma separated list of regexps>
+ loggers matching regexp will be assigned XXX level.
+@@ -140,9 +140,9 @@ followed by a symbolic or numeric log level, for example:
+ log_logger_level_35 = ipalib\\.plugins\\.dogtag
+ .IP
+ The first line says any logger belonging to the ipalib.dn module
+-will have it's level configured to debug.
++will have its level configured to debug.
+ .IP
+-The second line say the ipa.plugins.dogtag logger will be
++The second line says the ipa.plugins.dogtag logger will be
+ configured to level 35.
+ .IP
+ This config item is useful when you only want to see the log output from
+@@ -158,10 +158,10 @@ will usually need to escape the dot in the logger names by
+ preceding it with a backslash.
+ .TP
+ .B mode <mode>
+-Specifies the mode the server is running in. The currently support values are \fBproduction\fR and \fBdeveloper\fR. When running in production mode some self\-tests are skipped to improve performance.
++Specifies the mode the server is running in. The currently supported values are \fBproduction\fR and \fBdeveloper\fR. When running in production mode some self\-tests are skipped to improve performance.
+ .TP
+ .B mount_ipa <URI>
+-Specifies the mount point that the development server will register. The default is /ipa/
++Specifies the mount point that the development server will register. The default is /ipa/.
+ .TP
+ .B oidc_child_debug_level <debuglevel>
+ Specifies the debug level of \fBoidc_child\fR, a helper process used by \fBipa-otpd\fR for OIDC/OAuth2 authentication. Level can be between 0 and 10, the higher the more details. If the level is 6 or higher HTTP debug output is added as well.
+@@ -188,7 +188,7 @@ The number of seconds for the ipa tool to cache the IPA API and help schema. Red
+ Specifies the IPA Server hostname.
+ .TP
+ .B skip_version_check <boolean>
+-Skip client vs. server API version checking. Can lead to errors/strange behavior when newer clients talk to older servers. Use with caution.
++Skip client vs. server API version checking. This can lead to errors/strange behavior when newer clients talk to older servers. Use with caution.
+ .TP
+ .B startup_timeout <time in seconds>
+ Controls the amount of time waited when starting a service. The default value is 90 seconds, the same as the default systemd startup timeout. If configuring a CA the startup_timeout value will be added as an override for TimeoutStartSec in systemd. If installation times out when starting the CA create /etc/ipa/installer.conf with this value set.
+@@ -200,7 +200,7 @@ If the IPA server fails to start and this value is True the server will attempt
+ Used internally in the IPA source package to verify that the API has not changed. This is used to prevent regressions. If it is true then some errors are ignored so enough of the IPA framework can be loaded to verify all of the API, even if optional components are not installed. The default is False.
+ .TP
+ .B verbose <boolean>
+-When True provides more information. Specifically this sets the global log level to "info".
++When True, provides more information. Specifically this sets the global log level to "info".
+ .TP
+ .B wait_for_dns <number of attempts>
+ Controls whether the IPA commands dnsrecord\-{add,mod,del} work synchronously or not. The DNS commands will repeat DNS queries up to the specified number of attempts until the DNS server returns an up-to-date answer to a query for modified records. Delay between retries is one second.
+@@ -223,7 +223,7 @@ Specifies the type of RPC calls IPA makes: 'jsonrpc' or 'xmlrpc'. Defaults to 'j
+ .B key_type_size TYPE:SIZE
+ Specifies the type and size of private keys for the Apache, LDAP, PKINIT and RA (if configuring the CA) certificates. The CA/KRA certificate sizes need to be specified using a pki-config-override file provided to the installer. Currently only supports the RSA key type. Valid type values are: rsa. This only applies during initial server installation. The value is stored in the IPA config. Changing it there will not change existing certificates. It will only apply when a new replica is added. The default is: rsa:2048.
+ .TP
+-The following define the containers for the IPA server. Containers define where in the DIT that objects can be found. The full location is the value of container + basedn.
++The following entries define the containers for the IPA server. Containers define where in the DIT that objects can be found. The full location is the value of container + basedn.
+ container_accounts: cn=accounts
+ container_applications: cn=applications,cn=configs,cn=policies
+ container_automount: cn=automount
+--
+2.56.0
+
+
+From d61d856f1bdda2b3eebea3bde13b0b5b3d709209 Mon Sep 17 00:00:00 2001
+From: Florence Blanc-Renaud <flo@redhat.com>
+Date: Tue, 20 Oct 2026 10:10:37 +0200
+Subject: [PATCH 54/55] ipa ca plugin: key can be None
+
+The fix for 10085 introduced a regression in ipa ca-find.
+The API can be called with no argument and in this case the key
+is None, triggering an InternalError in add_token_key.
+
+Properly handle the case where keys[-1] = None.
+
+Related: https://codeberg.org/freeipa/freeipa/issues/10085
+Fixes: https://codeberg.org/freeipa/freeipa/issues/10095
+Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
+Reviewed-By: David Hanina <dhanina@redhat.com>
+---
+ ipaserver/plugins/ca.py | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/ipaserver/plugins/ca.py b/ipaserver/plugins/ca.py
+index f0297adf5..421ecf3c1 100644
+--- a/ipaserver/plugins/ca.py
++++ b/ipaserver/plugins/ca.py
+@@ -196,7 +196,11 @@ class ca(LDAPObject):
+
+ def add_token_key(self, *keys):
+ # the ca name is stored in a cn attribute which is case-insensitive
+- if len(keys) == 0 or keys[0].lower() == IPA_CA_CN.lower():
++ if (
++ len(keys) == 0
++ or keys[-1] is None
++ or keys[-1] and keys[-1].lower() == IPA_CA_CN.lower()
++ ):
+ return keys
+ config = api.Command['config_show']()['result']
+ if 'hsm_token_name' in config and not keys[-1].startswith(
+--
+2.56.0
+
+
+From 687559589db8a87acc4ceecbf38722d324cf0909 Mon Sep 17 00:00:00 2001
+From: Sudhir Menon <sumenon@redhat.com>
+Date: Wed, 2 Sep 2026 22:42:34 +0530
+Subject: [PATCH 55/55] ipatests: Add xmlprc tests for topology suffix.
+
+This patch adds test for topology plugin topologysuffix and topologysegment
+
+TestTopologySuffix
+Both the domain and CA suffixes are present.
+A real suffix can be retrieved by name.
+An unknown suffix returns NotFound.
+Topology verification succeeds on a single server.
+Verifying an unknown suffix returns NotFound.
+
+TestTopologySegment
+Finding segments on the domain suffix returns none.
+A segment whose left node does not exist is rejected.
+A segment that points at the same server on both sides is rejected.
+An unknown segment returns NotFound.
+
+Signed-off-by: Sudhir Menon <sumenon@redhat.com>
+Assisted-by: Claude <claude@noreply.com>
+Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
+Reviewed-By: Anuja More <amore@redhat.com>
+---
+ ipatests/test_xmlrpc/test_topology_plugin.py | 163 +++++++++++++++++++
+ 1 file changed, 163 insertions(+)
+ create mode 100644 ipatests/test_xmlrpc/test_topology_plugin.py
+
+diff --git a/ipatests/test_xmlrpc/test_topology_plugin.py b/ipatests/test_xmlrpc/test_topology_plugin.py
+new file mode 100644
+index 000000000..723737c09
+--- /dev/null
++++ b/ipatests/test_xmlrpc/test_topology_plugin.py
+@@ -0,0 +1,163 @@
++#
++# Copyright (C) 2026 FreeIPA Contributors see COPYING for license
++#
++
++"""XML-RPC tests for the topology plugin.
++
++test_topologysuffix:
++- topologysuffix_find returns the CA and domain suffixes
++- topologysuffix_show returns the domain suffix
++- topologysuffix_show of an unknown suffix raises NotFound
++- topologysuffix_verify reports the domain topology in order, with no
++ connection or agreement errors
++- topologysuffix_verify of an unknown suffix raises NotFound
++
++test_topologysegment:
++- topologysegment_find on the domain suffix returns no segments
++- topologysegment_add rejects a left node that is not an IPA server
++- topologysegment_add rejects a segment whose endpoints are the same
++- topologysegment_show of an unknown segment raises NotFound
++"""
++
++import pytest
++
++from ipalib import api, errors
++from ipalib.constants import CA_SUFFIX_NAME, DOMAIN_SUFFIX_NAME
++from ipapython.dn import DN
++from ipatests.test_xmlrpc.xmlrpc_test import Declarative
++
++MISSING_SUFFIX = 'bogus'
++MISSING_SEGMENT = 'bogus-to-bogus'
++MISSING_NODE = 'bogus.example.com'
++CA_SUFFIX_DN = DN('o=ipaca')
++
++
++def suffix_dn(name):
++ return DN(('cn', name), api.env.container_topology, api.env.basedn)
++
++
++def suffix_entry(name, root):
++ return dict(
++ cn=[name],
++ iparepltopoconfroot=[root],
++ dn=suffix_dn(name),
++ )
++
++
++@pytest.mark.tier1
++class test_topologysuffix(Declarative):
++ """Test topologysuffix commands."""
++
++ tests = [
++ dict(
++ desc='Search returns the CA and domain suffixes',
++ command=('topologysuffix_find', [], {}),
++ expected=dict(
++ result=[
++ suffix_entry(CA_SUFFIX_NAME, CA_SUFFIX_DN),
++ suffix_entry(DOMAIN_SUFFIX_NAME, api.env.basedn),
++ ],
++ count=2,
++ truncated=False,
++ summary='2 topology suffixes matched',
++ ),
++ ),
++
++ dict(
++ desc='Retrieve the domain suffix',
++ command=('topologysuffix_show', [DOMAIN_SUFFIX_NAME], {}),
++ expected=dict(
++ value=DOMAIN_SUFFIX_NAME,
++ summary=None,
++ result=suffix_entry(DOMAIN_SUFFIX_NAME, api.env.basedn),
++ ),
++ ),
++
++ dict(
++ desc='Retrieve a suffix that does not exist',
++ command=('topologysuffix_show', [MISSING_SUFFIX], {}),
++ expected=errors.NotFound(
++ reason='%s: suffix not found' % MISSING_SUFFIX),
++ ),
++
++ dict(
++ desc='Verify the domain topology on a single server',
++ command=('topologysuffix_verify', [DOMAIN_SUFFIX_NAME], {}),
++ expected=dict(
++ result=dict(
++ in_order=True,
++ connect_errors=[],
++ max_agmts_errors=[],
++ max_agmts=api.env.recommended_max_agmts,
++ ),
++ ),
++ ),
++
++ dict(
++ desc='Verify a suffix that does not exist',
++ command=('topologysuffix_verify', [MISSING_SUFFIX], {}),
++ expected=errors.NotFound(
++ reason='%s: suffix not found' % MISSING_SUFFIX),
++ ),
++ ]
++
++
++@pytest.mark.tier1
++class test_topologysegment(Declarative):
++ """Test topologysegment commands."""
++
++ tests = [
++ dict(
++ desc='Search the domain suffix on a single master',
++ command=('topologysegment_find', [DOMAIN_SUFFIX_NAME], {}),
++ expected=dict(
++ result=[],
++ count=0,
++ truncated=False,
++ summary='0 segments matched',
++ ),
++ ),
++
++ dict(
++ desc='Reject a segment whose left node does not exist',
++ command=(
++ 'topologysegment_add',
++ [DOMAIN_SUFFIX_NAME],
++ dict(
++ iparepltoposegmentleftnode=MISSING_NODE,
++ iparepltoposegmentrightnode=api.env.host,
++ ),
++ ),
++ expected=errors.ValidationError(
++ name='leftnode',
++ error='left node is not a topology node: %s' % MISSING_NODE,
++ ),
++ ),
++
++ dict(
++ desc='Reject a segment whose left and right nodes are the same',
++ command=(
++ 'topologysegment_add',
++ [DOMAIN_SUFFIX_NAME],
++ dict(
++ iparepltoposegmentleftnode=api.env.host,
++ iparepltoposegmentrightnode=api.env.host,
++ ),
++ ),
++ expected=errors.ValidationError(
++ name='leftnode',
++ error='left node and right node must not be the same',
++ ),
++ ),
++
++ dict(
++ desc='Retrieve a segment that does not exist',
++ command=(
++ 'topologysegment_show',
++ [DOMAIN_SUFFIX_NAME, MISSING_SEGMENT],
++ {},
++ ),
++ expected=errors.NotFound(
++ reason='%s: segment not found' % MISSING_SEGMENT),
++ ),
++ ]
+--
+2.56.0
+
diff --git a/freeipa-CVE-2026-14612.patch b/freeipa-CVE-2026-14612.patch
deleted file mode 100644
index 6ead66b..0000000
--- a/freeipa-CVE-2026-14612.patch
+++ /dev/null
@@ -1,285 +0,0 @@
-From 59b6b7c4ae0307c37c6636a6e44ba5c2a8929571 Mon Sep 17 00:00:00 2001
-From: Alexander Bokovoy <abokovoy@redhat.com>
-Date: Fri, 3 Jul 2026 18:38:27 +0300
-Subject: [PATCH] CVE-2026-14612: ipa-otpd/oauth2: fix memory safety and error
- handling bugs
-
-Fix several pre-existing bugs in the OAuth2 device code flow:
-
-- Use-after-free: otpd_queue_item_free() was called before the retry
- check in oauth2_on_child_writable(). On EAGAIN, the freed saved_item
- would be dereferenced on the next callback invocation.
-
-- CVE-2026-14612: buffer overflow: read() into a 10240-byte buffer could
- return exactly 10240 bytes, causing buf[10240]='\0' to write past the
- end. Use sizeof(buf)-1 instead.
-
-- Memory leaks: saved_item was leaked on strndup failure and on
- child_ctx allocation failure. The done: label now cleans up
- saved_item, pipe fds, and child_ctx on error paths.
-
-- NULL dereference: ipaidpSub was dereferenced without a NULL check in
- check_access_token_reply().
-
-- verto_add_child() return was not checked for NULL, leading to a NULL
- dereference on verto_set_private().
-
-- set_fd_nonblocking() return values were silently ignored; a failure
- would leave pipes in blocking mode, hanging the daemon.
-
-- Off-by-one in memchr length calculation for second newline.
-
-- Avoid logging full oidc_child output (may contain tokens); log byte
- count instead.
-
-- Fix error message for reader event (was copy-pasted as "writer").
-
-- Fix uninitialized loop variable in disabled debug block.
-
-Fixes: CVE-2026-14612
-Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
-Reviewed-By: Rafael Guterres Jeffman <rjeffman@redhat.com>
-Reviewed-By: David Hanina <dhanina@redhat.com>
-Reviewed-By: Carla Martinez <carlmart@redhat.com>
----
- daemons/ipa-otpd/oauth2.c | 95 ++++++++++++++++++++++++++++++++-------
- 1 file changed, 80 insertions(+), 15 deletions(-)
-
-diff --git a/daemons/ipa-otpd/oauth2.c b/daemons/ipa-otpd/oauth2.c
-index 0eb43b237..1fb07141a 100644
---- a/daemons/ipa-otpd/oauth2.c
-+++ b/daemons/ipa-otpd/oauth2.c
-@@ -31,7 +31,10 @@
- #include <unistd.h>
- #include <fcntl.h>
- #include <sys/random.h>
-+#include <signal.h>
-+#include <string.h>
- #include <sys/uio.h>
-+#include <sys/wait.h>
-
- #include "internal.h"
-
-@@ -125,8 +128,6 @@ static void oauth2_on_child_writable(verto_ctx *vctx, verto_ev *ev)
- idx++;
- io = writev(verto_get_fd(ev), iov, idx);
- }
-- otpd_queue_item_free(child_ctx->saved_item);
--
- if (io < 0) {
- switch (errno) {
- #if defined(EWOULDBLOCK) && (!defined(EAGAIN) || EAGAIN - EWOULDBLOCK != 0)
-@@ -146,6 +147,14 @@ static void oauth2_on_child_writable(verto_ctx *vctx, verto_ev *ev)
- otpd_log_err(errno, "Failed to send to child");
- }
-
-+ if (child_ctx->item->idp.ipaidpClientSecret != NULL) {
-+ explicit_bzero(child_ctx->item->idp.ipaidpClientSecret,
-+ strlen(child_ctx->item->idp.ipaidpClientSecret));
-+ }
-+ if (child_ctx->saved_item != NULL) {
-+ otpd_queue_item_free(child_ctx->saved_item);
-+ child_ctx->saved_item = NULL;
-+ }
- verto_del(ev);
- }
-
-@@ -173,6 +182,7 @@ static int handle_device_code_reply(struct child_ctx *child_ctx,
-
- state_item->oauth2.device_code_reply = strdup(dc_reply);
- if (state_item->oauth2.device_code_reply == NULL) {
-+ ret = ENOMEM;
- otpd_log_req(child_ctx->item->req, "Failed to copy device code reply.");
- goto done;
- }
-@@ -188,6 +198,7 @@ static int handle_device_code_reply(struct child_ctx *child_ctx,
-
- state_item->oauth2.state.data = strdup(dc_reply);
- if (state_item->oauth2.state.data == NULL) {
-+ ret = ENOMEM;
- otpd_log_req(child_ctx->item->req,
- "Failed to copy device code reply to krad.");
- goto done;
-@@ -242,6 +253,12 @@ static int check_access_token_reply(struct child_ctx *child_ctx,
- {
- int ret;
-
-+ if (child_ctx->item->user.ipaidpSub == NULL) {
-+ otpd_log_req(child_ctx->item->req,
-+ "Missing ipaidpSub for access token verification");
-+ return EPERM;
-+ }
-+
- if (strlen(child_ctx->item->user.ipaidpSub) != len
- || memcmp(child_ctx->item->user.ipaidpSub, buf, len) != 0) {
- return EPERM;
-@@ -279,17 +296,22 @@ static void oauth2_on_child_readable(verto_ctx *vctx, verto_ev *ev)
- child_ctx->item->rsp = NULL;
- child_ctx->item->sent = 0;
-
-- io = read(verto_get_fd(ev), buf, 10240);
-+ io = read(verto_get_fd(ev), buf, sizeof(buf) - 1);
- if (io < 0) {
- otpd_log_err(errno, "Failed to read from child");
- goto done;
- }
-
-- if (io >= 0) {
-- buf[io] = '\0';
-- otpd_log_req(child_ctx->item->req, "Received: [%s]", buf);
-+ if (io == 0) {
-+ otpd_log_req(child_ctx->item->req,
-+ "oidc_child closed stdout without producing output");
-+ verto_del(ev);
-+ goto done;
- }
-
-+ buf[io] = '\0';
-+ otpd_log_req(child_ctx->item->req, "Received: [%zu bytes]", (size_t)io);
-+
- verto_del(ev);
-
- if (child_ctx->oauth2_state == OAUTH2_GET_DEVICE_CODE) {
-@@ -302,7 +324,7 @@ static void oauth2_on_child_readable(verto_ctx *vctx, verto_ev *ev)
- if (rad_reply != NULL) {
- *rad_reply = '\0';
- rad_reply++;
-- end = memchr(rad_reply, '\n', io - (rad_reply - 1 - buf));
-+ end = memchr(rad_reply, '\n', io - (rad_reply - buf));
- if (end == NULL) {
- otpd_log_req(child_ctx->item->req, "Missing second new-line.");
- goto done;
-@@ -328,6 +350,7 @@ static void oauth2_on_child_readable(verto_ctx *vctx, verto_ev *ev)
- }
-
- done:
-+ explicit_bzero(buf, sizeof(buf));
- otpd_queue_push(&ctx.stdio.responses, child_ctx->item);
- verto_set_flags(ctx.stdio.writer, VERTO_EV_FLAG_PERSIST |
- VERTO_EV_FLAG_IO_ERROR |
-@@ -387,16 +410,20 @@ int oauth2(struct otpd_queue_item **item, enum oauth2_state oauth2_state)
-
- saved_item = calloc(sizeof(struct otpd_queue_item), 1);
- if (saved_item == NULL) {
-- otpd_log_req((*item)->req, "No matching saved state found");
-- return EINVAL;
-+ otpd_log_req((*item)->req,
-+ "Failed to allocate saved state item");
-+ krb5_free_data_contents(NULL, &data_state);
-+ return ENOMEM;
- }
- saved_item->oauth2.device_code_reply = strndup(data_state.data,
- data_state.length);
-+ krb5_free_data_contents(NULL, &data_state);
- if (saved_item->oauth2.device_code_reply == NULL) {
- otpd_log_req((*item)->req, "Failed to copy device code reply");
-- return EINVAL;
-+ free(saved_item);
-+ saved_item = NULL;
-+ return ENOMEM;
- }
-- krb5_free_data_contents(NULL, &data_state);
- }
-
- child_ctx = calloc(sizeof(struct child_ctx), 1);
-@@ -406,6 +433,7 @@ int oauth2(struct otpd_queue_item **item, enum oauth2_state oauth2_state)
- }
- child_ctx->item = (*item);
- child_ctx->saved_item = saved_item;
-+ saved_item = NULL; /* ownership transferred to child_ctx */
- child_ctx->oauth2_state = oauth2_state;
-
- otpd_log_req((*item)->req, "oauth2 start: %s",
-@@ -466,7 +494,7 @@ int oauth2(struct otpd_queue_item **item, enum oauth2_state oauth2_state)
- }
-
- #if 0
-- for (int i; args[i]; i++) {
-+ for (int i = 0; args[i]; i++) {
- otpd_log_req((*item)->req, "oidc_child exec: %s", args[i]);
- }
- #endif
-@@ -501,11 +529,21 @@ int oauth2(struct otpd_queue_item **item, enum oauth2_state oauth2_state)
- exit(EXIT_FAILURE);
- } else if (child_pid > 0) { /* parent */
- close(pipefd_to_child[0]);
-- set_fd_nonblocking(pipefd_to_child[1]);
-+ pipefd_to_child[0] = -1;
-+ ret = set_fd_nonblocking(pipefd_to_child[1]);
-+ if (ret != 0) {
-+ otpd_log_err(ret, "Failed to set write pipe non-blocking");
-+ goto done;
-+ }
- child_ctx->write_to_child = pipefd_to_child[1];
-
- close(pipefd_from_child[1]);
-- set_fd_nonblocking(pipefd_from_child[0]);
-+ pipefd_from_child[1] = -1;
-+ ret = set_fd_nonblocking(pipefd_from_child[0]);
-+ if (ret != 0) {
-+ otpd_log_err(ret, "Failed to set read pipe non-blocking");
-+ goto done;
-+ }
- child_ctx->read_from_child = pipefd_from_child[0];
-
- child_ctx->write_ev = verto_add_io(ctx.vctx, VERTO_EV_FLAG_PERSIST |
-@@ -519,6 +557,8 @@ int oauth2(struct otpd_queue_item **item, enum oauth2_state oauth2_state)
- otpd_log_err(ret, "Unable to initialize oauth2 writer event");
- goto done;
- }
-+ /* verto owns the fd now (IO_CLOSE_FD) */
-+ pipefd_to_child[1] = -1;
- verto_set_private(child_ctx->write_ev, child_ctx, NULL);
-
- child_ctx->read_ev = verto_add_io(ctx.vctx, VERTO_EV_FLAG_PERSIST |
-@@ -529,14 +569,29 @@ int oauth2(struct otpd_queue_item **item, enum oauth2_state oauth2_state)
- child_ctx->read_from_child);
- if (child_ctx->read_ev == NULL) {
- ret = ENOMEM;
-- otpd_log_err(ret, "Unable to initialize oauth2 writer event");
-+ otpd_log_err(ret, "Unable to initialize oauth2 reader event");
-+ verto_del(child_ctx->write_ev);
-+ child_ctx->write_ev = NULL;
- goto done;
- }
-+ /* verto owns the fd now (IO_CLOSE_FD) */
-+ pipefd_from_child[0] = -1;
- verto_set_private(child_ctx->read_ev, child_ctx, NULL);
-
- child_ctx->child_ev = verto_add_child(ctx.vctx, VERTO_EV_FLAG_NONE,
- oauth2_on_child_exit, child_pid);
-+ if (child_ctx->child_ev == NULL) {
-+ ret = ENOMEM;
-+ otpd_log_err(ret, "Unable to initialize oauth2 child event");
-+ verto_del(child_ctx->read_ev);
-+ verto_del(child_ctx->write_ev);
-+ kill(child_pid, SIGKILL);
-+ waitpid(child_pid, NULL, 0);
-+ goto done;
-+ }
- verto_set_private(child_ctx->child_ev, child_ctx, free_child_ctx);
-+ /* child_ctx is now owned by verto via free_child_ctx */
-+ child_ctx = NULL;
-
- } else { /* error */
- ret = errno;
-@@ -548,6 +603,16 @@ int oauth2(struct otpd_queue_item **item, enum oauth2_state oauth2_state)
- done:
- if (ret == 0) {
- *item = NULL;
-+ } else {
-+ if (saved_item != NULL) {
-+ free(saved_item->oauth2.device_code_reply);
-+ free(saved_item);
-+ }
-+ if (pipefd_to_child[0] >= 0) close(pipefd_to_child[0]);
-+ if (pipefd_to_child[1] >= 0) close(pipefd_to_child[1]);
-+ if (pipefd_from_child[0] >= 0) close(pipefd_from_child[0]);
-+ if (pipefd_from_child[1] >= 0) close(pipefd_from_child[1]);
-+ free(child_ctx);
- }
-
- return ret;
---
-2.55.0
-
diff --git a/freeipa-force-rewrite-of-ipa-pki-proxy.conf-on-upgrade.patch b/freeipa-force-rewrite-of-ipa-pki-proxy.conf-on-upgrade.patch
deleted file mode 100644
index 3922f3a..0000000
--- a/freeipa-force-rewrite-of-ipa-pki-proxy.conf-on-upgrade.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From 97c01284cc378404faf2b02b99d678a630c763f6 Mon Sep 17 00:00:00 2001
-From: Fraser Tweedale <ftweedal@redhat.com>
-Date: Wed, 15 Jul 2026 21:15:59 -0400
-Subject: [PATCH] Force rewrite of ipa-pki-proxy.conf on upgrade
-
-There are several conditions that require the updating of
-ipa-pki-proxy.conf, in addition to version bump:
-
-- AJP secret added or changed
-- Dogtag AJP packet size added or changed
-
-To avoid the complexity of checking these conditions, force a
-rewrite on every upgrade.
-
-Also add a comment to `ipa-pki-proxy.conf` to warn administrators
-and discourage customisation.
-
-Related: https://pagure.io/freeipa/issue/9988
-
-Signed-off-by: Fraser Tweedale <ftweedal@redhat.com>
----
- install/share/ipa-pki-proxy.conf.template | 2 ++
- ipaserver/install/server/upgrade.py | 14 +++++++++++---
- 2 files changed, 13 insertions(+), 3 deletions(-)
-
-diff --git a/install/share/ipa-pki-proxy.conf.template b/install/share/ipa-pki-proxy.conf.template
-index 036b8118d..edd6c3f62 100644
---- a/install/share/ipa-pki-proxy.conf.template
-+++ b/install/share/ipa-pki-proxy.conf.template
-@@ -1,5 +1,7 @@
- # VERSION 18 - DO NOT REMOVE THIS LINE
-
-+# Do not customise this file; it gets rewritten on every upgrade
-+
- ProxyRequests Off
-
- $DOGTAG_AJP_PACKET_SIZE
-diff --git a/ipaserver/install/server/upgrade.py b/ipaserver/install/server/upgrade.py
-index 6f9148259..1db05abfa 100644
---- a/ipaserver/install/server/upgrade.py
-+++ b/ipaserver/install/server/upgrade.py
-@@ -1732,7 +1732,7 @@ def upgrade_configuration():
- ca.add_ipa_wait()
-
- # Handle upgrade of AJP connector configuration
-- secret_needs_sync = ca.secure_ajp_connector()
-+ ca.secure_ajp_connector()
- if ca.ajp_secret:
- sub_dict['DOGTAG_AJP_SECRET'] = "secret={}".format(
- ca.ajp_secret)
-@@ -1746,13 +1746,21 @@ def upgrade_configuration():
- else:
- sub_dict['DOGTAG_AJP_PACKET_SIZE'] = ''
-
-- # force=True will ensure the secret is updated if it changes
-+ # There are several conditions that require the updating
-+ # of ipa-pki-proxy.conf, in addition to version bump:
-+ #
-+ # - AJP secret added or changed
-+ # - Dogtag AJP packet size added or changed
-+ #
-+ # Forcing a rewrite on every upgrade avoids the complexity
-+ # to check for these conditions. Therefore: force=True
-+ #
- upgrade_file(
- sub_dict,
- paths.HTTPD_IPA_PKI_PROXY_CONF,
- os.path.join(paths.USR_SHARE_IPA_DIR,
- "ipa-pki-proxy.conf.template"),
-- add=True, force=secret_needs_sync)
-+ add=True, force=True)
- else:
- if os.path.isfile(paths.HTTPD_IPA_PKI_PROXY_CONF):
- os.remove(paths.HTTPD_IPA_PKI_PROXY_CONF)
---
-2.55.0
-
diff --git a/freeipa-increase-the-AJP-proxy-buffer-size-to-handle-large-c.patch b/freeipa-increase-the-AJP-proxy-buffer-size-to-handle-large-c.patch
deleted file mode 100644
index 60d2a6b..0000000
--- a/freeipa-increase-the-AJP-proxy-buffer-size-to-handle-large-c.patch
+++ /dev/null
@@ -1,164 +0,0 @@
-From 291d484b39e67e062b7a5ddf6c69cfdd1eb3fc40 Mon Sep 17 00:00:00 2001
-From: Rob Crittenden <rcritten@redhat.com>
-Date: Mon, 11 May 2026 14:20:48 -0400
-Subject: [PATCH] Increase the AJP proxy buffer size to handle large
- certificates
-
-The key sizes of ML-DSA 65 and 87 generate very large certificates,
-CSRs, etc. These can be larger than the default mod_proxy AJP
-setting allows (8192).
-
-The equivalent value in PKI was updated to 65536 in dogtagpki
-change. See:
-
-https://github.com/dogtagpki/pki/commit/9d8d6d2
-https://github.com/dogtagpki/pki/commit/3007eda
-https://github.com/dogtagpki/pki/commit/8e667b2
-
-We do NOT want to increase the value if the tomcat packetSize
-attribute is not set in the AJP connector. If only one of these
-is set between Apache and Tomcat then one side is likely to
-send a packet too large which will be rejected by the other side.
-
-An upgrade script is used to ensure the environment is sane.
-
-Fixes: https://pagure.io/freeipa/issue/9988
-
-Signed-off-by: Rob Crittenden <rcritten@redhat.com>
-Co-authored-by: Fraser Tweedale <ftweedal@redhat.com>
----
- install/share/ipa-pki-proxy.conf.template | 4 ++-
- ipaserver/install/cainstance.py | 1 -
- ipaserver/install/dogtaginstance.py | 36 +++++++++++++++++++++++
- ipaserver/install/server/upgrade.py | 22 +++++++++-----
- 4 files changed, 53 insertions(+), 10 deletions(-)
-
-diff --git a/install/share/ipa-pki-proxy.conf.template b/install/share/ipa-pki-proxy.conf.template
-index c7f0bfc36..036b8118d 100644
---- a/install/share/ipa-pki-proxy.conf.template
-+++ b/install/share/ipa-pki-proxy.conf.template
-@@ -1,7 +1,9 @@
--# VERSION 17 - DO NOT REMOVE THIS LINE
-+# VERSION 18 - DO NOT REMOVE THIS LINE
-
- ProxyRequests Off
-
-+$DOGTAG_AJP_PACKET_SIZE
-+
- # matches for ee port
- <LocationMatch "^/ca/ee/ca/checkRequest|^/ca/ee/ca/getCertChain|^/ca/ee/ca/getTokenInfo|^/ca/ee/ca/tokenAuthenticate|^/ca/ocsp|^/ca/ee/ca/updateNumberRange|^/ca/ee/ca/getCRL|^/ca/ee/ca/profileSubmit">
- SSLOptions +StdEnvVars +ExportCertData +StrictRequire +OptRenegotiate
-diff --git a/ipaserver/install/cainstance.py b/ipaserver/install/cainstance.py
-index 8edc7f839..40f4161ee 100644
---- a/ipaserver/install/cainstance.py
-+++ b/ipaserver/install/cainstance.py
-@@ -1178,7 +1178,6 @@ class CAInstance(DogtagInstance):
-
- return publishdir
-
--
- def __enable_crl_publish(self):
- """
- Enable file-based CRL publishing and disable LDAP publishing.
-diff --git a/ipaserver/install/dogtaginstance.py b/ipaserver/install/dogtaginstance.py
-index aac8fb989..80e04890c 100644
---- a/ipaserver/install/dogtaginstance.py
-+++ b/ipaserver/install/dogtaginstance.py
-@@ -489,8 +489,39 @@ class DogtagInstance(service.Service):
-
- return rewrite
-
-+ def get_ajp_packet_size(self):
-+ """Return packetSize if set in the AJP connectors
-+
-+ There are multiple connectors but the value should be the same.
-+
-+ We aren't trying to keep the values in sync between PKI and
-+ Apache. They should both be 65536.
-+
-+ There are several opportunities for a user to mess this up:
-+ * the attribute name is case-sensitive
-+ * we only want the max possible value, nothing creative
-+
-+ Return the value if set, None if not.
-+ """
-+
-+ server_xml = lxml.etree.parse(paths.PKI_TOMCAT_SERVER_XML)
-+ doc = server_xml.getroot()
-+
-+ # no AJP connector is probably bad.
-+ connectors = doc.xpath('//Connector[@protocol="AJP/1.3"]')
-+ if len(connectors) == 0:
-+ logger.debug("No AJP connectors found in get_ajp_packet_size")
-+ return None
-+
-+ for connector in connectors:
-+ if 'packetSize' in connector.attrib:
-+ return connector.get('packetSize')
-+
-+ return None
-+
- def http_proxy(self):
- """ Update the http proxy file """
-+ ajp_packet_size = self.get_ajp_packet_size()
- template_filename = (
- os.path.join(paths.USR_SHARE_IPA_DIR,
- "ipa-pki-proxy.conf.template"))
-@@ -499,9 +530,14 @@ class DogtagInstance(service.Service):
- CLONE='' if self.clone else '#',
- FQDN=self.fqdn,
- DOGTAG_AJP_SECRET='',
-+ DOGTAG_AJP_PACKET_SIZE='',
- )
- if self.ajp_secret:
- sub_dict['DOGTAG_AJP_SECRET'] = "secret={}".format(self.ajp_secret)
-+ if ajp_packet_size:
-+ sub_dict['DOGTAG_AJP_PACKET_SIZE'] = (
-+ "ProxyIOBufferSize {}".format(ajp_packet_size)
-+ )
- template = ipautil.template_file(template_filename, sub_dict)
- with open(paths.HTTPD_IPA_PKI_PROXY_CONF, "w") as fd:
- fd.write(template)
-diff --git a/ipaserver/install/server/upgrade.py b/ipaserver/install/server/upgrade.py
-index 0ae0ea235..6f9148259 100644
---- a/ipaserver/install/server/upgrade.py
-+++ b/ipaserver/install/server/upgrade.py
-@@ -1732,21 +1732,27 @@ def upgrade_configuration():
- ca.add_ipa_wait()
-
- # Handle upgrade of AJP connector configuration
-- rewrite = ca.secure_ajp_connector()
-+ secret_needs_sync = ca.secure_ajp_connector()
- if ca.ajp_secret:
- sub_dict['DOGTAG_AJP_SECRET'] = "secret={}".format(
- ca.ajp_secret)
- else:
- sub_dict['DOGTAG_AJP_SECRET'] = ''
-
-+ ajp_packet_size = ca.get_ajp_packet_size()
-+ if ajp_packet_size:
-+ sub_dict['DOGTAG_AJP_PACKET_SIZE'] = (
-+ "ProxyIOBufferSize {}".format(ajp_packet_size))
-+ else:
-+ sub_dict['DOGTAG_AJP_PACKET_SIZE'] = ''
-+
- # force=True will ensure the secret is updated if it changes
-- if rewrite:
-- upgrade_file(
-- sub_dict,
-- paths.HTTPD_IPA_PKI_PROXY_CONF,
-- os.path.join(paths.USR_SHARE_IPA_DIR,
-- "ipa-pki-proxy.conf.template"),
-- add=True, force=True)
-+ upgrade_file(
-+ sub_dict,
-+ paths.HTTPD_IPA_PKI_PROXY_CONF,
-+ os.path.join(paths.USR_SHARE_IPA_DIR,
-+ "ipa-pki-proxy.conf.template"),
-+ add=True, force=secret_needs_sync)
- else:
- if os.path.isfile(paths.HTTPD_IPA_PKI_PROXY_CONF):
- os.remove(paths.HTTPD_IPA_PKI_PROXY_CONF)
---
-2.55.0
-
diff --git a/freeipa-ipa-join-increase-argv-array-suze-for-ipa-getkeytab.patch b/freeipa-ipa-join-increase-argv-array-suze-for-ipa-getkeytab.patch
deleted file mode 100644
index 2624766..0000000
--- a/freeipa-ipa-join-increase-argv-array-suze-for-ipa-getkeytab.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 8ef907327b569b3cc9c782881ee95de8ef7b180c Mon Sep 17 00:00:00 2001
-From: David Hanina <dhanina@redhat.com>
-Date: Mon, 31 Aug 2026 14:43:32 +0200
-Subject: [PATCH] ipa-join: increase argv array size for ipa-getkeytab
-
-Make room for an additional argument by enlarging the argv array
-from 12 to 13 elements.
-
-Fixes: https://codeberg.org/freeipa/freeipa/issues/10044
-Signed-off-by: David Hanina <dhanina@redhat.com>
-Reviewed-By: Sudhir Menon <sumenon@redhat.com>
----
- client/ipa-join.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/client/ipa-join.c b/client/ipa-join.c
-index a8d4a82cc..7c16919a4 100644
---- a/client/ipa-join.c
-+++ b/client/ipa-join.c
-@@ -1196,7 +1196,7 @@ join(const char *server, const char *hostname, const char *bindpw, const char *b
- }
-
- if (childpid == 0) {
-- char *argv[12];
-+ char *argv[13];
- char *path = "/usr/sbin/ipa-getkeytab";
- int arg = 0;
- int err;
---
-2.55.0
-
diff --git a/freeipa-ipa-kdb-fix-NULL-pointer-dereference-when-freeing-cr.patch b/freeipa-ipa-kdb-fix-NULL-pointer-dereference-when-freeing-cr.patch
deleted file mode 100644
index 3713bdd..0000000
--- a/freeipa-ipa-kdb-fix-NULL-pointer-dereference-when-freeing-cr.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From dbe1e198b9fc15727599d9ac1409ef00240e98be Mon Sep 17 00:00:00 2001
-From: David Hanina <dhanina@redhat.com>
-Date: Mon, 31 Aug 2026 14:43:16 +0200
-Subject: [PATCH] ipa-kdb: fix NULL pointer dereference when freeing credential
- type values
-
-Guard the loop that frees individual `cvals` entries with a NULL check
-before dereferencing the array.
-
-Fixes: https://codeberg.org/freeipa/freeipa/issues/10045
-Signed-off-by: David Hanina <dhanina@redhat.com>
-Reviewed-By: Sudhir Menon <sumenon@redhat.com>
----
- daemons/ipa-kdb/ipa_kdb.c | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/daemons/ipa-kdb/ipa_kdb.c b/daemons/ipa-kdb/ipa_kdb.c
-index 531ee223e..36be5e5a2 100644
---- a/daemons/ipa-kdb/ipa_kdb.c
-+++ b/daemons/ipa-kdb/ipa_kdb.c
-@@ -437,8 +437,10 @@ int ipadb_get_enc_salt_types(struct ipadb_context *ipactx,
-
- done:
- ldap_value_free_len(vals);
-- for (i = 0; i < c && cvals[i]; i++) {
-- free(cvals[i]);
-+ if (cvals) {
-+ for (i = 0; i < c && cvals[i]; i++) {
-+ free(cvals[i]);
-+ }
- }
- free(cvals);
- return ret;
---
-2.55.0
-
diff --git a/freeipa-pr-8557.patch b/freeipa-pr-8557.patch
deleted file mode 100644
index 213ae24..0000000
--- a/freeipa-pr-8557.patch
+++ /dev/null
@@ -1,556 +0,0 @@
-From 58ea09f489406fea624d390cee386d85aa66fd6c Mon Sep 17 00:00:00 2001
-From: Julien Rische <jrische@redhat.com>
-Date: Mon, 7 Sep 2026 11:16:09 +0200
-Subject: [PATCH] kdb: rework cross-realm PAC validation and ID override checks
-
-The cross-realm PAC validation code had several issues:
-
-The ID override check used the POSIX "uid" attribute instead of
-"ipaOriginalUid", and compared it against the ticket cname which is
-the service principal (not the user) in S4U2Self referral TGTs.
-
-The PAC cross-validation compared client_name directly against
-account_name using case-sensitive strcmp, which failed for S4U2Self
-referral TGTs where client_name is qualified ("username@userRealm"
-per MS-SFU 3.2.5.1.1) and for legitimate case differences.
-
-This commit reworks the validation to use PAC_CLIENT_INFO client_name
-as the reference for all name-based checks. MIT krb5 validates
-client_name against the correct non-PAC identity source (ticket cname,
-PA-FOR-USER, or PA-S4U-X509-USER) before the KDB plugin runs, making
-it the value IPA will use to identify the user, and the value we must
-cross-validate against canonical PAC attributes to detect alias-based
-identity fraud.
-
-Comparisons now handle the qualified ("user@REALM") and unqualified
-("user") forms of client_name: when both values are qualified, a full
-comparison including the realm is performed; otherwise only the name
-part is compared.
-
-The ID override check now compares ipaOriginalUid against client_name
-instead of the ticket cname, fixing S4U2Self flows.
-
-All comparisons are now case-insensitive, and all validation failures
-return KRB5KDC_ERR_POLICY as mandated by MS-SFU 3.2.5.1.
-
-Signed-off-by: Julien Rische <jrische@redhat.com>
-Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
----
- daemons/ipa-kdb/ipa_kdb.h | 1 +
- daemons/ipa-kdb/ipa_kdb_mspac_private.h | 6 +
- daemons/ipa-kdb/ipa_kdb_mspac_trust.c | 288 ++++++++++++++----------
- 3 files changed, 176 insertions(+), 119 deletions(-)
-
-diff --git a/daemons/ipa-kdb/ipa_kdb.h b/daemons/ipa-kdb/ipa_kdb.h
-index cbac54fecc9..1c6647b7d25 100644
---- a/daemons/ipa-kdb/ipa_kdb.h
-+++ b/daemons/ipa-kdb/ipa_kdb.h
-@@ -93,6 +93,7 @@
-
- #define IPA_KRB_AUTHZ_DATA_ATTR "ipaKrbAuthzData"
- #define IPA_USER_AUTH_TYPE "ipaUserAuthType"
-+#define IPA_ORIGINAL_UID_ATTR "ipaOriginalUid"
-
- /* Virtual managed ticket flags like "-allow_tix", are always controlled by the
- * "nsAccountLock" attribute, such flags should never be set in the database.
-diff --git a/daemons/ipa-kdb/ipa_kdb_mspac_private.h b/daemons/ipa-kdb/ipa_kdb_mspac_private.h
-index c76fb8e59cb..ccdcd6c59dd 100644
---- a/daemons/ipa-kdb/ipa_kdb_mspac_private.h
-+++ b/daemons/ipa-kdb/ipa_kdb_mspac_private.h
-@@ -23,6 +23,12 @@
-
- #pragma once
-
-+/* This is used as a global maximum length for:
-+ * userPrincipalName: no explicit limit
-+ * samAccountName: 20 for backward compatibility reasons
-+ */
-+#define MSPAC_ID_NAME_MAX_LENGTH (2048)
-+
- struct ipadb_mspac {
- char *flat_domain_name;
- char *flat_server_name;
-diff --git a/daemons/ipa-kdb/ipa_kdb_mspac_trust.c b/daemons/ipa-kdb/ipa_kdb_mspac_trust.c
-index a09dc2dfbda..9dfda66337e 100644
---- a/daemons/ipa-kdb/ipa_kdb_mspac_trust.c
-+++ b/daemons/ipa-kdb/ipa_kdb_mspac_trust.c
-@@ -18,6 +18,60 @@
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
-+ *
-+ *
-+ * THREAT MODEL
-+ *
-+ * If Active Directory does not enforce uniqueness of principal aliases
-+ * (UPN), a regular AD user could set their userPrincipalName to
-+ * impersonate another user (e.g. "administrator@AD.TEST"). Since IPA
-+ * resolves AD user identity from the ticket client name, a forged alias
-+ * could lead to privilege escalation.
-+ *
-+ * However, other PAC attributes (account_name from PAC_LOGON_INFO, SAM
-+ * name and SID from UPN_DNS_INFO extended format) always reflect the
-+ * canonical AD identity regardless of aliases. Cross-validating these
-+ * against client_name detects the inconsistency.
-+ *
-+ * PAC_CLIENT_INFO client_name
-+ *
-+ * Before the KDB plugin runs, MIT krb5 validates PAC_CLIENT_INFO
-+ * client_name (MS-PAC 2.7) against the appropriate non-PAC identity
-+ * source (tgs_policy.c:check_tgs_s4u2self, check_normal_tgs_pac):
-+ * - ticket cname for regular TGS
-+ * - PA-FOR-USER for S4U2Self
-+ * - PA-S4U-X509-USER for certificate-based S4U2Self
-+ * This makes client_name the value that IPA will use to identify the
-+ * user, and the value we must cross-validate against canonical PAC
-+ * attributes to detect alias-based identity fraud.
-+ *
-+ * client_name is bare ("username") in regular tickets, or qualified
-+ * ("username@userRealm") in S4U2Self referral TGTs (MS-SFU 3.2.5.1.1).
-+ * The name part (before '@') is used for cross-validation against bare
-+ * attributes. When both client_name and the tested attribute are
-+ * qualified, a full comparison including the realm is performed.
-+ *
-+ * CHECKS PERFORMED
-+ *
-+ * 1. PAC cross-validation: all PAC name attributes (account_name, UPN,
-+ * SAM name) must match client_name. UPN extended SID must match the
-+ * logon info SID. PAC_REQUESTER_SID is not checked because it may
-+ * legitimately differ in S4U delegation scenarios (MS-PAC 2.12).
-+ * AD is case-insensitive, so all string comparisons use
-+ * case-insensitive functions.
-+ *
-+ * 2. ID override validation: if a Default Trust View override exists for
-+ * the PAC SID, its ipaOriginalUid must match client_name.
-+ *
-+ * 3. UPN qualification: for enterprise principals, the UPN must be
-+ * qualified (contain '@') unless constructed (U flag), per MS-KILE
-+ * 3.3.5.2.
-+ *
-+ * ERROR HANDLING
-+ *
-+ * All validation failures return KRB5KDC_ERR_POLICY (KDC_ERR_POLICY,
-+ * error code 12) as mandated by MS-SFU 3.2.5.1. The status string is
-+ * included in the KRB-ERROR e-text field.
- */
-
- #include "ipa_kdb.h"
-@@ -40,7 +94,7 @@ struct crossrealm_tgt_info {
- /* PAC_LOGON_INFO (Type 1) - mandatory
- * Present since Windows 2000 */
- bool logon_info_present;
-- const char *account_name;
-+ const char *account_name; /* samAccountName, always bare */
- struct dom_sid logon_info_sid;
- char *logon_info_sid_string;
-
-@@ -48,15 +102,17 @@ struct crossrealm_tgt_info {
- * Present since Windows 2000 */
- bool client_info_present;
- const char *client_name;
-+ bool client_name_is_qualified;
-+ size_t unqualified_cn_len; /* length of name part (before '@') */
-
- /* PAC_UPN_DNS_INFO (Type 12) - optional
- * Present since Windows Server 2008 */
- bool upn_dns_info_present;
-- const char *upn;
-+ const char *upn; /* always qualified ("user@REALM") */
- bool upn_is_qualified;
-- bool upn_is_constructed;
-- bool upn_has_sam_and_sid;
-- const char *upn_sam_name;
-+ bool upn_is_constructed; /* U flag: UPN built from samAccountName */
-+ bool upn_has_sam_and_sid; /* S flag: extended format present */
-+ const char *upn_sam_name; /* samAccountName from extended UPN, bare */
- struct dom_sid upn_sid;
-
- /* PAC_REQUESTER_SID (Type 18) - optional
-@@ -99,25 +155,25 @@ ipadb_validate_pac_attributes(krb5_context context,
- /* PAC_LOGON_INFO is mandatory */
- if (!info->logon_info_present) {
- *status = "TRUST_PAC_MISSING_LOGON_INFO";
-- return ENOENT;
-+ return KRB5KDC_ERR_POLICY;
- }
-
- /* Verify account_name was successfully extracted from LOGON_INFO */
- if (!info->account_name) {
- *status = "TRUST_PAC_MISSING_ACCOUNT_NAME";
-- return ENOENT;
-+ return KRB5KDC_ERR_POLICY;
- }
-
- /* PAC_CLIENT_INFO is mandatory */
- if (!info->client_info_present) {
- *status = "TRUST_PAC_MISSING_CLIENT_INFO";
-- return ENOENT;
-+ return KRB5KDC_ERR_POLICY;
- }
-
- /* Verify client_name was successfully extracted from CLIENT_INFO */
- if (!info->client_name) {
-- *status = "TRUST_PAC_MISSING_CLIENT_NAME";
-- return ENOENT;
-+ *status = "TRUST_PAC_CLIENT_NAME_MISSING";
-+ return KRB5KDC_ERR_POLICY;
- }
-
- return 0;
-@@ -134,7 +190,7 @@ ipadb_extract_crtgt_info(krb5_context context,
- struct crossrealm_tgt_info *info,
- const char **status)
- {
-- krb5_error_code kerr = EINVAL;
-+ krb5_error_code kerr = KRB5KDC_ERR_POLICY;
- krb5_data linfo_blob = {0}, upn_blob = {0}, cinfo_blob = {0};
- krb5_data req_sid_blob = {0};
- DATA_BLOB linfo_data, upn_data, cinfo_data, req_sid_data;
-@@ -170,22 +226,22 @@ ipadb_extract_crtgt_info(krb5_context context,
-
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
- *status = "TRUST_PAC_CANNOT_PARSE_LOGON_INFO";
-- kerr = EINVAL;
-+ kerr = KRB5KDC_ERR_POLICY;
- goto end;
- }
-
- /* Check if logon_info structure is valid */
- if (!logon_info.info) {
- *status = "TRUST_PAC_LOGON_INFO_UNDEFINED";
-- kerr = EINVAL;
-+ kerr = KRB5KDC_ERR_POLICY;
- goto end;
- }
-
- /* Store pointer to account name */
- info->account_name = logon_info.info->info3.base.account_name.string;
- if (!info->account_name) {
-- *status = "TRUST_PAC_ACCOUNT_NAME_UNDEFINED";
-- kerr = EINVAL;
-+ *status = "TRUST_PAC_ACCOUNT_NAME_MISSING";
-+ kerr = KRB5KDC_ERR_POLICY;
- goto end;
- }
-
-@@ -225,8 +281,18 @@ ipadb_extract_crtgt_info(krb5_context context,
- (ndr_pull_flags_fn_t)ndr_pull_PAC_INFO);
- krb5_free_data_contents(context, &cinfo_blob);
-
-- if (NDR_ERR_CODE_IS_SUCCESS(ndr_err))
-+ if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
-+ const char *at_sign;
-+
- info->client_name = client_info.logon_name.account_name;
-+ if (info->client_name) {
-+ at_sign = strchr(info->client_name, '@');
-+ info->client_name_is_qualified = (at_sign != NULL);
-+ info->unqualified_cn_len = at_sign ?
-+ (size_t)(at_sign - info->client_name) :
-+ strlen(info->client_name);
-+ }
-+ }
- }
-
- /* Extract Type 12 - PRIMARY UPN SOURCE
-@@ -248,14 +314,18 @@ ipadb_extract_crtgt_info(krb5_context context,
-
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
- *status = "TRUST_PAC_CANNOT_PARSE_UPN_DNS_INFO";
-- kerr = EINVAL;
-+ kerr = KRB5KDC_ERR_POLICY;
- goto end;
- }
-
- /* Store pointer to UPN string */
- info->upn = upn_info.upn_dns_info.upn_name;
-- if (info->upn)
-- info->upn_is_qualified = (NULL != strchr(info->upn, '@'));
-+ if (!info->upn) {
-+ *status = "TRUST_PAC_UPN_MISSING";
-+ kerr = KRB5KDC_ERR_POLICY;
-+ goto end;
-+ }
-+ info->upn_is_qualified = (NULL != strchr(info->upn, '@'));
-
- /* Extract U flag - indicates constructed UPN */
- info->upn_is_constructed =
-@@ -309,119 +379,100 @@ ipadb_extract_crtgt_info(krb5_context context,
- return kerr;
- }
-
--/* Cross-validate PAC attributes for consistency
-- * All available attributes must match across different PAC buffers.
-- * LOGON_INFO and CLIENT_INFO must be present (asserted).
-- */
-+/* Compare a PAC name attribute against client_name (case-insensitive).
-+ * If both are qualified, compare fully. Otherwise compare name parts only,
-+ * expecting '@' (qualified) or '\0' (bare) after the matched prefix.
-+ * Returns true if the names differ. */
-+static bool
-+client_name_differs(const struct crossrealm_tgt_info *info,
-+ const char *tested, bool qualified)
-+{
-+ return (qualified && info->client_name_is_qualified)
-+ ? (0 != strcasecmp(info->client_name, tested))
-+ : (0 != strncasecmp(info->client_name, tested,
-+ info->unqualified_cn_len)
-+ || tested[info->unqualified_cn_len] != (qualified ? '@' : '\0'));
-+}
-+
-+/* Cross-validate PAC name attributes and SIDs against client_name.
-+ * See file header for design rationale. */
- static krb5_error_code
- ipadb_cross_validate_pac_attributes(krb5_context context,
- const struct crossrealm_tgt_info *info,
- const char **status)
- {
-- krb5_error_code kerr = EINVAL;
-- const char *at_sign = NULL;
-- char *ticket_cname = NULL;
-- size_t name_len;
-+ krb5_error_code kerr = KRB5KDC_ERR_POLICY;
-
- /* Mandatory PAC attributes must have been validated already */
- assert(info->logon_info_present);
- assert(info->client_info_present);
-
-- /* Validate UPN matches ticket cname (for enterprise principals) */
-- if (info->is_enterprise_princ && info->upn_dns_info_present) {
-- /* Unparse client principal name (without realm) */
-- kerr = krb5_unparse_name_flags(context, info->client_princ,
-- KRB5_PRINCIPAL_UNPARSE_NO_REALM,
-- &ticket_cname);
-- if (kerr) {
-- *status = "TRUST_CANNOT_UNPARSE_CNAME";
-- goto end;
-- }
--
-- /* Find the @ sign in UPN */
-- at_sign = strchr(info->upn, '@');
-- if (at_sign) {
-- name_len = at_sign - info->upn;
--
-- /* Compare UPN name part with ticket cname */
-- if (0 != strncmp(info->upn, ticket_cname, name_len) ||
-- ticket_cname[name_len] != '\0') {
-- *status = "TRUST_PAC_UPN_CNAME_MISMATCH";
-- kerr = EINVAL;
-- goto end;
-- }
-- }
--
-- krb5_free_unparsed_name(context, ticket_cname);
-- ticket_cname = NULL;
-+ /* account_name (bare) vs client_name */
-+ if (client_name_differs(info, info->account_name, false)) {
-+ *status = "TRUST_PAC_ACCOUNT_NAME_MISMATCH";
-+ kerr = KRB5KDC_ERR_POLICY;
-+ goto end;
- }
-
-- /* Cross-validate account names if extended UPN format is available */
-- if (info->upn_has_sam_and_sid) {
-- if (!info->account_name || !info->upn_sam_name ||
-- 0 != strcmp(info->account_name, info->upn_sam_name)) {
-- *status = "TRUST_PAC_ACCOUNT_NAME_MISMATCH";
-- kerr = EINVAL;
-+ /* UPN (qualified) vs client_name, enterprise principals only.
-+ * For enterprise principals, the AD KDC looks up the user by UPN
-+ * (MS-KILE 3.3.5.6.1), so a forged UPN alias could produce a
-+ * client_name that differs from account_name. For regular principals
-+ * the lookup is by samAccountName, and the UPN may legitimately
-+ * differ, so this check would cause false positives. */
-+ if (info->is_enterprise_princ && info->upn_dns_info_present) {
-+ if (client_name_differs(info, info->upn, true)) {
-+ *status = "TRUST_PAC_UPN_MISMATCH";
-+ kerr = KRB5KDC_ERR_POLICY;
- goto end;
- }
- }
-
-- /* Cross-validate client name matches account name */
-- if (info->client_info_present) {
-- if (!info->client_name || !info->account_name ||
-- 0 != strcmp(info->client_name, info->account_name)) {
-- *status = "TRUST_PAC_CLIENT_NAME_MISMATCH";
-- kerr = EINVAL;
-+ /* UPN SAM name (bare) vs client_name */
-+ if (info->upn_has_sam_and_sid) {
-+ if (!info->upn_sam_name ||
-+ client_name_differs(info, info->upn_sam_name, false)) {
-+ *status = "TRUST_PAC_UPN_SAM_NAME_MISMATCH";
-+ kerr = KRB5KDC_ERR_POLICY;
- goto end;
- }
- }
-
-- /* Cross-validate SIDs if extended UPN format is available */
-+ /* UPN SID vs logon info SID */
- if (info->upn_has_sam_and_sid) {
- if (!dom_sid_check(&info->logon_info_sid,
- &info->upn_sid, true)) {
- *status = "TRUST_PAC_UPN_SID_MISMATCH";
-- kerr = EINVAL;
-+ kerr = KRB5KDC_ERR_POLICY;
- goto end;
- }
- }
-
-- /* Cross-validate SID from REQUESTER_SID buffer if present */
-- if (info->requester_sid_present) {
-- if (!dom_sid_check(&info->logon_info_sid,
-- &info->requester_sid, true)) {
-- *status = "TRUST_PAC_REQUESTER_SID_MISMATCH";
-- kerr = EINVAL;
-- goto end;
-- }
-- }
-+ /* PAC_REQUESTER_SID is not checked against logon_info_sid because
-+ * in S4U delegation scenarios, the requester SID is the service's
-+ * SID, not the impersonated user's (MS-PAC 2.12). */
-
- kerr = 0;
-
- end:
-- if (ticket_cname)
-- krb5_free_unparsed_name(context, ticket_cname);
--
- return kerr;
- }
-
--/* Check Default Trust View override username consistency
-- * If a user override exists for this SID in the Default Trust View,
-- * verify that the override username matches the ticket cname.
-- * LOGON_INFO and CLIENT_INFO must be present (asserted).
-- */
-+/* If a Default Trust View override exists for this SID, verify that
-+ * ipaOriginalUid (always qualified) matches client_name. */
- static krb5_error_code
- ipadb_check_trust_view_override(krb5_context context,
- const struct crossrealm_tgt_info *info,
- const char **status)
- {
- struct ipadb_context *ipactx = NULL;
-- krb5_error_code kerr = EINVAL;
-- char *basedn = NULL, *filter = NULL, *attrs[] = {"uid", NULL};
-+ krb5_error_code kerr = KRB5KDC_ERR_POLICY;
-+ char *basedn = NULL, *filter = NULL;
-+ char *attrs[] = {IPA_ORIGINAL_UID_ATTR, NULL};
- LDAPMessage *res = NULL, *entry = NULL;
- struct berval **uid_values = NULL;
-- char *ticket_cname = NULL;
- int count;
-+ bool mismatch;
-
- /* Mandatory PAC attributes must have been validated already */
- assert(info->logon_info_present);
-@@ -470,35 +521,45 @@ ipadb_check_trust_view_override(krb5_context context,
- goto end;
- }
-
-- /* Override exists - verify the username matches the ticket cname */
-+ /* Override exists - verify the username matches client_name */
- entry = ldap_first_entry(ipactx->lcontext, res);
- if (!entry) {
- *status = "TRUST_CANNOT_READ_OVERRIDE_ENTRY";
-- kerr = EINVAL;
-+ kerr = KRB5KDC_ERR_POLICY;
- goto end;
- }
-
-- uid_values = ldap_get_values_len(ipactx->lcontext, entry, "ipaOriginalUid");
-+ uid_values = ldap_get_values_len(ipactx->lcontext, entry,
-+ IPA_ORIGINAL_UID_ATTR);
- if (!uid_values || !uid_values[0]) {
- *status = "TRUST_OVERRIDE_UID_UNDEFINED";
-- kerr = EINVAL;
-+ kerr = KRB5KDC_ERR_POLICY;
- goto end;
- }
-
-- /* Unparse client principal name (without realm) */
-- kerr = krb5_unparse_name_flags(context, info->client_princ,
-- KRB5_PRINCIPAL_UNPARSE_NO_REALM,
-- &ticket_cname);
-- if (kerr) {
-- *status = "TRUST_CANNOT_UNPARSE_CNAME";
-- goto end;
-+ /* Compare ipaOriginalUid (always qualified) against client_name.
-+ * When client_name is qualified, compare full value including realm.
-+ * When bare, compare name part only and verify ipaOriginalUid
-+ * continues with '@' at that position. */
-+ if (info->client_name_is_qualified) {
-+ /* Full comparison: client_name length must match bv_len */
-+ mismatch = (strlen(info->client_name) != uid_values[0]->bv_len ||
-+ 0 != strncasecmp(info->client_name,
-+ uid_values[0]->bv_val,
-+ uid_values[0]->bv_len));
-+ } else {
-+ /* Name part only: unqualified_cn_len must be less than bv_len,
-+ * the name part must match, and bv_val must have '@' at that
-+ * position */
-+ mismatch = (info->unqualified_cn_len >= uid_values[0]->bv_len ||
-+ 0 != strncasecmp(info->client_name,
-+ uid_values[0]->bv_val,
-+ info->unqualified_cn_len) ||
-+ uid_values[0]->bv_val[info->unqualified_cn_len] != '@');
- }
-
-- /* Compare override username with ticket cname */
-- if (0 != strncmp(uid_values[0]->bv_val, ticket_cname,
-- uid_values[0]->bv_len) ||
-- '\0' != ticket_cname[uid_values[0]->bv_len]) {
-- *status = "TRUST_OVERRIDE_UID_CNAME_MISMATCH";
-+ if (mismatch) {
-+ *status = "TRUST_OVERRIDE_UID_MISMATCH";
- kerr = KRB5KDC_ERR_POLICY;
- goto end;
- }
-@@ -508,8 +569,6 @@ ipadb_check_trust_view_override(krb5_context context,
- end:
- if (uid_values)
- ldap_value_free_len(uid_values);
-- if (ticket_cname)
-- krb5_free_unparsed_name(context, ticket_cname);
- if (res)
- ldap_msgfree(res);
- if (filter)
-@@ -520,10 +579,8 @@ ipadb_check_trust_view_override(krb5_context context,
- return kerr;
- }
-
--/* Check that enterprise principal has qualified UPN in PAC
-- * UPN MUST be qualified if it is NOT constructed (U flag not set).
-- * LOGON_INFO and CLIENT_INFO must be present (asserted).
-- */
-+/* For enterprise principals, UPN must be qualified unless constructed
-+ * (U flag set), per MS-KILE 3.3.5.2. */
- static krb5_error_code
- ipadb_check_upn_qualified(krb5_context context,
- const struct crossrealm_tgt_info *info,
-@@ -558,14 +615,7 @@ ipadb_check_upn_qualified(krb5_context context,
- return 0;
- }
-
--/* Main function to check trust PAC content
-- *
-- * Performs security checks on trust TGS-REQ:
-- * 1. Cross-validation - verify PAC attributes consistency
-- * 2. User registration - requester SID must exist in Default Trust View
-- * 3. UPN qualification - enterprise principals must have qualified UPN
-- * (if not constructed)
-- */
-+/* Entry point for trust PAC content checks. See file header. */
- krb5_error_code
- ipadb_check_trust_pac_content(krb5_context context,
- const krb5_kdc_req *request,
-@@ -574,7 +624,7 @@ ipadb_check_trust_pac_content(krb5_context context,
- const char **status)
- {
- struct crossrealm_tgt_info info;
-- krb5_error_code kerr = EINVAL;
-+ krb5_error_code kerr = KRB5KDC_ERR_POLICY;
-
- /* Initialize PAC check info structure and create talloc context */
- kerr = ipadb_trust_pac_info_init(&info);
diff --git a/freeipa-pr-8558.patch b/freeipa-pr-8558.patch
deleted file mode 100644
index 043f07b..0000000
--- a/freeipa-pr-8558.patch
+++ /dev/null
@@ -1,811 +0,0 @@
-From 8f33c1304dec167e844074e89fca857fd3a40df0 Mon Sep 17 00:00:00 2001
-From: Alexander Bokovoy <abokovoy@redhat.com>
-Date: Mon, 7 Sep 2026 16:12:33 +0300
-Subject: [PATCH 1/4] Allow fine tuned privilege check
-
-Let users pass through the privilege check if either
-- whole entry read granted ('v' in the GER response)
-- at least one attribute read granted
-
-This is enough to allow LDAPRetrieve to pass, because the rest is
-controlled by the explicit ACIs in LDAP.
-
-Remove permission checks from member-management commands as they apply
-those ACI checks per each individual member (some might fail, some will
-succeed). The partial success is supported and expected by tests.
-
-Related: CVE-2026-79678
-
-Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
----
- ipaserver/plugins/baseldap.py | 98 ++++++++++++++++++++++++++--------
- ipaserver/plugins/privilege.py | 29 +++++++---
- 2 files changed, 98 insertions(+), 29 deletions(-)
-
-diff --git a/ipaserver/plugins/baseldap.py b/ipaserver/plugins/baseldap.py
-index d693c7112d5..122a279f2bb 100644
---- a/ipaserver/plugins/baseldap.py
-+++ b/ipaserver/plugins/baseldap.py
-@@ -1001,7 +1001,10 @@ class BaseLDAPCommand(Method):
- enforce_managed_permission_operations = []
-
- def enforce_managed_permissions(self, *keys, **options):
-- from ipaserver.plugins.privilege import principal_has_privilege
-+ # avoid circular import through explicit plugin reference
-+ principal_has_privilege = (
-+ self.api.packages[0].privilege.principal_has_privilege
-+ )
- mp = getattr(self.obj, 'managed_permissions', None)
- if not mp:
- return
-@@ -1024,23 +1027,31 @@ def has_privilege(priv):
- self.api, op_account, priv)
- return priv_cache[priv]
-
-- # Effective rights, if needed at all, are fetched once in a single
-- # get-effective-rights round trip shared by every permission below.
-- # probe['res'] is (entry_rights, {attr: rights}) or None (no entry).
-- probe = {}
-+ # LDAPDelete and other LDAPMultiQuery commands pass the trailing
-+ # primary key as a *list* of pkeys and act on each target entry in
-+ # turn (see LDAPDelete.execute). get_dn and the effective-rights probes
-+ # below operate on a single entry, so expand the operation into its
-+ # individual targets and require the right on every one of them.
-+ target_keys = self._expand_target_keys(keys)
-
-- def rights_allow(right, perm, touched):
-+ # Effective rights, if needed at all, are fetched at most once per
-+ # target in a single get-effective-rights round trip shared by every
-+ # permission checked for that target. probes[i]['res'] is
-+ # (entry_rights, {attr: rights}) or None (no entry).
-+ probes = [{} for _ in target_keys]
-+
-+ def right_allowed_for(right, perm, touched, probe, tkeys):
- if right == 'add':
- # The target does not exist yet and target-scoped/SELFDN add
- # ACIs cannot be evaluated through a get-effective-rights
- # template probe, so detect the right with a trial add of the
- # real target entry (see _can_add_target).
- if 'add' not in probe:
-- probe['add'] = self._can_add_target(*keys, **options)
-+ probe['add'] = self._can_add_target(*tkeys, **options)
- return probe['add']
- if 'res' not in probe:
- probe['res'] = self._probe_effective_rights(
-- mp, enforce_mp, *keys, **options)
-+ mp, enforce_mp, *tkeys, **options)
- res = probe['res']
- if res is None:
- # Entry does not exist; let the operation report it properly.
-@@ -1054,11 +1065,31 @@ def rights_allow(right, perm, touched):
- if not attrs:
- return True
- return any('w' in attr_rights.get(a, '') for a in attrs)
-- # read / search / compare
-- attrs = {a.lower() for a in perm.get('ipapermdefaultattr', ())}
-- if not attrs:
-+ # read / search / compare: a read is never denied wholesale by
-+ # 389-ds -- it returns the entry and silently filters out the
-+ # individual attributes the caller may not see. Permit the
-+ # operation whenever the caller can view the entry (entry-level
-+ # 'v') or read *any* of its attributes. IPA's read ACIs are
-+ # attribute-scoped, so an unprivileged caller reading its own entry
-+ # gets 'entryLevelRights: none' yet can still read cn/sn/mail/...;
-+ # requiring read on this permission's specific attributes would
-+ # wrongly turn such a legitimate partial read into a total denial.
-+ # Attribute-level confidentiality (e.g. the admin-only Kerberos
-+ # login attributes) stays enforced by 389-ds on the read that
-+ # follows. The probe always requests '*' (see
-+ # _probe_effective_rights), so attr_rights reflects every attribute.
-+ if 'v' in entry_rights:
- return True
-- return any('r' in attr_rights.get(a, '') for a in attrs)
-+ return any('r' in r for r in attr_rights.values())
-+
-+ def rights_allow(right, perm, touched):
-+ # Permit only if the caller may perform the operation on *every*
-+ # target entry the command names (a batch delete/retrieve must be
-+ # authorised for all of its pkeys).
-+ return all(
-+ right_allowed_for(right, perm, touched, probe, tkeys)
-+ for probe, tkeys in zip(probes, target_keys)
-+ )
-
- modified_attrs = None # computed lazily, only for 'write'
- for m in mp.keys():
-@@ -1106,6 +1137,20 @@ def rights_allow(right, perm, touched):
- raise errors.ACIError(
- info=_("not allowed to perform this operation"))
-
-+ def _expand_target_keys(self, keys):
-+ """Expand an operation's keys into one key-tuple per target entry.
-+
-+ LDAPDelete and other LDAPMultiQuery commands pass the trailing primary
-+ key as a list of pkeys and iterate over it, calling get_dn once per
-+ entry (see LDAPDelete.execute). get_dn and the effective-rights probes
-+ expect a single pkey, so mirror that expansion here. For ordinary
-+ single-target commands the keys are returned unchanged as one tuple.
-+ """
-+ if keys and self.obj.primary_key and isinstance(
-+ keys[-1], (list, tuple)):
-+ return [keys[:-1] + (pkey,) for pkey in keys[-1]]
-+ return [tuple(keys)]
-+
- def _modified_attributes(self, **options):
- """Best-effort set of LDAP attributes an update operation changes.
-
-@@ -1214,8 +1259,14 @@ def _probe_effective_rights(self, mp, enforce_mp, *keys, **options):
- continue
- needed.update(a.lower() for a in perm.get('ipapermdefaultattr', ()))
-
-+ # Always include '*' so the effective rights cover every attribute of
-+ # the entry, not only the gated ones. The read/search/compare check
-+ # needs to know whether the caller can read *any* attribute (an
-+ # unprivileged caller may read its own entry without holding the
-+ # object's read privilege), which cannot be answered from the gated
-+ # attributes alone.
- try:
-- rights = ldap.get_effective_rights(dn, sorted(needed) or ['*'])
-+ rights = ldap.get_effective_rights(dn, sorted(needed | {'*'}))
- except errors.NotFound:
- return None
-
-@@ -2020,7 +2071,9 @@ class LDAPAddMember(LDAPModMember):
- member_param_doc = _('%s to add')
- member_count_out = ('%i member added.', '%i members added.')
- allow_same = False
-- enforce_managed_permission_operations = ['write']
-+ # Member writes are enforced per-member by 389-ds and reported gracefully
-+ # in the command's `failed` output, so no API-level gate is applied here
-+ # (an up-front ACIError would abort the whole batch instead).
-
- has_output = (
- output.Entry('result'),
-@@ -2037,8 +2090,6 @@ class LDAPAddMember(LDAPModMember):
- has_output_params = global_output_params
-
- def execute(self, *keys, **options):
-- self.enforce_managed_permissions(*keys, **options)
--
- ldap = self.obj.backend
-
- (member_dns, failed) = self.get_member_dns(**options)
-@@ -2121,7 +2172,9 @@ class LDAPRemoveMember(LDAPModMember):
- """
- member_param_doc = _('%s to remove')
- member_count_out = ('%i member removed.', '%i members removed.')
-- enforce_managed_permission_operations = ['write']
-+ # Member writes are enforced per-member by 389-ds and reported gracefully
-+ # in the command's `failed` output, so no API-level gate is applied here
-+ # (an up-front ACIError would abort the whole batch instead).
-
- has_output = (
- output.Entry('result'),
-@@ -2138,8 +2191,6 @@ class LDAPRemoveMember(LDAPModMember):
- has_output_params = global_output_params
-
- def execute(self, *keys, **options):
-- self.enforce_managed_permissions(*keys, **options)
--
- ldap = self.obj.backend
-
- (member_dns, failed) = self.get_member_dns(**options)
-@@ -2715,8 +2766,6 @@ def _update_attrs(self, update, entry_attrs):
- )
-
- def execute(self, *keys, **options):
-- self.enforce_managed_permissions(*keys, **options)
--
- ldap = self.obj.backend
- try:
- index = tuple(self.args).index(self.attribute)
-@@ -2725,6 +2774,13 @@ def execute(self, *keys, **options):
- else:
- obj_keys = keys[:index]
-
-+ # Enforce on the target entry's own keys. For the arg-based variants
-+ # the attribute value is a trailing positional arg that is not part of
-+ # the entry's DN (see obj_keys), so it must be excluded here: passing
-+ # the full keys would make the effective-rights probe's get_dn target a
-+ # bogus DN and silently bypass the check.
-+ self.enforce_managed_permissions(*obj_keys, **options)
-+
- dn = self.obj.get_dn(*obj_keys, **options)
- entry_attrs = ldap.make_entry(dn, self.args_options_2_entry(
- *keys, **options))
-diff --git a/ipaserver/plugins/privilege.py b/ipaserver/plugins/privilege.py
-index 47f27f12c7d..65199adc0d8 100644
---- a/ipaserver/plugins/privilege.py
-+++ b/ipaserver/plugins/privilege.py
-@@ -92,11 +92,28 @@ def principal_has_privilege(api, principal, privilege):
- privilege_dn = api.Object.privilege.get_dn(privilege)
- ldap = api.Backend.ldap2
- if principal is None:
-- dn_or_princ = DN(ldap.conn.whoami_s()[4:])
-- if dn_or_princ == DN('cn=Directory Manager'):
-+ # whoami reports the bound identity as an entry DN, not a Kerberos
-+ # principal name. Check its privilege membership directly by DN: a
-+ # 'krbprincipalname=<DN>' filter can never match and would always
-+ # (wrongly) report the caller as lacking the privilege.
-+ bound_dn = DN(ldap.conn.whoami_s()[4:])
-+ if bound_dn == DN('cn=Directory Manager'):
- return True
-- else:
-- dn_or_princ = principal
-+ filter = ldap.make_filter(
-+ {'memberof': privilege_dn}, rules=ldap.MATCH_ALL)
-+ try:
-+ ldap.find_entries(base_dn=bound_dn, scope=ldap.SCOPE_BASE,
-+ filter=filter)
-+ return True
-+ except errors.ExecutionError:
-+ # NotFound is the normal negative result (not a member, or the
-+ # bound entry does not exist). Any other execution error (database
-+ # error, limits, ...) cannot positively confirm the privilege
-+ # either, and there is no Kerberos principal to fall back on for
-+ # the ID override check below, so fail closed: not privileged.
-+ return False
-+
-+ dn_or_princ = principal
-
- # First try: Check if there is a principal that has the needed
- # privilege.
-@@ -110,10 +127,6 @@ def principal_has_privilege(api, principal, privilege):
- except errors.NotFound:
- pass
-
-- # Do not run ID override check for the user that has no Kerberos principal
-- if principal is None:
-- return False
--
- # Second try: Check if there is an idoverride for the principal as
- # ipaOriginalUid that has the needed privilege.
- filter = ldap.make_filter(
-
-From b1af1d8bbfad25c59073b6197808d57197c5062b Mon Sep 17 00:00:00 2001
-From: Alexander Bokovoy <abokovoy@redhat.com>
-Date: Tue, 8 Sep 2026 09:54:57 +0300
-Subject: [PATCH 2/4] ipatests: fix XMLRPC test expecations
-
-Two classes of behavior changes:
-
- - permission baseline is now 'read', not 'write'
- - self-service LDAP ACI is slightly different
-
-Related: CVE-2026-79678
-
-Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
----
- .../test_xmlrpc/test_permission_plugin.py | 46 ++++++++++++-------
- .../test_xmlrpc/test_selfservice_plugin.py | 8 ++--
- 2 files changed, 33 insertions(+), 21 deletions(-)
-
-diff --git a/ipatests/test_xmlrpc/test_permission_plugin.py b/ipatests/test_xmlrpc/test_permission_plugin.py
-index dbcd1173d7f..84b88e0c764 100644
---- a/ipatests/test_xmlrpc/test_permission_plugin.py
-+++ b/ipatests/test_xmlrpc/test_permission_plugin.py
-@@ -3182,6 +3182,18 @@ class test_permission_bindtype(Declarative):
- expected=dict(
- value=permission1,
- summary=u'Added permission "%s"' % permission1,
-+ messages=(
-+ {
-+ 'message': ('The permission has read rights but no '
-+ 'attributes are set.'),
-+ 'code': 13032,
-+ 'type': 'warning',
-+ 'name': 'MissingTargetAttributesinPermission',
-+ 'data': {
-+ 'right': 'read',
-+ }
-+ },
-+ ),
- result=dict(
- dn=permission1_dn,
- cn=[permission1],
-@@ -3245,13 +3257,13 @@ class test_permission_bindtype(Declarative):
- summary=u'Modified permission "%s"' % permission1,
- messages=(
- {
-- 'message': ('The permission has write rights but no '
-+ 'message': ('The permission has read rights but no '
- 'attributes are set.'),
- 'code': 13032,
- 'type': 'warning',
- 'name': 'MissingTargetAttributesinPermission',
- 'data': {
-- 'right': 'write',
-+ 'right': 'read',
- }
- },
- ),
-@@ -3260,7 +3272,7 @@ class test_permission_bindtype(Declarative):
- cn=[permission1],
- objectclass=objectclasses.permission,
- type=[u'user'],
-- ipapermright=[u'write'],
-+ ipapermright=[u'read'],
- ipapermbindruletype=[u'all'],
- ipapermissiontype=[u'SYSTEM', u'V2'],
- ipapermlocation=[users_dn],
-@@ -3272,7 +3284,7 @@ class test_permission_bindtype(Declarative):
- permission1, users_dn,
- '(targetfilter = "(objectclass=posixaccount)")' +
- '(version 3.0;acl "permission:%s";' % permission1 +
-- 'allow (write) userdn = "ldap:///all";)',
-+ 'allow (read) userdn = "ldap:///all";)',
- ),
-
- dict(
-@@ -3301,7 +3313,7 @@ class test_permission_bindtype(Declarative):
- dn=permission1_dn,
- cn=[permission1],
- type=[u'user'],
-- ipapermright=[u'write'],
-+ ipapermright=[u'read'],
- ipapermbindruletype=[u'all'],
- objectclass=objectclasses.permission,
- ipapermissiontype=[u'SYSTEM', u'V2'],
-@@ -3348,13 +3360,13 @@ class test_permission_bindtype(Declarative):
- summary=u'Modified permission "%s"' % permission1,
- messages=(
- {
-- 'message': ('The permission has write rights but no '
-+ 'message': ('The permission has read rights but no '
- 'attributes are set.'),
- 'code': 13032,
- 'type': 'warning',
- 'name': 'MissingTargetAttributesinPermission',
- 'data': {
-- 'right': 'write',
-+ 'right': 'read',
- }
- },
- ),
-@@ -3363,7 +3375,7 @@ class test_permission_bindtype(Declarative):
- cn=[permission1_renamed],
- type=[u'user'],
- objectclass=objectclasses.permission,
-- ipapermright=[u'write'],
-+ ipapermright=[u'read'],
- ipapermbindruletype=[u'all'],
- ipapermissiontype=[u'SYSTEM', u'V2'],
- ipapermlocation=[users_dn],
-@@ -3375,7 +3387,7 @@ class test_permission_bindtype(Declarative):
- permission1_renamed, users_dn,
- '(targetfilter = "(objectclass=posixaccount)")' +
- '(version 3.0;acl "permission:%s";' % permission1_renamed +
-- 'allow (write) userdn = "ldap:///all";)',
-+ 'allow (read) userdn = "ldap:///all";)',
- ),
-
- dict(
-@@ -3391,13 +3403,13 @@ class test_permission_bindtype(Declarative):
- summary=u'Modified permission "%s"' % permission1_renamed,
- messages=(
- {
-- 'message': ('The permission has write rights but no '
-+ 'message': ('The permission has read rights but no '
- 'attributes are set.'),
- 'code': 13032,
- 'type': 'warning',
- 'name': 'MissingTargetAttributesinPermission',
- 'data': {
-- 'right': 'write',
-+ 'right': 'read',
- }
- },
- ),
-@@ -3406,7 +3418,7 @@ class test_permission_bindtype(Declarative):
- cn=[permission1_renamed],
- objectclass=objectclasses.permission,
- type=[u'user'],
-- ipapermright=[u'write'],
-+ ipapermright=[u'read'],
- ipapermbindruletype=[u'permission'],
- ipapermissiontype=[u'SYSTEM', u'V2'],
- ipapermlocation=[users_dn],
-@@ -3418,7 +3430,7 @@ class test_permission_bindtype(Declarative):
- permission1_renamed, users_dn,
- '(targetfilter = "(objectclass=posixaccount)")' +
- '(version 3.0;acl "permission:%s";' % permission1_renamed +
-- 'allow (write) groupdn = "ldap:///%s";)' % permission1_renamed_dn,
-+ 'allow (read) groupdn = "ldap:///%s";)' % permission1_renamed_dn,
- ),
-
- dict(
-@@ -3432,13 +3444,13 @@ class test_permission_bindtype(Declarative):
- summary=u'Modified permission "%s"' % permission1_renamed,
- messages=(
- {
-- 'message': ('The permission has write rights but no '
-+ 'message': ('The permission has read rights but no '
- 'attributes are set.'),
- 'code': 13032,
- 'type': 'warning',
- 'name': 'MissingTargetAttributesinPermission',
- 'data': {
-- 'right': 'write',
-+ 'right': 'read',
- }
- },
- ),
-@@ -3447,7 +3459,7 @@ class test_permission_bindtype(Declarative):
- cn=[permission1],
- type=[u'user'],
- objectclass=objectclasses.permission,
-- ipapermright=[u'write'],
-+ ipapermright=[u'read'],
- ipapermbindruletype=[u'permission'],
- ipapermissiontype=[u'SYSTEM', u'V2'],
- ipapermlocation=[users_dn],
-@@ -3459,7 +3471,7 @@ class test_permission_bindtype(Declarative):
- permission1, users_dn,
- '(targetfilter = "(objectclass=posixaccount)")' +
- '(version 3.0;acl "permission:%s";' % permission1 +
-- 'allow (write) groupdn = "ldap:///%s";)' % permission1_dn,
-+ 'allow (read) groupdn = "ldap:///%s";)' % permission1_dn,
- ),
-
- dict(
-diff --git a/ipatests/test_xmlrpc/test_selfservice_plugin.py b/ipatests/test_xmlrpc/test_selfservice_plugin.py
-index 3ce043e46a4..be86c5a6727 100644
---- a/ipatests/test_xmlrpc/test_selfservice_plugin.py
-+++ b/ipatests/test_xmlrpc/test_selfservice_plugin.py
-@@ -803,7 +803,7 @@ class test_selfservice_cli_add_del(Declarative):
- r'(version 3.0;acl '
- r'\22selfservice:selfservice_add_1002\22;'
- r'allow (write) (userdn = \22ldap:///self\22 '
-- r'and userdn = \22ldap:///all\22;)',
-+ r'and userdn = \22ldap:///all\22);)',
- ),
- ),
-
-@@ -881,7 +881,7 @@ class test_selfservice_cli_add_del(Declarative):
- r'(version 3.0;acl '
- r'\22selfservice:selfservice_add_1005\22;'
- r'allow (write) (userdn = \22ldap:///self\22 '
-- r'and userdn = \22ldap:///all\22;)',
-+ r'and userdn = \22ldap:///all\22);)',
- ),
- ),
-
-@@ -1591,7 +1591,7 @@ class test_selfservice_mod_cli(Declarative):
- r'(version 3.0;acl '
- r'\22selfservice:%s\22;'
- r'allow (write) (userdn = \22ldap:///self\22 '
-- r'and userdn = \22ldap:///all\22;)'
-+ r'and userdn = \22ldap:///all\22);)'
- ) % SS_CLI_MOD,
- ),
- ),
-@@ -1658,7 +1658,7 @@ class test_selfservice_mod_cli(Declarative):
- r'(version 3.0;acl '
- r'\22selfservice:%s\22;'
- r'allow (write) (userdn = \22ldap:///self\22 '
-- r'and userdn = \22ldap:///all\22;)'
-+ r'and userdn = \22ldap:///all\22);)'
- ) % SS_CLI_MOD,
- ),
- ),
-
-From 29ec4764e04c2841d001478fd63ba6ea06d3c7aa Mon Sep 17 00:00:00 2001
-From: Alexander Bokovoy <abokovoy@redhat.com>
-Date: Tue, 8 Sep 2026 12:57:44 +0300
-Subject: [PATCH 3/4] permission enforcement: allow services to define keys to
- enforce
-
-service_add_smb constructs cifs/hostname out of hostname. We need to
-adjust what the permission check is using for an ADD test per command.
-
-Related: CVE-2026-79678
-
-Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
----
- ipaserver/plugins/baseldap.py | 16 ++++++++++++++++
- ipaserver/plugins/service.py | 7 +++++++
- 2 files changed, 23 insertions(+)
-
-diff --git a/ipaserver/plugins/baseldap.py b/ipaserver/plugins/baseldap.py
-index 122a279f2bb..926afb17ec7 100644
---- a/ipaserver/plugins/baseldap.py
-+++ b/ipaserver/plugins/baseldap.py
-@@ -1027,6 +1027,11 @@ def has_privilege(priv):
- self.api, op_account, priv)
- return priv_cache[priv]
-
-+ # Some commands construct the real target principal/DN only later (in
-+ # pre_callback), so let them supply the keys the probes should target
-+ # (e.g. service-add-smb builds cifs/<hostname> from a bare hostname).
-+ keys = self._enforcement_keys(*keys, **options)
-+
- # LDAPDelete and other LDAPMultiQuery commands pass the trailing
- # primary key as a *list* of pkeys and act on each target entry in
- # turn (see LDAPDelete.execute). get_dn and the effective-rights probes
-@@ -1137,6 +1142,17 @@ def rights_allow(right, perm, touched):
- raise errors.ACIError(
- info=_("not allowed to perform this operation"))
-
-+ def _enforcement_keys(self, *keys, **options):
-+ """Keys identifying the target entry for permission enforcement.
-+
-+ Defaults to the command's own keys. Commands whose real target DN is
-+ derived only later -- e.g. service-add-smb, which takes a bare hostname
-+ and constructs the ``cifs/<hostname>`` principal in pre_callback --
-+ override this so the effective-rights/trial-add probes target the
-+ actual entry rather than a DN built from the raw key.
-+ """
-+ return keys
-+
- def _expand_target_keys(self, keys):
- """Expand an operation's keys into one key-tuple per target entry.
-
-diff --git a/ipaserver/plugins/service.py b/ipaserver/plugins/service.py
-index bbe71ddc78d..51ea015f401 100644
---- a/ipaserver/plugins/service.py
-+++ b/ipaserver/plugins/service.py
-@@ -810,6 +810,13 @@ def get_options(self):
- if check:
- yield arg
-
-+ def _enforcement_keys(self, *keys, **options):
-+ # The primary key here is a bare hostname; the real target principal
-+ # (cifs/<hostname>) is only built in pre_callback. Enforce the add
-+ # against that actual principal so the "Hosts can add own services"
-+ # ACI (target krbprincipalname=*/($dn)@$REALM) is matched correctly.
-+ return ('cifs/{}'.format(keys[0]),)
-+
- def pre_callback(self, ldap, dn, entry_attrs, attrs_list,
- *keys, **options):
- assert isinstance(dn, DN)
-
-From 6eabd3c675a9d09667d6319ac65a6104a66b5f4f Mon Sep 17 00:00:00 2001
-From: Alexander Bokovoy <abokovoy@redhat.com>
-Date: Tue, 8 Sep 2026 18:04:52 +0300
-Subject: [PATCH 4/4] ipa-pwd-extop: allow password expiration override on
- create
-
-Permit to create accounts with a limited principal password expiration
-but not beyond what Kerberos password policy defines for this account.
-
-Additionally, fix timezone-related bugs in setting password expiration.
-
-Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
----
- .../ipa-slapi-plugins/ipa-pwd-extop/common.c | 2 +-
- .../ipa-slapi-plugins/ipa-pwd-extop/prepost.c | 50 +++++++++++
- ipapython/ipaldap.py | 21 ++++-
- ipatests/test_integration/test_commands.py | 86 +++++++++++++++++++
- 4 files changed, 154 insertions(+), 5 deletions(-)
-
-diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/common.c b/daemons/ipa-slapi-plugins/ipa-pwd-extop/common.c
-index 71642540a20..ebae0465b66 100644
---- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/common.c
-+++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/common.c
-@@ -799,7 +799,7 @@ int ipapwd_setdate(Slapi_Entry *source, Slapi_Mods *smods, const char *attr,
- Slapi_Attr *t;
- bool exists;
-
-- exists = (slapi_entry_attr_find(source, attr, &t) == 0);
-+ exists = (source != NULL && slapi_entry_attr_find(source, attr, &t) == 0);
-
- if (remove) {
- if (exists) {
-diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/prepost.c b/daemons/ipa-slapi-plugins/ipa-pwd-extop/prepost.c
-index 4bfd60e7c3f..71ccc5f0712 100644
---- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/prepost.c
-+++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/prepost.c
-@@ -400,6 +400,40 @@ static int ipapwd_pre_add(Slapi_PBlock *pb)
- goto done;
- }
-
-+ /* If the entry being added already carries a krbPasswordExpiration, treat
-+ * it as an explicit request. An explicit request overrides the default
-+ * expiration derived by ipapwd_CheckPolicy (which, for an admin-set
-+ * password, force-expires the account), but is still capped at the policy
-+ * maximum lifetime -- a password must never outlive policy. A
-+ * max_pwd_life of 0 means "never expire".
-+ *
-+ * This is only meaningful on LDAP ADD, where the attribute value is the
-+ * request; on a password change it holds the previous expiration and must
-+ * not constrain the new one. */
-+ {
-+ char *req_exp_str;
-+ time_t req_exp;
-+
-+ req_exp_str = slapi_entry_attr_get_charptr(e, "krbPasswordExpiration");
-+ req_exp = ipapwd_gentime_to_time_t(req_exp_str);
-+ slapi_ch_free_string(&req_exp_str);
-+
-+ if (req_exp != 0) {
-+ time_t policy_max = 0;
-+
-+ if (pwdop->pwdata.policy.max_pwd_life > 0) {
-+ policy_max = pwdop->pwdata.timeNow +
-+ pwdop->pwdata.policy.max_pwd_life;
-+ }
-+
-+ if (policy_max != 0 && req_exp > policy_max) {
-+ pwdop->pwdata.expireTime = policy_max;
-+ } else {
-+ pwdop->pwdata.expireTime = req_exp;
-+ }
-+ }
-+ }
-+
- if (is_krb || is_smb || is_ipant) {
-
- Slapi_Value **svals = NULL;
-@@ -1150,6 +1184,22 @@ static int ipapwd_post_modadd(Slapi_PBlock *pb)
- }
- }
-
-+ /* The date-setting and grace-time logic below needs the current entry to
-+ * detect already-present single-valued attributes (e.g. a client-supplied
-+ * krbPasswordExpiration on add) so ipapwd_setdate can REPLACE rather than
-+ * append a duplicate value. On add -- and on password changes that skipped
-+ * history -- pwdata.target is still NULL, so fetch the just-committed entry
-+ * (freed with the mod path's entry at 'done'). */
-+ if (pwdop->pwdata.target == NULL) {
-+ Slapi_DN *tmp_dn = slapi_sdn_new_dn_byref(pwdop->pwdata.dn);
-+ if (tmp_dn) {
-+ (void)slapi_search_internal_get_entry(tmp_dn, 0,
-+ &pwdop->pwdata.target,
-+ ipapwd_plugin_id);
-+ slapi_sdn_free(&tmp_dn);
-+ }
-+ }
-+
- /* we assume that krb attributes are properly updated too if keys were
- * passed in */
- if (!pwdop->skip_keys) {
-diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py
-index 1e56aad87d8..a3f1319c431 100644
---- a/ipapython/ipaldap.py
-+++ b/ipapython/ipaldap.py
-@@ -23,7 +23,7 @@
- import errno
- import logging
- import time
--from datetime import datetime
-+from datetime import datetime, timezone
- from decimal import Decimal
- from copy import deepcopy
- import contextlib
-@@ -972,6 +972,20 @@ def get_attribute_single_value(self, name_or_oid):
-
- return None
-
-+ @staticmethod
-+ def _encode_datetime(val):
-+ """Translate a datetime to an LDAP GeneralizedTime string.
-+
-+ The GeneralizedTime format used here (``...Z``) denotes UTC, so a
-+ timezone-aware value must be converted to UTC first; otherwise its
-+ wall-clock components would be emitted verbatim and mislabelled as
-+ UTC. A naive datetime is assumed to already be in UTC (the convention
-+ used throughout IPA).
-+ """
-+ if val.tzinfo is not None:
-+ val = val.astimezone(timezone.utc)
-+ return val.strftime(LDAP_GENERALIZED_TIME_FORMAT)
-+
- def encode(self, val):
- """
- Encode attribute value to LDAP representation (str/bytes).
-@@ -999,7 +1013,7 @@ def encode(self, val):
- dct = dict((k, self.encode(v)) for k, v in val.items())
- return dct
- elif isinstance(val, datetime):
-- return val.strftime(LDAP_GENERALIZED_TIME_FORMAT).encode('utf-8')
-+ return self._encode_datetime(val).encode('utf-8')
- elif isinstance(val, x509.IPACertificate):
- return val.public_bytes(x509.Encoding.DER)
- elif val is None:
-@@ -1389,8 +1403,7 @@ def make_filter_from_attr(
- value = u'\\'.join(
- value[i:i+2] for i in six.moves.range(-2, len(value), 2))
- elif isinstance(value, datetime):
-- value = value.strftime(
-- LDAP_GENERALIZED_TIME_FORMAT)
-+ value = cls._encode_datetime(value)
- value = ldap.filter.escape_filter_chars(value)
- else:
- value = str(value)
-diff --git a/ipatests/test_integration/test_commands.py b/ipatests/test_integration/test_commands.py
-index 4d221abc208..d370b49a05b 100644
---- a/ipatests/test_integration/test_commands.py
-+++ b/ipatests/test_integration/test_commands.py
-@@ -471,6 +471,92 @@ def test_change_sysaccount_password_issue7561(self):
- tasks.ldappasswd_sysaccount_change(sysuser, original_passwd,
- new_passwd, master)
-
-+ def test_user_add_password_expiration_bounded_by_policy(self):
-+ """user-add with --password and an explicit --password-expiration.
-+
-+ The ipa-pwd-extop DS plugin must:
-+ * store a single value of the single-valued krbPasswordExpiration
-+ attribute (it used to append a second, policy-derived value on add,
-+ failing the operation with a schema violation), and
-+ * honor an explicitly requested expiration but bound it by the
-+ effective password policy, so a password never outlives policy.
-+ """
-+ master = self.master
-+ tasks.kinit_admin(master)
-+ base_dn = str(master.domain.basedn)
-+
-+ # Effective global policy maximum password lifetime, in seconds
-+ # (krbMaxPwdLife is stored in seconds; 0 means "never expire").
-+ result = master.run_command(['ipa', 'pwpolicy-show', '--raw'])
-+ match = re.search(r'krbmaxpwdlife:\s*(\d+)', result.stdout_text)
-+ max_life_secs = int(match.group(1)) if match else 0
-+
-+ def add_user(user, exp_dt):
-+ master.run_command(
-+ ['ipa', 'user-add', user, '--first', user, '--last', user,
-+ '--password', '--password-expiration',
-+ exp_dt.strftime('%Y%m%d%H%M%SZ')],
-+ stdin_text='Secret123\nSecret123\n')
-+
-+ def stored_expirations(user):
-+ result = tasks.ldapsearch_dm(
-+ master,
-+ 'uid={user},cn=users,cn=accounts,{base_dn}'.format(
-+ user=user, base_dn=base_dn),
-+ ['krbpasswordexpiration'],
-+ scope='base')
-+ values = re.findall(r'krbpasswordexpiration: (\S+)',
-+ result.stdout_text.lower())
-+ return [datetime.strptime(v.strip().upper(), '%Y%m%d%H%M%SZ')
-+ for v in values]
-+
-+ # A request comfortably within policy must be honored verbatim.
-+ within_user = 'pwdexpwithin'
-+ if max_life_secs:
-+ within_delta = timedelta(seconds=min(max_life_secs // 2, 86400))
-+ else:
-+ within_delta = timedelta(days=1)
-+ requested = datetime.utcnow() + within_delta
-+ # second precision only: krbPasswordExpiration has no sub-second part
-+ requested = requested.replace(microsecond=0)
-+ try:
-+ add_user(within_user, requested)
-+ stored = stored_expirations(within_user)
-+ assert len(stored) == 1, (
-+ 'krbPasswordExpiration must be single-valued, got %r' % stored)
-+ assert abs((stored[0] - requested).total_seconds()) < 120, (
-+ 'within-policy request %s not honored, stored %s'
-+ % (requested, stored[0]))
-+ finally:
-+ master.run_command(['ipa', 'user-del', within_user],
-+ raiseonerr=False)
-+
-+ # A request far beyond policy must be capped at the policy maximum
-+ # (only meaningful when the policy actually sets a maximum lifetime).
-+ if max_life_secs:
-+ over_user = 'pwdexpover'
-+ requested = (datetime.utcnow()
-+ + timedelta(seconds=max_life_secs)
-+ + timedelta(days=3650))
-+ requested = requested.replace(microsecond=0)
-+ try:
-+ add_user(over_user, requested)
-+ stored = stored_expirations(over_user)
-+ assert len(stored) == 1, (
-+ 'krbPasswordExpiration must be single-valued, got %r'
-+ % stored)
-+ assert stored[0] < requested - timedelta(days=1), (
-+ 'beyond-policy request was not capped, stored %s'
-+ % stored[0])
-+ cap = (datetime.utcnow() + timedelta(seconds=max_life_secs)
-+ + timedelta(days=1))
-+ assert stored[0] <= cap, (
-+ 'stored expiration %s exceeds policy cap %s'
-+ % (stored[0], cap))
-+ finally:
-+ master.run_command(['ipa', 'user-del', over_user],
-+ raiseonerr=False)
-+
- def get_krbinfo(self, user):
- base_dn = str(self.master.domain.basedn)
- result = tasks.ldapsearch_dm(
diff --git a/freeipa.spec b/freeipa.spec
index 77fe24b..431a000 100644
--- a/freeipa.spec
+++ b/freeipa.spec
@@ -211,7 +211,7 @@
Name: %{package_name}
Version: %{IPA_VERSION}
-Release: 3.2%{?rc_version:.%rc_version}%{?dist}
+Release: 4%{?rc_version:.%rc_version}%{?dist}
Summary: The Identity, Policy and Audit system
License: GPL-3.0-or-later
@@ -235,13 +235,7 @@ Source2: gpgkey-B40A78FBA576C4A3FC7D7BBC359FAF777296F653.asc
%endif
Patch0: freeipa-version-upgrade-fedora-only.patch
-Patch1: freeipa-pr-8557.patch
-Patch2: freeipa-pr-8558.patch
-Patch3: freeipa-CVE-2026-14612.patch
-Patch4: freeipa-ipa-join-increase-argv-array-suze-for-ipa-getkeytab.patch
-Patch5: freeipa-ipa-kdb-fix-NULL-pointer-dereference-when-freeing-cr.patch
-Patch6: freeipa-increase-the-AJP-proxy-buffer-size-to-handle-large-c.patch
-Patch7: freeipa-force-rewrite-of-ipa-pki-proxy.conf-on-upgrade.patch
+Patch1: freeipa-4.13.4-updates.patch
# RHEL spec file only: START: Change branding to IPA and Identity Management
# Moved branding logos and background to redhat-logos-ipa-80.4:
@@ -1979,6 +1973,10 @@ fi
%endif
%changelog
+* Mon Oct 26 2026 David Hanina <dhanina@redhat.com> - 4.13.4-4
+- Rebuild against Samba 4.25.1
+- Consolidate post-4.13.4 patches from ipa-4-13 branch upstream
+
* Tue Oct 06 2026 David Hanina <dhanina@redhat.com> - 4.13.4-3.2
- Resolves: rhbz#2546573
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-26 20:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26 20:25 [rpms/freeipa] rawhide: Update patches to track ipa-4-13 branch upstream Alexander Bokovoy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox