Bug 12614 - libsmbclient ignores username part after @
libsmbclient ignores username part after @
Status: NEW
Product: Samba 4.1 and newer
Classification: Unclassified
Component: libsmbclient
4.5.4
x64 Linux
: P5 minor
: ---
Assigned To: Samba QA Contact
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-03-06 11:49 UTC by Willem Mulder
Modified: 2017-08-01 13:32 UTC (History)
1 user (show)

See Also:


Attachments
Screenshot of Wireshark dump of gvfsd-smb login sequence (5.87 KB, image/png)
2017-03-06 11:49 UTC, Willem Mulder
no flags Details
Screenshot of Wireshark dump of mount.cifs login sequence (5.55 KB, image/png)
2017-03-06 11:50 UTC, Willem Mulder
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Willem Mulder 2017-03-06 11:49:20 UTC
Created attachment 13021 [details]
Screenshot of Wireshark dump of gvfsd-smb login sequence

When trying to connect to an smb share, libsmbclient ignores the part after an @ in the username. This causes login to fail when an @-part is required.

I discovered this bug through GNOME (original bug report at https://bugzilla.gnome.org/show_bug.cgi?id=775477), but it turns out the bug is in libsmbclient.

I've attached a screenshot of a Wireshark dump of a login attempt with gvfsd-smb.
Comment 1 Willem Mulder 2017-03-06 11:50:48 UTC
Created attachment 13022 [details]
Screenshot of Wireshark dump of mount.cifs login sequence

This is a screenshot of a wireshark dump of a login attempt to the same host using mount.cifs
Comment 2 Stefan Metzmacher 2017-03-06 15:02:23 UTC
This will be mostly fixed in 4.6 (at least for the 'smbclient' command line tool).

I'm not sure if libsmbclient is fixed yet.
Comment 3 Willem Mulder 2017-08-01 13:32:38 UTC
I just checked whether it was fixed (using 4.6.5). I can indeed connect using smbclient, but gvfsd-smb still fails.

Looking through the code, it seems `cli_session_creds_init` mistakenly thinks it's a principal, and proceeds to strip the part after the @ from the username (source3/libsmb/cliconnect.c, lines 111-122). I'm not too sure what the best option would be here, so I'll leave that to the Samba team.