From 6c5acd37a36b55ae4cfaf9cbd62a64f1f8626687 Mon Sep 17 00:00:00 2001 From: wjiang Date: Tue, 3 Dec 2024 14:46:31 +0800 Subject: [PATCH] backport patches from upstream community --- ...Missing-dns_update_per_family-option.patch | 76 +++++++++++++++++++ backport-TOOLS-mistype-fix.patch | 34 +++++++++ ...ldaps-setting-with-ad_machine_pw_ren.patch | 65 ++++++++++++++++ sssd.spec | 8 +- 4 files changed, 182 insertions(+), 1 deletion(-) create mode 100644 backport-Missing-dns_update_per_family-option.patch create mode 100644 backport-TOOLS-mistype-fix.patch create mode 100644 backport-ad-honor-ad_use_ldaps-setting-with-ad_machine_pw_ren.patch diff --git a/backport-Missing-dns_update_per_family-option.patch b/backport-Missing-dns_update_per_family-option.patch new file mode 100644 index 0000000..4c99b82 --- /dev/null +++ b/backport-Missing-dns_update_per_family-option.patch @@ -0,0 +1,76 @@ +From a822206c7859b5f39af2b2ea1b117850a0589e3c Mon Sep 17 00:00:00 2001 +From: Tomas Halman +Date: Mon, 21 Oct 2024 16:31:38 +0200 +Subject: [PATCH] Missing 'dns_update_per_family' option + +This update fixes missing 'dns_update_per_family' option in python code +and config files. + +Reviewed-by: Alexey Tikhonov +--- + src/config/SSSDConfig/sssdoptions.py | 2 ++ + src/config/SSSDConfigTest.py | 2 ++ + src/config/cfg_rules.ini | 1 + + src/config/etc/sssd.api.conf | 1 + + 4 files changed, 6 insertions(+) + +diff --git a/src/config/SSSDConfig/sssdoptions.py b/src/config/SSSDConfig/sssdoptions.py +index e7de867..3aba87a 100644 +--- a/src/config/SSSDConfig/sssdoptions.py ++++ b/src/config/SSSDConfig/sssdoptions.py +@@ -200,6 +200,8 @@ class SSSDOptions(object): + 'refresh_expired_interval': _('How often should expired entries be refreshed in background'), + 'refresh_expired_interval_offset': _("Maximum period deviation when refreshing expired entries in background"), + 'dyndns_update': _("Whether to automatically update the client's DNS entry"), ++ 'dyndns_update_per_family': _('Whether DNS update of A and AAAA record should be performed ' ++ 'in one update or in two separate updates'), + 'dyndns_ttl': _("The TTL to apply to the client's DNS entry after updating it"), + 'dyndns_iface': _("The interface whose IP should be used for dynamic DNS updates"), + 'dyndns_refresh_interval': _("How often to periodically update the client's DNS entry"), +diff --git a/src/config/SSSDConfigTest.py b/src/config/SSSDConfigTest.py +index e08109a..21a08c8 100755 +--- a/src/config/SSSDConfigTest.py ++++ b/src/config/SSSDConfigTest.py +@@ -581,6 +581,7 @@ class SSSDConfigTestSSSDDomain(unittest.TestCase): + 'dns_discovery_domain', + 'failover_primary_timeout', + 'dyndns_update', ++ 'dyndns_update_per_family', + 'dyndns_ttl', + 'dyndns_iface', + 'dyndns_refresh_interval', +@@ -942,6 +943,7 @@ class SSSDConfigTestSSSDDomain(unittest.TestCase): + 'dns_discovery_domain', + 'failover_primary_timeout', + 'dyndns_update', ++ 'dyndns_update_per_family', + 'dyndns_ttl', + 'dyndns_iface', + 'dyndns_refresh_interval', +diff --git a/src/config/cfg_rules.ini b/src/config/cfg_rules.ini +index 39b66ba..0a630f1 100644 +--- a/src/config/cfg_rules.ini ++++ b/src/config/cfg_rules.ini +@@ -444,6 +444,7 @@ option = refresh_expired_interval + + # Dynamic DNS updates + option = dyndns_update ++option = dyndns_update_per_family + option = dyndns_ttl + option = dyndns_iface + option = dyndns_refresh_interval +diff --git a/src/config/etc/sssd.api.conf b/src/config/etc/sssd.api.conf +index 67b7a5f..5930f4a 100644 +--- a/src/config/etc/sssd.api.conf ++++ b/src/config/etc/sssd.api.conf +@@ -209,6 +209,7 @@ refresh_expired_interval = int, None, false + + # Dynamic DNS updates + dyndns_update = bool, None, false ++dyndns_update_per_family = bool, None, false + dyndns_ttl = int, None, false + dyndns_iface = str, None, false + dyndns_refresh_interval = int, None, false +-- +2.33.0 + diff --git a/backport-TOOLS-mistype-fix.patch b/backport-TOOLS-mistype-fix.patch new file mode 100644 index 0000000..f7bc93f --- /dev/null +++ b/backport-TOOLS-mistype-fix.patch @@ -0,0 +1,34 @@ +From 3621a587a32589e8404ed1f2356fcbfebc128efc Mon Sep 17 00:00:00 2001 +From: Alexey Tikhonov +Date: Mon, 2 Sep 2024 21:04:34 +0200 +Subject: [PATCH] TOOLS: mistype fix +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Reviewed-by: Iker Pedrosa +Reviewed-by: Tomáš Halman + +Reference:https://github.com/SSSD/sssd/commit/3621a587a32589e8404ed1f2356fcbfebc128efc +Conflict:NA + +--- + src/tools/sssctl/sssctl_data.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/tools/sssctl/sssctl_data.c b/src/tools/sssctl/sssctl_data.c +index 79e12078e..43b9814ea 100644 +--- a/src/tools/sssctl/sssctl_data.c ++++ b/src/tools/sssctl/sssctl_data.c +@@ -168,7 +168,7 @@ static errno_t sssctl_restore(bool force_start, bool force_restart) + } + } + +- if (sssctl_backup_file_exists(SSS_BACKUP_USER_OVERRIDES)) { ++ if (sssctl_backup_file_exists(SSS_BACKUP_GROUP_OVERRIDES)) { + ret = sssctl_run_command((const char *[]){"sss_override", "group-import", + SSS_BACKUP_GROUP_OVERRIDES, NULL}); + if (ret != EOK) { +-- +2.33.0 + diff --git a/backport-ad-honor-ad_use_ldaps-setting-with-ad_machine_pw_ren.patch b/backport-ad-honor-ad_use_ldaps-setting-with-ad_machine_pw_ren.patch new file mode 100644 index 0000000..6d9a23d --- /dev/null +++ b/backport-ad-honor-ad_use_ldaps-setting-with-ad_machine_pw_ren.patch @@ -0,0 +1,65 @@ +From d004e7b4b977da3dd9f1d3de910c28c093a6fb26 Mon Sep 17 00:00:00 2001 +From: santeri3700 +Date: Tue, 15 Oct 2024 20:13:20 +0300 +Subject: [PATCH] ad: honor ad_use_ldaps setting with ad_machine_pw_renewal + +The value of ad_use_ldaps was not passed as `--use-ldaps` +argument to the adcli update command which handles +the automatic renewal of AD machine account password. + +Resolves: https://github.com/SSSD/sssd/issues/7642 + +Signed-off-by: santeri3700 + +Reviewed-by: Alexey Tikhonov +Reviewed-by: Sumit Bose + +Reference:https://github.com/SSSD/sssd/commit/d004e7b4b977da3dd9f1d3de910c28c093a6fb26 +Conflict:NA + +--- + src/providers/ad/ad_machine_pw_renewal.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/providers/ad/ad_machine_pw_renewal.c b/src/providers/ad/ad_machine_pw_renewal.c +index 56b64a2a9..2e54e9bff 100644 +--- a/src/providers/ad/ad_machine_pw_renewal.c ++++ b/src/providers/ad/ad_machine_pw_renewal.c +@@ -39,6 +39,7 @@ struct renewal_data { + static errno_t get_adcli_extra_args(const char *ad_domain, + const char *ad_hostname, + const char *ad_keytab, ++ bool ad_use_ldaps, + size_t pw_lifetime_in_days, + bool add_samba_data, + size_t period, +@@ -59,7 +60,7 @@ static errno_t get_adcli_extra_args(const char *ad_domain, + return ENOMEM; + } + +- args = talloc_array(renewal_data, const char *, 9); ++ args = talloc_array(renewal_data, const char *, 10); + if (args == NULL) { + DEBUG(SSSDBG_OP_FAILURE, "talloc_array failed.\n"); + return ENOMEM; +@@ -79,6 +80,9 @@ static errno_t get_adcli_extra_args(const char *ad_domain, + args[c++] = talloc_asprintf(args, "--host-keytab=%s", ad_keytab); + } + args[c++] = talloc_asprintf(args, "--domain=%s", ad_domain); ++ if (ad_use_ldaps) { ++ args[c++] = talloc_strdup(args, "--use-ldaps"); ++ } + if (DEBUG_IS_SET(SSSDBG_TRACE_LIBS)) { + args[c++] = talloc_strdup(args, "--verbose"); + } +@@ -390,6 +394,7 @@ errno_t ad_machine_account_password_renewal_init(struct be_ctx *be_ctx, + dp_opt_get_cstring(ad_opts->basic, AD_HOSTNAME), + dp_opt_get_cstring(ad_opts->id_ctx->sdap_id_ctx->opts->basic, + SDAP_KRB5_KEYTAB), ++ dp_opt_get_bool(ad_opts->basic, AD_USE_LDAPS), + lifetime, + dp_opt_get_bool(ad_opts->basic, + AD_UPDATE_SAMBA_MACHINE_ACCOUNT_PASSWORD), +-- +2.33.0 + diff --git a/sssd.spec b/sssd.spec index f8a42e3..3410067 100644 --- a/sssd.spec +++ b/sssd.spec @@ -8,13 +8,16 @@ Name: sssd Version: 2.9.5 -Release: 2 +Release: 3 Summary: System Security Services Daemon License: GPL-3.0-or-later URL: https://github.com/SSSD/sssd/ Source0: https://github.com/SSSD/sssd/releases/download/%{version}/sssd-%{version}.tar.gz Patch0001: backport-Make-sure-invalid-krb5-context-is-not-used.patch +Patch0002: backport-Missing-dns_update_per_family-option.patch +Patch0003: backport-TOOLS-mistype-fix.patch +Patch0004: backport-ad-honor-ad_use_ldaps-setting-with-ad_machine_pw_ren.patch Requires: sssd-ad = %{version}-%{release} Requires: sssd-common = %{version}-%{release} @@ -914,6 +917,9 @@ fi %systemd_postun_with_restart sssd.service %changelog +* Tue Dec 03 2024 wangjiang - 2.9.5-3 +- backport upstream patches + * Fri Nov 22 2024 Majianhan - 2.9.5-2 - backport make sure invalid krb5 context is not used -- Gitee