Tomas Mraz 75b62b
diff -up authconfig-6.2.10/authinfo.py.byteconv authconfig-6.2.10/authinfo.py
Tomas Mraz 75b62b
--- authconfig-6.2.10/authinfo.py.byteconv	2015-05-11 16:50:15.608497236 +0200
Tomas Mraz 75b62b
+++ authconfig-6.2.10/authinfo.py	2015-05-11 16:51:56.303867029 +0200
Tomas Mraz 75b62b
@@ -904,9 +904,9 @@ def feedFork(command, echo, query, respo
Tomas Mraz 076370
 	if not pid:
Tomas Mraz 076370
 		# child
Tomas Mraz 076370
 		if query:
Tomas Mraz 076370
-			child = Popen([command], shell=True)
Tomas Mraz 076370
+			child = Popen([command], shell=True, universal_newlines=True)
Tomas Mraz 076370
 		else:
Tomas Mraz 076370
-			child = Popen([command], stdin=PIPE, shell=True)
Tomas Mraz 076370
+			child = Popen([command], stdin=PIPE, shell=True, universal_newlines=True)
Tomas Mraz 076370
 			child.communicate(input=(response or '')+'\n')
Tomas Mraz 076370
 
Tomas Mraz 076370
 		# wait for the child to terminate & set the returncode
Tomas Mraz 75b62b
@@ -1005,8 +1005,8 @@ def isEmptyDir(path):
Tomas Mraz 076370
 
Tomas Mraz 076370
 def callPKCS11Setup(options):
Tomas Mraz 076370
 	try:
Tomas Mraz 076370
-		child = Popen([PATH_SCSETUP] + options, stdout=PIPE)
Tomas Mraz 076370
-		lst = child.communicate()[0].split(b"\n")
Tomas Mraz 076370
+		child = Popen([PATH_SCSETUP] + options, stdout=PIPE, universal_newlines=True)
Tomas Mraz 076370
+		lst = child.communicate()[0].split("\n")
Tomas Mraz 076370
 		if child.returncode != 0:
Tomas Mraz 076370
 			return None
Tomas Mraz 076370
 		if lst[-1] == '':
Tomas Mraz 718c2f
@@ -1940,7 +1940,7 @@ class AuthInfo:
Tomas Mraz 718c2f
 		if rmactions == None:
Tomas Mraz 718c2f
 			return False
Tomas Mraz 718c2f
 		for action in rmactions:
Tomas Mraz 718c2f
-			if b"lockhelper.sh" in action:
Tomas Mraz 718c2f
+			if "lockhelper.sh" in action:
Tomas Mraz 718c2f
 				lock = True
Tomas Mraz 718c2f
 		if lock:
Tomas Mraz 718c2f
 			self.setParam("smartcardAction", _("Lock"), ref)
Tomas Mraz 75b62b
@@ -4310,11 +4310,12 @@ class AuthInfo:
Tomas Mraz 75b62b
 			
Tomas Mraz 75b62b
 			if echo:
Tomas Mraz 75b62b
 				sys.stderr.write("[%s]\n" % cmd)
Tomas Mraz 076370
-				child = Popen([cmd], shell=True)
Tomas Mraz 75b62b
+			if self.joinPassword or not echo:
Tomas Mraz 75b62b
+				status, error = feedFork(cmd, echo, "sword:", self.joinPassword)
Tomas Mraz 75b62b
+			else:
Tomas Mraz 076370
+				child = Popen([cmd], shell=True, universal_newlines=True)
Tomas Mraz 076370
 				child.communicate()
Tomas Mraz 076370
 				status = child.returncode
Tomas Mraz 75b62b
-			else:
Tomas Mraz 75b62b
-				status, error = feedFork(cmd, echo, "sword:", self.joinPassword)
Tomas Mraz 076370
 			if echo:
Tomas Mraz 75b62b
 				if status != 0:
Tomas Mraz 75b62b
 					self.messageCB(_("Winbind domain join was not successful."))
Tomas Mraz 75b62b
@@ -4347,7 +4348,7 @@ class AuthInfo:
Tomas Mraz 076370
 
Tomas Mraz 076370
 			if echo:
Tomas Mraz 076370
 				sys.stderr.write("[%s]\n" % cmd)
Tomas Mraz 076370
-				child = Popen([cmd], shell=True)
Tomas Mraz 076370
+				child = Popen([cmd], shell=True, universal_newlines=True)
Tomas Mraz 076370
 				child.communicate()
Tomas Mraz 076370
 				status = child.returncode
Tomas Mraz 076370
 			else:
Tomas Mraz 75b62b
@@ -4366,7 +4367,7 @@ class AuthInfo:
Tomas Mraz 75b62b
 		return status == 0
Tomas Mraz 75b62b
 
Tomas Mraz 75b62b
 	def uninstallIPA(self):
Tomas Mraz 75b62b
-		cmd = PATH_IPA_CLIENT_INSTALL + " --uninstall --noac"
Tomas Mraz 75b62b
+		cmd = PATH_IPA_CLIENT_INSTALL + " --uninstall --noac --unattended"
Tomas Mraz 75b62b
 		os.system(cmd)
Tomas Mraz 75b62b
 
Tomas Mraz 75b62b
 	def toggleCachingService(self, nostart):
Tomas Mraz 75b62b
@@ -4486,7 +4487,7 @@ class AuthInfo:
Tomas Mraz 076370
 		try:
Tomas Mraz 076370
 			readf = request.urlopen(self.ldapCacertURL)
Tomas Mraz 076370
 			writef = openLocked(self.ldapCacertDir + "/" + LDAP_CACERT_DOWNLOADED, 0o644)
Tomas Mraz 076370
-			writef.write(readf.read())
Tomas Mraz 076370
+			writef.write(readf.read().decode())
Tomas Mraz 076370
 			readf.close()
Tomas Mraz 076370
 			writef.close()
Tomas Mraz 076370
 		except (IOError, OSError, ValueError):