hpux:samba 4.5.11 single_terminate: reason[socket_get_remote_addr() failed]

Silambarasan Madhappan silambarasan0109 at gmail.com
Tue Sep 12 10:40:22 UTC 2017


Hi Team,



I have setup samba 4.5.11 as Active Directory Domain Controller on hp-ux
box.



On running samba binary I’m getting below error in logs.



*[2017/08/28 16:18:56.431097,  3, pid=3730, effective(0, 3), real(0, 3)]
../source4/smbd/service_stream.c:66(stream_terminate_connection)*

*  Terminating connection - 'socket_get_remote_addr() failed'*

*[2017/08/28 16:18:56.431173,  3, pid=3730, effective(0, 3), real(0, 3)]
../source4/smbd/process_single.c:114(single_terminate)*

*  single_terminate: reason[socket_get_remote_addr() failed]*



On *triaging* this further I found that *below if condition* of *file *
* lib/tsocket/tsocket_bsd.c*

*Function *

*int _tsocket_address_bsd_from_sockaddr(TALLOC_CTX *mem_ctx,*

*       const struct sockaddr *sa,*

*       size_t sa_socklen,*

*       struct tsocket_address **_addr,*

*       const char *location)*



returns error

*if (sa_socklen < sizeof(sa->sa_family)) { *

*                                errno = EINVAL;*

*                                return -1;*

*}*



The reason of above failure is how getpeername(2) is implemented on hp-ux .

Which doesn’t update sockaddr structure and len variable for AF_UNIX.  For
hp-ux getpeername(2) to update above values we have to explicitly provide
client path and bind it to client socket.



Please suggested where to apply required changes in samba code.

Also let me know if any further information is required at my end.


More information about the samba-technical mailing list