Kodi Community Forum

Full Version: Samba password is not persistent
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,
I had to change the Samba password on my server.
Now XBMC asks for the password (after every single reboot) when I access the NAS the first time.
The "remember for this path" toggle does have some effect: if I don't enable it, XBMC asks for the password every time I access the NAS (not only once after reboot).

I came to think that either:
- there is something preventing the password from being saved persistently.
- there is a bug where saving is not even attempted.

I did a few searches and as a result, I tried editing sources.xml as described here. Unfortunately, the result is exactly the same.

I am using the latest wsnipex PPA.

Which logs should I be looking at (posting) to track this problem down?
Thank you!
What version?

Assuming a Frodo alpha, check what is in passwords.xml. Your sources.xml file should contain no usernames or passwords.
Quote:Linux CSIMBIXBMC 3.2.0-32-generic-pae #51-Ubuntu SMP Wed Sep 26 21:54:23 UTC 2012 i686 i686 i386 GNU/Linux
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.1 LTS"

Quote:XBMC 12.0-ALPHA7 Git:Unknown (Compiled: Pct 6 2012)
Using the wsnipex PPA.

This was in passwords.xml:
Code:
<passwords>
    <path>
        <from pathversion="1">smb://csimbinas/</from>
        <to pathversion="1">smb://nas:correctpass@mynas//backups/Movies/</to>
    </path>
    <path>
        <from pathversion="1">smb://csimbinas/backupsa</from>
        <to pathversion="1">smb://nas:oldpass@mynas/backupsa</to>
    </path>
</passwords>

Corrected manually. so now this is in passwords.xml:
Code:
<passwords>
    <path>
        <from pathversion="1">smb://csimbinas/</from>
        <to pathversion="1">smb://nas:correctpass@mynas//backups/Movies/</to>
    </path>
    <path>
        <from pathversion="1">smb://csimbinas/backupsa</from>
        <to pathversion="1">smb://nas:correctpass@mynas/backupsa</to>
    </path>
</passwords>
Works now.

So, the questions I have now are:
- Why would the first path include two slashes after the host name? (Is it ok to remove it manually?)
- I understand that the two passwords were different (before I changed them), but why would not XBMC use the password corresponding to the right share?
Thank you!
The entry format isn't too much of an issue - we use only the username + password from the <to> fields.

What's going on is xbmc keeps 2 caches: The permanent cache, which you see in passwords.xml, and an additional temporary cache which is the same, with the addition that we save the path for the server in addition to just the specific share.

I can't see how the code can screw up here though, as AuthenticateURL() should receive the same URL (save username/pass) as PromptForAuthenticatedURL() does (which then saves the URL).

If you happen to have time and inclination to debug things, you need to checkout xbmc/PasswordManager.cpp. I suspect just logging which URLs are being requested to each function and the returned URLs would give you a good idea as to what is going on.

Cheers,
Jonathan
Well if you use only the username and password, probably you use the hostname, too (or else, how would you know which share it is).
When doing a hostname match, probably both results are picked up, but the one picked up the second time prevails because the path portion is ignored.
I have a birthday party coming up this weekend, so I will check PasswordManager.cpp later.
Thanks for the fix and the pointer.