Blame SOURCES/authconfig-6.2.8-krb5-include.patch

977b74
diff -up authconfig-6.2.8/authinfo.py.krb5-include authconfig-6.2.8/authinfo.py
977b74
--- authconfig-6.2.8/authinfo.py.krb5-include	2015-07-03 11:52:58.000000000 +0200
977b74
+++ authconfig-6.2.8/authinfo.py	2015-07-03 12:47:44.993864700 +0200
977b74
@@ -109,6 +109,8 @@ PATH_PAM_SSS = AUTH_MODULE_DIR + "/pam_s
977b74
 
977b74
 PATH_LIBSSS_AUTOFS = "/usr" + LIBDIR + "/sssd/modules/libsss_autofs.so"
977b74
 
977b74
+PATH_KRB5_INCLUDEDIR = "/var/lib/sss/pubconf/krb5.include.d/"
977b74
+
977b74
 PATH_WINBIND_NET = "/usr/bin/net"
977b74
 PATH_IPA_CLIENT_INSTALL = "/usr/sbin/ipa-client-install"
977b74
 
977b74
@@ -3022,6 +3024,8 @@ class AuthInfo:
977b74
 		wroteourdomrealm = False
977b74
 		wrotedomrealm = False
977b74
 		wrotedomrealm2 = False
977b74
+		# No dir -> no incdir line, set as if already written
977b74
+		wroteincdir = not os.access(PATH_KRB5_INCLUDEDIR, os.R_OK)		
977b74
 		section = ""
977b74
 		subsection = ""
977b74
 		f = None
977b74
@@ -3043,6 +3047,12 @@ class AuthInfo:
977b74
 			for line in f.file:
977b74
 				ls = line.strip()
977b74
 
977b74
+				if matchLine(ls, "includedir " + PATH_KRB5_INCLUDEDIR):
977b74
+					if not wroteincdir:
977b74
+						wroteincdir = True
977b74
+					else:
977b74
+						# already written or should be removed
977b74
+						continue
977b74
 				# If this is the "kdc" in our realm, replace it with
977b74
 				# the values we now have.
977b74
 				if (section == "realms" and subsection and subsection == self.kerberosRealm
977b74
@@ -3132,6 +3142,9 @@ class AuthInfo:
977b74
 					continue
977b74
 				# If it's the beginning of a section, record its name.
977b74
 				if matchLine(ls, "["):
977b74
+					if not wroteincdir:
977b74
+						output += "includedir " + PATH_KRB5_INCLUDEDIR + "\n"
977b74
+						wroteincdir = True
977b74
 					# If the previous section was "realms", and we didn't
977b74
 					# see ours, write our realm out.
977b74
 					if (section == "realms" and self.kerberosRealm