[Date Prev][Date Next] [Chronological] [Thread] [Top]

AF_LOCAL socket problems. (ITS#877)



Full_Name: Gerrit Thomson
Version: 2.06
OS: redhat 7
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (136.186.1.117)


A possible problem with "getaddressinfo" for the unix domain socket. The file
name is 
not put into the sai->ai_addr structure as expected in daemon.c.

Thus the chmod of the socket fails and the server does not operate.

I patched daemon.c to use the LDAPI_SOCK constant as a replacment for
sai->ai_addr in 
a couple of places. This works but perhaps the problem is actually earlier in
the code
in the initialization of the information to the call to "getaddressinfo".

The patch follows. I appologise for leaving the old lines in as comments, its my

fallback position.

Cheers,
   Gerrit Thomson.

daemon.c
425c425,426
<               if ( chmod( (char *)sai->ai_addr, S_IRWXU ) < 0 ) {
---
> /*            if ( chmod( (char *)sai->ai_addr, S_IRWXU ) < 0 ) { */
>               if ( chmod( LDAPI_SOCK, S_IRWXU ) < 0 ) {
428a430,431
>                       Debug( LDAP_DEBUG_ANY, "daemon: fchmod(%ld) failed
errno
r=%d file (%s)",
>                               (long) l.sl_sd, err,(char *)sai->ai_addr );
432,433c435,438
<               l.sl_name = ch_malloc( strlen((char *)sai->ai_addr) +
sizeof("PA
TH=") );
<               sprintf( l.sl_name, "PATH=%s", sai->ai_addr );
---
> /*            l.sl_name = ch_malloc( strlen((char *)sai->ai_addr) +
sizeof("PA
TH=") ); */
>               l.sl_name = ch_malloc( strlen(LDAPI_SOCK) + sizeof("PATH=") );
> /*            sprintf( l.sl_name, "PATH=%s", sai->ai_addr ); */
>               sprintf( l.sl_name, "PATH=%s", LDAPI_SOCK ); 

------ end of diff -----------