I'm a bit new to samba but I think this is a bug. Using smbclient 3.0.14a recently compiled from source on a RedHat 7.3 machine, when I list a directory on one share, it doesn't show all the files (it lists only the first 36 out of 44 files/dirs). However, an old version of smbclient I still had lying around, Version 2.2.8a, lists all the files correctly. One weird thing is the share I'm connecting to is on an iSeries (was AS/400 , runs OS/400 now iOS or something) IFS (Integrated File System) share. So, it isn't a typical Windows machine or a typical Samba server. From what I've seen, the IFS stuff is pretty archaic, more like NT 4.0 or Win95 workgroup sharing than anything modern. If there are any debug flags I could turn on to give you more info I'd be happy to... I will paste the good and bad smbclient sessions below.
this is the BAD session: $ /usr/bin/smbclient "//10.41.16.215/psaera" -U "secret%secret" -c 'ls' -d 4 lp_load: refreshing parameters Initialising global parameters params.c:pm_process() - Processing configuration file "/usr/local/samba/lib/smb.conf" Processing section "[global]" doing parameter workgroup = BHS doing parameter server string = FAI01101 doing parameter security = user doing parameter hosts allow = 10.41.3. 10.41.16. 127. doing parameter socket options = TCP_NODELAY doing parameter local master = no doing parameter wins server = 10.41.16.100 doing parameter dns proxy = no pm_process() returned Yes added interface ip=10.41.16.81 bcast=10.41.16.255 nmask=255.255.255.0 Client started (version 3.0.14a). Connecting to 10.41.16.215 at port 445 session request ok Serverzone is 28800 Domain=[FMHDC] OS=[OS/400 V5R2M0] Server=[iSeries Support for Windows Network Neighborhood] session setup ok tconx ok dos_clean_name [] received 36 entries (eos=0) AE D 0 Thu May 5 06:06:47 2005 BC D 0 Wed May 4 22:18:56 2005 ER011122 A 1559 Sun Dec 28 16:00:00 1980 ER011127 A 18861 Tue Nov 27 11:25:28 2001 ER020404 A 11399 Thu Apr 4 10:16:48 2002 ER020405 A 67897 Fri Apr 5 10:33:04 2002 ER020408 A 4101 Mon Apr 8 09:16:10 2002 ER020409 A 2871 Tue Apr 9 09:26:26 2002 ER020410 A 6889 Wed Apr 10 09:10:44 2002 ER020411 A 6315 Thu Apr 11 09:18:32 2002 ER020412 A 55187 Sun Dec 28 16:00:00 1980 ER269001 132021 Fri Sep 26 03:35:00 2003 ER270001 6315 Sat Sep 27 02:02:00 2003 ER273001 5167 Tue Sep 30 03:54:00 2003 EZ D 0 Fri Apr 29 06:33:14 2005 F505201 A 7019 Tue Feb 22 08:50:00 2005 MB D 0 Fri Apr 23 07:30:51 2004 MC D 0 Wed Oct 6 03:26:26 2004 MD D 0 Tue May 3 03:14:48 2005 MD021005.DAT 26146 Thu Feb 10 04:22:05 2005 MD022305.DAT 24931 Tue Feb 22 23:48:19 2005 MD032205.DAT 23042 Tue Mar 22 03:08:30 2005 MD033105.DAT 26466 Wed Mar 30 17:03:50 2005 MD040505.DAT 22909 Mon Apr 4 16:57:48 2005 MD040705.DAT 396015 Wed Apr 6 17:02:20 2005 MD040805.DAT 245071 Thu Apr 7 17:01:56 2005 MD041205.DAT 20480 Mon Apr 11 18:13:54 2005 MD041305.DAT 24418 Tue Apr 12 16:59:28 2005 MD041405.DAT 20737 Wed Apr 13 16:59:33 2005 MD041505.DAT 581282 Thu Apr 14 17:03:52 2005 MD041805.DAT 311471 Sun Apr 17 16:54:50 2005 MD041905.DAT 85440 Mon Apr 18 16:59:59 2005 MD042005.DAT 74285 Tue Apr 19 17:00:48 2005 MD042105.DAT 20737 Thu Apr 21 00:17:19 2005 MD042205.DAT 8487 Thu Apr 21 17:02:44 2005 MD042505.DAT 399692 Sun Apr 24 16:56:30 2005 65535 blocks of size 32768. 65535 blocks available Total bytes listed: 2637210
this is the GOOD session with the old smbclient: $ /usr/bin/samba-old/smbclient "//10.41.16.215/psaera" -U "secret%secret" -c 'ls' -d 4 Serverzone is 28800 Initialising global parameters params.c:pm_process() - Processing configuration file "/etc/samba/smb.conf" Processing section "[global]" doing parameter workgroup = BHS doing parameter server string = FAI01101 doing parameter security = user doing parameter hosts allow = 10.41.3. 10.41.16. 127. doing parameter socket options = TCP_NODELAY doing parameter local master = no doing parameter wins server = 10.41.16.100 wins_srv_load_list(): Building WINS server list: 10.41.16.100, 1 WINS server listed. doing parameter dns proxy = no pm_process() returned Yes added interface ip=10.41.16.81 bcast=10.41.16.255 nmask=255.255.255.0 Client started (version 2.2.8a). Connecting to 10.41.16.215 at port 139 session request to 10.41.16.215 failed (Called name not present) Connecting to 10.41.16.215 at port 139 session request to 10 failed (Called name not present) Connecting to 10.41.16.215 at port 139 session request ok Domain=[FMHDC] OS=[OS/400 V5R2M0] Server=[iSeries Support for Windows Network Neighborhood] session setup ok tconx ok received 36 entries (eos=0) received 8 entries (eos=0) AE D 0 Thu May 5 06:06:47 2005 BC D 0 Wed May 4 22:18:56 2005 ER011122 A 1559 Sun Dec 28 16:00:00 1980 ER011127 A 18861 Tue Nov 27 11:25:28 2001 ER020404 A 11399 Thu Apr 4 10:16:48 2002 ER020405 A 67897 Fri Apr 5 10:33:04 2002 ER020408 A 4101 Mon Apr 8 09:16:10 2002 ER020409 A 2871 Tue Apr 9 09:26:26 2002 ER020410 A 6889 Wed Apr 10 09:10:44 2002 ER020411 A 6315 Thu Apr 11 09:18:32 2002 ER020412 A 55187 Sun Dec 28 16:00:00 1980 ER269001 132021 Fri Sep 26 03:35:00 2003 ER270001 6315 Sat Sep 27 02:02:00 2003 ER273001 5167 Tue Sep 30 03:54:00 2003 EZ D 0 Fri Apr 29 06:33:14 2005 F505201 A 7019 Tue Feb 22 08:50:00 2005 MB D 0 Fri Apr 23 07:30:51 2004 MC D 0 Wed Oct 6 03:26:26 2004 MD D 0 Tue May 3 03:14:48 2005 MD021005.DAT 26146 Thu Feb 10 04:22:05 2005 MD022305.DAT 24931 Tue Feb 22 23:48:19 2005 MD032205.DAT 23042 Tue Mar 22 03:08:30 2005 MD033105.DAT 26466 Wed Mar 30 17:03:50 2005 MD040505.DAT 22909 Mon Apr 4 16:57:48 2005 MD040705.DAT 396015 Wed Apr 6 17:02:20 2005 MD040805.DAT 245071 Thu Apr 7 17:01:56 2005 MD041205.DAT 20480 Mon Apr 11 18:13:54 2005 MD041305.DAT 24418 Tue Apr 12 16:59:28 2005 MD041405.DAT 20737 Wed Apr 13 16:59:33 2005 MD041505.DAT 581282 Thu Apr 14 17:03:52 2005 MD041805.DAT 311471 Sun Apr 17 16:54:50 2005 MD041905.DAT 85440 Mon Apr 18 16:59:59 2005 MD042005.DAT 74285 Tue Apr 19 17:00:48 2005 MD042105.DAT 20737 Thu Apr 21 00:17:19 2005 MD042205.DAT 8487 Thu Apr 21 17:02:44 2005 MD042505.DAT 399692 Sun Apr 24 16:56:30 2005 MD042605.DAT 657478 Tue Apr 26 02:25:43 2005 MD042905.DAT 118662 Fri Apr 29 07:53:08 2005 MD050205.DAT 142835 Mon May 2 06:42:52 2005 MD050405.DAT 99577 Tue May 3 16:59:08 2005 M1 D 0 Thu May 5 01:01:30 2005 P0511804 A 6875 Fri Apr 29 09:53:00 2005 TMD D 0 Tue May 3 04:00:53 2005 TSOCBLI D 0 Thu May 5 06:06:33 2005 65535 blocks of size 32768. 65535 blocks available Total bytes listed: 3662637
I was able to reproduce a similar problem when connecting to a Windows 2000 SMB server, using smbclient version 3.0.12-5-SUSE (ships with SuSE Linux Professional 9.3). The test logs below show that I created 2 identical directories: one on a remote Windows 2000 machine and one on a remote Linux (SuSE SLES9) machine. Each of these directories contained exactly 52 files, which were all created in exactly the same manner (named a..z, aa..zz). - When I used smbclient to display the directory on the remote Linux machine, it displayed all 52 files just fine. - When I used smbclient to display the directory on the remote Windows 2000 machine, it only showed the first 41 files (a..z, aa..oo) of the 52 total files. Begin test logs.... ---------------------------------------------------------------------------- ---------------------------------- Directory on remote Linux machine: ---------------------------------- main:/tmp/play# l total 225 drwxr-xr-x 2 root root 1296 Sep 5 00:20 ./ drwxrwxrwt 81 root root 15904 Sep 5 00:15 ../ -rw-r--r-- 1 root root 2 Sep 4 22:52 a -rw-r--r-- 1 root root 3 Sep 4 22:54 aa -rw-r--r-- 1 root root 2 Sep 4 22:52 b -rw-r--r-- 1 root root 3 Sep 4 22:54 bb -rw-r--r-- 1 root root 2 Sep 4 22:52 c -rw-r--r-- 1 root root 3 Sep 4 22:54 cc -rw-r--r-- 1 root root 2 Sep 4 22:52 d -rw-r--r-- 1 root root 3 Sep 4 22:54 dd -rw-r--r-- 1 root root 2 Sep 4 22:52 e -rw-r--r-- 1 root root 3 Sep 4 22:54 ee -rw-r--r-- 1 root root 2 Sep 4 22:52 f -rw-r--r-- 1 root root 3 Sep 4 22:54 ff -rw-r--r-- 1 root root 2 Sep 4 22:52 g -rw-r--r-- 1 root root 3 Sep 4 22:54 gg -rw-r--r-- 1 root root 2 Sep 4 22:52 h -rw-r--r-- 1 root root 3 Sep 4 22:54 hh -rw-r--r-- 1 root root 2 Sep 4 22:53 i -rw-r--r-- 1 root root 3 Sep 4 22:54 ii -rw-r--r-- 1 root root 2 Sep 4 22:53 j -rw-r--r-- 1 root root 3 Sep 4 22:54 jj -rw-r--r-- 1 root root 2 Sep 4 22:53 k -rw-r--r-- 1 root root 3 Sep 4 22:54 kk -rw-r--r-- 1 root root 2 Sep 4 22:53 l -rw-r--r-- 1 root root 3 Sep 4 22:54 ll -rw-r--r-- 1 root root 2 Sep 4 22:53 m -rw-r--r-- 1 root root 3 Sep 4 22:54 mm -rw-r--r-- 1 root root 2 Sep 4 22:53 n -rw-r--r-- 1 root root 3 Sep 4 22:54 nn -rw-r--r-- 1 root root 2 Sep 4 22:53 o -rw-r--r-- 1 root root 3 Sep 4 22:54 oo -rw-r--r-- 1 root root 2 Sep 4 22:53 p -rw-r--r-- 1 root root 3 Sep 4 22:54 pp -rw-r--r-- 1 root root 2 Sep 4 22:53 q -rw-r--r-- 1 root root 3 Sep 4 22:54 qq -rw-r--r-- 1 root root 2 Sep 4 22:53 r -rw-r--r-- 1 root root 3 Sep 4 22:54 rr -rw-r--r-- 1 root root 2 Sep 4 22:53 s -rw-r--r-- 1 root root 3 Sep 4 22:54 ss -rw-r--r-- 1 root root 2 Sep 4 22:53 t -rw-r--r-- 1 root root 3 Sep 4 22:54 tt -rw-r--r-- 1 root root 2 Sep 4 22:53 u -rw-r--r-- 1 root root 3 Sep 4 22:54 uu -rw-r--r-- 1 root root 2 Sep 4 22:53 v -rw-r--r-- 1 root root 3 Sep 4 22:54 vv -rw-r--r-- 1 root root 2 Sep 4 22:53 w -rw-r--r-- 1 root root 3 Sep 4 22:54 ww -rw-r--r-- 1 root root 2 Sep 4 22:53 x -rw-r--r-- 1 root root 3 Sep 4 22:54 xx -rw-r--r-- 1 root root 2 Sep 4 22:53 y -rw-r--r-- 1 root root 3 Sep 4 22:54 yy -rw-r--r-- 1 root root 2 Sep 4 22:53 z -rw-r--r-- 1 root root 3 Sep 4 22:54 zz ----------------------------------------- Directory on remote Windows 2000 machine: ----------------------------------------- c:\tmp\play>dir Volume in drive C has no label. Volume Serial Number is 07D2-0508 Directory of C:\tmp\play 09/04/2005 11:01p <DIR> . 09/04/2005 11:01p <DIR> .. 09/04/2005 10:52p 2 a 09/04/2005 10:52p 2 b 09/04/2005 10:52p 2 c 09/04/2005 10:52p 2 d 09/04/2005 10:52p 2 e 09/04/2005 10:52p 2 f 09/04/2005 10:52p 2 g 09/04/2005 10:52p 2 h 09/04/2005 10:53p 2 i 09/04/2005 10:53p 2 j 09/04/2005 10:53p 2 k 09/04/2005 10:53p 2 l 09/04/2005 10:53p 2 m 09/04/2005 10:53p 2 n 09/04/2005 10:53p 2 o 09/04/2005 10:53p 2 p 09/04/2005 10:53p 2 q 09/04/2005 10:53p 2 r 09/04/2005 10:53p 2 s 09/04/2005 10:53p 2 t 09/04/2005 10:53p 2 u 09/04/2005 10:53p 2 v 09/04/2005 10:53p 2 w 09/04/2005 10:53p 2 x 09/04/2005 10:53p 2 y 09/04/2005 10:53p 2 z 09/04/2005 10:54p 3 aa 09/04/2005 10:54p 3 bb 09/04/2005 10:54p 3 cc 09/04/2005 10:54p 3 dd 09/04/2005 10:54p 3 ee 09/04/2005 10:54p 3 ff 09/04/2005 10:54p 3 gg 09/04/2005 10:54p 3 hh 09/04/2005 10:54p 3 ii 09/04/2005 10:54p 3 jj 09/04/2005 10:54p 3 kk 09/04/2005 10:54p 3 ll 09/04/2005 10:54p 3 mm 09/04/2005 10:54p 3 nn 09/04/2005 10:54p 3 oo 09/04/2005 10:54p 3 pp 09/04/2005 10:54p 3 qq 09/04/2005 10:54p 3 rr 09/04/2005 10:54p 3 ss 09/04/2005 10:54p 3 tt 09/04/2005 10:54p 3 uu 09/04/2005 10:54p 3 vv 09/04/2005 10:54p 3 ww 09/04/2005 10:54p 3 xx 09/04/2005 10:54p 3 yy 09/04/2005 10:54p 3 zz 52 File(s) 130 bytes 2 Dir(s) 16,154,689,536 bytes free ----------------------------------------------- smbclient run to Linux SMB server (works fine): ----------------------------------------------- guest@linux:~> smbclient --version Version 3.0.12-5-SUSE guest@linux:~> smbclient //192.168.0.44/root -U root Password: Domain=[MAIN] OS=[Unix] Server=[Samba 3.0.4-SUSE] smb: \> cd \tmp\play smb: \tmp\play\> dir . D 0 Mon Sep 5 00:20:39 2005 .. D 0 Mon Sep 5 00:15:00 2005 a 2 Sun Sep 4 22:52:12 2005 b 2 Sun Sep 4 22:52:18 2005 c 2 Sun Sep 4 22:52:20 2005 d 2 Sun Sep 4 22:52:22 2005 e 2 Sun Sep 4 22:52:24 2005 f 2 Sun Sep 4 22:52:28 2005 g 2 Sun Sep 4 22:52:31 2005 h 2 Sun Sep 4 22:52:35 2005 i 2 Sun Sep 4 22:53:15 2005 j 2 Sun Sep 4 22:53:17 2005 k 2 Sun Sep 4 22:53:21 2005 l 2 Sun Sep 4 22:53:24 2005 m 2 Sun Sep 4 22:53:27 2005 n 2 Sun Sep 4 22:53:30 2005 o 2 Sun Sep 4 22:53:33 2005 p 2 Sun Sep 4 22:53:36 2005 q 2 Sun Sep 4 22:53:38 2005 r 2 Sun Sep 4 22:53:40 2005 s 2 Sun Sep 4 22:53:43 2005 t 2 Sun Sep 4 22:53:45 2005 u 2 Sun Sep 4 22:53:47 2005 v 2 Sun Sep 4 22:53:49 2005 w 2 Sun Sep 4 22:53:51 2005 x 2 Sun Sep 4 22:53:54 2005 y 2 Sun Sep 4 22:53:56 2005 z 2 Sun Sep 4 22:53:58 2005 aa 3 Sun Sep 4 22:54:54 2005 bb 3 Sun Sep 4 22:54:54 2005 cc 3 Sun Sep 4 22:54:54 2005 dd 3 Sun Sep 4 22:54:54 2005 ee 3 Sun Sep 4 22:54:54 2005 ff 3 Sun Sep 4 22:54:54 2005 gg 3 Sun Sep 4 22:54:54 2005 hh 3 Sun Sep 4 22:54:54 2005 ii 3 Sun Sep 4 22:54:54 2005 jj 3 Sun Sep 4 22:54:54 2005 kk 3 Sun Sep 4 22:54:54 2005 ll 3 Sun Sep 4 22:54:54 2005 mm 3 Sun Sep 4 22:54:54 2005 nn 3 Sun Sep 4 22:54:54 2005 oo 3 Sun Sep 4 22:54:54 2005 pp 3 Sun Sep 4 22:54:54 2005 qq 3 Sun Sep 4 22:54:54 2005 rr 3 Sun Sep 4 22:54:54 2005 ss 3 Sun Sep 4 22:54:54 2005 tt 3 Sun Sep 4 22:54:54 2005 uu 3 Sun Sep 4 22:54:54 2005 vv 3 Sun Sep 4 22:54:54 2005 ww 3 Sun Sep 4 22:54:54 2005 xx 3 Sun Sep 4 22:54:54 2005 yy 3 Sun Sep 4 22:54:54 2005 zz 3 Sun Sep 4 22:54:54 2005 35847 blocks of size 1048576. 19641 blocks available smb: \tmp\play\> quit ------------------------------------------------------------------------- smbclient run to Windows 2000 SMB server (truncates list after 41 files): ------------------------------------------------------------------------- guest@linux:~> smbclient --version Version 3.0.12-5-SUSE guest@linux:~> smbclient //192.168.0.50/c -U selltc Password: Domain=[NA] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager] smb: \> cd \tmp\play smb: \tmp\play\> dir . D 0 Sun Sep 4 23:01:22 2005 .. D 0 Sun Sep 4 23:01:22 2005 a A 2 Sun Sep 4 22:52:12 2005 b A 2 Sun Sep 4 22:52:18 2005 c A 2 Sun Sep 4 22:52:20 2005 d A 2 Sun Sep 4 22:52:22 2005 e A 2 Sun Sep 4 22:52:24 2005 f A 2 Sun Sep 4 22:52:28 2005 g A 2 Sun Sep 4 22:52:32 2005 h A 2 Sun Sep 4 22:52:36 2005 i A 2 Sun Sep 4 22:53:16 2005 j A 2 Sun Sep 4 22:53:18 2005 k A 2 Sun Sep 4 22:53:22 2005 l A 2 Sun Sep 4 22:53:24 2005 m A 2 Sun Sep 4 22:53:28 2005 n A 2 Sun Sep 4 22:53:30 2005 o A 2 Sun Sep 4 22:53:34 2005 p A 2 Sun Sep 4 22:53:36 2005 q A 2 Sun Sep 4 22:53:38 2005 r A 2 Sun Sep 4 22:53:40 2005 s A 2 Sun Sep 4 22:53:44 2005 t A 2 Sun Sep 4 22:53:46 2005 u A 2 Sun Sep 4 22:53:48 2005 v A 2 Sun Sep 4 22:53:50 2005 w A 2 Sun Sep 4 22:53:52 2005 x A 2 Sun Sep 4 22:53:54 2005 y A 2 Sun Sep 4 22:53:56 2005 z A 2 Sun Sep 4 22:53:58 2005 aa A 3 Sun Sep 4 22:54:54 2005 bb A 3 Sun Sep 4 22:54:54 2005 cc A 3 Sun Sep 4 22:54:54 2005 dd A 3 Sun Sep 4 22:54:54 2005 ee A 3 Sun Sep 4 22:54:54 2005 ff A 3 Sun Sep 4 22:54:54 2005 gg A 3 Sun Sep 4 22:54:54 2005 hh A 3 Sun Sep 4 22:54:54 2005 ii A 3 Sun Sep 4 22:54:54 2005 jj A 3 Sun Sep 4 22:54:54 2005 kk A 3 Sun Sep 4 22:54:54 2005 ll A 3 Sun Sep 4 22:54:54 2005 mm A 3 Sun Sep 4 22:54:54 2005 nn A 3 Sun Sep 4 22:54:54 2005 oo A 3 Sun Sep 4 22:54:54 2005 38137 blocks of size 1048576. 15406 blocks available smb: \tmp\play\>
Please re-test with 3.0.20 - there has been much work in this area for that release. Thanks, Jeremy.
(In reply to comment #4) > Please re-test with 3.0.20 - there has been much work in this area for that release. > Thanks, > Jeremy. Thanks for the quick response! Yes, I just built the smbclient in 3.0.20, and it works MUCH better. (The full directory is listed, even on my test Windows 2000 share.) I suspect this COULD have even been fixed as early as 3.0.13, where I found a changelog entry saying "Numerous smbclient bugs when listing directories". It's ashame SuSE happened to pick up 3.0.12 for SUSE Linux Pro 9.3. Now I just need to figure out how to get the fixed smbclient 3.0.20 functionality linked in with KDE Konqueror, so I can navigate file shares using their nifty "smb://" syntax correctly... perhaps I'll save that adventure for another day. :-) Tim
(Update for comment #5) Just FYI, copying in the 3.0.20 versions of libsmbclient.so (as /usr/lib/libsmbclient.so.0) and smbclient (/usr/bin/smbclient) was all I needed to get KDE Konqueror working correctly. (I didn't think it was going to be that easy, because I couldn't find any rpm dependency between Konqueror and libsmbclient.so.0.)
report says fixed.