Blame SOURCES/authconfig-6.2.8-sssd-catch-NoServiceError-exception.patch

ee2f06
From 6cb26b2d4ea21bc9f44f8448e2749b4624ff0581 Mon Sep 17 00:00:00 2001
ee2f06
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
ee2f06
Date: Thu, 20 Apr 2017 12:04:15 +0200
ee2f06
Subject: [PATCH] sssd: catch NoServiceError exception
ee2f06
ee2f06
SSSDConfig throws an NoServiceError exception if the service is not
ee2f06
yet present in the configuration file. We need to catch it and
ee2f06
create the service manually in such situation.
ee2f06
---
ee2f06
 authinfo.py | 5 ++++-
ee2f06
 1 file changed, 4 insertions(+), 1 deletion(-)
ee2f06
ee2f06
diff --git a/authinfo.py b/authinfo.py
ee2f06
index 7ef7453f6dea5e363a17efe199338a0646c20a51..510e6d5f140fd61322286c8eb630e88efeb5db11 100644
ee2f06
--- a/authinfo.py
ee2f06
+++ b/authinfo.py
ee2f06
@@ -3113,7 +3113,10 @@ class AuthInfo:
ee2f06
 		if not self.sssdConfig:
ee2f06
 			return True
ee2f06
 
ee2f06
-		pam = self.sssdConfig.get_service('pam')
ee2f06
+		try:
ee2f06
+			pam = self.sssdConfig.get_service('pam')
ee2f06
+		except SSSDConfig.NoServiceError:
ee2f06
+			pam = self.sssdConfig.new_service('pam')
ee2f06
 
ee2f06
 		if self.enableSmartcard and self.enableSSSDAuth and self.smartcardModule == "sssd" :
ee2f06
 			pam.set_option('pam_cert_auth', 'True')
ee2f06
-- 
ee2f06
2.9.3
ee2f06