Help with more issues in samba4/cygwin 2.5.2 on ROS

All development related issues welcome

Moderator: Moderator Team

Post Reply
bugdude
Posts: 28
Joined: Wed Nov 27, 2019 11:41 pm

Help with more issues in samba4/cygwin 2.5.2 on ROS

Post by bugdude »

Hello again,

I made some progress with getting Samba working, but it seems that datagram communications will not work on ReactOS. I am working on tracing the details, but so far it seems to be related to two things. The first is that several Winsock IOCTL calls are not present in ReactOS yet. One of the missing Winsock IOCTLs (SIO_UDP_CONNRESET, SIO_BASE_HANDLE and SIO_GET_EXTENSION_FUNCTION_POINTER). SIO_BASE_HANDLE is listed as Vista or later, but the others are not recent. I am tracing things now to see which one is causing the issue, but at the moment UDP datagram based commands are not working under ReactOS.

I can see the SIO_UDP_CONNRESET generate a WSAEINVAL because it's not defined and it seems Cygwin ignores that, but it looks like the lack of SIO_GET_EXTENSION_FUNCTION_POINTER may be the cause of the failure. That IOCTL is used to get the address of the unexported WSASendMsg function.

Has anyone ever coded a function for that that they would be willing to share ?

The second issue has to do with socket handle inheritance. Samba opens these sockets from the main program, but it then forks off new instances and expects to be able to use the sockets if they are flagged as inheritable. This works in Windows 10, but does not seem to work in ReactOS. The code in Samba does check for the inheritable attribute and finds it, but 'most' of the sockets seem to get closed and disposed even though they are in use from the forked process. This one is strange because the implication is that the instance counting is not being handled properly across processes if a socket handle is inherited. The strangest part is that it works in one instance but not in three others. The SMB server forks our a total of four processes, but it does it in a specific pattern. The first process is visible and runs as normal process under CMD.exe and opens a UDP socket listening for commands as its control channel. Then SMBD.EXE forks for the first time to create a unattached server process which inherits the control channel when the original process exits. This is the only listening UDP socket that does not disappear. The unattached process forks off three more children in the same fashion, each with a UDP listening control channel socket, but all of these disappear and get closed under ReactOS while they stay open under Windows 10 using the same binaries. This issue looks like it may be deeper down in the kernel and harder to find. I'm honestly not sure where to start with this one.. I need to trace to see if it's that the unattached hidden processes that are forked off cannot open sockets at all, or if they don't inherit them correctly. Since this issue is stranger I am concentrating on the winsock IOCTLs first.

SAMBA provides test for that functionality that do not do any inheritance or forking in msg_send and msg_sink. They work on Windows 10, but not ReactOS. I am setting up a WindowsXP VM to test them there and see if they work, but I suspect they will.

Does anyone have any ideas of where to look for the second issue ??

bugdude

bugdude
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests