From bc0d62db237daa53b3cd2d15b7d4f2fdc0c1dda7 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 27 Mar 2021 10:28:52 +0000 Subject: [PATCH] Revert "ITS#8847 more fallout from ldap_pvt_sockaddrstr move" This reverts commit f2ddf89e3cbe2ba65728cfc7b4c022d72192f442. Move Sockaddr def to ac/socket.h instead. --- include/ac/socket.h | 12 ++++++++++++ include/ldap_pvt.h | 17 +---------------- libraries/liblber/debug.c | 1 + libraries/libldap/ftest.c | 1 - libraries/liblutil/passwd.c | 1 - libraries/liblutil/sasl.c | 1 - 6 files changed, 14 insertions(+), 19 deletions(-) diff --git a/include/ac/socket.h b/include/ac/socket.h index 2b669e9af7..f4ce3648e1 100644 --- a/include/ac/socket.h +++ b/include/ac/socket.h @@ -234,6 +234,18 @@ LDAP_LUTIL_F( int ) lutil_getpeereid( int s, uid_t *, gid_t * ); #define LUTIL_GETPEEREID( s, uid, gid, bv ) lutil_getpeereid( s, uid, gid ) #endif +typedef union Sockaddr { + struct sockaddr sa_addr; + struct sockaddr_in sa_in_addr; +#ifdef LDAP_PF_INET6 + struct sockaddr_storage sa_storage; + struct sockaddr_in6 sa_in6_addr; +#endif +#ifdef LDAP_PF_LOCAL + struct sockaddr_un sa_un_addr; +#endif +} Sockaddr; + /* DNS RFC defines max host name as 255. New systems seem to use 1024 */ #ifndef NI_MAXHOST #define NI_MAXHOST 256 diff --git a/include/ldap_pvt.h b/include/ldap_pvt.h index adee63c84a..3e8ad8e976 100644 --- a/include/ldap_pvt.h +++ b/include/ldap_pvt.h @@ -178,22 +178,7 @@ ldap_pvt_get_hname LDAP_P(( #define LDAP_IPADDRLEN sizeof("IP=255.255.255.255:65336") #endif -struct sockaddr_in; -struct sockaddr_in6; -struct sockaddr_storage; -struct sockaddr_un; - -typedef union Sockaddr { - struct sockaddr sa_addr; - struct sockaddr_in sa_in_addr; -#ifdef LDAP_PF_INET6 - struct sockaddr_storage sa_storage; - struct sockaddr_in6 sa_in6_addr; -#endif -#ifdef LDAP_PF_LOCAL - struct sockaddr_un sa_un_addr; -#endif -} Sockaddr; +typedef union Sockaddr Sockaddr; LDAP_F (void) ldap_pvt_sockaddrstr LDAP_P(( diff --git a/libraries/liblber/debug.c b/libraries/liblber/debug.c index f133f80e4b..7d1f772ad3 100644 --- a/libraries/liblber/debug.c +++ b/libraries/liblber/debug.c @@ -30,6 +30,7 @@ #include "ldap_log.h" #include "ldap_defaults.h" #include "lber.h" +#include "ldap_pvt.h" static FILE *log_file = NULL; static int debug_lastc = '\n'; diff --git a/libraries/libldap/ftest.c b/libraries/libldap/ftest.c index fd3c6a5905..c0952b533c 100644 --- a/libraries/libldap/ftest.c +++ b/libraries/libldap/ftest.c @@ -19,7 +19,6 @@ #include #include #include -#include #include diff --git a/libraries/liblutil/passwd.c b/libraries/liblutil/passwd.c index 379618f332..eb92f1b2b1 100644 --- a/libraries/liblutil/passwd.c +++ b/libraries/liblutil/passwd.c @@ -33,7 +33,6 @@ #include #include #include -#include #ifdef SLAPD_CRYPT # include diff --git a/libraries/liblutil/sasl.c b/libraries/liblutil/sasl.c index 9a71c2269d..e7531dd8c6 100644 --- a/libraries/liblutil/sasl.c +++ b/libraries/liblutil/sasl.c @@ -21,7 +21,6 @@ #include #include #include -#include #ifdef HAVE_SASL_SASL_H #include