Backport PR #2610 to fix for authselect 1.0.2+ (see #1645708)

This commit is contained in:
Adam Williamson 2018-11-27 17:13:12 -08:00
parent e5b9ea7287
commit 38293c2b0c
2 changed files with 62 additions and 1 deletions

55
2610.patch Normal file
View File

@ -0,0 +1,55 @@
From 349955624e55e5afe23776a2c4f269da80cf917f Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Tue, 27 Nov 2018 16:21:06 -0800
Subject: [PATCH] Fix authselect invocations to work with 1.0.2
Since authselect 1.0.2, invoking an authselect command sequence
like this:
['authselect', 'sssd', '', '--force']
does not work: authselect barfs on the empty string arg and
errors out. We must only pass a features arg if we actually have
some text to go in it.
This broke uninstallation.
I don't know for sure whether the fix in `restore` is needed -
it may be that `cfg[1]` is never an empty sequence - but it
seems sensible to do it just in case.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
---
ipaplatform/redhat/authconfig.py | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/ipaplatform/redhat/authconfig.py b/ipaplatform/redhat/authconfig.py
index a512345202..3de42cc365 100644
--- a/ipaplatform/redhat/authconfig.py
+++ b/ipaplatform/redhat/authconfig.py
@@ -166,7 +166,10 @@ def unconfigure(
statestore.restore_state('authselect', 'features_list') or ''
statestore.delete_state('authselect', 'mkhomedir')
- cmd = [paths.AUTHSELECT, "select", profile, features, "--force"]
+ cmd = [paths.AUTHSELECT, "select", profile]
+ if features:
+ cmd.append(features)
+ cmd.append("--force")
ipautil.run(cmd)
def backup(self, path):
@@ -187,9 +190,10 @@ def restore(self, path):
if cfg:
profile = cfg[0]
- cmd = [
- paths.AUTHSELECT, "select", profile,
- " ".join(cfg[1]), "--force"]
+ cmd = [paths.AUTHSELECT, "select", profile]
+ if cfg[1]:
+ cmd.append(" ".join(cfg[1]))
+ cmd.append("--force")
ipautil.run(cmd)
def set_nisdomain(self, nisdomain):

View File

@ -132,7 +132,7 @@
Name: %{package_name}
Version: %{IPA_VERSION}
Release: 2%{?dist}
Release: 3%{?dist}
Summary: The Identity, Policy and Audit system
Group: System Environment/Base
@ -140,6 +140,9 @@ License: GPLv3+
URL: http://www.freeipa.org/
Source0: https://releases.pagure.org/freeipa/freeipa-%{version}.tar.gz
Source1: https://releases.pagure.org/freeipa/freeipa-%{version}.tar.gz.asc
# Fix authselect command invocation (breaks with authselect 1.0.2)
# https://github.com/freeipa/freeipa/pull/2610
Patch0: 2610.patch
# For the timestamp trick in patch application
BuildRequires: diffstat
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -1733,6 +1736,9 @@ fi
%changelog
* Tue Nov 27 2018 Adam Williamson <awilliam@redhat.com> - 4.7.1-3
- Backport PR #2610 to fix for authselect 1.0.2+ (see #1645708)
* Sun Nov 11 2018 Alexander Bokovoy <abokovoy@redhat.com> - 4.7.1-2
- Rebuild for krb5-1.17 (#1648673)
- Bump required SSSD version to 2.0.0-4 to get back pysss.getgrouplist() API