Author Topic: Updated Samba Client  (Read 179307 times)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2535
  • Karma: +195/-0
    • View Profile
Re: Updated Samba Client
« Reply #45 on: January 03, 2024, 06:53:50 am »
I'd have to  check the plugin code regarding EA's - I wonder if it's worth testing with EA support  disabled in smb.conf? How big is that software\os2 folder?  I wonder if it's worth zipping it up to see if it works for me on my setup?  I'll go back and have another look and see that the previous logs were telling us...

Interesting.... the final lines before the OSO001.MSG are:
Code: [Select]
2024/01/02 16:37:16.14: 9 2: CacheWriteBegin: software\os2
2024/01/02 16:37:16.14: 9 2: dircache_write_begin returning ctx 0x3fa860
2024/01/02 16:37:30.99: 9 3: NdpRsrcQueryInfo in
2024/01/02 16:37:30.99: 9 3: NdpRsrcQueryInfo 0
2024/01/02 16:37:50.63: 9 2: NdpFindStart <software\os2\*> (\software\os2\*) cnt 0 109

*EVERY* other time dircache_write_begin is called,  the log looks like:
Code: [Select]
2024/01/02 16:37:16.14: 9 2: CacheWriteBegin: software\os2
2024/01/02 16:33:10.84: 9 2: dircache_write_begin returning ctx 0x329ca0
2024/01/02 16:33:10.87: 8 2: adding <.> 293 1426065411 261
2024/01/02 16:33:10.87: 9 2: dircache_write_entry 0x329ca0

So, it appears we're getting stuck somewhere between https://github.com/psmedley/ndpsmb/blob/master/src/smbwrp.c#L1248 & https://github.com/psmedley/ndpsmb/blob/master/src/smbwrp.c#L1264

Just for the sake of something to test - try https://smedley.id.au/tmp/ndpsmb.zip which disables the dircache....
« Last Edit: January 03, 2024, 07:16:16 am by Paul Smedley »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2535
  • Karma: +195/-0
    • View Profile
Re: Updated Samba Client
« Reply #46 on: January 03, 2024, 09:46:10 am »
Updated ndpsmb where the code for list_files is synchronised against upstream  - combining smb1 and smb2 directory listings into a single function. Bugs expected :)

https://smedley.id.au/tmp/ndpsmb-3.18.2-samba418-20240103.zip  (Needs smbcl418.dll  from ndpsmb-3.18.1-samba418-20231217.zip)

Code at https://github.com/psmedley/ndpsmb/tree/cli_list_resync

David McKenna

  • Hero Member
  • *****
  • Posts: 895
  • Karma: +32/-0
    • View Profile
Re: Updated Samba Client
« Reply #47 on: January 03, 2024, 01:15:09 pm »
Paul,

  I quickly tested both of these new ndpsmb.dll's, but neither helped with the \software\os2 directory. Tried with ea support on and off on both the server and client, but no difference.

 The \software\os2 directory contains 6 directories and over 2500 files for over 22GB of data. By far the largest directory on the disc.

 Gotta run to work... more testing later.

Regards,

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2535
  • Karma: +195/-0
    • View Profile
Re: Updated Samba Client
« Reply #48 on: January 03, 2024, 10:51:39 pm »
  I quickly tested both of these new ndpsmb.dll's, but neither helped with the \software\os2 directory. Tried with ea support on and off on both the server and client, but no difference.

 The \software\os2 directory contains 6 directories and over 2500 files for over 22GB of data. By far the largest directory on the disc.

 Gotta run to work... more testing later.

OK I have an *idea*.... I  think the default timeout on Samba is 20 seconds.  It's possible that due to the number of files - the query is taking more than 20 seconds to execute and the connection is dropped.  I've  just  done a built which should  set the timeout to 60 seconds - https://smedley.id.au/tmp/ndpsmb-3.18.2-samba418-20240104.zip If it doesn't  work,  can I have a new ndpsmb.log to see if it changed  anything?  Also,  can you try connecting with smbclient - in theory -  it should also default to a 20  second timeout and show the same issue (if I'm right).

David McKenna

  • Hero Member
  • *****
  • Posts: 895
  • Karma: +32/-0
    • View Profile
Re: Updated Samba Client
« Reply #49 on: January 04, 2024, 12:26:50 pm »
Paul,

  Something is wrong with this one - when I try to open the shared drive, ndctl crashes with a POPUPLOG:

01-04-2024  06:23:08  SYS3175  PID 003e  TID 0002  Slot 00a7
C:\PROGRAMS\NDFS\NDCTL.EXE
c0000005
1e176365
P1=00000001  P2=302f3130  P3=XXXXXXXX  P4=XXXXXXXX 
EAX=302f3130  EBX=0254f534  ECX=00320cb0  EDX=00325d60
ESI=0254f534  EDI=00325d60 
DS=0053  DSACC=d0f3  DSLIM=bfffffff 
ES=0053  ESACC=d0f3  ESLIM=bfffffff 
FS=150b  FSACC=00f3  FSLIM=00000030
GS=0000  GSACC=****  GSLIM=********
CS:EIP=005b:1e176365  CSACC=d0df  CSLIM=bfffffff
SS:ESP=0053:0254f0fc  SSACC=d0f3  SSLIM=bfffffff
EBP=0254f134  FLG=00010216

NDPSMB.DLL 0001:00006365

 I'll attach the log too...

Regards,

David McKenna

  • Hero Member
  • *****
  • Posts: 895
  • Karma: +32/-0
    • View Profile
Re: Updated Samba Client
« Reply #50 on: January 04, 2024, 01:08:19 pm »
Paul,

 Also tried smbclient from 4.18 on the client machine (ndctl not running) and something isn't right there either -  I can start smbclient and attach to the share no problem, but it will only take 3 letters typed: it immediately executes when I hit the 3rd letter, so I can't change directories. It will list the contents of the root though... Here's an example:

[C:\programs\samba]smbclient \\MAINMACHINE\D
Password for [IBMPEERS\DaveM]:
Try "help" to get a list of possible commands.
smb: \> hel
?              allinfo        altname        archive        backup
blocksize      cancel         case_sensitive cd             chmod
chown          close          del            deltree        dir
du             echo           exit           get            getfacl
geteas         hardlink       help           history        iosize
lcd            link           lock           lowercase      ls
l              mask           md             mget           mkdir
more           mput           newer          notify         open
posix          posix_encrypt  posix_open     posix_mkdir    posix_rmdir
posix_unlink   posix_whoami   print          prompt         put
pwd            q              queue          quit           readlink
rd             recurse        reget          rename         reput
rm             rmdir          showacls       setea          setmode
scopy          stat           symlink        tar            tarmode
timeout        translate      unlock         volume         vuid
wdel           logon          listconnect    showconnect    tcon
tdis           tid            utimes         logoff         ..
!

Regards,

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2535
  • Karma: +195/-0
    • View Profile
Re: Updated Samba Client
« Reply #51 on: January 04, 2024, 09:34:28 pm »
Sorry about that -  appears https://github.com/psmedley/ndpsmb/commit/2bba56334ca2359129f0e0cd61bdd2c0be63d8c5 wasn't a good  fix  :/
 
Please try with https://smedley.id.au/tmp/ndpsmb-3.18.2-samba418-20240105.zip

re:smbclient -I forgot I hadn't uploaded a build with the readline fix... https://smedley.id.au/tmp/smbclient-4.18-os2-20240105.zip

David McKenna

  • Hero Member
  • *****
  • Posts: 895
  • Karma: +32/-0
    • View Profile
Re: Updated Samba Client
« Reply #52 on: January 04, 2024, 11:01:57 pm »
Hey Paul!

  This new ndpsmb.dll works... I can browse the share at \software\os2 now! It takes longer than it used to do when using the 4.11 server, but it works. This kinda is similar to Windows too, which seems to take longer than it used to, but works. Also, so far I can still browse even though I am sharing the root of the drive - over 30 minutes so far.

  The smbclient is better - I can now type more than 3 characters at the smb: prompt, but now I have to type each character twice (type 2 to get 1) like:

ccdd  ssooffttwwaarree

to change directory to \software

 then, when I get to \software\os2 and try to llss I get:

smb: \> cd software
smb: \software\> cd os2
smb: \software\os2\> ls
NT_STATUS_INVALID_NETWORK_RESPONSE listing \software\os2\*
smb: \software\os2\> SMBecho failed (NT_STATUS_CONNECTION_DISCONNECTED). The con
nection is disconnected now

 But when I go back to the WPS I can list that directory, and from a command line too (although it takes some time). Maybe this is because NDFS is still attached - I need to check...

Thanks!

EDIT: Nope - stopping the ndctl program does not change the smbclient result...
« Last Edit: January 04, 2024, 11:26:00 pm by David McKenna »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2535
  • Karma: +195/-0
    • View Profile
Re: Updated Samba Client
« Reply #53 on: January 05, 2024, 12:50:24 am »
Hey Dave,

Well that's pretty good news all around - except for the slower speed bit. Are you using SMB1 or  SMB2+ to connect?

re: smbclient, maybe you need an updated smbcl418.dll as well - I forget now what I had to  do to fix readline... Try with https://smedley.id.au/tmp/smbclient-4.18-os2-20240105b.zip

That NT_STATUS_CONNECTION_DISCONNECTED is what I was expecting - due to the command taking longer than 20 seconds, the command times out and the connection is disconnected.

There might be some optimisation of the atfuncs in https://github.com/psmedley/at-funcs - this is the key difference between 4.11 and 4.12+

David McKenna

  • Hero Member
  • *****
  • Posts: 895
  • Karma: +32/-0
    • View Profile
Re: Updated Samba Client
« Reply #54 on: January 05, 2024, 03:11:52 am »
Hey Paul,

  This smbclient seems doesn't need double letters - thanks! Still doesn't list \software\os2 though...

   How do I force whether it uses smb1 or smb2? Don't see a choice in the ndctl console...

Regards,
« Last Edit: January 05, 2024, 03:13:42 am by David McKenna »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2535
  • Karma: +195/-0
    • View Profile
Re: Updated Samba Client
« Reply #55 on: January 05, 2024, 03:34:59 am »
With smbclient you can use the -t parameter to set the timeout. It smbclient -t 60 will increase the timeout to 60 seconds.

Again with smbclient, you can force the protocol using -m - so -m NT1 should force nt1, and -m SMB3 should force SMB3.

It may also be worth testing if:
Smbclient -m SMB3 --client-protection=off

Speeds things up. Encryption is enabled by default in newer samba versions, and may be slowing things down (but is more secure).

David McKenna

  • Hero Member
  • *****
  • Posts: 895
  • Karma: +32/-0
    • View Profile
Re: Updated Samba Client
« Reply #56 on: January 05, 2024, 03:54:27 am »
 Thanks Paul. I tried 'smbclient -t 60 \\MAINMACHINE\D' and I could get a list of \software\os2 - took awhile but it worked. Also tried 'smbclient --client-protection=off \\MAINMACHINE\D' but could not get a listing of \software\os2. Gotta have that -t 60.

 Just for kicks, I tried using the 4.11 client with the 4.18 server, and it has the same trouble the 4.18 client did at first. All of this testing seems to imply the 4.18 server is serving up files much slower than the 4.11 server did....

Regards,

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1440
  • Karma: +28/-0
    • View Profile
Re: Updated Samba Client
« Reply #57 on: January 05, 2024, 04:11:59 am »
David,
...How do I force whether it uses smb1 or smb2? Don't see a choice in the ndctl console...

NDCTL has it, but it's at the individual resource level, so open one up (or create a new one if you don't have anything saved) and look for the "Support NTLMv1" radio button...right hand side of the window.

EAs support can be dis/en-abled here as well.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2535
  • Karma: +195/-0
    • View Profile
Re: Updated Samba Client
« Reply #58 on: January 05, 2024, 04:17:28 am »
NTLM is a deprecated authentication mechanism, not a SMB protocol....

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2535
  • Karma: +195/-0
    • View Profile
Re: Updated Samba Client
« Reply #59 on: January 05, 2024, 04:25:57 am »
Thanks Paul. I tried 'smbclient -t 60 \\MAINMACHINE\D' and I could get a list of \software\os2 - took awhile but it worked. Also tried 'smbclient --client-protection=off \\MAINMACHINE\D' but could not get a listing of \software\os2. Gotta have that -t 60.

 Just for kicks, I tried using the 4.11 client with the 4.18 server, and it has the same trouble the 4.18 client did at first. All of this testing seems to imply the 4.18 server is serving up files much slower than the 4.11 server did....

Might be worth trying with:
client smb encrypt =off
In SMB.conf, just to rule out encryption as the cause.