Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
How exactly does passwords.xml work?
#1
I'd like to understand exactly how the substitutions in passwords.xml are applied, because I am moving my media library to a new server, and I can't figure out how my old/current one works at all Smile. Strangely, passwords.xml is hardly even mentioned in the wiki, and it's suspiciously absent from the userdata page.

Do the substitutions have to match exactly? Like a straight string replacement? Or is there some fuzzy/advanced logic? If multiple passwords.xml paths match, how does it choose which one to use?

The reason I'm confused is all my media has their paths set like "smb://ipaddr/path/to/media.mkv" in the db. I have a record in passwords.xml that prefix-matches it exactly, (<from>smb://ipaddr/path</from>) but the <to> value actually has an invalid path in it...so if it was using that one it wouldn't be able to find any of my media. There is another record in the form of <from>smb://hostname</from> (where hostname resolves to ipaddr) which has a valid <to> path, so I assume it must be using that record...but I don't know how it figured out to use that one instead. Anyone have any insights? Thanks!
Reply
#2
So...for anyone else who is curious, here is what I found out by looking at the source code:
  • To decide which record to use:
    1. first, it will try an exact match of protocol://host/first-directory-only in the <from> tag
    2. if no match is found, it will look for any record that starts with protocol://host in the <from> tag, and it will use the *last* one it finds (based on the order of the records in the file)
  • Once it finds the record to use, it only grabs the username and password from the <to> field - it doesn't care about the rest of the url at all, nothing else is substituted
Reply
#3
Thanks heaps for this, with the SMB changes in Matrix (Android) I wanted to use the passwords.xml file to start faking a password (so that I didn't have to update all of my network links). Searched everywhere to determine how it worked, this was perfect.
Reply

Logout Mark Read Team Forum Stats Members Help
How exactly does passwords.xml work?0