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

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