From 299a0bd8f91a8be571a4d9bcdaf12d2404c0dd7e Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Thu, 27 Jul 2017 18:07:00 -0500 Subject: [PATCH] Fix network creds Convert backslash to ; for domain\username --- resources/lib/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/resources/lib/utils.py b/resources/lib/utils.py index 33b7450f..c7601e98 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -320,19 +320,20 @@ def passwordsXML(): for path in root.findall('.//path'): if path.find('.//from').text.lower() == "smb://%s/" % server.lower(): # Found the server, rewrite credentials - path.find('.//to').text = "smb://%s:%s@%s/" % (user, password, server) + topath = "smb://%s:%s@%s/" % (user, password, server) + path.find('.//to').text = topath.replace("\\", ";") break else: # Server not found, add it. path = etree.SubElement(root, 'path') etree.SubElement(path, 'from', attrib={'pathversion': "1"}).text = "smb://%s/" % server topath = "smb://%s:%s@%s/" % (user, password, server) - etree.SubElement(path, 'to', attrib={'pathversion': "1"}).text = topath + etree.SubElement(path, 'to', attrib={'pathversion': "1"}).text = topath.replace("\\", ";") # Force Kodi to see the credentials without restarting xbmcvfs.exists(topath) # Add credentials - settings('networkCreds', value="%s" % server) + settings('networkCreds', value=server) log.info("Added server: %s to passwords.xml" % server) # Prettify and write to file try: