#ifdef GO500GW_HOSTNAME
strcpy( myhost, GO500GW_HOSTNAME );
#else
- if ( myhost[0] == '\0' && gethostname( myhost, sizeof(myhost) )
+ if ( myhost[0] == '\0' && gethostname( myhost, sizeof(myhost)-1 )
== -1 ) {
perror( "gethostname" );
exit( EXIT_FAILURE );
}
+ myhost[sizeof(myhost)-1] = '\0';
#endif
/* detach if stderr is redirected or no debugging */
}
#ifdef LDAP_PROCTITLE
- setproctitle( hp == NULL ? inet_ntoa( from.sin_addr ) :
+ setproctitle( "%s", hp == NULL ? inet_ntoa( from.sin_addr ) :
hp->h_name );
#endif
}
; /* NULL */
#endif
- (void) SIGNAL( SIGCHLD, wait4child );
+ (void) SIGNAL_REINSTALL ( SIGCHLD, wait4child );
}
static void
timeout.tv_usec = 0;
ldap_set_option(ld, LDAP_OPT_SIZELIMIT, &sizelimit);
if ( (rc = ldap_search_st( ld, dn, LDAP_SCOPE_ONELEVEL,
- "(objectClass=*)", attrs, 0, &timeout, &res ))
+ NULL, attrs, 0, &timeout, &res ))
== LDAP_SUCCESS || rc == LDAP_SIZELIMIT_EXCEEDED ) {
sizelimit = LDAP_NO_LIMIT;
ldap_set_option(ld, LDAP_OPT_SIZELIMIT, &sizelimit);
timeout.tv_sec = GO500GW_TIMEOUT;
timeout.tv_usec = 0;
- if ( ldap_search_st( ld, dn, LDAP_SCOPE_BASE, "objectClass=*",
+ if ( ldap_search_st( ld, dn, LDAP_SCOPE_BASE, NULL,
attrs, 0, &timeout, &res ) != LDAP_SUCCESS ) {
return( -1 );
}