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
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
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
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_%'`
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
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
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
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
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
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])
#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_ */
/* 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
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;
#include "portable.h"
-#ifdef LDAP_PF_UNIX
+#ifdef LDAP_PF_LOCAL
#include <stdio.h>
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 );
}
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);
}
#else
static int dummy;
-#endif /* LDAP_PF_UNIX */
+#endif /* LDAP_PF_LOCAL */
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
(void)unlink(path);
}
}
-#endif /* LDAP_PF_UNIX */
+#endif /* LDAP_PF_LOCAL */
free(c->c_peer_name);
c->c_peer_name = NULL;
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;
#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;
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);
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'
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' ) {
url, 0, 0);
ldap_free_urldesc( lud );
return NULL;
-#endif /* LDAP_PF_UNIX */
+#endif /* LDAP_PF_LOCAL */
} else {
port = lud->lud_port;
}
#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
#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();
}
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)",
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];
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;
}
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,
+ 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") );
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';
}
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: {
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;
}