Blame SOURCES/authconfig-6.2.8-sssd-prompting.patch

921b1a
diff -up authconfig-6.2.8/authinfo.py.sssd-prompting authconfig-6.2.8/authinfo.py
921b1a
--- authconfig-6.2.8/authinfo.py.sssd-prompting	2015-07-03 11:09:29.329857063 +0200
921b1a
+++ authconfig-6.2.8/authinfo.py	2015-07-03 11:52:58.462677742 +0200
921b1a
@@ -132,6 +132,7 @@ LOGIC_FORCE_PKCS11_KRB5 = "[success=ok i
921b1a
 LOGIC_SKIPNEXT = "[success=1 default=ignore]"
921b1a
 LOGIC_SKIPNEXT3 = "[success=3 default=ignore]"
921b1a
 LOGIC_ALWAYS_SKIP = "[default=1]"
921b1a
+LOGIC_SKIPNEXT_ON_FAILURE = "[default=1 success=ok]"
921b1a
 
921b1a
 # Snip off line terminators and final whitespace from a passed-in string.
921b1a
 def snipString(s):
921b1a
@@ -460,6 +461,8 @@ pam_modules[STANDARD] = [
921b1a
 	 "permit",		[]],
921b1a
 	[False,  AUTH,          LOGIC_SUFFICIENT,
921b1a
 	 "fprintd",		[]],
921b1a
+	[False, AUTH,		LOGIC_SKIPNEXT_ON_FAILURE,
921b1a
+	 "localuser",		[]],
921b1a
 	[True,  AUTH,		LOGIC_SUFFICIENT,
921b1a
 	 "unix",		argv_unix_auth],
921b1a
 	[False, AUTH,		LOGIC_REQUISITE,
921b1a
@@ -583,6 +586,8 @@ pam_modules[PASSWORD_ONLY] = [
921b1a
 	 "env",			[]],
921b1a
 	[False, AUTH,		LOGIC_REQUIRED,
921b1a
 	 "deny",		[]],
921b1a
+	[False, AUTH,		LOGIC_SKIPNEXT_ON_FAILURE,
921b1a
+	 "localuser",		[]],
921b1a
 	[True,  AUTH,		LOGIC_SUFFICIENT,
921b1a
 	 "unix",		argv_unix_auth],
921b1a
 	[False, AUTH,		LOGIC_REQUISITE,
921b1a
@@ -3791,6 +3796,10 @@ class AuthInfo:
921b1a
 						argv = module[ARGV][0:] # shallow copy
921b1a
 						argv[1] = self.uidMin
921b1a
 						args = " ".join(argv)
921b1a
+			# do not continue to following modules if authentication fails
921b1a
+			if name == "unix" and stack == "auth" and (self.enableSSSDAuth or
921b1a
+				self.implicitSSSDAuth or self.enableIPAv2) and (not self.enableNIS):
921b1a
+				logic = LOGIC_FORCE_PKCS11 # make it or break it logic
921b1a
 			# use oddjob_mkhomedir if available
921b1a
 			if name == "mkhomedir" and os.access("%s/pam_%s.so"
921b1a
 				% (AUTH_MODULE_DIR, "oddjob_mkhomedir"), os.X_OK):
921b1a
@@ -3818,6 +3827,8 @@ class AuthInfo:
921b1a
 				args = self.mkhomedirArgs
921b1a
 			if name == "systemd":
921b1a
 				args = self.systemdArgs
921b1a
+			if name == "sss" and stack == "auth" and not self.enableNIS:
921b1a
+				args = "forward_pass"
921b1a
 			if not args and module[ARGV]:
921b1a
 				args = " ".join(module[ARGV])
921b1a
 			if name == "winbind" and self.winbindOffline and stack != "password":
921b1a
@@ -3922,7 +3933,9 @@ class AuthInfo:
921b1a
 					(self.enablePasswdQC and module[NAME] == "passwdqc") or
921b1a
 					(self.enableWinbindAuth and module[NAME] == "winbind") or
921b1a
 					((self.enableSSSDAuth or self.implicitSSSDAuth or self.enableIPAv2) and module[NAME] == "sss") or
921b1a
-					(self.enableLocAuthorize and module[NAME] == "localuser") or
921b1a
+					((self.enableSSSDAuth or self.implicitSSSDAuth or self.enableIPAv2) and
921b1a
+						(not self.enableNIS) and module[NAME] == "localuser" and module[STACK] == AUTH) or
921b1a
+					(self.enableLocAuthorize and module[NAME] == "localuser" and module[STACK] == ACCOUNT) or
921b1a
 					(self.enablePAMAccess and module[NAME] == "access") or
921b1a
 					(self.enableMkHomeDir and module[NAME] == "mkhomedir") or
921b1a
 					(not self.enableSysNetAuth and module[STACK] == AUTH and