Blame SOURCES/authconfig-6.2.8-krb5comment.patch

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