[Samba] Cannot access the (old) samba server on my router from Linux

Luca Olivetti luca at wetron.es
Wed Sep 2 17:06:53 UTC 2015


Hello,

my isp provided me with an ont+wireless router combo.
The router can share via samba a mounted usb thumb drive.
The problem is that it's a very old samba version (apparently 1.9.16p10) 
and I cannot access it from Linux:

luca at seis:~$ smbclient -s /dev/null -L 192.168.10.1
Enter luca's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 1.9.16p10]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME


I tried also with -d 10, but it doesn't give too much information, e.g. 
these are the last few lines of output:

Connecting to 192.168.10.1 at port 445
Connecting to 192.168.10.1 at port 139
Socket options:
         SO_KEEPALIVE = 0
         SO_REUSEADDR = 0
         SO_BROADCAST = 0
         TCP_NODELAY = 1
         TCP_KEEPCNT = 9
         TCP_KEEPIDLE = 7200
         TCP_KEEPINTVL = 75
         IPTOS_LOWDELAY = 0
         IPTOS_THROUGHPUT = 0
         SO_REUSEPORT = 0
         SO_SNDBUF = 87040
         SO_RCVBUF = 372480
         SO_SNDLOWAT = 1
         SO_RCVLOWAT = 1
         SO_SNDTIMEO = 0
         SO_RCVTIMEO = 0
         TCP_QUICKACK = 1
         TCP_DEFER_ACCEPT = 0
  session request ok
cli_init_creds: user luca domain WORKGROUP
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 1.9.16p10]
  session setup ok
tree connect failed: NT_STATUS_BAD_NETWORK_NAME


The behaviour is even stranger if I use mount.cifs:

luca at seis:~$ sudo mount -t cifs -o guest //192.168.10.1/rootdir test
luca at seis:~$ LC_ALL= LANG= sudo ls -l test
ls: cannot access test/b: No such file or directory
ls: cannot access test/e: No such file or directory
ls: cannot access test/k: No such file or directory
ls: cannot access test/s: No such file or directory
ls: cannot access test/t: No such file or directory
ls: cannot access test/l: No such file or directory
ls: cannot access test/p: No such file or directory
ls: cannot access test/u: No such file or directory
ls: cannot access test/h: No such file or directory
ls: cannot access test/r: No such file or directory
ls: cannot access test/w: No such file or directory
ls: cannot access test/u: No such file or directory
ls: cannot access test/s: No such file or directory
ls: cannot access test/t: No such file or directory
ls: cannot access test/t: No such file or directory
ls: cannot access test/l: No such file or directory
ls: cannot access test/d: No such file or directory
ls: cannot access test/m: No such file or directory
ls: cannot access test/w: No such file or directory
ls: cannot access test/v: No such file or directory
total 0
d????????? ? ? ? ?            ? b
d????????? ? ? ? ?            ? d
d????????? ? ? ? ?            ? e
d????????? ? ? ? ?            ? h
d????????? ? ? ? ?            ? k
-????????? ? ? ? ?            ? l
d????????? ? ? ? ?            ? l
d????????? ? ? ? ?            ? m
d????????? ? ? ? ?            ? p
d????????? ? ? ? ?            ? r
d????????? ? ? ? ?            ? s
d????????? ? ? ? ?            ? s
d????????? ? ? ? ?            ? t
d????????? ? ? ? ?            ? t
d????????? ? ? ? ?            ? t
d????????? ? ? ? ?            ? u
d????????? ? ? ? ?            ? u
d????????? ? ? ? ?            ? v
d????????? ? ? ? ?            ? w
d????????? ? ? ? ?            ? w

Needless to say, everything works fine with windows (and of course those 
single letter directories are completely bogus).

Looking with wireshark, the main difference I see is that smbclient does 
a "Session Setup AndX Request" which succeeds and then does a "Tree 
Connect AndX Request, Path: \\192.168.10.1\IPC$" which fails ("Invalid 
network name. Service not found"), while a "net view" from windows does 
a "Session Setup AndX Request, User: WETRON\luca; Tree Connect AndX, 
Path: \\192.168.10.1\IPC$" in a single step.

Note that, when listing the files, both from Linux and from windows the 
reply to FIND_FIRST2 appears to be the same, bogus, one from wireshark 
("Trans2 Response, FIND_FIRST2, Files: b e k s t l p u h r w u s t t l d 
m w v") but windows manages to show the correct directory listing.
Most probably the bug is in wireshark (copied from samba?), since the 
correct filenames are visible in the raw reply.


Any hint?

Bye
-- 
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007



More information about the samba mailing list