Author Topic: Updated Samba Client  (Read 112640 times)

David McKenna

  • Hero Member
  • *****
  • Posts: 806
  • Karma: +25/-0
    • View Profile
Re: Updated Samba Client
« Reply #210 on: July 14, 2024, 01:16:03 am »
 Hi Steven,

  Thanks for the process dump guidance - it turns out smbd is not the problem...

  I originally installed SAMBA using the last Netlabs SAMBA WPI and it worked well. This has a utility - 'Simple SAMBA Configuration Center' that allows to update the basic SAMBA files from a zip file and I have done that with every drop from Paul up to now.

 To start SAMBA, the Netlabs 'smb.cmd' file starts smbd, nmbd, and winbindd from the Startup folder.

 After the latest drop, after the server froze, rebooted then renamed smb.cmd from the <alt>F1 menu command prompt. Then followed your instructions to capture a process dump, but there was no hang, and no file captured. Clients (OS/2 and Windows) could browse the share.

 Then started nmbd from another command prompt, and again there was no hang. Clients could browse.

 Then started winbindd from another command prompt and the server froze.

 So it appears winbindd is the culprit here...

Regards,

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2244
  • Karma: +170/-0
    • View Profile
Re: Updated Samba Client
« Reply #211 on: July 14, 2024, 03:31:10 am »
interesting....I'll see if I can reproduce here....  I typically only start smbd.exe for my local testing...

David McKenna

  • Hero Member
  • *****
  • Posts: 806
  • Karma: +25/-0
    • View Profile
Re: Updated Samba Client
« Reply #212 on: July 20, 2024, 12:10:19 am »
 Weirdly, if I try to run winbindd in a command prompt by itself (without first starting smbd or nmbd) I get a message that says it cannot be run in an OS/2 session...

Regards,

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2244
  • Karma: +170/-0
    • View Profile
Re: Updated Samba Client
« Reply #213 on: July 20, 2024, 02:13:55 am »
interesting.... I haven't had a chance to investigate  yet, I've been fighting with binutils on the OS/2 side, and getting an additional binding added to the OpenHAB source on the non-OS/2 side - then of course there's that day job :)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2244
  • Karma: +170/-0
    • View Profile
Re: Updated Samba Client
« Reply #214 on: July 20, 2024, 03:02:48 am »
I seem to have fixed my binutils issue - just need to do some testing,  so then will try to get back onto the Samba issue...

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2244
  • Karma: +170/-0
    • View Profile
Re: Updated Samba Client
« Reply #215 on: July 20, 2024, 06:39:25 am »
ok so running jsut winbindd.exe from the command line works here, but it does appear to be unkillable....

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2244
  • Karma: +170/-0
    • View Profile
Re: Updated Samba Client
« Reply #216 on: July 21, 2024, 10:54:55 am »
ok so running jsut winbindd.exe from the command line works here, but it does appear to be unkillable....

Tried it a few more times, and sometimes it did lockup the machine - weird....

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2244
  • Karma: +170/-0
    • View Profile
Re: Updated Samba Client
« Reply #217 on: August 04, 2024, 11:33:05 am »
I suspect select() is failing and consuming loads of CPU..... perhaps introduced in 'cleaning up' some warnings... will see if I can work it out....

Notwithstanding the fact that it shouldn' be unkillable... I'm not sure what benefit here is to running winbindd for most OS/2 users.

From https://www.samba.org/samba/docs/current/man-html/winbindd.8.html

Code: [Select]
winbindd is a daemon that provides a number of services to the Name Service Switch capability found in most modern C libraries, to arbitrary applications via PAM and ntlm_auth and to Samba itself.

Even if winbind is not used for nsswitch, it still provides a service to smbd, ntlm_auth and the pam_winbind.so PAM module, by managing connections to domain controllers. In this configuration the idmap config * : range parameter is not required. (This is known as `netlogon proxy only mode'.)

The Name Service Switch allows user and system information to be obtained from different databases services such as NIS or DNS. The exact behaviour can be configured through the /etc/nsswitch.conf file. Users and groups are allocated as they are resolved to a range of user and group ids specified by the administrator of the Samba system.

The service provided by winbindd is called `winbind' and can be used to resolve user and group information from a Windows NT server. The service can also provide authentication services via an associated PAM module.
« Last Edit: August 04, 2024, 11:40:13 am by Paul Smedley »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2244
  • Karma: +170/-0
    • View Profile

KO Myung-Hun

  • Newbie
  • *
  • Posts: 45
  • Karma: +6/-0
    • View Profile
Re: Updated Samba Client
« Reply #219 on: August 11, 2024, 01:24:12 pm »
Hi/2.

I suggest to check sun_path which should start with `\socket\'. In case of

  https://github.com/psmedley/samba-os2/blob/samba-os2-4.19.x/source3/lib/util_sock.c#L930

it processes properly.

However,

  https://github.com/psmedley/samba-os2/blob/samba-os2-4.19.x/source3/rpc_client/local_np.c#L558

and

  https://github.com/psmedley/samba-os2/blob/samba-os2-4.19.x/source3/rpc_client/cli_pipe.c#L2976

do not.

These are the result which I've searched with `printf', so I might miss any other parts.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2244
  • Karma: +170/-0
    • View Profile
Re: Updated Samba Client
« Reply #220 on: August 12, 2024, 10:35:19 am »
Thanks KO, I'm going to rebuild with the attached...

Edit: I did - 'net rpc user' triggered a hang and the last bits in log.smbd were:
Code: [Select]
[2024/08/12 18:36:09.211000, 10, pid=29073, effective(109, 514), real(0, 0)] ../../source3/rpc_client/local_np.c:175(np_sock_connect_connected)
  np_sock_connect_connected: async_connect_recv returned Can't assign requested address
[2024/08/12 18:36:09.211000, 10, pid=29073, effective(109, 514), real(0, 0)] ../../source3/rpc_client/local_np.c:699(local_np_connect_connected)
  local_np_connect_connected: np_sock_connect failed: Can't assign requested address

As I recall, I got something simialr previously - address was \\socket\\xxxx which no surprise can't be assigned...

Anyone, a job for later in the week...
« Last Edit: August 12, 2024, 11:14:35 am by Paul Smedley »

KO Myung-Hun

  • Newbie
  • *
  • Posts: 45
  • Karma: +6/-0
    • View Profile
Re: Updated Samba Client
« Reply #221 on: August 12, 2024, 02:06:06 pm »
Any reason to omit socket dir part such as lp_ncalrpc_dir() and socket_dir?

And in

Code: [Select]
diff --git a/source3/rpc_client/local_np.c b/source3/rpc_client/local_np.c
index 791ded99a..e8f97f127 100644
--- a/source3/rpc_client/local_np.c
+++ b/source3/rpc_client/local_np.c
@@ -555,8 +555,13 @@ struct tevent_req *local_np_connect_send(
  return tevent_req_post(req, ev);
  }
 
+#ifndef __OS2__
+ state->socketpath = talloc_asprintf(
+ state, "\\socket\\np\\%s", lower_case_pipename);
+#else
  state->socketpath = talloc_asprintf(
  state, "%s/np/%s", socket_dir, lower_case_pipename);
+#endif
  if (tevent_req_nomem(state->socketpath, req)) {
  return tevent_req_post(req, ev);
  }

I think, #ifndef is a typo. It should be #ifdef, right ?

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2244
  • Karma: +170/-0
    • View Profile
Re: Updated Samba Client
« Reply #222 on: August 13, 2024, 11:25:45 am »
Hi KO!

I omitted the directory as part of the socket  name as I couldn't remember the rules around  socket names - but figured something like \\socket\\c:\mptn\etc\samba\np\xxxx may not be allowed..

Yes you are right - that was a typo. That now lets me trigger a hang as soon as I attempt 'net rpc user -S 192.168.1.135' from a linux box (where 192.168.1.135 is the IP of the ArcaOS box).

The error is still:
Code: [Select]
[2024/08/13 18:47:25.882000, 10, pid=4720, effective(109, 514), real(0, 0)] ../../source3/rpc_client/local_np.c:175(np_sock_connect_connected)
  np_sock_connect_connected: async_connect_recv returned Can't assign requested address
[2024/08/13 18:47:25.882000, 10, pid=4720, effective(109, 514), real(0, 0)] ../../source3/rpc_client/local_np.c:699(local_np_connect_connected)
  local_np_connect_connected: np_sock_connect failed: Can't assign requested address

Interestingly, log.samba-dceprcd ends with:
Code: [Select]
[2024/08/13 18:47:26.181000, 10, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:2435(rpc_host_send)
  rpc_host_send: server_setup for U:/dev/samba-os2-4.19.x/bin/rpcd_classic.exe index 0
[2024/08/13 18:47:26.368000, 10, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:2435(rpc_host_send)
  rpc_host_send: server_setup for U:/dev/samba-os2-4.19.x/bin/rpcd_epmapper.exe index 1
[2024/08/13 18:47:26.548000, 10, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:2435(rpc_host_send)
  rpc_host_send: server_setup for U:/dev/samba-os2-4.19.x/bin/rpcd_fsrvp.exe index 2
[2024/08/13 18:47:26.736000, 10, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:2435(rpc_host_send)
  rpc_host_send: server_setup for U:/dev/samba-os2-4.19.x/bin/rpcd_lsad.exe index 3
[2024/08/13 18:47:27.370000, 10, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:2435(rpc_host_send)
  rpc_host_send: server_setup for U:/dev/samba-os2-4.19.x/bin/rpcd_mdssvc.exe index 4
[2024/08/13 18:47:27.730000, 10, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:2435(rpc_host_send)
  rpc_host_send: server_setup for U:/dev/samba-os2-4.19.x/bin/rpcd_spoolss.exe index 5
[2024/08/13 18:47:27.902000, 10, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:2435(rpc_host_send)
  rpc_host_send: server_setup for U:/dev/samba-os2-4.19.x/bin/rpcd_winreg.exe index 6
[2024/08/13 18:47:28.058000, 10, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:1784(rpc_host_sigchld)
  rpc_host_sigchld: pid=4726, wstatus=0
[2024/08/13 18:47:28.058000,  1, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:1752(rpc_worker_exited)
  rpc_worker_exited: No worker with PID 4726
[2024/08/13 18:47:28.058000, 10, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:1784(rpc_host_sigchld)
  rpc_host_sigchld: pid=4724, wstatus=0
[2024/08/13 18:47:28.058000,  1, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:1752(rpc_worker_exited)
  rpc_worker_exited: No worker with PID 4724
[2024/08/13 18:47:28.058000, 10, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:1784(rpc_host_sigchld)
  rpc_host_sigchld: pid=4723, wstatus=0
[2024/08/13 18:47:28.058000,  1, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:1752(rpc_worker_exited)
  rpc_worker_exited: No worker with PID 4723
[2024/08/13 18:47:28.355000, 10, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:1784(rpc_host_sigchld)
  rpc_host_sigchld: pid=4730, wstatus=0
[2024/08/13 18:47:28.355000,  1, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:1752(rpc_worker_exited)
  rpc_worker_exited: No worker with PID 4730
[2024/08/13 18:47:28.654000, 10, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:1784(rpc_host_sigchld)
  rpc_host_sigchld: pid=4728, wstatus=0
[2024/08/13 18:47:28.654000,  1, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:1752(rpc_worker_exited)
  rpc_worker_exited: No worker with PID 4728
[2024/08/13 18:47:28.663000, 10, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:1784(rpc_host_sigchld)
  rpc_host_sigchld: pid=4733, wstatus=0
[2024/08/13 18:47:28.663000,  1, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:1752(rpc_worker_exited)
  rpc_worker_exited: No worker with PID 4733
[2024/08/13 18:47:28.683000, 10, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:1784(rpc_host_sigchld)
  rpc_host_sigchld: pid=4735, wstatus=0
[2024/08/13 18:47:28.683000,  1, pid=4722, effective(0, 0), real(0, 0)] ../../source3/rpc_server/rpc_host.c:1752(rpc_worker_exited)
  rpc_worker_exited: No worker with PID 4735

That could be due to pipe() in lieu of socketpair()... will go hunting...

Edit:  attached patch eliminates the errors in log.samba-dcerpcd but still get the log.smbd errors.
« Last Edit: August 13, 2024, 12:01:57 pm by Paul Smedley »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2244
  • Karma: +170/-0
    • View Profile
Re: Updated Samba Client
« Reply #223 on: August 16, 2024, 02:36:14 am »
Will update Post 1 shortly...

samba 4.19.8 (Build with GCC 9.x, which seems to resolve some hangs at exit) - https://smedley.id.au/tmp/samba-4.19.8-os2-20240816.zip
Client DLL  - https://smedley.id.au/tmp/smbcl419-4.19.8-20240816.zip

issues with 'net rpc user' persist.
« Last Edit: August 16, 2024, 02:48:28 am by Paul Smedley »

David McKenna

  • Hero Member
  • *****
  • Posts: 806
  • Karma: +25/-0
    • View Profile
Re: Updated Samba Client
« Reply #224 on: August 16, 2024, 06:48:55 pm »
Thanks Paul!

  The client works well with your version 4.19.7 built with gcc 9.

  I have troubles with the server though (installed using the SSCC app). Once again, winbindd.exe hangs the machine solid and need to do a hard reset. I renamed winbindd.exe so it wouldn't run and now the server runs. I can browse and use files from Windows, but as soon as I try to use OS/2 (with the new client) I get a 'access denied' message and the server locks solid, and needs a hard reset. Going back to 4.19.7 everything works again.

Regards,