mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-18 10:07:56 -05:00
s/enable-unix/enable-local/
s/LDAP_PF_UNIX/LDAP_PF_LOCAL/ s/AF_UNIX/AF_LOCAL/ s/PF_UNIX/PF_LOCAL/
This commit is contained in:
parent
fe23628faa
commit
1f1993989a
8 changed files with 74 additions and 66 deletions
30
configure
vendored
30
configure
vendored
|
|
@ -43,7 +43,7 @@ ac_help="$ac_help
|
|||
ac_help="$ac_help
|
||||
--enable-ipv6 enable IPv6 support (auto)"
|
||||
ac_help="$ac_help
|
||||
--enable-unix enable UNIX domain socket support (auto)"
|
||||
--enable-local enable AF_LOCAL socket support (auto)"
|
||||
ac_help="$ac_help
|
||||
--enable-x-compile enable cross compiling (no)"
|
||||
ac_help="$ac_help
|
||||
|
|
@ -1337,10 +1337,10 @@ else
|
|||
ol_enable_ipv6="auto"
|
||||
fi
|
||||
# end --enable-ipv6
|
||||
# OpenLDAP --enable-unix
|
||||
# Check whether --enable-unix or --disable-unix was given.
|
||||
if test "${enable_unix+set}" = set; then
|
||||
enableval="$enable_unix"
|
||||
# OpenLDAP --enable-local
|
||||
# Check whether --enable-local or --disable-local was given.
|
||||
if test "${enable_local+set}" = set; then
|
||||
enableval="$enable_local"
|
||||
|
||||
ol_arg=invalid
|
||||
for ol_val in auto yes no ; do
|
||||
|
|
@ -1349,14 +1349,14 @@ if test "${enable_unix+set}" = set; then
|
|||
fi
|
||||
done
|
||||
if test "$ol_arg" = "invalid" ; then
|
||||
{ echo "configure: error: bad value $enableval for --enable-unix" 1>&2; exit 1; }
|
||||
{ echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
|
||||
fi
|
||||
ol_enable_unix="$ol_arg"
|
||||
ol_enable_local="$ol_arg"
|
||||
|
||||
else
|
||||
ol_enable_unix="auto"
|
||||
ol_enable_local="auto"
|
||||
fi
|
||||
# end --enable-unix
|
||||
# end --enable-local
|
||||
# OpenLDAP --enable-x_compile
|
||||
# Check whether --enable-x_compile or --disable-x_compile was given.
|
||||
if test "${enable_x_compile+set}" = set; then
|
||||
|
|
@ -4192,7 +4192,7 @@ if test $ac_cv_func_getaddrinfo = no ; then
|
|||
ol_enable_ipv6=no
|
||||
fi
|
||||
|
||||
if test $ol_enable_unix != no ; then
|
||||
if test $ol_enable_local != no ; then
|
||||
for ac_hdr in sys/un.h
|
||||
do
|
||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||
|
|
@ -4234,10 +4234,10 @@ fi
|
|||
done
|
||||
|
||||
|
||||
if test $ol_enable_unix = auto ; then
|
||||
ol_enable_unix=$ac_cv_header_sys_un_h
|
||||
if test $ol_enable_local = auto ; then
|
||||
ol_enable_local=$ac_cv_header_sys_un_h
|
||||
elif test $ac_cv_header_sys_un_h = no ; then
|
||||
{ echo "configure: error: UNIX domain support requires sys/un.h" 1>&2; exit 1; }
|
||||
{ echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
@ -15738,9 +15738,9 @@ if test "$ol_enable_cldap" != no ; then
|
|||
EOF
|
||||
|
||||
fi
|
||||
if test "$ol_enable_unix" != no; then
|
||||
if test "$ol_enable_local" != no; then
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define LDAP_PF_UNIX 1
|
||||
#define LDAP_PF_LOCAL 1
|
||||
EOF
|
||||
|
||||
fi
|
||||
|
|
|
|||
16
configure.in
16
configure.in
|
|
@ -108,7 +108,7 @@ OL_ARG_ENABLE(referrals,[ --enable-referrals enable V2 Referrals extension], ye
|
|||
OL_ARG_ENABLE(kbind,[ --enable-kbind enable V2 Kerberos IV bind], auto)dnl
|
||||
OL_ARG_ENABLE(cldap,[ --enable-cldap enable connectionless ldap], no)dnl
|
||||
OL_ARG_ENABLE(ipv6,[ --enable-ipv6 enable IPv6 support], auto)dnl
|
||||
OL_ARG_ENABLE(unix,[ --enable-unix enable UNIX domain socket support], auto)dnl
|
||||
OL_ARG_ENABLE(local,[ --enable-local enable AF_LOCAL socket support], auto)dnl
|
||||
OL_ARG_ENABLE(x_compile,[ --enable-x-compile enable cross compiling],
|
||||
no, [yes no])dnl
|
||||
|
||||
|
|
@ -597,7 +597,7 @@ AC_CHECK_LIB(s, afopen, [
|
|||
|
||||
dnl ----------------------------------------------------------------
|
||||
dnl PF_INET6 support requires getaddrinfo
|
||||
dnl PF_UNIX may use getaddrinfo in available
|
||||
dnl PF_LOCAL may use getaddrinfo in available
|
||||
AC_CHECK_FUNCS( getaddrinfo )
|
||||
|
||||
if test $ac_cv_func_getaddrinfo = no ; then
|
||||
|
|
@ -607,13 +607,13 @@ if test $ac_cv_func_getaddrinfo = no ; then
|
|||
ol_enable_ipv6=no
|
||||
fi
|
||||
|
||||
if test $ol_enable_unix != no ; then
|
||||
if test $ol_enable_local != no ; then
|
||||
AC_CHECK_HEADERS( sys/un.h )
|
||||
|
||||
if test $ol_enable_unix = auto ; then
|
||||
ol_enable_unix=$ac_cv_header_sys_un_h
|
||||
if test $ol_enable_local = auto ; then
|
||||
ol_enable_local=$ac_cv_header_sys_un_h
|
||||
elif test $ac_cv_header_sys_un_h = no ; then
|
||||
AC_MSG_ERROR([UNIX domain support requires sys/un.h])
|
||||
AC_MSG_ERROR([AF_LOCAL domain support requires sys/un.h])
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
@ -2125,8 +2125,8 @@ fi
|
|||
if test "$ol_enable_cldap" != no ; then
|
||||
AC_DEFINE(LDAP_CONNECTIONLESS,1,[define to support CLDAP])
|
||||
fi
|
||||
if test "$ol_enable_unix" != no; then
|
||||
AC_DEFINE(LDAP_PF_UNIX,1,[define to support PF_UNIX])
|
||||
if test "$ol_enable_local" != no; then
|
||||
AC_DEFINE(LDAP_PF_LOCAL,1,[define to support PF_LOCAL])
|
||||
fi
|
||||
if test "$ol_enable_ipv6" != no; then
|
||||
AC_DEFINE(LDAP_PF_INET6,1,[define to support PF_INET6])
|
||||
|
|
|
|||
|
|
@ -167,5 +167,13 @@ LDAP_F (int) ldap_pvt_inet_aton LDAP_P(( const char *, struct in_addr * ));
|
|||
#define AC_HTONS( s ) htons( s )
|
||||
#define AC_NTOHS( s ) ntohs( s )
|
||||
|
||||
#ifdef LDAP_PF_LOCAL
|
||||
# if !defined( AF_LOCAL ) && defined( AF_UNIX )
|
||||
# define AF_LOCAL AF_UNIX
|
||||
# endif
|
||||
# if !defined( PF_LOCAL ) && defined( PF_UNIX )
|
||||
# define PF_LOCAL PF_UNIX
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* _AC_SOCKET_H_ */
|
||||
|
|
|
|||
|
|
@ -849,8 +849,8 @@
|
|||
/* define to support CLDAP */
|
||||
#undef LDAP_CONNECTIONLESS
|
||||
|
||||
/* define to support PF_UNIX */
|
||||
#undef LDAP_PF_UNIX
|
||||
/* define to support PF_LOCAL */
|
||||
#undef LDAP_PF_LOCAL
|
||||
|
||||
/* define to support PF_INET6 */
|
||||
#undef LDAP_PF_INET6
|
||||
|
|
|
|||
|
|
@ -306,16 +306,16 @@ open_ldap_connection( LDAP *ld, Sockbuf *sb, LDAPURLDesc *srv,
|
|||
LBER_SBIOD_LEVEL_PROVIDER, NULL );
|
||||
break;
|
||||
case LDAP_PROTO_IPC:
|
||||
#ifdef LDAP_PF_UNIX
|
||||
/* only IPC mechanism supported is PF_UNIX */
|
||||
rc = ldap_connect_to_path( ld, sb, srv->lud_host,
|
||||
async );
|
||||
#ifdef LDAP_PF_LOCAL
|
||||
/* only IPC mechanism supported is PF_LOCAL (PF_UNIX) */
|
||||
rc = ldap_connect_to_path( ld, sb,
|
||||
srv->lud_host, async );
|
||||
if ( rc == -1 )
|
||||
return rc;
|
||||
ber_sockbuf_add_io( sb, &ber_sockbuf_io_fd,
|
||||
LBER_SBIOD_LEVEL_PROVIDER, NULL );
|
||||
break;
|
||||
#endif /* LDAP_PF_UNIX */
|
||||
#endif /* LDAP_PF_LOCAL */
|
||||
default:
|
||||
return -1;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include "portable.h"
|
||||
|
||||
#ifdef LDAP_PF_UNIX
|
||||
#ifdef LDAP_PF_LOCAL
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ ldap_pvt_ndelay_off(LDAP *ld, int fd)
|
|||
static ber_socket_t
|
||||
ldap_pvt_socket(LDAP *ld)
|
||||
{
|
||||
ber_socket_t s = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
ber_socket_t s = socket(PF_LOCAL, SOCK_STREAM, 0);
|
||||
oslocal_debug(ld, "ldap_new_socket: %d\n",s,0,0);
|
||||
return ( s );
|
||||
}
|
||||
|
|
@ -203,7 +203,7 @@ ldap_connect_to_path(LDAP *ld, Sockbuf *sb, const char *path, int async)
|
|||
oslocal_debug(ld, "ldap_connect_to_path: Trying %s\n", path, 0, 0);
|
||||
|
||||
memset( &server, '\0', sizeof(server) );
|
||||
server.sun_family = AF_UNIX;
|
||||
server.sun_family = AF_LOCAL;
|
||||
strcpy( server.sun_path, path );
|
||||
|
||||
rc = ldap_pvt_connect(ld, s, &server, async);
|
||||
|
|
@ -217,4 +217,4 @@ ldap_connect_to_path(LDAP *ld, Sockbuf *sb, const char *path, int async)
|
|||
}
|
||||
#else
|
||||
static int dummy;
|
||||
#endif /* LDAP_PF_UNIX */
|
||||
#endif /* LDAP_PF_LOCAL */
|
||||
|
|
|
|||
|
|
@ -504,7 +504,7 @@ connection_destroy( Connection *c )
|
|||
c->c_peer_domain = NULL;
|
||||
}
|
||||
if(c->c_peer_name != NULL) {
|
||||
#ifdef LDAP_PF_UNIX
|
||||
#ifdef LDAP_PF_lOCAL
|
||||
/*
|
||||
* If peer was a domain socket, unlink. Mind you,
|
||||
* they may be un-named. Should we leave this to
|
||||
|
|
@ -516,7 +516,7 @@ connection_destroy( Connection *c )
|
|||
(void)unlink(path);
|
||||
}
|
||||
}
|
||||
#endif /* LDAP_PF_UNIX */
|
||||
#endif /* LDAP_PF_LOCAL */
|
||||
|
||||
free(c->c_peer_name);
|
||||
c->c_peer_name = NULL;
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@ int allow_severity = LOG_INFO;
|
|||
int deny_severity = LOG_NOTICE;
|
||||
#endif /* TCP Wrappers */
|
||||
|
||||
#ifdef LDAP_PF_UNIX
|
||||
#ifdef LDAP_PF_LOCAL
|
||||
#include <sys/stat.h>
|
||||
#endif /* LDAP_PF_UNIX */
|
||||
#endif /* LDAP_PF_LOCAL */
|
||||
|
||||
/* globals */
|
||||
time_t starttime;
|
||||
|
|
@ -41,7 +41,7 @@ typedef union slap_sockaddr {
|
|||
#ifdef LDAP_PF_INET6
|
||||
struct sockaddr_in6 sa_in6_addr;
|
||||
#endif
|
||||
#ifdef LDAP_PF_UNIX
|
||||
#ifdef LDAP_PF_LOCAL
|
||||
struct sockaddr_un sa_un_addr;
|
||||
#endif
|
||||
} Sockaddr;
|
||||
|
|
@ -244,7 +244,7 @@ static Listener * open_listener( const char* url )
|
|||
hints.ai_family = AF_UNSPEC;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
|
||||
# ifdef LDAP_PF_UNIX
|
||||
# ifdef LDAP_PF_LOCAL
|
||||
if ( ldap_pvt_url_scheme2proto(lud->lud_scheme) == LDAP_PROTO_IPC ) {
|
||||
if ( lud->lud_host == NULL || lud->lud_host[0] == '\0' ) {
|
||||
err = getaddrinfo(NULL, LDAPI_SOCK, &hints, &res);
|
||||
|
|
@ -256,7 +256,7 @@ static Listener * open_listener( const char* url )
|
|||
unlink( lud->lud_host );
|
||||
}
|
||||
} else
|
||||
# endif /* LDAP_PF_UNIX */
|
||||
# endif /* LDAP_PF_LOCAL */
|
||||
{
|
||||
snprintf(serv, sizeof serv, "%d", lud->lud_port);
|
||||
if( lud->lud_host == NULL || lud->lud_host[0] == '\0'
|
||||
|
|
@ -286,15 +286,15 @@ static Listener * open_listener( const char* url )
|
|||
continue;
|
||||
}
|
||||
|
||||
if ( sai->ai_family != AF_UNIX ) {
|
||||
if ( sai->ai_family != AF_LOCAL ) {
|
||||
#else
|
||||
|
||||
if ( ldap_pvt_url_scheme2proto(lud->lud_scheme) == LDAP_PROTO_IPC ) {
|
||||
#ifdef LDAP_PF_UNIX
|
||||
#ifdef LDAP_PF_LOCAL
|
||||
port = 0;
|
||||
(void) memset( (void *)&l.sl_sa.sa_un_addr, '\0', sizeof(l.sl_sa.sa_un_addr) );
|
||||
|
||||
l.sl_sa.sa_un_addr.sun_family = AF_UNIX;
|
||||
l.sl_sa.sa_un_addr.sun_family = AF_LOCAL;
|
||||
|
||||
/* hack: overload the host to be the path */
|
||||
if ( lud->lud_host == NULL || lud->lud_host[0] == '\0' ) {
|
||||
|
|
@ -321,7 +321,7 @@ static Listener * open_listener( const char* url )
|
|||
url, 0, 0);
|
||||
ldap_free_urldesc( lud );
|
||||
return NULL;
|
||||
#endif /* LDAP_PF_UNIX */
|
||||
#endif /* LDAP_PF_LOCAL */
|
||||
} else {
|
||||
|
||||
port = lud->lud_port;
|
||||
|
|
@ -375,10 +375,10 @@ static Listener * open_listener( const char* url )
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef LDAP_PF_UNIX
|
||||
#ifdef LDAP_PF_LOCAL
|
||||
/* for IP sockets only */
|
||||
if ( l.sl_sa.sa_addr.sa_family == AF_INET ) {
|
||||
#endif /* LDAP_PF_UNIX */
|
||||
#endif /* LDAP_PF_LOCAL */
|
||||
#endif /* HAVE_GETADDRINFO */
|
||||
|
||||
#ifdef SO_REUSEADDR
|
||||
|
|
@ -419,7 +419,7 @@ static Listener * open_listener( const char* url )
|
|||
#endif
|
||||
|
||||
#ifdef HAVE_GETADDRINFO
|
||||
} /* sai->ai_family != AF_UNIX */
|
||||
} /* sai->ai_family != AF_LOCAL */
|
||||
if (!bind(l.sl_sd, sai->ai_addr, sai->ai_addrlen))
|
||||
break;
|
||||
err = sock_errno();
|
||||
|
|
@ -435,8 +435,8 @@ static Listener * open_listener( const char* url )
|
|||
}
|
||||
|
||||
switch ( sai->ai_family ) {
|
||||
# ifdef LDAP_PF_UNIX
|
||||
case AF_UNIX:
|
||||
# ifdef LDAP_PF_LOCAL
|
||||
case AF_LOCAL:
|
||||
if ( chmod( (char *)sai->ai_addr, S_IRWXU ) < 0 ) {
|
||||
int err = sock_errno();
|
||||
Debug( LDAP_DEBUG_ANY, "daemon: fchmod(%ld) failed errno=%d (%s)",
|
||||
|
|
@ -447,7 +447,7 @@ static Listener * open_listener( const char* url )
|
|||
l.sl_name = ch_malloc( strlen((char *)sai->ai_addr) + sizeof("PATH=") );
|
||||
sprintf( l.sl_name, "PATH=%s", sai->ai_addr );
|
||||
break;
|
||||
# endif /* LDAP_PF_UNIX */
|
||||
# endif /* LDAP_PF_LOCAL */
|
||||
|
||||
case AF_INET: {
|
||||
char addr[INET_ADDRSTRLEN];
|
||||
|
|
@ -475,14 +475,14 @@ static Listener * open_listener( const char* url )
|
|||
break;
|
||||
}
|
||||
#else
|
||||
#ifdef LDAP_PF_UNIX
|
||||
#ifdef LDAP_PF_LOCAL
|
||||
/* close conditional */
|
||||
}
|
||||
#endif /* LDAP_PF_UNIX */
|
||||
#endif /* LDAP_PF_LOCAL */
|
||||
|
||||
switch ( l.sl_sa.sa_addr.sa_family ) {
|
||||
#ifdef LDAP_PF_UNIX
|
||||
case AF_UNIX:
|
||||
#ifdef LDAP_PF_LOCAL
|
||||
case AF_LOCAL:
|
||||
rc = bind( l.sl_sd, (struct sockaddr *)&l.sl_sa,
|
||||
sizeof(l.sl_sa.sa_un_addr) );
|
||||
break;
|
||||
|
|
@ -508,8 +508,8 @@ static Listener * open_listener( const char* url )
|
|||
}
|
||||
|
||||
switch ( l.sl_sa.sa_addr.sa_family ) {
|
||||
#ifdef LDAP_PF_UNIX
|
||||
case AF_UNIX:
|
||||
#ifdef LDAP_PF_LOCAL
|
||||
case AF_LOCAL:
|
||||
if ( chmod( l.sl_sa.sa_un_addr.sun_path, S_IRWXU ) < 0 ) {
|
||||
int err = sock_errno();
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
|
|
@ -523,7 +523,7 @@ static Listener * open_listener( const char* url )
|
|||
+ sizeof("PATH=") );
|
||||
sprintf( l.sl_name, "PATH=%s", l.sl_sa.sa_un_addr.sun_path );
|
||||
break;
|
||||
#endif /* LDAP_PF_UNIX */
|
||||
#endif /* LDAP_PF_LOCAL */
|
||||
|
||||
case AF_INET:
|
||||
l.sl_name = ch_malloc( sizeof("IP=255.255.255.255:65336") );
|
||||
|
|
@ -831,13 +831,13 @@ slapd_daemon_task(
|
|||
|
||||
char *dnsname;
|
||||
char *peeraddr;
|
||||
#ifdef LDAP_PF_UNIX
|
||||
#ifdef LDAP_PF_LOCAL
|
||||
char peername[MAXPATHLEN + sizeof("PATH=")];
|
||||
#elif defined(LDAP_PF_INET6)
|
||||
char peername[sizeof("IP=ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff 65535")];
|
||||
#else
|
||||
char peername[sizeof("IP=255.255.255.255:65336")];
|
||||
#endif /* LDAP_PF_UNIX */
|
||||
#endif /* LDAP_PF_LOCAL */
|
||||
|
||||
peername[0] = '\0';
|
||||
|
||||
|
|
@ -896,11 +896,11 @@ slapd_daemon_task(
|
|||
}
|
||||
|
||||
switch ( from.sa_addr.sa_family ) {
|
||||
# ifdef LDAP_PF_UNIX
|
||||
case AF_UNIX:
|
||||
# ifdef LDAP_PF_LOCAL
|
||||
case AF_LOCAL:
|
||||
sprintf( peername, "PATH=%s", from.sa_un_addr.sun_path );
|
||||
break;
|
||||
#endif /* LDAP_PF_UNIX */
|
||||
#endif /* LDAP_PF_LOCAL */
|
||||
|
||||
# ifdef LDAP_PF_INET6
|
||||
case AF_INET6: {
|
||||
|
|
@ -1147,11 +1147,11 @@ slapd_daemon_task(
|
|||
|
||||
for ( l = 0; slap_listeners[l] != NULL; l++ ) {
|
||||
if ( slap_listeners[l]->sl_sd != AC_SOCKET_INVALID ) {
|
||||
#ifdef LDAP_PF_UNIX
|
||||
if ( slap_listeners[l]->sl_sa.sa_addr.sa_family == AF_UNIX ) {
|
||||
#ifdef LDAP_PF_LOCAL
|
||||
if ( slap_listeners[l]->sl_sa.sa_addr.sa_family == AF_LOCAL ) {
|
||||
unlink( slap_listeners[l]->sl_sa.sa_un_addr.sun_path );
|
||||
}
|
||||
#endif /* LDAP_PF_UNIX */
|
||||
#endif /* LDAP_PF_LOCAL */
|
||||
slapd_close( slap_listeners[l]->sl_sd );
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue