Update PR #2610 patch to tiran's modified version
This commit is contained in:
parent
38293c2b0c
commit
d489fe9ffe
51
2610.patch
51
2610.patch
@ -1,4 +1,4 @@
|
|||||||
From 349955624e55e5afe23776a2c4f269da80cf917f Mon Sep 17 00:00:00 2001
|
From 66c57e6d92a9c5ca7b36ff125375810401e64233 Mon Sep 17 00:00:00 2001
|
||||||
From: Adam Williamson <awilliam@redhat.com>
|
From: Adam Williamson <awilliam@redhat.com>
|
||||||
Date: Tue, 27 Nov 2018 16:21:06 -0800
|
Date: Tue, 27 Nov 2018 16:21:06 -0800
|
||||||
Subject: [PATCH] Fix authselect invocations to work with 1.0.2
|
Subject: [PATCH] Fix authselect invocations to work with 1.0.2
|
||||||
@ -14,41 +14,62 @@ some text to go in it.
|
|||||||
|
|
||||||
This broke uninstallation.
|
This broke uninstallation.
|
||||||
|
|
||||||
I don't know for sure whether the fix in `restore` is needed -
|
In all cases, features are now passed as separate arguments instead of one
|
||||||
it may be that `cfg[1]` is never an empty sequence - but it
|
argument separated by space.
|
||||||
seems sensible to do it just in case.
|
|
||||||
|
|
||||||
|
Fixes: https://pagure.io/freeipa/issue/7776
|
||||||
Signed-off-by: Adam Williamson <awilliam@redhat.com>
|
Signed-off-by: Adam Williamson <awilliam@redhat.com>
|
||||||
---
|
---
|
||||||
ipaplatform/redhat/authconfig.py | 12 ++++++++----
|
ipaplatform/redhat/authconfig.py | 30 ++++++++++++++++++++----------
|
||||||
1 file changed, 8 insertions(+), 4 deletions(-)
|
1 file changed, 20 insertions(+), 10 deletions(-)
|
||||||
|
|
||||||
diff --git a/ipaplatform/redhat/authconfig.py b/ipaplatform/redhat/authconfig.py
|
diff --git a/ipaplatform/redhat/authconfig.py b/ipaplatform/redhat/authconfig.py
|
||||||
index a512345202..3de42cc365 100644
|
index a512345202..9d98b5b644 100644
|
||||||
--- a/ipaplatform/redhat/authconfig.py
|
--- a/ipaplatform/redhat/authconfig.py
|
||||||
+++ b/ipaplatform/redhat/authconfig.py
|
+++ b/ipaplatform/redhat/authconfig.py
|
||||||
@@ -166,7 +166,10 @@ def unconfigure(
|
@@ -158,15 +158,26 @@ def unconfigure(
|
||||||
statestore.restore_state('authselect', 'features_list') or ''
|
" ".join(args))
|
||||||
|
|
||||||
|
profile = 'sssd'
|
||||||
|
- features = ''
|
||||||
|
+ features = []
|
||||||
|
else:
|
||||||
|
- profile = \
|
||||||
|
- statestore.restore_state('authselect', 'profile') or 'sssd'
|
||||||
|
- features = \
|
||||||
|
- statestore.restore_state('authselect', 'features_list') or ''
|
||||||
|
+ profile = statestore.restore_state('authselect', 'profile')
|
||||||
|
+ if not profile:
|
||||||
|
+ profile = 'sssd'
|
||||||
|
+ features_state = statestore.restore_state(
|
||||||
|
+ 'authselect', 'features_list'
|
||||||
|
+ )
|
||||||
statestore.delete_state('authselect', 'mkhomedir')
|
statestore.delete_state('authselect', 'mkhomedir')
|
||||||
|
+ # only non-empty features, https://pagure.io/freeipa/issue/7776
|
||||||
|
+ if features_state is not None:
|
||||||
|
+ features = [
|
||||||
|
+ f.strip() for f in features_state.split(' ') if f.strip()
|
||||||
|
+ ]
|
||||||
|
+ else:
|
||||||
|
+ features = []
|
||||||
|
|
||||||
- cmd = [paths.AUTHSELECT, "select", profile, features, "--force"]
|
- cmd = [paths.AUTHSELECT, "select", profile, features, "--force"]
|
||||||
+ cmd = [paths.AUTHSELECT, "select", profile]
|
+ cmd = [paths.AUTHSELECT, "select", profile]
|
||||||
+ if features:
|
+ cmd.extend(features)
|
||||||
+ cmd.append(features)
|
|
||||||
+ cmd.append("--force")
|
+ cmd.append("--force")
|
||||||
ipautil.run(cmd)
|
ipautil.run(cmd)
|
||||||
|
|
||||||
def backup(self, path):
|
def backup(self, path):
|
||||||
@@ -187,9 +190,10 @@ def restore(self, path):
|
@@ -186,10 +197,9 @@ def restore(self, path):
|
||||||
|
|
||||||
if cfg:
|
if cfg:
|
||||||
profile = cfg[0]
|
profile = cfg[0]
|
||||||
|
-
|
||||||
- cmd = [
|
- cmd = [
|
||||||
- paths.AUTHSELECT, "select", profile,
|
- paths.AUTHSELECT, "select", profile,
|
||||||
- " ".join(cfg[1]), "--force"]
|
- " ".join(cfg[1]), "--force"]
|
||||||
+ cmd = [paths.AUTHSELECT, "select", profile]
|
+ cmd = [paths.AUTHSELECT, "select", profile]
|
||||||
+ if cfg[1]:
|
+ cmd.extend(cfg[1])
|
||||||
+ cmd.append(" ".join(cfg[1]))
|
|
||||||
+ cmd.append("--force")
|
+ cmd.append("--force")
|
||||||
ipautil.run(cmd)
|
ipautil.run(cmd)
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@
|
|||||||
|
|
||||||
Name: %{package_name}
|
Name: %{package_name}
|
||||||
Version: %{IPA_VERSION}
|
Version: %{IPA_VERSION}
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
Summary: The Identity, Policy and Audit system
|
Summary: The Identity, Policy and Audit system
|
||||||
|
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
@ -1736,6 +1736,9 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Nov 28 2018 Adam Williamson <awilliam@redhat.com> - 4.7.1-4
|
||||||
|
- Update PR #2610 patch to tiran's modified version
|
||||||
|
|
||||||
* Tue Nov 27 2018 Adam Williamson <awilliam@redhat.com> - 4.7.1-3
|
* 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)
|
- Backport PR #2610 to fix for authselect 1.0.2+ (see #1645708)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user