Blame SOURCES/authconfig-6.2.8-krb5comment.patch

921b1a
diff -up authconfig-6.2.8/authinfo.py.krb5comment authconfig-6.2.8/authinfo.py
921b1a
--- authconfig-6.2.8/authinfo.py.krb5comment	2015-07-03 11:04:01.174220956 +0200
921b1a
+++ authconfig-6.2.8/authinfo.py	2015-07-03 11:09:29.329857063 +0200
921b1a
@@ -1701,6 +1701,7 @@ class AuthInfo:
921b1a
 			return False
921b1a
 	
921b1a
 		for line in f:
921b1a
+			line = line.split('#')[0]
921b1a
 			line = line.strip()
921b1a
 
921b1a
 			# If it's a new section, note which one we're "in".
921b1a
@@ -3203,7 +3204,7 @@ class AuthInfo:
921b1a
 					output += str(bool(self.kerberosKDCviaDNS)).lower()
921b1a
 					output += "\n"
921b1a
 			# If we haven't encountered a realms section yet...
921b1a
-			if not wroterealms2:
921b1a
+			if not wroterealms2 and (self.kerberosRealm or self.smbRealm):
921b1a
 				if not wroterealms:
921b1a
 					output += "[realms]\n"
921b1a
 				if not wroterealm:
921b1a
@@ -3211,7 +3212,7 @@ class AuthInfo:
921b1a
 						self.kerberosAdminServer)
921b1a
 				if not wrotesmbrealm:
921b1a
 					output += krbRealm(self.smbRealm, self.smbServers, "")
921b1a
-			if not wrotedomrealm2:
921b1a
+			if not wrotedomrealm2 and self.kerberosRealm:
921b1a
 				if not wrotedomrealm:
921b1a
 					output += "[domain_realm]\n"
921b1a
 				if self.kerberosRealm and not wroteourdomrealm: