Blame SOURCES/authconfig-6.2.8-handle-no-realm.patch

977b74
diff -up authconfig-6.2.8/authinfo.py.no-realm authconfig-6.2.8/authinfo.py
977b74
--- authconfig-6.2.8/authinfo.py.no-realm	2016-06-16 14:25:21.354653226 +0200
977b74
+++ authconfig-6.2.8/authinfo.py	2016-06-16 14:27:56.335158214 +0200
977b74
@@ -1285,7 +1285,7 @@ class AuthInfo:
977b74
 		self.ldapServer = ""
977b74
 		self.ldapBaseDN = ""
977b74
 
977b74
-		self.kerberosRealm = ""
977b74
+		self.kerberosRealm = None
977b74
 		self.kerberosRealmviaDNS = None
977b74
 		self.kerberosKDC = ""
977b74
 		self.kerberosKDCviaDNS = None
977b74
@@ -1698,6 +1698,7 @@ class AuthInfo:
977b74
 		section = ""
977b74
 		self.allKerberosKDCs = {}
977b74
 		self.allKerberosAdminServers = {}
977b74
+		realm_found = False
977b74
 		# Open the file.  Bail if it's not there or there's some problem
977b74
 		# reading it.
977b74
 		try:
977b74
@@ -1720,6 +1721,7 @@ class AuthInfo:
977b74
 				value = matchKeyEquals(line, "default_realm")
977b74
 				if value:
977b74
 					self.setParam("kerberosRealm", value, ref)
977b74
+					realm_found = True;
977b74
 					continue;
977b74
 				# Check for the DNS settings.
977b74
 				value = matchKeyEquals(line, "dns_lookup_kdc")
977b74
@@ -1746,6 +1748,7 @@ class AuthInfo:
977b74
 					if not self.kerberosRealm:
977b74
 						# No reason to use setParam here
977b74
 						self.kerberosRealm = subsection
977b74
+						realm_found = True;
977b74
 					# See if this is a key we care about.
977b74
 					value = matchKeyEquals(line, "kdc")
977b74
 					if value:
977b74
@@ -1754,10 +1757,16 @@ class AuthInfo:
977b74
 					value = matchKeyEquals(line, "admin_server")
977b74
 					if value:
977b74
 						self.allKerberosAdminServers[subsection] = commaAppend(self.getKerberosAdminServer(subsection), value)
977b74
-		if self.kerberosRealm:
977b74
-			self.setParam("kerberosKDC", self.getKerberosKDC(self.kerberosRealm), ref)
977b74
-			self.setParam("kerberosAdminServer", self.getKerberosAdminServer(self.kerberosRealm), ref)
977b74
 		f.close()
977b74
+		if realm_found:
977b74
+			if self.kerberosRealm:
977b74
+				self.setParam("kerberosKDC", self.getKerberosKDC(self.kerberosRealm), ref)
977b74
+				self.setParam("kerberosAdminServer", self.getKerberosAdminServer(self.kerberosRealm), ref)
977b74
+		else:
977b74
+			if self.kerberosRealm:
977b74
+				self.inconsistentAttrs.append("kerberosRealm")
977b74
+			else:
977b74
+				self.setParam("kerberosRealm", "", ref)
977b74
 		return True
977b74
 
977b74
 	def readLibuser(self, ref):
977b74
@@ -2477,6 +2486,8 @@ class AuthInfo:
977b74
 		self.passwordAlgorithm = self.passwordAlgorithm.lower()
977b74
 		if self.enableCacheCreds == None:
977b74
 			self.enableCacheCreds = True # enabled by default
977b74
+		if self.kerberosRealm == None:
977b74
+			self.kerberosRealm = ""
977b74
 
977b74
 	def read(self):
977b74
 		ref = self.copy()