Public bug reported:

Binary package hint: gvfs

This may be the root cause for 206439 and/or 209520.

Repro steps:
1) apt-get install samba gvfs-bin
2) Set a samba password for yourself: sudo smbpasswd <your username>
3) Add a share to your smb.conf like so:
[foo]
    path = /tmp/foo
    guest ok = yes

4) mkdir /tmp/foo
5) chmod 700 /tmp/foo   (so the guest account doesn't have permission to access 
the share)
6) gvfs-mount smb://<server name>/foo
    Enter your username and password when prompted.

Expected behavior: for the share to be mounted successfully using the 
credentials you specified.
Actual behavior: You get "Error mounting location: Failed to mount Windows 
share"

Note: If you set "guest ok = no" for the share, then it mounts successfully.
Also: Using smbclient works fine, as does accessing the share from a Windows 
machine.

I'm no SMB expert, but I took a quick packet trace.  With "guest ok =
no" (the working case), I see the following exchange ("AARDVARK" is my
server name, "youngoat" is my username):

 --> Session Setup AndX Request, User: anonymous
 <-- Session Setup AndX Response (STATUS_SUCCESS)
 --> Tree Connect AndX Request, Path: \\AARDVARK\FOO
 <-- Tree Connect AndX Response, Error: STATUS_ACCESS_DENIED
 [I get prompted for username / password]
 --> Session Startup AndX Request, NTLMSSP_NEGOTIATE
 <-- Session Startup AndX Response, NTLMSSP_CHALLENGE, Error: 
STATUS_MORE_PROCESSING_REQUIRED
 --> Session Startup AndX Request, NTLMSSP_AUTH, User: WORKGROUP\youngoat
 <-- Session Startup AndX Response (STATUS_SUCCESS)
 --> Tree Connect AndX Request, Path: \\AARDVARK\FOO
 <-- Tree Connect AndX Response (STATUS_SUCCESS)
 --> Trans2 Request, QUERY_PATH_INFO, Query File All Info, Path:
 <-- Trans2 Response, QUERY_PATH_INFO (STATUS_SUCCESS)

If I set "guest ok = yes" (the broken case), I see the following
exchange:

 --> Session Setup AndX Request, User: anonymous
 <-- Session Setup AndX Response, STATUS_SUCCESS
 -->Tree Connect AndX Request, Path: \\AARDVARK\FOO
 <-- Tree Connect AndX Response (STATUS_SUCCESS)
 --> Trans2 Request, QUERY_PATH_INFO, Query File All Info, Path:
 <-- Trans2 Response, QUERY_PATH_INFO, Error: STATUS_NETWORK_ACCESS_DENIED
[I get prompted for username / password]
 --> Session Startup AndX Request, NTLMSSP_NEGOTIATE
 <-- Session Startup AndX Response, NTLMSSP_CHALLENGE, Error: 
STATUS_MORE_PROCESSING_REQUIRED
 --> Session Startup AndX Request, NTLMSSP_AUTH, User: WORKGROUP\youngoat
 <-- Session Startup AndX Response (STATUS_SUCCESS)
 --> Tree Connect AndX Request, Path: \\AARDVARK\FOO
 <-- Tree Connect AndX Response (STATUS_SUCCESS)
 --> Tree Disconnect Request
 <-- Tree Disconnect Response (STATUS_SUCCESS)

The difference seems to be that with "guest account = yes" (the broken case):
1) Instead of the anonymous attempt failing at "Tree Connect", it fails at 
"Trans2 Request, QUERY_PATH_INFO."
2) Then after it authenticates with my credentials (WORKGROUP\youngoat) 
successfully, it *DOESN't* try to do a "Trans2 Request, QUERY_PATH_INFO".

I suspect this last item is the issue.  I don't know why it immediately does a 
"Tree Disconnect Request" instead of doing "Trans2 Request QUERY_PATH_INFO".
 
Hopefully this is enough information to track down the bug, but please let me 
know if there's anything else I can provide.

** Affects: gvfs (Ubuntu)
     Importance: Undecided
         Status: New

-- 
gvfs-mount with user credentials fails if smb share has "guest ok=yes" but the 
guest account doesn't have proper permissions.
https://bugs.launchpad.net/bugs/223372
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to gvfs in ubuntu.

-- 
desktop-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

Reply via email to