Jump to content

[BUG] backslash network credentials.


FingerlessGlovs

Recommended Posts

FingerlessGlovs

Hi,

 

I've found a bug in the network credentials add wizard. If the username contains a \ because its authenticating against a domain. It doesn't work, I believe it's doing something with the \

I tried, good number of times reentering it.

Reopened Kodi, still no luck.

 

I fixed it but going in to the file manager. Adding a new Source, then when it asked for my SMB credentials I said to remember these credentials for this path. Used my domain\user and then I was able to use Kodi.

 

I hope this can be fixed as I took a while for me to think of another way for Kodi to remember my credentials.

 

Jonny

 

 

Using Kodi 17.2

I would upload logs but using an Android TV box(Nvidea Shield), so not so easy to grab the logs off it. I'm guessing its converting the character to something else

Edited by MrJonny
Link to comment
Share on other sites

FingerlessGlovs

Little update,

 

After some looking in to the problem. I believe you have to store the \ as a ;

 

 

In the python of the plugin it just adds exactly what you type in.

https://github.com/MediaBrowser/plugin.video.emby/blob/5b6a53f58bbb12efab5abae31eb0195dacacbda2/resources/lib/utils.py

 

In the sources.xml wiki page, they say to use a ; for the domain part of the username.

http://kodi.wiki/view/Sources.xml/Types

 

I shall have to try and retrieve my sources.xml see how it gets stored. Doing it kodi file browser and how Emby Plugin adds it.

 

Might be just a case of putting a find and replace on the username string to replace \ with ;

  • Like 1
Link to comment
Share on other sites

Angelblue05

Thanks for reporting. A fix will be put in place.

Edit: The fix is on github and will be in the next beta version of the add-on.

Edited by Angelblue05
Link to comment
Share on other sites

FingerlessGlovs

Thanks for reporting. A fix will be put in place.

Edit: The fix is on github and will be in the next beta version of the add-on.

 

Hi Angelblue05,

 

I've looked in to this some more. Ideally passwords for SMB should be stored in passwords.xml, it also stores the special characters encoded like \ becomes %5c and a @ becomes %40.

I think the passwords should be stored in passwords.xml instead of adding it to the sources. Its also more secure according to the Kodi Forums.

There's no need to add a source, just add the credentials to passwords.xml, an example below. I'm guessing there are others it encodes too.

<passwords>
    <path>
        <from pathversion="1">smb://192.168.2.10/</from>
        <to pathversion="1">smb://DOMAIN%5cUSER:PASSWORD%40@192.168.2.10/</to>
    </path>
</passwords>

What do you think Angelblue05?

 

Edited by MrJonny
Link to comment
Share on other sites

Angelblue05

It is already writing to passwords.xml. Not to sources.

 

Ok, I'll substitute the characters then. Thanks. I thought you said backlash ended up a semi-colon.

 

 

Sent from my iPhone using Tapatalk

Link to comment
Share on other sites

FingerlessGlovs

It is already writing to passwords.xml. Not to sources.

 

Ok, I'll substitute the characters then. Thanks. I thought you said backlash ended up a semi-colon.

 

 

Sent from my iPhone using Tapatalk

 

Yeah sorry about that, I miss read the code, it indeed says passwords.xml on line 248.

 

The ; is used if you want to specify the username/password on the sources.xml. You can still do it that way for legacy support. passwords.xml is now used for holding username/password. Yeah I think escaping the special characters  will do the trick. 

 

I think you need to escape them with "urllib.quote" function, which you may need to import.

Edited by MrJonny
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...