]> git.sur5r.net Git - openldap/commitdiff
s/enable-unix/enable-local/
authorKurt Zeilenga <kurt@openldap.org>
Sun, 9 Jul 2000 21:49:36 +0000 (21:49 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sun, 9 Jul 2000 21:49:36 +0000 (21:49 +0000)
s/LDAP_PF_UNIX/LDAP_PF_LOCAL/
s/AF_UNIX/AF_LOCAL/
s/PF_UNIX/PF_LOCAL/

configure
configure.in
include/ac/socket.h
include/portable.h.in
libraries/libldap/open.c
libraries/libldap/os-local.c
servers/slapd/connection.c
servers/slapd/daemon.c

index 9ee0c9f66b306a39ca605a5aa25ee61fe7741f0f..bfcffb940e349bbcaa8d783158d7fda84a1df7f7 100755 (executable)
--- a/configure
+++ b/configure
@@ -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
index b7ceb8c6664c504d08e1b8a8d8e829af34d7d46e..7023dbc4a4d7caf7ba58084367d469d001510293 100644 (file)
@@ -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])
index 81b4895e8cb5b7b2a67134a04bc95b5163e2f34a..027ed88765844d1b77938427e331dba9a40201b9 100644 (file)
@@ -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_ */
index b93bfe4b12c4b9c2c7c0159c27084eed4810ce3e..516629d4eb113304b5df55f0015ba3156ba92a08 100644 (file)
 /* 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
index f0a5a593df419905dd890d0f6e3f814e22145b91..2c9fafb669ff9bb3703c29f12730a7981dd3615e 100644 (file)
@@ -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;
index 89d4278e185693a4ff8a97bf883f139f569d9e69..6ccb1f4bd7b7c75474dd4046e5014fec77d8df25 100644 (file)
@@ -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 */
index a86d9b0f377aa0b08c8096e430144372508c76fe..adadffe8fc266b9826e65f525bab497e1c8da1be 100644 (file)
@@ -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;
index 88dcd60d4694c547108b7cc8cb88be7c4a156934..8c496ab0bc93274c4dd7c7eac0a6b6832a8a154c 100644 (file)
@@ -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;
                }