summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/bind/bin/named-bootconf/test.boot30
-rw-r--r--contrib/bind/include/netgroup.h17
-rw-r--r--contrib/bind/lib/inet/inet_data.c44
-rw-r--r--contrib/bind/lib/isc/hex.c116
-rw-r--r--contrib/bzip2/FREEBSD-upgrade32
-rw-r--r--contrib/diff/sdiff.c121
6 files changed, 95 insertions, 265 deletions
diff --git a/contrib/bind/bin/named-bootconf/test.boot b/contrib/bind/bin/named-bootconf/test.boot
deleted file mode 100644
index 2b001e4ab041..000000000000
--- a/contrib/bind/bin/named-bootconf/test.boot
+++ /dev/null
@@ -1,30 +0,0 @@
-directory /var/named
-forwarders 1.2.3.4 1.2.3.5
-limit datasize 10000000
-limit files 1000
-limit transfers-in 100
-limit transfers-per-ns 20
-; no-round-robin in HP specific
-options no-round-robin fake-iquery forward-only no-fetch-glue no-recursion
-slave
-tcplist 10.0.0.1
-xfrnets 10.0.0.2
-cache . rootservers
-primary example.net example.net.db
-secondary example.com 127.0.0.1 example.com.db
-stub example.org 127.0.0.1 example.org.db
-primary/IN example.net example.net.db
-secondary/IN example.com 127.0.0.1 example.com.db
-stub/IN example.org 127.0.0.1 example.org.db
-secondary/IN example.com 127.0.0.1
-stub/IN example.org 127.0.0.1
-primary/CHAOS example.net example.net.db
-secondary/CHAOS example.com 127.0.0.1 example.com.db
-stub/CHAOS example.org 127.0.0.1 example.org.db
-secondary/CHAOS example.com 127.0.0.1
-stub/CHAOS example.org 127.0.0.1
-primary/HS example.net example.net.db
-secondary/HS example.com 127.0.0.1 example.com.db
-stub/HS example.org 127.0.0.1 example.org.db
-secondary/HS example.com 127.0.0.1
-stub/HS example.org 127.0.0.1
diff --git a/contrib/bind/include/netgroup.h b/contrib/bind/include/netgroup.h
deleted file mode 100644
index 30efb9414413..000000000000
--- a/contrib/bind/include/netgroup.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef netgroup_h
-#define netgroup_h
-
-int getnetgrent(const char **machinep, const char **userp,
- const char **domainp);
-
-int getnetgrent_r(char **machinep, char **userp, char **domainp,
- char *buffer, int buflen);
-
-void setnetgrent(const char *netgroup);
-
-void endnetgrent(void);
-
-int innetgr(const char *netgroup, const char *machine,
- const char *user, const char *domain);
-
-#endif
diff --git a/contrib/bind/lib/inet/inet_data.c b/contrib/bind/lib/inet/inet_data.c
deleted file mode 100644
index 47b6d9bf6579..000000000000
--- a/contrib/bind/lib/inet/inet_data.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 1995-1999 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$Id: inet_data.c,v 1.2 2001/06/20 22:06:36 marka Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#include "port_before.h"
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <arpa/nameser.h>
-
-#include <ctype.h>
-#include <netdb.h>
-#include <resolv.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "port_after.h"
-
-const struct in6_addr isc_in6addr_any = IN6ADDR_ANY_INIT;
-const struct in6_addr isc_in6addr_loopback = IN6ADDR_LOOPBACK_INIT;
diff --git a/contrib/bind/lib/isc/hex.c b/contrib/bind/lib/isc/hex.c
deleted file mode 100644
index 223979629896..000000000000
--- a/contrib/bind/lib/isc/hex.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2001 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#include <port_before.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <string.h>
-#include <isc/misc.h>
-#include <port_after.h>
-
-static const char hex[17] = "0123456789abcdef";
-
-int
-isc_gethexstring(unsigned char *buf, size_t len, int count, FILE *fp,
- int *multiline)
-{
- int c, n;
- unsigned char x;
- char *s;
- int result = count;
-
- x = 0; /* silence compiler */
- n = 0;
- while (count > 0) {
- c = fgetc(fp);
-
- if ((c == EOF) ||
- (c == '\n' && !*multiline) ||
- (c == '(' && *multiline) ||
- (c == ')' && !*multiline))
- goto formerr;
- /* comment */
- if (c == ';') {
- while ((c = fgetc(fp)) != EOF && c != '\n')
- /* empty */
- if (c == '\n' && *multiline)
- continue;
- goto formerr;
- }
- /* white space */
- if (c == ' ' || c == '\t' || c == '\n' || c == '\r')
- continue;
- /* multiline */
- if ('(' == c || c == ')') {
- *multiline = (c == '(' /*)*/);
- continue;
- }
- if ((s = strchr(hex, tolower(c))) == NULL)
- goto formerr;
- x = (x<<4) | (s - hex);
- if (++n == 2) {
- if (len > 0) {
- *buf++ = x;
- len--;
- } else
- result = -1;
- count--;
- n = 0;
- }
- }
- return (result);
-
- formerr:
- if (c == '\n')
- ungetc(c, fp);
- return (-1);
-}
-
-void
-isc_puthexstring(FILE *fp, const unsigned char *buf, size_t buflen,
- size_t len1, size_t len2, const char *sep)
-{
- size_t i = 0;
-
- if (len1 < 4)
- len1 = 4;
- if (len2 < 4)
- len2 = 4;
- while (buflen > 0) {
- fputc(hex[(buf[0]>>4)&0xf], fp);
- fputc(hex[buf[0]&0xf], fp);
- i += 2;
- buflen--;
- buf++;
- if (i >= len1 && sep != NULL) {
- fputs(sep, fp);
- i = 0;
- len1 = len2;
- }
- }
-}
-
-void
-isc_tohex(const unsigned char *buf, size_t buflen, char *t) {
- while (buflen > 0) {
- *t++ = hex[(buf[0]>>4)&0xf];
- *t++ = hex[buf[0]&0xf];
- buf++;
- buflen--;
- }
- *t = '\0';
-}
diff --git a/contrib/bzip2/FREEBSD-upgrade b/contrib/bzip2/FREEBSD-upgrade
deleted file mode 100644
index eebf2febc34d..000000000000
--- a/contrib/bzip2/FREEBSD-upgrade
+++ /dev/null
@@ -1,32 +0,0 @@
-$FreeBSD$
-
-Julian Seward's bzip2
- originals can be found at: http://sources.redhat.com/bzip2/
-
-Imported by:
-
- cvs import -m "Virgin import (trimmed) of Bzip2 version 1.0.2." \
- src/contrib/bzip2 BZIP2 v1_0_2
-
-Notes:
- 1. The following log shows details of trimming:
-
- $ tar xvfz bzip2-1.0.2.tar.gz
- $ cd bzip2-1.0.2
- $ rm bzdiff bzdiff.1 bzgrep bzgrep.1 bzip2.1.preformatted bzip2.txt
- $ rm bzmore bzmore.1 dlltest.dsp libbz2.dsp manual.html manual.pdf
- $ rm manual.ps manual_1.html manual_2.html manual_3.html manual_4.html
- $ rm manual_abt.html manual_ovr.html manual_toc.html mk251.c
- $ uuencode sample1.bz2 sample1.bz2 > sample1.bz2.uu
- $ uuencode sample2.bz2 sample2.bz2 > sample2.bz2.uu
- $ uuencode sample3.bz2 sample3.bz2 > sample3.bz2.uu
- $ gzip -9 sample1.ref sample2.ref sample3.ref
- $ uuencode sample1.ref.gz sample1.ref.gz > sample1.ref.gz.uu
- $ uuencode sample2.ref.gz sample2.ref.gz > sample2.ref.gz.uu
- $ uuencode sample3.ref.gz sample3.ref.gz > sample3.ref.gz.uu
- $ rm sample1.bz2 sample1.ref.gz sample2.bz2 sample2.ref.gz
- $ rm sample3.bz2 sample3.ref.gz
-
-
-sobomax@FreeBSD.org
-1 February 2002
diff --git a/contrib/diff/sdiff.c b/contrib/diff/sdiff.c
index 83f3ac025177..b64f1d038365 100644
--- a/contrib/diff/sdiff.c
+++ b/contrib/diff/sdiff.c
@@ -19,11 +19,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* GNU SDIFF was written by Thomas Lord. */
-#ifndef lint
-static const char rcsid[] =
-"$FreeBSD$";
-#endif /* not lint */
-
#include "system.h"
#include <stdio.h>
#include <signal.h>
@@ -87,6 +82,19 @@ static void try_help PARAMS((char const *));
static void untrapsig PARAMS((int));
static void usage PARAMS((void));
+/* this lossage until the gnu libc conquers the universe */
+#if HAVE_TMPNAM
+#define private_tempnam() tmpnam ((char *) 0)
+#else
+#ifndef PVT_tmpdir
+#define PVT_tmpdir "/tmp"
+#endif
+#ifndef TMPDIR_ENV
+#define TMPDIR_ENV "TMPDIR"
+#endif
+static char *private_tempnam PARAMS((void));
+static int exists PARAMS((char const *));
+#endif
static int diraccess PARAMS((char const *));
/* Options: */
@@ -927,29 +935,13 @@ edit (left, lenl, right, lenr, outfile)
case 'q':
return 0;
case 'e':
- {
- int tfd;
- FILE *tmp;
+ if (! tmpname && ! (tmpname = private_tempnam ()))
+ perror_fatal ("temporary file name");
- if (tmpmade)
- {
- unlink (tmpname);
- tmpmade = 0;
- free (tmpname);
- }
+ tmpmade = 1;
- asprintf (&tmpname, "%s/sdiff.XXXXXX",
- getenv("TMPDIR") ?: P_tmpdir);
- if (tmpname == NULL)
- perror_fatal ("temporary file name");
- tfd = mkstemp(tmpname);
- if (tfd == -1)
- perror_fatal ("temporary file name");
- tmp = fdopen (tfd, "w+");
- if (tmp == NULL)
- perror_fatal ("temporary file name");
-
- tmpmade = 1;
+ {
+ FILE *tmp = ck_fopen (tmpname, "w+");
if (cmd1 == 'l' || cmd1 == 'b')
lf_copy (left, lenl, tmp);
@@ -1109,3 +1101,80 @@ diraccess (dir)
struct stat buf;
return stat (dir, &buf) == 0 && S_ISDIR (buf.st_mode);
}
+
+#if ! HAVE_TMPNAM
+
+/* Return zero if we know that FILE does not exist. */
+static int
+exists (file)
+ char const *file;
+{
+ struct stat buf;
+ return stat (file, &buf) == 0 || errno != ENOENT;
+}
+
+/* These are the characters used in temporary filenames. */
+static char const letters[] =
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+
+/* Generate a temporary filename and return it (in a newly allocated buffer).
+ Use the prefix "dif" as in tempnam.
+ This goes through a cyclic pattern of all possible
+ filenames consisting of five decimal digits of the current pid and three
+ of the characters in `letters'. Each potential filename is
+ tested for an already-existing file of the same name, and no name of an
+ existing file will be returned. When the cycle reaches its end
+ return 0. */
+static char *
+private_tempnam ()
+{
+ char const *dir = getenv (TMPDIR_ENV);
+ static char const tmpdir[] = PVT_tmpdir;
+ size_t index;
+ char *buf;
+ pid_t pid = getpid ();
+ size_t dlen;
+
+ if (!dir)
+ dir = tmpdir;
+
+ dlen = strlen (dir);
+
+ /* Remove trailing slashes from the directory name. */
+ while (dlen && dir[dlen - 1] == '/')
+ --dlen;
+
+ buf = xmalloc (dlen + 1 + 3 + 5 + 1 + 3 + 1);
+
+ sprintf (buf, "%.*s/.", (int) dlen, dir);
+ if (diraccess (buf))
+ {
+ for (index = 0;
+ index < ((sizeof (letters) - 1) * (sizeof (letters) - 1)
+ * (sizeof (letters) - 1));
+ ++index)
+ {
+ /* Construct a file name and see if it already exists.
+
+ We use a single counter in INDEX to cycle each of three
+ character positions through each of 62 possible letters. */
+
+ sprintf (buf, "%.*s/dif%.5lu.%c%c%c", (int) dlen, dir,
+ (unsigned long) pid % 100000,
+ letters[index % (sizeof (letters) - 1)],
+ letters[(index / (sizeof (letters) - 1))
+ % (sizeof (letters) - 1)],
+ letters[index / ((sizeof (letters) - 1) *
+ (sizeof (letters) - 1))]);
+
+ if (!exists (buf))
+ return buf;
+ }
+ errno = EEXIST;
+ }
+
+ /* Don't free buf; `free' might change errno. We'll exit soon anyway. */
+ return 0;
+}
+
+#endif /* ! HAVE_TMPNAM */