Bug 4857 - mount.cifs does not connect to requested netbios name
Summary: mount.cifs does not connect to requested netbios name
Status: RESOLVED INVALID
Alias: None
Product: CifsVFS
Classification: Unclassified
Component: user space tools (show other bugs)
Version: 2.6
Hardware: x86 Linux
: P3 normal
Target Milestone: ---
Assignee: Steve French
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-03 04:07 UTC by Karolin Seeger
Modified: 2010-01-22 03:12 UTC (History)
2 users (show)

See Also:


Attachments
tcpdump of trial to mount via mount.cifs (5.26 KB, application/octet-stream)
2007-08-03 04:11 UTC, Karolin Seeger
no flags Details
tcpdump of working connection via smbclient (4.63 KB, application/octet-stream)
2007-08-03 04:14 UTC, Karolin Seeger
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karolin Seeger 2007-08-03 04:07:43 UTC
Scenario:
Samba server with multiple netbios aliases and specific includes for each netbios alias.

smb.conf:

netbios name = bando
netbios aliases = cat
include = /etc/samba/smb.conf.%L
smb ports = 139

smb.conf.cat:

[cats_share]
path = /tmp  

Connecting to //cat/cats_share with smbclient works fine.
Mounting //cat/cats_share with mount.cifs fails with:

retrying with upper case share name
mount error 6 = No such device or address
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

In the network sniff, you can see a nbss session request to *SMBSERVER<20>
(packet number 6) instead of CAT<20> (which is the case with smbclient).
Mount option 'netbiosname' only applies to the client netbios name and I wonder how I can connect to the virtual server 'cat'.

Thanks in advance!
Comment 1 Karolin Seeger 2007-08-03 04:11:44 UTC
Created attachment 2852 [details]
tcpdump of trial to mount via mount.cifs

mount -t cifs //cat/cats_share /mnt -o username=xxx,password=xxx
Comment 2 Karolin Seeger 2007-08-03 04:14:53 UTC
Created attachment 2853 [details]
tcpdump of working connection via smbclient

smbclient //cat/cats_share -Ukseeger
Comment 3 Karolin Seeger 2007-08-03 05:00:17 UTC
Okay, works (with newer kernels) with mount option 'servername' (which is not documented in the man page).
Why not grabbing the netbios name out of the unc path?
Comment 4 shirishpargaonkar@gmail.com 2009-11-01 18:53:29 UTC
Looking at the tcpdump/wireshark traces for cifs vfs client and smbclient.
The user id used during session setup is different in both the cases.
Are cifs vfs client and smbclient and Samba server running on the same machine?
I do not see smbclient resolving netbios name of the Samba server in the
trace, wonder how smbclient is resolving netbios name of the server to 
negotiate/session_setup/tree_connnet to that server!
Also, can you please state the entire command that works when used with cifs 
client (with servername option)?
Comment 5 shirishpargaonkar@gmail.com 2009-11-02 09:12:23 UTC
cifs vfs client does not do netbios name query like smbclient does.
Comment 6 shirishpargaonkar@gmail.com 2009-11-02 13:38:21 UTC
I have files /usr/local/samba/lib/smb.conf with this content (only)
 
        netbios name = cfstst8
        netbios alias = cfstst8a
        client signing = mandatory
        server signing = mandatory
        include = /usr/local/samba/lib/smb.conf.%L
        smb ports = 139

and /usr/local/samba/lib/smb.conf.cfstst8

[smbshare8]
        path =  /tmp/smbshare8
        browsable = yes
        read only = no
        guest ok = yes
        writable = yes

yet, when I try to either mount via cifs using netbios name or 
use smbclient with netbios name, I get an error


cifstest8:~ # smbclient //cfstst8/smbshare8 /mnt/smb_a -U root
Connection to cfstst8 failed (Error NT_STATUS_BAD_NETWORK_NAME)
Comment 7 Karolin Seeger 2009-11-11 03:49:49 UTC
(In reply to comment #4)
> Looking at the tcpdump/wireshark traces for cifs vfs client and smbclient.
> The user id used during session setup is different in both the cases.
> Are cifs vfs client and smbclient and Samba server running on the same machine?

Yes.

> I do not see smbclient resolving netbios name of the Samba server in the
> trace, wonder how smbclient is resolving netbios name of the server to 
> negotiate/session_setup/tree_connnet to that server!
> Also, can you please state the entire command that works when used with cifs 
> client (with servername option)?

mount -t cifs //127.0.0.1/cats_share /mnt -o username=xxx,password=xxx,servername=cat
Comment 8 Karolin Seeger 2009-11-11 03:50:54 UTC
(In reply to comment #6)
> I have files /usr/local/samba/lib/smb.conf with this content (only)
> 
>         netbios name = cfstst8
>         netbios alias = cfstst8a
>         client signing = mandatory
>         server signing = mandatory
>         include = /usr/local/samba/lib/smb.conf.%L
>         smb ports = 139
> 
> and /usr/local/samba/lib/smb.conf.cfstst8
> 
> [smbshare8]
>         path =  /tmp/smbshare8
>         browsable = yes
>         read only = no
>         guest ok = yes
>         writable = yes
> 
> yet, when I try to either mount via cifs using netbios name or 
> use smbclient with netbios name, I get an error
> 
> 
> cifstest8:~ # smbclient //cfstst8/smbshare8 /mnt/smb_a -U root
> Connection to cfstst8 failed (Error NT_STATUS_BAD_NETWORK_NAME)

Does /tmp/smbshare8 exist?

Comment 9 shirishpargaonkar@gmail.com 2009-11-11 12:58:47 UTC
(In reply to comment #8)
> (In reply to comment #6)

> Does /tmp/smbshare8 exist?

yes.

Comment 10 shirishpargaonkar@gmail.com 2010-01-21 13:37:20 UTC
cifs client does not discover netbios hosts, I think unlike smbclient.
So I am not sure what the issue here is.
Comment 11 shirishpargaonkar@gmail.com 2010-01-21 13:51:02 UTC
cifs client does not talk NBNS.  So I do not think it can discover
netbios names.
Comment 12 Karolin Seeger 2010-01-22 03:12:07 UTC
Marking bug as invalid, as it seems to be impossible.