Remove support for obsolete ISC UNIX and MIPS RISC/OS systems.
They were getting in the way of net_its.c simplification.
This commit is contained in:
146
configure
vendored
146
configure
vendored
@@ -16732,152 +16732,6 @@ fi
|
|||||||
# lockf() is broken on the Hurd
|
# lockf() is broken on the Hurd
|
||||||
ac_cv_func_lockf=no
|
ac_cv_func_lockf=no
|
||||||
;;
|
;;
|
||||||
*-*-riscos*)
|
|
||||||
LIBS="${LIBS} -lsun -lbsd"
|
|
||||||
|
|
||||||
if test ${CPPFLAGS+y}
|
|
||||||
then :
|
|
||||||
|
|
||||||
case " $CPPFLAGS " in #(
|
|
||||||
*" -I/usr/include "*) :
|
|
||||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CPPFLAGS already contains -I/usr/include"; } >&5
|
|
||||||
(: CPPFLAGS already contains -I/usr/include) 2>&5
|
|
||||||
ac_status=$?
|
|
||||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
|
||||||
test $ac_status = 0; } ;; #(
|
|
||||||
*) :
|
|
||||||
|
|
||||||
as_fn_append CPPFLAGS " -I/usr/include"
|
|
||||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CPPFLAGS=\"\$CPPFLAGS\""; } >&5
|
|
||||||
(: CPPFLAGS="$CPPFLAGS") 2>&5
|
|
||||||
ac_status=$?
|
|
||||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
|
||||||
test $ac_status = 0; }
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
else $as_nop
|
|
||||||
|
|
||||||
CPPFLAGS=-I/usr/include
|
|
||||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CPPFLAGS=\"\$CPPFLAGS\""; } >&5
|
|
||||||
(: CPPFLAGS="$CPPFLAGS") 2>&5
|
|
||||||
ac_status=$?
|
|
||||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
|
||||||
test $ac_status = 0; }
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if test ${CPPFLAGS+y}
|
|
||||||
then :
|
|
||||||
|
|
||||||
case " $CPPFLAGS " in #(
|
|
||||||
*" -I/usr/include/bsd "*) :
|
|
||||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CPPFLAGS already contains -I/usr/include/bsd"; } >&5
|
|
||||||
(: CPPFLAGS already contains -I/usr/include/bsd) 2>&5
|
|
||||||
ac_status=$?
|
|
||||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
|
||||||
test $ac_status = 0; } ;; #(
|
|
||||||
*) :
|
|
||||||
|
|
||||||
as_fn_append CPPFLAGS " -I/usr/include/bsd"
|
|
||||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CPPFLAGS=\"\$CPPFLAGS\""; } >&5
|
|
||||||
(: CPPFLAGS="$CPPFLAGS") 2>&5
|
|
||||||
ac_status=$?
|
|
||||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
|
||||||
test $ac_status = 0; }
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
else $as_nop
|
|
||||||
|
|
||||||
CPPFLAGS=-I/usr/include/bsd
|
|
||||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CPPFLAGS=\"\$CPPFLAGS\""; } >&5
|
|
||||||
(: CPPFLAGS="$CPPFLAGS") 2>&5
|
|
||||||
ac_status=$?
|
|
||||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
|
||||||
test $ac_status = 0; }
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if test ${CPPFLAGS+y}
|
|
||||||
then :
|
|
||||||
|
|
||||||
case " $CPPFLAGS " in #(
|
|
||||||
*" -D_MIPS "*) :
|
|
||||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CPPFLAGS already contains -D_MIPS"; } >&5
|
|
||||||
(: CPPFLAGS already contains -D_MIPS) 2>&5
|
|
||||||
ac_status=$?
|
|
||||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
|
||||||
test $ac_status = 0; } ;; #(
|
|
||||||
*) :
|
|
||||||
|
|
||||||
as_fn_append CPPFLAGS " -D_MIPS"
|
|
||||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CPPFLAGS=\"\$CPPFLAGS\""; } >&5
|
|
||||||
(: CPPFLAGS="$CPPFLAGS") 2>&5
|
|
||||||
ac_status=$?
|
|
||||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
|
||||||
test $ac_status = 0; }
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
else $as_nop
|
|
||||||
|
|
||||||
CPPFLAGS=-D_MIPS
|
|
||||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CPPFLAGS=\"\$CPPFLAGS\""; } >&5
|
|
||||||
(: CPPFLAGS="$CPPFLAGS") 2>&5
|
|
||||||
ac_status=$?
|
|
||||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
|
||||||
test $ac_status = 0; }
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
: ${mansectsu='1m'}
|
|
||||||
: ${mansectform='4'}
|
|
||||||
;;
|
|
||||||
*-*-isc*)
|
|
||||||
|
|
||||||
if test ${CPPFLAGS+y}
|
|
||||||
then :
|
|
||||||
|
|
||||||
case " $CPPFLAGS " in #(
|
|
||||||
*" -D_ISC "*) :
|
|
||||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CPPFLAGS already contains -D_ISC"; } >&5
|
|
||||||
(: CPPFLAGS already contains -D_ISC) 2>&5
|
|
||||||
ac_status=$?
|
|
||||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
|
||||||
test $ac_status = 0; } ;; #(
|
|
||||||
*) :
|
|
||||||
|
|
||||||
as_fn_append CPPFLAGS " -D_ISC"
|
|
||||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CPPFLAGS=\"\$CPPFLAGS\""; } >&5
|
|
||||||
(: CPPFLAGS="$CPPFLAGS") 2>&5
|
|
||||||
ac_status=$?
|
|
||||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
|
||||||
test $ac_status = 0; }
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
else $as_nop
|
|
||||||
|
|
||||||
CPPFLAGS=-D_ISC
|
|
||||||
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CPPFLAGS=\"\$CPPFLAGS\""; } >&5
|
|
||||||
(: CPPFLAGS="$CPPFLAGS") 2>&5
|
|
||||||
ac_status=$?
|
|
||||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
|
||||||
test $ac_status = 0; }
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
ac_cv_search_crypt="-lcrypt"
|
|
||||||
|
|
||||||
shadow_funcs="getspnam"
|
|
||||||
shadow_libs="-lsec"
|
|
||||||
|
|
||||||
: ${mansectsu='1m'}
|
|
||||||
: ${mansectform='4'}
|
|
||||||
;;
|
|
||||||
*-*-sco*|*-sco-*)
|
*-*-sco*|*-sco-*)
|
||||||
shadow_funcs="getprpwnam"
|
shadow_funcs="getprpwnam"
|
||||||
shadow_libs="-lprot -lx"
|
shadow_libs="-lprot -lx"
|
||||||
|
18
configure.ac
18
configure.ac
@@ -2184,24 +2184,6 @@ case "$host" in
|
|||||||
# lockf() is broken on the Hurd
|
# lockf() is broken on the Hurd
|
||||||
ac_cv_func_lockf=no
|
ac_cv_func_lockf=no
|
||||||
;;
|
;;
|
||||||
*-*-riscos*)
|
|
||||||
LIBS="${LIBS} -lsun -lbsd"
|
|
||||||
AX_APPEND_FLAG([-I/usr/include], [CPPFLAGS])
|
|
||||||
AX_APPEND_FLAG([-I/usr/include/bsd], [CPPFLAGS])
|
|
||||||
AX_APPEND_FLAG([-D_MIPS], [CPPFLAGS])
|
|
||||||
: ${mansectsu='1m'}
|
|
||||||
: ${mansectform='4'}
|
|
||||||
;;
|
|
||||||
*-*-isc*)
|
|
||||||
AX_APPEND_FLAG([-D_ISC], [CPPFLAGS])
|
|
||||||
ac_cv_search_crypt="-lcrypt"
|
|
||||||
|
|
||||||
shadow_funcs="getspnam"
|
|
||||||
shadow_libs="-lsec"
|
|
||||||
|
|
||||||
: ${mansectsu='1m'}
|
|
||||||
: ${mansectform='4'}
|
|
||||||
;;
|
|
||||||
*-*-sco*|*-sco-*)
|
*-*-sco*|*-sco-*)
|
||||||
shadow_funcs="getprpwnam"
|
shadow_funcs="getprpwnam"
|
||||||
shadow_libs="-lprot -lx"
|
shadow_libs="-lprot -lx"
|
||||||
|
@@ -57,18 +57,6 @@ struct rtentry;
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#ifdef _ISC
|
|
||||||
# include <sys/stream.h>
|
|
||||||
# include <sys/sioctl.h>
|
|
||||||
# include <sys/stropts.h>
|
|
||||||
# define STRSET(cmd, param, len) {strioctl.ic_cmd=(cmd);\
|
|
||||||
strioctl.ic_dp=(param);\
|
|
||||||
strioctl.ic_timout=0;\
|
|
||||||
strioctl.ic_len=(len);}
|
|
||||||
#endif /* _ISC */
|
|
||||||
#ifdef _MIPS
|
|
||||||
# include <net/soioctl.h>
|
|
||||||
#endif /* _MIPS */
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#ifdef NEED_RESOLV_H
|
#ifdef NEED_RESOLV_H
|
||||||
@@ -277,7 +265,7 @@ get_net_ifs(char **addrinfo)
|
|||||||
lifn.lifn_count = 512;
|
lifn.lifn_count = 512;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate space for the interface buffer. */
|
/* Allocate and fill in the interface buffer. */
|
||||||
memset(&lifconf, 0, sizeof(lifconf));
|
memset(&lifconf, 0, sizeof(lifconf));
|
||||||
lifconf.lifc_len = lifn.lifn_count * sizeof(struct lifreq);
|
lifconf.lifc_len = lifn.lifn_count * sizeof(struct lifreq);
|
||||||
lifconf.lifc_buf = malloc(lifconf.lifc_len);
|
lifconf.lifc_buf = malloc(lifconf.lifc_len);
|
||||||
@@ -430,18 +418,15 @@ get_net_ifs(char **addrinfo)
|
|||||||
{
|
{
|
||||||
long ifr_tmpbuf[1024 / sizeof(long)];
|
long ifr_tmpbuf[1024 / sizeof(long)];
|
||||||
struct ifreq *ifr, *ifr_tmp = (struct ifreq *)ifr_tmpbuf;
|
struct ifreq *ifr, *ifr_tmp = (struct ifreq *)ifr_tmpbuf;
|
||||||
struct ifconf *ifconf;
|
struct ifconf ifconf;
|
||||||
struct sockaddr_in *sin;
|
struct sockaddr_in *sin;
|
||||||
# ifdef HAVE_STRUCT_IN6_ADDR
|
# ifdef HAVE_STRUCT_IN6_ADDR
|
||||||
struct sockaddr_in6 *sin6;
|
struct sockaddr_in6 *sin6;
|
||||||
# endif
|
# endif
|
||||||
char addrstr[INET6_ADDRSTRLEN], maskstr[INET6_ADDRSTRLEN];
|
char addrstr[INET6_ADDRSTRLEN], maskstr[INET6_ADDRSTRLEN];
|
||||||
int i, n, sock, sock4, sock6 = -1, num_interfaces = 0;
|
int i, n, sock, sock4, sock6 = -1, num_interfaces = 0;
|
||||||
size_t ailen, buflen = sizeof(struct ifconf) + BUFSIZ;
|
size_t ailen;
|
||||||
char *cp, *ifconf_buf = NULL;
|
char *cp, *ifconf_buf = NULL;
|
||||||
#ifdef _ISC
|
|
||||||
struct strioctl strioctl;
|
|
||||||
#endif /* _ISC */
|
|
||||||
debug_decl(get_net_ifs, SUDO_DEBUG_NETIF);
|
debug_decl(get_net_ifs, SUDO_DEBUG_NETIF);
|
||||||
|
|
||||||
if (!sudo_conf_probe_interfaces())
|
if (!sudo_conf_probe_interfaces())
|
||||||
@@ -457,48 +442,42 @@ get_net_ifs(char **addrinfo)
|
|||||||
/* Use INET6 socket with SIOCGIFCONF if possible (may not matter). */
|
/* Use INET6 socket with SIOCGIFCONF if possible (may not matter). */
|
||||||
sock = sock6 != -1 ? sock6 : sock4;
|
sock = sock6 != -1 ? sock6 : sock4;
|
||||||
|
|
||||||
/*
|
/* Get the size of the interface buffer (if possible). */
|
||||||
* Get interface configuration or return.
|
memset(&ifconf, 0, sizeof(ifconf));
|
||||||
*/
|
# if defined(SIOCGSIZIFCONF)
|
||||||
for (;;) {
|
if (ioctl(sock, SIOCGSIZIFCONF, &i) != -1) {
|
||||||
if ((ifconf_buf = malloc(buflen)) == NULL) {
|
ifconf.ifc_len = i;
|
||||||
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
|
}
|
||||||
"unable to allocate memory");
|
# elif defined(SIOCGIFNUM)
|
||||||
num_interfaces = -1;
|
if (ioctl(sock, SIOCGIFNUM, &i) != -1) {
|
||||||
goto done;
|
ifconf.ifc_len = sizeof(struct ifreq) * (i + 4);
|
||||||
}
|
}
|
||||||
ifconf = (struct ifconf *)ifconf_buf;
|
# endif
|
||||||
ifconf->ifc_len = buflen - sizeof(struct ifconf);
|
if (ifconf.ifc_len = 0)
|
||||||
ifconf->ifc_buf = (caddr_t)(ifconf_buf + sizeof(struct ifconf));
|
ifconf.ifc_len = sizeof(struct ifreq) * 512;
|
||||||
|
|
||||||
#ifdef _ISC
|
/* Allocate and fill in the interface buffer. */
|
||||||
STRSET(SIOCGIFCONF, (caddr_t)ifconf, buflen);
|
ifconf.ifc_buf = malloc(ifconf.ifc_len);
|
||||||
if (ioctl(sock, I_STR, (caddr_t)&strioctl) < 0)
|
if (ifconf.ifc_buf == NULL) {
|
||||||
#else
|
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
|
||||||
/* Note that some kernels return EINVAL if the buffer is too small */
|
"unable to allocate memory");
|
||||||
if (ioctl(sock, SIOCGIFCONF, ifconf) < 0 && errno != EINVAL)
|
num_interfaces = -1;
|
||||||
#endif /* _ISC */
|
goto done;
|
||||||
{
|
}
|
||||||
num_interfaces = -1;
|
if (ioctl(sock, SIOCGIFCONF, &ifconf) < 0) {
|
||||||
goto done;
|
num_interfaces = -1;
|
||||||
}
|
goto done;
|
||||||
|
|
||||||
/* Break out of loop if we have a big enough buffer. */
|
|
||||||
if (ifconf->ifc_len + sizeof(struct ifreq) < buflen)
|
|
||||||
break;
|
|
||||||
buflen += BUFSIZ;
|
|
||||||
free(ifconf_buf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allocate space for the maximum number of interfaces that could exist.
|
* Allocate space for the maximum number of interfaces that could exist.
|
||||||
* We walk the list for systems with sa_len in struct sockaddr.
|
* We walk the list for systems with sa_len in struct sockaddr.
|
||||||
*/
|
*/
|
||||||
for (i = 0, n = 0; i < ifconf->ifc_len; n++) {
|
for (i = 0, n = 0; i < ifconf.ifc_len; n++) {
|
||||||
/* Set i to the subscript of the next interface. */
|
/* Set i to the subscript of the next interface. */
|
||||||
i += sizeof(struct ifreq);
|
i += sizeof(struct ifreq);
|
||||||
#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
|
#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
|
||||||
ifr = (struct ifreq *)&ifconf->ifc_buf[i];
|
ifr = (struct ifreq *)&ifconf.ifc_buf[i];
|
||||||
if (ifr->ifr_addr.sa_len > sizeof(ifr->ifr_addr))
|
if (ifr->ifr_addr.sa_len > sizeof(ifr->ifr_addr))
|
||||||
i += ifr->ifr_addr.sa_len - sizeof(struct sockaddr);
|
i += ifr->ifr_addr.sa_len - sizeof(struct sockaddr);
|
||||||
#endif /* HAVE_STRUCT_SOCKADDR_SA_LEN */
|
#endif /* HAVE_STRUCT_SOCKADDR_SA_LEN */
|
||||||
@@ -515,9 +494,9 @@ get_net_ifs(char **addrinfo)
|
|||||||
*addrinfo = cp;
|
*addrinfo = cp;
|
||||||
|
|
||||||
/* For each interface, store the ip address and netmask. */
|
/* For each interface, store the ip address and netmask. */
|
||||||
for (i = 0; i < ifconf->ifc_len; ) {
|
for (i = 0; i < ifconf.ifc_len; ) {
|
||||||
/* Get a pointer to the current interface. */
|
/* Get a pointer to the current interface. */
|
||||||
ifr = (struct ifreq *)&ifconf->ifc_buf[i];
|
ifr = (struct ifreq *)&ifconf.ifc_buf[i];
|
||||||
|
|
||||||
/* Set i to the subscript of the next interface. */
|
/* Set i to the subscript of the next interface. */
|
||||||
i += sizeof(struct ifreq);
|
i += sizeof(struct ifreq);
|
||||||
@@ -579,12 +558,7 @@ get_net_ifs(char **addrinfo)
|
|||||||
/* Fetch and store the netmask. */
|
/* Fetch and store the netmask. */
|
||||||
memset(ifr_tmp, 0, sizeof(*ifr_tmp));
|
memset(ifr_tmp, 0, sizeof(*ifr_tmp));
|
||||||
memcpy(ifr_tmp->ifr_name, ifr->ifr_name, sizeof(ifr_tmp->ifr_name));
|
memcpy(ifr_tmp->ifr_name, ifr->ifr_name, sizeof(ifr_tmp->ifr_name));
|
||||||
#ifdef _ISC
|
|
||||||
STRSET(SIOCGIFNETMASK, (caddr_t)ifr_tmp, sizeof(*ifr_tmp));
|
|
||||||
if (ioctl(sock, I_STR, &strioctl) < 0)
|
|
||||||
#else
|
|
||||||
if (ioctl(sock, SIOCGIFNETMASK, ifr_tmp) < 0)
|
if (ioctl(sock, SIOCGIFNETMASK, ifr_tmp) < 0)
|
||||||
#endif /* _ISC */
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Convert the mask to string form. */
|
/* Convert the mask to string form. */
|
||||||
|
Reference in New Issue
Block a user