mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-28 12:57:50 +00:00
Fix inet_ntop() replacement on older systems without it.
We only expose the prototype for net_ifs.c due to the use of socklen_t.
This commit is contained in:
parent
7dc2c8fa1c
commit
d0cc4d9e4b
14
configure
vendored
14
configure
vendored
@ -19216,6 +19216,20 @@ $as_echo "no" >&6; }
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
LIBS="$OLIBS"
|
LIBS="$OLIBS"
|
||||||
|
if test X"$found" != X"true"; then
|
||||||
|
case " $LIBOBJS " in
|
||||||
|
*" inet_ntop.$ac_objext "* ) ;;
|
||||||
|
*) LIBOBJS="$LIBOBJS inet_ntop.$ac_objext"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
for _sym in sudo_inet_ntop; do
|
||||||
|
COMPAT_EXP="${COMPAT_EXP}${_sym}
|
||||||
|
"
|
||||||
|
done
|
||||||
|
|
||||||
|
fi
|
||||||
OLIBS="$LIBS"
|
OLIBS="$LIBS"
|
||||||
LIBS="${LIBS} ${NET_LIBS}"
|
LIBS="${LIBS} ${NET_LIBS}"
|
||||||
found=false
|
found=false
|
||||||
|
@ -2686,6 +2686,10 @@ AC_CHECK_FUNC(inet_ntop, [
|
|||||||
done
|
done
|
||||||
])
|
])
|
||||||
LIBS="$OLIBS"
|
LIBS="$OLIBS"
|
||||||
|
if test X"$found" != X"true"; then
|
||||||
|
AC_LIBOBJ(inet_ntop)
|
||||||
|
SUDO_APPEND_COMPAT_EXP(sudo_inet_ntop)
|
||||||
|
fi
|
||||||
dnl
|
dnl
|
||||||
dnl If inet_pton(3) not in libc, check -lnsl and -linet
|
dnl If inet_pton(3) not in libc, check -lnsl and -linet
|
||||||
dnl May need to link with *both* -lnsl and -lsocket due to unresolved symbols
|
dnl May need to link with *both* -lnsl and -lsocket due to unresolved symbols
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
* Materiel Command, USAF, under agreement number F39502-99-1-0512.
|
* Materiel Command, USAF, under agreement number F39502-99-1-0512.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SUDO_MISSING_H
|
#ifndef _SUDO_COMPAT_H
|
||||||
#define _SUDO_MISSING_H
|
#define _SUDO_COMPAT_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#ifdef STDC_HEADERS
|
#ifdef STDC_HEADERS
|
||||||
@ -467,6 +467,11 @@ __dso_public int sudo_clock_gettime(clockid_t clock_id, struct timespec *tp);
|
|||||||
# undef clock_gettime
|
# undef clock_gettime
|
||||||
# define clock_gettime(_a, _b) sudo_clock_gettime((_a), (_b))
|
# define clock_gettime(_a, _b) sudo_clock_gettime((_a), (_b))
|
||||||
#endif /* HAVE_CLOCK_GETTIME */
|
#endif /* HAVE_CLOCK_GETTIME */
|
||||||
|
#if !defined(HAVE_INET_NTOP) && defined(_SUDO_NET_IFS_C)
|
||||||
|
__dso_public char *sudo_inet_ntop(int af, const void *src, char *dst, socklen_t size);
|
||||||
|
# undef inet_ntop
|
||||||
|
# define inet_ntop(_a, _b, _c, _d) sudo_inet_ntop((_a), (_b), (_c), (_d))
|
||||||
|
#endif /* HAVE_INET_NTOP */
|
||||||
#ifndef HAVE_INET_PTON
|
#ifndef HAVE_INET_PTON
|
||||||
__dso_public int sudo_inet_pton(int af, const char *src, void *dst);
|
__dso_public int sudo_inet_pton(int af, const char *src, void *dst);
|
||||||
# undef inet_pton
|
# undef inet_pton
|
||||||
@ -478,4 +483,4 @@ __dso_public const char *sudo_getprogname(void);
|
|||||||
# define getprogname() sudo_getprogname()
|
# define getprogname() sudo_getprogname()
|
||||||
#endif /* HAVE_GETPROGNAME */
|
#endif /* HAVE_GETPROGNAME */
|
||||||
|
|
||||||
#endif /* _SUDO_MISSING_H */
|
#endif /* _SUDO_COMPAT_H */
|
||||||
|
@ -211,7 +211,7 @@ inet_ntop6(const unsigned char *src, char *dst, socklen_t size)
|
|||||||
* Paul Vixie, 1996.
|
* Paul Vixie, 1996.
|
||||||
*/
|
*/
|
||||||
const char *
|
const char *
|
||||||
inet_ntop(int af, const void *src, char *dst, socklen_t size)
|
sudo_inet_ntop(int af, const void *src, char *dst, socklen_t size)
|
||||||
{
|
{
|
||||||
switch (af) {
|
switch (af) {
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
|
@ -84,6 +84,8 @@ struct rtentry;
|
|||||||
# include <ifaddrs.h>
|
# include <ifaddrs.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define _SUDO_NET_IFS_C /* to expose sudo_inet_ntop in sudo_compat.h */
|
||||||
|
|
||||||
#define DEFAULT_TEXT_DOMAIN "sudo"
|
#define DEFAULT_TEXT_DOMAIN "sudo"
|
||||||
#include "sudo_gettext.h" /* must be included before sudo_compat.h */
|
#include "sudo_gettext.h" /* must be included before sudo_compat.h */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user