Commit 2e6bef4a authored by Mark Andrews's avatar Mark Andrews

add centos7

parent bbb64955
image: "debian:sid"
variables: variables:
DEBIAN_FRONTEND: noninteractive DEBIAN_FRONTEND: noninteractive
LC_ALL: C.UTF-8
DOCKER_DRIVER: overlay2 DOCKER_DRIVER: overlay2
CI_REGISTRY_IMAGE: oerdnj/bind9
stages: stages:
- build - build
- test - test
build: .centos-centos7-amd64: &centos_centos7_amd64_image
image: "$CI_REGISTRY_IMAGE:centos-centos7-amd64"
variables:
LC_ALL: en_US.UTF-8
tags:
- linux
- docker
- amd64
.debian-sid-amd64: &debian_sid_amd64_image
image: "$CI_REGISTRY_IMAGE:debian-sid-amd64"
variables:
LC_ALL: C.UTF-8
image: "$CI_REGISTRY_IMAGE:debian-sid-amd64"
tags:
- linux
- docker
- amd64
.build: &build_job
stage: build stage: build
tags: tags:
- linux - linux
- docker - docker
before_script: before_script:
- apt-get update
- apt-get -y install autotools-dev build-essential autoconf automake libtool
- autoreconf -fi - autoreconf -fi
script: script:
- ./configure - ./configure
...@@ -27,12 +42,42 @@ build: ...@@ -27,12 +42,42 @@ build:
- config.log - config.log
- genreport - genreport
test: .test: &test_job
stage: test stage: test
tags: tags:
- linux - linux
- docker - docker
script: script:
- echo . f.root-servers.net | ./genreport - echo . f.root-servers.net | ./genreport
build:centos:centos7:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g -D_BSD_SOURCE"
before_script:
- autoreconf -fi
<<: *centos_centos7_amd64_image
<<: *build_job
build:debian:sid:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g"
before_script:
- apt-get update
- apt-get -y install autotools-dev build-essential autoconf automake libtool
- autoreconf -fi
<<: *debian_sid_amd64_image
<<: *build_job
test:centos:centos7:amd64:
<<: *centos_centos7_amd64_image
<<: *test_job
dependencies:
- build:centos:centos7:amd64
test:debian:sid:amd64:
<<: *debian_sid_amd64_image
<<: *test_job
dependencies: dependencies:
- build - build:debian:sid:amd64
This diff is collapsed.
#! /bin/sh #! /bin/sh
# Wrapper for compilers which do not understand '-c -o'. # Wrapper for compilers which do not understand '-c -o'.
scriptversion=2016-01-11.22; # UTC scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2017 Free Software Foundation, Inc. # Copyright (C) 1999-2018 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>. # Written by Tom Tromey <tromey@cygnus.com>.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
...@@ -17,7 +17,7 @@ scriptversion=2016-01-11.22; # UTC ...@@ -17,7 +17,7 @@ scriptversion=2016-01-11.22; # UTC
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
...@@ -340,7 +340,7 @@ exit $ret ...@@ -340,7 +340,7 @@ exit $ret
# Local Variables: # Local Variables:
# mode: shell-script # mode: shell-script
# sh-indentation: 2 # sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp) # eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion=" # time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0" # time-stamp-time-zone: "UTC0"
......
...@@ -5,7 +5,6 @@ AC_PROG_CC_C99 ...@@ -5,7 +5,6 @@ AC_PROG_CC_C99
AC_CONFIG_SRCDIR([genreport.c]) AC_CONFIG_SRCDIR([genreport.c])
AC_CONFIG_HEADER([config.h]) AC_CONFIG_HEADER([config.h])
AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([Makefile])
AC_USE_SYSTEM_EXTENSIONS
AC_CANONICAL_HOST AC_CANONICAL_HOST
AC_SEARCH_LIBS([res_mkquery],[resolv bind]) AC_SEARCH_LIBS([res_mkquery],[resolv bind])
AC_SEARCH_LIBS([res_9_mkquery],[resolv bind]) AC_SEARCH_LIBS([res_9_mkquery],[resolv bind])
......
#! /bin/sh #! /bin/sh
# depcomp - compile a program generating dependencies as side-effects # depcomp - compile a program generating dependencies as side-effects
scriptversion=2016-01-11.22; # UTC scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2017 Free Software Foundation, Inc. # Copyright (C) 1999-2018 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
...@@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC ...@@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC
# GNU General Public License for more details. # GNU General Public License for more details.
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
...@@ -783,7 +783,7 @@ exit 0 ...@@ -783,7 +783,7 @@ exit 0
# Local Variables: # Local Variables:
# mode: shell-script # mode: shell-script
# sh-indentation: 2 # sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp) # eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion=" # time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0" # time-stamp-time-zone: "UTC0"
......
...@@ -8,9 +8,11 @@ ...@@ -8,9 +8,11 @@
#define FD_SETSIZE 1600 #define FD_SETSIZE 1600
#include <config.h> #ifndef _BSD_SOURCE
#define _BSD_SOURCE 1
#endif
#define __FAVOR_BSD 1 #include <config.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
...@@ -559,7 +561,7 @@ struct summary { ...@@ -559,7 +561,7 @@ struct summary {
char ns[1024]; /* the server's name */ char ns[1024]; /* the server's name */
struct sockaddr_storage storage;/* server we are talking to */ struct sockaddr_storage storage;/* server we are talking to */
int tests; /* number of outstanding tests */ int tests; /* number of outstanding tests */
int last; /* last test sent */ unsigned int last; /* last test sent */
int deferred; /* was the printing deferred */ int deferred; /* was the printing deferred */
int done; /* we are done */ int done; /* we are done */
int type; /* recursive query lookup type */ int type; /* recursive query lookup type */
...@@ -582,7 +584,7 @@ struct summary { ...@@ -582,7 +584,7 @@ struct summary {
int allrefused; /* all answers are current ok */ int allrefused; /* all answers are current ok */
int allservfail; /* all answers are current ok */ int allservfail; /* all answers are current ok */
struct summary *xlink; /* cross link of recursive A/AAAA */ struct summary *xlink; /* cross link of recursive A/AAAA */
int nsidlen; unsigned int nsidlen;
char nsid[100]; /* nsid if found */ char nsid[100]; /* nsid if found */
char results[sizeof(opts)/sizeof(opts[0])][100]; char results[sizeof(opts)/sizeof(opts[0])][100];
}; };
...@@ -883,7 +885,7 @@ printandfree(struct summary *summary) { ...@@ -883,7 +885,7 @@ printandfree(struct summary *summary) {
} }
printf(" %s=%s", opts[i].name, summary->results[i]); printf(" %s=%s", opts[i].name, summary->results[i]);
} }
if (printnsid && summary->nsidlen != 0) { if (printnsid && summary->nsidlen != 0U) {
printf(" ("); printf(" (");
for (i = 0; i < summary->nsidlen; i++) { for (i = 0; i < summary->nsidlen; i++) {
if (isprint(summary->nsid[i] & 0xff)) if (isprint(summary->nsid[i] & 0xff))
...@@ -1109,7 +1111,8 @@ static void ...@@ -1109,7 +1111,8 @@ static void
dotest(struct workitem *item) { dotest(struct workitem *item) {
unsigned char *cp; unsigned char *cp;
unsigned int ttl; unsigned int ttl;
int n, fd, id, tries = 0, opcode; int n, fd, id, tries = 0;
unsigned int opcode;
socklen_t ss_len; socklen_t ss_len;
...@@ -1644,7 +1647,8 @@ process(struct workitem *item, unsigned char *buf, int buflen) { ...@@ -1644,7 +1647,8 @@ process(struct workitem *item, unsigned char *buf, int buflen) {
unsigned int i, id, qr, aa, tc, rd, ra, z, ad, cd; unsigned int i, id, qr, aa, tc, rd, ra, z, ad, cd;
unsigned int qrcount, ancount, aucount, adcount; unsigned int qrcount, ancount, aucount, adcount;
unsigned int opcode, rcode; unsigned int opcode, rcode;
unsigned int type, ednssize = 0, class, ednsttl = 0, ttl, rdlen; unsigned int ednssize = 0, class, ednsttl = 0, ttl, rdlen;
unsigned short type;
unsigned char *cp, *eom; unsigned char *cp, *eom;
int seenopt = 0, seensoa = 0, seenrrsig = 0; int seenopt = 0, seensoa = 0, seenrrsig = 0;
int seennsid = 0, seenecs = 0, seenexpire = 0, seencookie = 0; int seennsid = 0, seenecs = 0, seenexpire = 0, seencookie = 0;
...@@ -1846,7 +1850,7 @@ process(struct workitem *item, unsigned char *buf, int buflen) { ...@@ -1846,7 +1850,7 @@ process(struct workitem *item, unsigned char *buf, int buflen) {
{ {
struct summary *summarya, *summaryaaaa; struct summary *summarya, *summaryaaaa;
n = dn_expand(buf, eom, cp, ns, sizeof(ns)); n = dn_expand(buf, eom, cp, ns, sizeof(ns));
if (n != rdlen) if (n < 0 || (size_t)n != rdlen)
goto err; goto err;
item->summary->done = 1; item->summary->done = 1;
/* /*
...@@ -1981,16 +1985,18 @@ process(struct workitem *item, unsigned char *buf, int buflen) { ...@@ -1981,16 +1985,18 @@ process(struct workitem *item, unsigned char *buf, int buflen) {
testname = opts[item->test].name; testname = opts[item->test].name;
else else
testname = ""; testname = "";
printf("id=%-5u %-9s opcode=%u rcode=%u aa=%u tc=%u rd=%u " printf("id=%-5u %-9s opcode=%u rcode=%u qr=%u aa=%u tc=%u rd=%u "
"ra=%u z=%u ad=%u cd=%u qrcount=%u ancount=%u " "ra=%u z=%u ad=%u cd=%u qrcount=%u ancount=%u "
"aucount=%u adcount=%u\n" "aucount=%u adcount=%u\n"
"\tseensoa=%u seenrrsig=%u seenopt=%u " "\tseensoa=%u seenrrsig=%u seenopt=%u "
"seennsid=%u seenecs=%u seenexpire=%u seencookie=%u\n", "seennsid=%u seenecs=%u seenexpire=%u seencookie=%u\n"
"\tednsudpsize=%u\n",
id, testname, opcode, rcode, id, testname, opcode, rcode,
aa, tc, rd, ra, z, ad, cd, qr, aa, tc, rd, ra, z, ad, cd,
qrcount, ancount, aucount, adcount, qrcount, ancount, aucount, adcount,
seensoa, seenrrsig, seenopt, seensoa, seenrrsig, seenopt,
seennsid, seenecs, seenexpire, seencookie); seennsid, seenecs, seenexpire, seencookie,
ednssize);
} }
if (item->summary->type) { if (item->summary->type) {
...@@ -2368,6 +2374,8 @@ readstdin(int fd) { ...@@ -2368,6 +2374,8 @@ readstdin(int fd) {
char address[1204]; char address[1204];
int n; int n;
fd = fd; /* unused */
/* /*
* Too much outstanding work then wait to be called again. * Too much outstanding work then wait to be called again.
*/ */
...@@ -2447,9 +2455,9 @@ icmp4read(int fd) { ...@@ -2447,9 +2455,9 @@ icmp4read(int fd) {
hlen = icmp->icmp_ip.ip_hl << 2; hlen = icmp->icmp_ip.ip_hl << 2;
offset = offsetof(struct icmp, icmp_ip) + hlen; offset = offsetof(struct icmp, icmp_ip) + hlen;
if (icmp->icmp_ip.ip_p == IPPROTO_UDP && if (icmp->icmp_ip.ip_p == IPPROTO_UDP &&
n >= offset + sizeof(struct udphdr)) { (size_t)n >= offset + sizeof(struct udphdr)) {
udphdr = (struct udphdr *)&buf[offset]; udphdr = (struct udphdr *)&buf[offset];
if (n >= offset + sizeof(struct udphdr) + 2) { if ((size_t)n >= offset + sizeof(struct udphdr) + 2) {
msgdata = offset + sizeof(struct udphdr); msgdata = offset + sizeof(struct udphdr);
id = (buf[msgdata] << 8) + buf[msgdata + 1]; id = (buf[msgdata] << 8) + buf[msgdata + 1];
memset(&storage, 0, sizeof(storage)); memset(&storage, 0, sizeof(storage));
...@@ -2463,9 +2471,9 @@ icmp4read(int fd) { ...@@ -2463,9 +2471,9 @@ icmp4read(int fd) {
} }
} }
if (icmp->icmp_ip.ip_p == IPPROTO_TCP && if (icmp->icmp_ip.ip_p == IPPROTO_TCP &&
n >= offset + sizeof(struct tcphdr)) { (size_t)n >= offset + sizeof(struct tcphdr)) {
tcphdr = (struct tcphdr *)&buf[offset]; tcphdr = (struct tcphdr *)&buf[offset];
if (n >= offset + sizeof(struct tcphdr) + 4) { if ((size_t)n >= offset + sizeof(struct tcphdr) + 4) {
msgdata = offset + sizeof(struct tcphdr); msgdata = offset + sizeof(struct tcphdr);
id = (buf[msgdata + 2] << 8) + buf[msgdata + 3]; id = (buf[msgdata + 2] << 8) + buf[msgdata + 3];
memset(&storage, 0, sizeof(storage)); memset(&storage, 0, sizeof(storage));
...@@ -2534,9 +2542,9 @@ icmp4read(int fd) { ...@@ -2534,9 +2542,9 @@ icmp4read(int fd) {
hlen = icmp->icmp_ip.ip_hl << 2; hlen = icmp->icmp_ip.ip_hl << 2;
offset = offsetof(struct icmp, icmp_ip) + hlen; offset = offsetof(struct icmp, icmp_ip) + hlen;
if (icmp->icmp_ip.ip_p == IPPROTO_UDP && if (icmp->icmp_ip.ip_p == IPPROTO_UDP &&
n >= offset + sizeof(struct udphdr)) { (size_t)n >= offset + sizeof(struct udphdr)) {
udphdr = (struct udphdr *)&buf[offset]; udphdr = (struct udphdr *)&buf[offset];
if (n >= offset + sizeof(struct udphdr) + 2) { if ((size_t)n >= offset + sizeof(struct udphdr) + 2) {
msgdata = offset + sizeof(struct udphdr); msgdata = offset + sizeof(struct udphdr);
id = (buf[msgdata] << 8) + buf[msgdata + 1]; id = (buf[msgdata] << 8) + buf[msgdata + 1];
memset(&storage, 0, sizeof(storage)); memset(&storage, 0, sizeof(storage));
...@@ -2550,9 +2558,9 @@ icmp4read(int fd) { ...@@ -2550,9 +2558,9 @@ icmp4read(int fd) {
} }
} }
if (icmp->icmp_ip.ip_p == IPPROTO_TCP && if (icmp->icmp_ip.ip_p == IPPROTO_TCP &&
n >= offset + sizeof(struct tcphdr)) { (size_t)n >= offset + sizeof(struct tcphdr)) {
tcphdr = (struct tcphdr *)&buf[offset]; tcphdr = (struct tcphdr *)&buf[offset];
if (n >= offset + sizeof(struct tcphdr) + 4) { if ((size_t)n >= offset + sizeof(struct tcphdr) + 4) {
msgdata = offset + sizeof(struct tcphdr); msgdata = offset + sizeof(struct tcphdr);
id = (buf[msgdata + 2] << 8) + buf[msgdata + 3]; id = (buf[msgdata + 2] << 8) + buf[msgdata + 3];
memset(&storage, 0, sizeof(storage)); memset(&storage, 0, sizeof(storage));
...@@ -2634,9 +2642,9 @@ icmp6read(int fd) { ...@@ -2634,9 +2642,9 @@ icmp6read(int fd) {
offset += 8; offset += 8;
} }
if (nxt == IPPROTO_UDP && if (nxt == IPPROTO_UDP &&
n >= offset + sizeof(struct udphdr)) { (size_t)n >= offset + sizeof(struct udphdr)) {
udphdr = (struct udphdr *)&buf[offset]; udphdr = (struct udphdr *)&buf[offset];
if (n >= offset + sizeof(struct udphdr) + 2) { if ((size_t)n >= offset + sizeof(struct udphdr) + 2) {
msgdata = offset + sizeof(struct udphdr); msgdata = offset + sizeof(struct udphdr);
id = (buf[msgdata] << 8) + buf[msgdata + 1]; id = (buf[msgdata] << 8) + buf[msgdata + 1];
memset(&storage, 0, sizeof(storage)); memset(&storage, 0, sizeof(storage));
...@@ -2669,9 +2677,9 @@ icmp6read(int fd) { ...@@ -2669,9 +2677,9 @@ icmp6read(int fd) {
offset += 8; offset += 8;
} }
if (nxt == IPPROTO_UDP && if (nxt == IPPROTO_UDP &&
n >= offset + sizeof(struct udphdr)) { (size_t)n >= offset + sizeof(struct udphdr)) {
udphdr = (struct udphdr *)&buf[offset]; udphdr = (struct udphdr *)&buf[offset];
if (n >= offset + sizeof(struct udphdr) + 2) { if ((size_t)n >= offset + sizeof(struct udphdr) + 2) {
msgdata = offset + sizeof(struct udphdr); msgdata = offset + sizeof(struct udphdr);
id = (buf[msgdata] << 8) + buf[msgdata + 1]; id = (buf[msgdata] << 8) + buf[msgdata + 1];
memset(&storage, 0, sizeof(storage)); memset(&storage, 0, sizeof(storage));
...@@ -2685,9 +2693,9 @@ icmp6read(int fd) { ...@@ -2685,9 +2693,9 @@ icmp6read(int fd) {
} }
} }
if (nxt == IPPROTO_TCP && if (nxt == IPPROTO_TCP &&
n >= offset + sizeof(struct tcphdr)) { (size_t)n >= offset + sizeof(struct tcphdr)) {
tcphdr = (struct tcphdr *)&buf[offset]; tcphdr = (struct tcphdr *)&buf[offset];
if (n >= offset + sizeof(struct tcphdr) + 2) { if ((size_t)n >= offset + sizeof(struct tcphdr) + 2) {
msgdata = offset + sizeof(struct tcphdr); msgdata = offset + sizeof(struct tcphdr);
id = (buf[msgdata + 2] << 8) + buf[msgdata + 3]; id = (buf[msgdata + 2] << 8) + buf[msgdata + 3];
memset(&storage, 0, sizeof(storage)); memset(&storage, 0, sizeof(storage));
...@@ -2734,9 +2742,9 @@ icmp6read(int fd) { ...@@ -2734,9 +2742,9 @@ icmp6read(int fd) {
offset += 8; offset += 8;
} }
if (nxt == IPPROTO_UDP && if (nxt == IPPROTO_UDP &&
n >= offset + sizeof(struct udphdr)) { (size_t)n >= offset + sizeof(struct udphdr)) {
udphdr = (struct udphdr *)&buf[offset]; udphdr = (struct udphdr *)&buf[offset];
if (n >= offset + sizeof(struct udphdr) + 2) { if ((size_t)n >= offset + sizeof(struct udphdr) + 2) {
msgdata = offset + sizeof(struct udphdr); msgdata = offset + sizeof(struct udphdr);
id = (buf[msgdata] << 8) + buf[msgdata + 1]; id = (buf[msgdata] << 8) + buf[msgdata + 1];
memset(&storage, 0, sizeof(storage)); memset(&storage, 0, sizeof(storage));
...@@ -2750,9 +2758,9 @@ icmp6read(int fd) { ...@@ -2750,9 +2758,9 @@ icmp6read(int fd) {
} }
} }
if (nxt == IPPROTO_TCP && if (nxt == IPPROTO_TCP &&
n >= offset + sizeof(struct tcphdr)) { (size_t)n >= offset + sizeof(struct tcphdr)) {
tcphdr = (struct tcphdr *)&buf[offset]; tcphdr = (struct tcphdr *)&buf[offset];
if (n >= offset + sizeof(struct tcphdr) + 2) { if ((size_t)n >= offset + sizeof(struct tcphdr) + 2) {
msgdata = offset + sizeof(struct tcphdr); msgdata = offset + sizeof(struct tcphdr);
id = (buf[msgdata + 2] << 8) + buf[msgdata + 3]; id = (buf[msgdata + 2] << 8) + buf[msgdata + 3];
memset(&storage, 0, sizeof(storage)); memset(&storage, 0, sizeof(storage));
...@@ -2917,6 +2925,7 @@ static int stats; ...@@ -2917,6 +2925,7 @@ static int stats;
static void static void
info(int sig) { info(int sig) {
sig = sig; /* unused */
stats = 1; stats = 1;
} }
......
#!/bin/sh #!/bin/sh
# install - install a program, script, or datafile # install - install a program, script, or datafile
scriptversion=2016-01-11.22; # UTC scriptversion=2018-03-11.20; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was # This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the # later released in X11R6 (xc/config/util/install.sh) with the
...@@ -271,15 +271,18 @@ do ...@@ -271,15 +271,18 @@ do
fi fi
dst=$dst_arg dst=$dst_arg
# If destination is a directory, append the input filename; won't work # If destination is a directory, append the input filename.
# if double slashes aren't ignored.
if test -d "$dst"; then if test -d "$dst"; then
if test "$is_target_a_directory" = never; then if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2 echo "$0: $dst_arg: Is a directory" >&2
exit 1 exit 1
fi fi
dstdir=$dst dstdir=$dst
dst=$dstdir/`basename "$src"` dstbase=`basename "$src"`
case $dst in
*/) dst=$dst$dstbase;;
*) dst=$dst/$dstbase;;
esac
dstdir_status=0 dstdir_status=0
else else
dstdir=`dirname "$dst"` dstdir=`dirname "$dst"`
...@@ -288,6 +291,11 @@ do ...@@ -288,6 +291,11 @@ do
fi fi
fi fi
case $dstdir in
*/) dstdirslash=$dstdir;;
*) dstdirslash=$dstdir/;;
esac
obsolete_mkdir_used=false obsolete_mkdir_used=false
if test $dstdir_status != 0; then if test $dstdir_status != 0; then
...@@ -324,34 +332,43 @@ do ...@@ -324,34 +332,43 @@ do
# is incompatible with FreeBSD 'install' when (umask & 300) != 0. # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;; ;;
*) *)
# Note that $RANDOM variable is not portable (e.g. dash); Use it
# here however when possible just to lower collision chance.
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
# Because "mkdir -p" follows existing symlinks and we likely work
# directly in world-writeable /tmp, make sure that the '$tmpdir'
# directory is successfully created first before we actually test
# 'mkdir -p' feature.
if (umask $mkdir_umask && if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 $mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then then
if test -z "$dir_arg" || { if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m. # Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't. # other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"` test_tmpdir="$tmpdir/a"
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
case $ls_ld_tmpdir in case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;; d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;; d????-?--*) different_mode=755;;
*) false;; *) false;;
esac && esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && { $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"` ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
} }
} }
then posix_mkdir=: then posix_mkdir=:
fi fi
rmdir "$tmpdir/d" "$tmpdir" rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else else
# Remove any dirs left behind by ancient mkdir implementations. # Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi fi
trap '' 0;; trap '' 0;;
esac;; esac;;
...@@ -427,8 +444,8 @@ do ...@@ -427,8 +444,8 @@ do
else else
# Make a couple of temp file names in the proper directory. # Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_ dsttmp=${dstdirslash}_inst.$$_
rmtmp=$dstdir/_rm.$$_ rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit. # Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
...@@ -493,7 +510,7 @@ do ...@@ -493,7 +510,7 @@ do
done done
# Local variables: # Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp) # eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion=" # time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0" # time-stamp-time-zone: "UTC0"
......
#! /bin/sh #! /bin/sh
# Common wrapper for a few potentially missing GNU programs. # Common wrapper for a few potentially missing GNU programs.
scriptversion=2016-01-11.22; # UTC scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1996-2017 Free Software Foundation, Inc. # Copyright (C) 1996-2018 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
...@@ -17,7 +17,7 @@ scriptversion=2016-01-11.22; # UTC ...@@ -17,7 +17,7 @@ scriptversion=2016-01-11.22; # UTC
# GNU General Public License for more details. # GNU General Public License for more details.
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
...@@ -101,9 +101,9 @@ else ...@@ -101,9 +101,9 @@ else
exit $st exit $st
fi fi
perl_URL=http://www.perl.org/ perl_URL=https://www.perl.org/
flex_URL=http://flex.sourceforge.net/ flex_URL=https://github.com/westes/flex
gnu_software_URL=http://www.gnu.org/software gnu_software_URL=https://www.gnu.org/software
program_details () program_details ()
{ {
...@@ -207,7 +207,7 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \ ...@@ -207,7 +207,7 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \
exit $st exit $st
# Local variables: # Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp) # eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion=" # time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0" # time-stamp-time-zone: "UTC0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment