After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 501389 - Manually connecting to a password protected DAAP share fails
Manually connecting to a password protected DAAP share fails
Status: RESOLVED FIXED
Product: libdmapsharing
Classification: Other
Component: DAAP Client
git master
Other All
: Normal normal
: ---
Assigned To: W. Michael Petullo
W. Michael Petullo
: 515999 635024 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-12-03 22:26 UTC by Peter Nelson
Modified: 2012-03-14 13:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix authentication in DAAP plugin (1.96 KB, patch)
2011-05-10 02:41 UTC, W. Michael Petullo
none Details | Review

Description Peter Nelson 2007-12-03 22:26:17 UTC
Please describe the problem:
When connecting to a manually connected DAAP share which requires a password, no prompt is provided. Running with "-D daap" indicates that the daap module knows it requires a password, but this is not acted upon.

Connecting to a password protected DAAP share advertised via avahi works as expected.

Steps to reproduce:
1. Manually add a password protected share.
2. Try to connect to the share.
3. ...

Actual results:


Expected results:


Does this happen every time?
Yes

Other information:
The following debug output is repeated several times a second:

(22:20:27) [0x80da028] [rb_daap_connection_do_something] rb-daap-connection.c:1475: Doing something for state: 1
(22:20:27) [0x80da028] [rb_daap_connection_do_something] rb-daap-connection.c:1516: Logging into DAAP server
(22:20:27) [0x80da028] [http_get] rb-daap-connection.c:663: Queued message for http://192.168.1.6:3689//login
(22:20:27) [0x80da028] [actual_http_response_handler] rb-daap-connection.c:444: Received response from http://192.168.1.6:3689/login: 401, Unauthorized

(22:20:27) [0x80da028] [actual_http_response_handler] rb-daap-connection.c:564: Error getting http://192.168.1.6:3689/login: 401, Unauthorized

(22:20:27) [0x80da028] [handle_login] rb-daap-connection.c:735: Incorrect password
Comment 1 Anton Lundin 2008-02-12 12:41:55 UTC
In plugins/daap/rb-daap-plugin.c , function new_daap_share_resolve_cb, it calls mdns_service_added with password_protected = FALSE.

Then down in rb_daap_connection_do_something it just get to priv->state = DAAP_LOGIN, and then you got the loop going.

//Anton
Comment 2 Sebastien Bacher 2008-05-17 08:59:01 UTC
there is a similar bug on https://bugs.launchpad.net/rhythmbox/+bug/230583
Comment 3 Moses Palmér 2008-05-23 21:23:24 UTC
I would like to confirm this bug. I am using Ubuntu Hardy Heron, and until I ran Rhythmbox from the terminal with debug messages turned on I thought this was an error with my router.

Until this is fixed, I will have to share my music without password protection to be able to access it from work; this, I assume, is a crime, since now anyone can listen to my music without having paid for it. Obviously, I deem this bug quite a serious one.
Comment 4 Guillaume Desmottes 2008-06-17 00:04:53 UTC
I can confirm this bug with rb 0.11.5
Comment 5 Guillaume Desmottes 2008-07-04 21:26:22 UTC
*** Bug 515999 has been marked as a duplicate of this bug. ***
Comment 6 Benedict Stein 2010-02-08 15:52:43 UTC
so. still having this bug - this worked for me in 0.12.6

In my opinion it's solved
Comment 7 Jonathan Matthew 2010-08-06 04:19:11 UTC
Moving this to libdmapsharing as that's where the code that handles this is now.

We probably just need to set priv->password_protected to TRUE in when we get a SOUP_STATUS_UNAUTHORIZED or FORBIDDEN in response to a login request.  I haven't tested this, though.
Comment 8 Jonathan Matthew 2010-11-16 22:40:53 UTC
*** Bug 635024 has been marked as a duplicate of this bug. ***
Comment 9 Bill Kvasnikoff 2010-12-23 00:27:02 UTC
At line 727 in rhythmbox-0.13.2/plugins/daap/rb-daap-plugin.c.

service.password_protected = FALSE;

The setting is just hard-coded to false.

At line 644 in rhythmbox-0.12.8/plugins/daap/rb-daap-plugin.c there is the same setting hard coded setting. I changed the setting to TRUE and compiled  getting a new libdaap.so and replace the one that I have in fedora 13 x86_64 and it now it prompts me for the password and works. 

mdns_service_added (NULL,
 g_strdup (location),
 g_strdup (location),
 g_strdup (host),
 port,
 TRUE,// FALSE,
 plugin);

So now it works with password protected daap, but not unprotected daap.

Anyway, I think that this confirms that service.possword_protected need to be set based on a response from the server rather than just hard-coded.
Comment 10 W. Michael Petullo 2011-05-10 02:41:39 UTC
Created attachment 187539 [details] [review]
Patch to fix authentication in DAAP plugin

I turns out that the authentication handling routines need some work. Please try the attached Rhythmbox patch along with libdmapsharing Git master (also in GNOME Git). This refactors the DAAP plugin's handling of authentication so that it is more inline with what libsoup expects.

I still have to do some clean up work, particularly figuring out how to nicely encapsulate "...soup_auth_authenticate (auth, username, password); soup_session_unpause_message (session, msg);..." in rb-daap-source.c.

The present solution will change the libdmapsharing ABI. I could avoid this, but the result would have some cruft, because the "get password" state in no longer applicable in the DMAPShare state machine.
Comment 11 W. Michael Petullo 2011-05-17 14:48:13 UTC
I committed the change mentioned above to Rhythmbox Git. Libdmapsharing 2.9.9+ is now required to build the DAAP plugin. It has been a while since there was any feedback for this bug. I will close it; please reopen with a clear comment if necessary.
Comment 12 Vadim Rutkovsky 2012-03-14 13:27:33 UTC
Reproduced on rhythmbox rhythmbox 2.95.5-0ubuntu1. See debug log at https://launchpadlibrarian.net/96652438/rhythmbox-debug.txt