[Midnightbsd-cvs] src [11153] trunk/contrib/tcp_wrappers: sync with freebsd

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Wed Jun 27 08:48:23 EDT 2018


Revision: 11153
          http://svnweb.midnightbsd.org/src/?rev=11153
Author:   laffer1
Date:     2018-06-27 08:48:23 -0400 (Wed, 27 Jun 2018)
Log Message:
-----------
sync with freebsd

Modified Paths:
--------------
    trunk/contrib/tcp_wrappers/Makefile
    trunk/contrib/tcp_wrappers/clean_exit.c
    trunk/contrib/tcp_wrappers/fix_options.c
    trunk/contrib/tcp_wrappers/hosts_access.5
    trunk/contrib/tcp_wrappers/hosts_access.c
    trunk/contrib/tcp_wrappers/inetcf.c
    trunk/contrib/tcp_wrappers/inetcf.h
    trunk/contrib/tcp_wrappers/misc.c
    trunk/contrib/tcp_wrappers/mystdarg.h
    trunk/contrib/tcp_wrappers/options.c
    trunk/contrib/tcp_wrappers/percent_x.c
    trunk/contrib/tcp_wrappers/refuse.c
    trunk/contrib/tcp_wrappers/rfc931.c
    trunk/contrib/tcp_wrappers/scaffold.c
    trunk/contrib/tcp_wrappers/scaffold.h
    trunk/contrib/tcp_wrappers/shell_cmd.c
    trunk/contrib/tcp_wrappers/socket.c
    trunk/contrib/tcp_wrappers/tcpd.c
    trunk/contrib/tcp_wrappers/tcpd.h
    trunk/contrib/tcp_wrappers/tcpdchk.c
    trunk/contrib/tcp_wrappers/tcpdmatch.c
    trunk/contrib/tcp_wrappers/tli-sequent.h
    trunk/contrib/tcp_wrappers/tli.c
    trunk/contrib/tcp_wrappers/update.c
    trunk/contrib/tcp_wrappers/workarounds.c

Modified: trunk/contrib/tcp_wrappers/Makefile
===================================================================
--- trunk/contrib/tcp_wrappers/Makefile	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/Makefile	2018-06-27 12:48:23 UTC (rev 11153)
@@ -1,5 +1,5 @@
 # @(#) Makefile 1.23 97/03/21 19:27:20
-# $FreeBSD$
+# $FreeBSD: stable/10/contrib/tcp_wrappers/Makefile 243933 2012-12-06 01:31:25Z eadler $
 
 what:
 	@echo
@@ -139,7 +139,7 @@
 
 freebsd:
 	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
-	RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP=-DNETGROUP TLI= \
+	RANLIB=ranlib ARFLAGS=$(ARFLAGS) AUX_OBJ= NETGROUP=-DNETGROUP TLI= \
 	EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DINET6 -DUSE_GETIPNODEBY" \
 	VSYSLOG= all
 
@@ -401,7 +401,7 @@
 RANLIB	= ranlib	# have ranlib (BSD-ish UNIX)
 #RANLIB	= echo		# no ranlib (SYSV-ish UNIX)
 
-ARFLAGS	= rv		# most systems
+ARFLAGS	?= rv		# most systems
 #ARFLAGS= rvs		# IRIX 4.0.x
 
 AR	= ar

Modified: trunk/contrib/tcp_wrappers/clean_exit.c
===================================================================
--- trunk/contrib/tcp_wrappers/clean_exit.c	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/clean_exit.c	2018-06-27 12:48:23 UTC (rev 11153)
@@ -13,6 +13,7 @@
 #endif
 
 #include <stdio.h>
+#include <unistd.h>
 
 extern void exit();
 

Modified: trunk/contrib/tcp_wrappers/fix_options.c
===================================================================
--- trunk/contrib/tcp_wrappers/fix_options.c	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/fix_options.c	2018-06-27 12:48:23 UTC (rev 11153)
@@ -4,7 +4,7 @@
   *
   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
   *
-  * $FreeBSD$
+  * $FreeBSD: stable/10/contrib/tcp_wrappers/fix_options.c 210386 2010-07-22 18:52:29Z rpaulo $
   */
 
 #ifndef lint

Modified: trunk/contrib/tcp_wrappers/hosts_access.5
===================================================================
--- trunk/contrib/tcp_wrappers/hosts_access.5	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/hosts_access.5	2018-06-27 12:48:23 UTC (rev 11153)
@@ -396,4 +396,4 @@
 Den Dolech 2, P.O. Box 513, 
 5600 MB Eindhoven, The Netherlands
 \" @(#) hosts_access.5 1.20 95/01/30 19:51:46
-\" $FreeBSD$
+\" $FreeBSD: stable/10/contrib/tcp_wrappers/hosts_access.5 56977 2000-02-03 10:27:03Z shin $

Modified: trunk/contrib/tcp_wrappers/hosts_access.c
===================================================================
--- trunk/contrib/tcp_wrappers/hosts_access.c	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/hosts_access.c	2018-06-27 12:48:23 UTC (rev 11153)
@@ -16,7 +16,7 @@
   * 
   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
   *
-  * $FreeBSD$
+  * $FreeBSD: stable/10/contrib/tcp_wrappers/hosts_access.c 311814 2017-01-09 20:14:02Z dim $
   */
 
 #ifndef lint
@@ -44,6 +44,7 @@
 #ifdef INET6
 #include <netdb.h>
 #endif
+#include <stdlib.h>
 
 extern char *fgets();
 extern int errno;
@@ -102,6 +103,11 @@
 
 #define	BUFLEN 2048
 
+/* definition to be used from workarounds.c */
+#ifdef NETGROUP
+int     yp_get_default_domain(char  **);
+#endif
+
 /* hosts_access - host access control facility */
 
 int     hosts_access(request)
@@ -269,7 +275,7 @@
 
 static int hostfile_match(path, host)
 char   *path;
-struct hosts_info *host;
+struct host_info *host;
 {
     char    tok[BUFSIZ];
     int     match = NO;

Modified: trunk/contrib/tcp_wrappers/inetcf.c
===================================================================
--- trunk/contrib/tcp_wrappers/inetcf.c	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/inetcf.c	2018-06-27 12:48:23 UTC (rev 11153)
@@ -1,4 +1,4 @@
-/* $FreeBSD$ */
+/* $FreeBSD: stable/10/contrib/tcp_wrappers/inetcf.c 108930 2003-01-08 07:02:07Z peter $ */
  /*
   * Routines to parse an inetd.conf or tlid.conf file. This would be a great
   * job for a PERL script.

Modified: trunk/contrib/tcp_wrappers/inetcf.h
===================================================================
--- trunk/contrib/tcp_wrappers/inetcf.h	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/inetcf.h	2018-06-27 12:48:23 UTC (rev 11153)
@@ -8,7 +8,7 @@
 extern void inet_set();			/* remember internet service */
 extern int inet_get();			/* look up internet service */
 
-#define WR_UNKNOWN	(-1)		/* service unknown */
-#define WR_NOT		1		/* may not be wrapped */
-#define WR_MAYBE	2		/* may be wrapped */
+#define	WR_UNKNOWN	(-1)		/* service unknown */
+#define	WR_NOT		1		/* may not be wrapped */
+#define	WR_MAYBE	2		/* may be wrapped */
 #define	WR_YES		3		/* service is wrapped */

Modified: trunk/contrib/tcp_wrappers/misc.c
===================================================================
--- trunk/contrib/tcp_wrappers/misc.c	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/misc.c	2018-06-27 12:48:23 UTC (rev 11153)
@@ -3,7 +3,7 @@
   * 
   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
   *
-  * $FreeBSD$
+  * $FreeBSD: stable/10/contrib/tcp_wrappers/misc.c 56977 2000-02-03 10:27:03Z shin $
   */
 
 #ifndef lint

Modified: trunk/contrib/tcp_wrappers/mystdarg.h
===================================================================
--- trunk/contrib/tcp_wrappers/mystdarg.h	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/mystdarg.h	2018-06-27 12:48:23 UTC (rev 11153)
@@ -6,14 +6,14 @@
 
 #ifdef __STDC__
 #include <stdarg.h>
-#define VARARGS(func,type,arg) func(type arg, ...)
-#define VASTART(ap,type,name)  va_start(ap,name)
-#define VAEND(ap)              va_end(ap)
+#define	VARARGS(func,type,arg) func(type arg, ...)
+#define	VASTART(ap,type,name)  va_start(ap,name)
+#define	VAEND(ap)              va_end(ap)
 #else
 #include <varargs.h>
-#define VARARGS(func,type,arg) func(va_alist) va_dcl
-#define VASTART(ap,type,name)  {type name; va_start(ap); name = va_arg(ap, type)
-#define VAEND(ap)              va_end(ap);}
+#define	VARARGS(func,type,arg) func(va_alist) va_dcl
+#define	VASTART(ap,type,name)  {type name; va_start(ap); name = va_arg(ap, type)
+#define	VAEND(ap)              va_end(ap);}
 #endif
 
 extern char *percent_m();

Modified: trunk/contrib/tcp_wrappers/options.c
===================================================================
--- trunk/contrib/tcp_wrappers/options.c	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/options.c	2018-06-27 12:48:23 UTC (rev 11153)
@@ -27,7 +27,7 @@
   * such options should clear the "dry_run" flag to inform the caller of this
   * course of action.
   *
-  * $FreeBSD$
+  * $FreeBSD: stable/10/contrib/tcp_wrappers/options.c 311814 2017-01-09 20:14:02Z dim $
   */
 
 #ifndef lint
@@ -50,6 +50,8 @@
 #include <ctype.h>
 #include <setjmp.h>
 #include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
 
 #ifndef MAXPATHNAMELEN
 #define MAXPATHNAMELEN  BUFSIZ
@@ -441,16 +443,21 @@
 /* severity_map - lookup facility or severity value */
 
 static int severity_map(table, name)
-CODE   *table;
+const CODE   *table;
 char   *name;
 {
-    CODE *t;
+    const CODE *t;
+    int ret = -1;
 
     for (t = table; t->c_name; t++)
-	if (STR_EQ(t->c_name, name))
-	    return (t->c_val);
-    tcpd_jump("bad syslog facility or severity: \"%s\"", name);
-    /* NOTREACHED */
+	if (STR_EQ(t->c_name, name)) {
+	    ret = t->c_val;
+	    break;
+	}
+    if (ret == -1)
+    	tcpd_jump("bad syslog facility or severity: \"%s\"", name);
+
+    return (ret);
 }
 
 /* severity_option - change logging severity for this event (Dave Mitchell) */

Modified: trunk/contrib/tcp_wrappers/percent_x.c
===================================================================
--- trunk/contrib/tcp_wrappers/percent_x.c	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/percent_x.c	2018-06-27 12:48:23 UTC (rev 11153)
@@ -19,6 +19,7 @@
 #include <stdio.h>
 #include <syslog.h>
 #include <string.h>
+#include <unistd.h>
 
 extern void exit();
 

Modified: trunk/contrib/tcp_wrappers/refuse.c
===================================================================
--- trunk/contrib/tcp_wrappers/refuse.c	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/refuse.c	2018-06-27 12:48:23 UTC (rev 11153)
@@ -6,7 +6,7 @@
   * 
   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
   *
-  * $FreeBSD$
+  * $FreeBSD: stable/10/contrib/tcp_wrappers/refuse.c 56977 2000-02-03 10:27:03Z shin $
   */
 
 #ifndef lint

Modified: trunk/contrib/tcp_wrappers/rfc931.c
===================================================================
--- trunk/contrib/tcp_wrappers/rfc931.c	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/rfc931.c	2018-06-27 12:48:23 UTC (rev 11153)
@@ -8,7 +8,7 @@
   * 
   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
   *
-  * $FreeBSD$
+  * $FreeBSD: stable/10/contrib/tcp_wrappers/rfc931.c 311814 2017-01-09 20:14:02Z dim $
   */
 
 #ifndef lint
@@ -25,6 +25,7 @@
 #include <setjmp.h>
 #include <signal.h>
 #include <string.h>
+#include <unistd.h>
 
 #ifndef SEEK_SET
 #define SEEK_SET 0

Modified: trunk/contrib/tcp_wrappers/scaffold.c
===================================================================
--- trunk/contrib/tcp_wrappers/scaffold.c	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/scaffold.c	2018-06-27 12:48:23 UTC (rev 11153)
@@ -3,7 +3,7 @@
   * 
   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
   *
-  * $FreeBSD$
+  * $FreeBSD: stable/10/contrib/tcp_wrappers/scaffold.c 323744 2017-09-19 08:34:13Z avg $
   */
 
 #ifndef lint
@@ -27,10 +27,6 @@
 #define	INADDR_NONE	(-1)		/* XXX should be 0xffffffff */
 #endif
 
-#ifndef INET6
-extern char *malloc();
-#endif
-
 /* Application-specific. */
 
 #include "tcpd.h"
@@ -235,16 +231,6 @@
     exit(0);
 }
 
-/* dummy function  to intercept the real rfc931() */
-
-/* ARGSUSED */
-
-void    rfc931(request)
-struct request_info *request;
-{
-    strcpy(request->user, unknown);
-}
-
 /* check_path - examine accessibility */
 
 int     check_path(path, st)

Modified: trunk/contrib/tcp_wrappers/scaffold.h
===================================================================
--- trunk/contrib/tcp_wrappers/scaffold.h	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/scaffold.h	2018-06-27 12:48:23 UTC (rev 11153)
@@ -3,7 +3,7 @@
   * 
   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
   *
-  * $FreeBSD$
+  * $FreeBSD: stable/10/contrib/tcp_wrappers/scaffold.h 63158 2000-07-14 17:15:34Z ume $
   */
 
 #ifdef INET6

Modified: trunk/contrib/tcp_wrappers/shell_cmd.c
===================================================================
--- trunk/contrib/tcp_wrappers/shell_cmd.c	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/shell_cmd.c	2018-06-27 12:48:23 UTC (rev 11153)
@@ -16,10 +16,13 @@
 
 #include <sys/types.h>
 #include <sys/param.h>
+#include <sys/wait.h>
 #include <signal.h>
 #include <stdio.h>
 #include <syslog.h>
 #include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
 
 extern void exit();
 

Modified: trunk/contrib/tcp_wrappers/socket.c
===================================================================
--- trunk/contrib/tcp_wrappers/socket.c	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/socket.c	2018-06-27 12:48:23 UTC (rev 11153)
@@ -14,7 +14,7 @@
   * 
   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
   *
-  * $FreeBSD$
+  * $FreeBSD: stable/10/contrib/tcp_wrappers/socket.c 146187 2005-05-13 16:31:11Z ume $
   */
 
 #ifndef lint

Modified: trunk/contrib/tcp_wrappers/tcpd.c
===================================================================
--- trunk/contrib/tcp_wrappers/tcpd.c	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/tcpd.c	2018-06-27 12:48:23 UTC (rev 11153)
@@ -9,7 +9,7 @@
   * 
   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
   *
-  * $FreeBSD$
+  * $FreeBSD: stable/10/contrib/tcp_wrappers/tcpd.c 56977 2000-02-03 10:27:03Z shin $
   */
 
 #ifndef lint

Modified: trunk/contrib/tcp_wrappers/tcpd.h
===================================================================
--- trunk/contrib/tcp_wrappers/tcpd.h	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/tcpd.h	2018-06-27 12:48:23 UTC (rev 11153)
@@ -3,21 +3,28 @@
   * 
   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
   *
-  * $FreeBSD$
+  * $FreeBSD: stable/10/contrib/tcp_wrappers/tcpd.h 311814 2017-01-09 20:14:02Z dim $
   */
 
+#ifdef INET6
+#define	TCPD_SOCKADDR struct sockaddr
+#else
+#define	TCPD_SOCKADDR struct sockaddr_in
+#endif
+
+#ifndef _STDFILE_DECLARED
+#define _STDFILE_DECLARED
+typedef struct __sFILE FILE;
+#endif
+
 /* Structure to describe one communications endpoint. */
 
-#define STRING_LENGTH	128		/* hosts, users, processes */
+#define	STRING_LENGTH	128		/* hosts, users, processes */
 
 struct host_info {
     char    name[STRING_LENGTH];	/* access via eval_hostname(host) */
     char    addr[STRING_LENGTH];	/* access via eval_hostaddr(host) */
-#ifdef INET6
-    struct sockaddr *sin;		/* socket address or 0 */
-#else
-    struct sockaddr_in *sin;		/* socket address or 0 */
-#endif
+    TCPD_SOCKADDR *sin;			/* socket address or 0 */
     struct t_unitdata *unit;		/* TLI transport address or 0 */
     struct request_info *request;	/* for shared information */
 };
@@ -31,21 +38,21 @@
     char    pid[10];			/* access via eval_pid(request) */
     struct host_info client[1];		/* client endpoint info */
     struct host_info server[1];		/* server endpoint info */
-    void  (*sink) ();			/* datagram sink function or 0 */
-    void  (*hostname) ();		/* address to printable hostname */
-    void  (*hostaddr) ();		/* address to printable address */
-    void  (*cleanup) ();		/* cleanup function or 0 */
+    void  (*sink) (int);		/* datagram sink function or 0 */
+    void  (*hostname) (struct host_info *); /* address to printable hostname */
+    void  (*hostaddr) (struct host_info *); /* address to printable address */
+    void  (*cleanup) (struct request_info *); /* cleanup function or 0 */
     struct netconfig *config;		/* netdir handle */
 };
 
 /* Common string operations. Less clutter should be more readable. */
 
-#define STRN_CPY(d,s,l)	{ strncpy((d),(s),(l)); (d)[(l)-1] = 0; }
+#define	STRN_CPY(d,s,l)	{ strncpy((d),(s),(l)); (d)[(l)-1] = 0; }
 
-#define STRN_EQ(x,y,l)	(strncasecmp((x),(y),(l)) == 0)
-#define STRN_NE(x,y,l)	(strncasecmp((x),(y),(l)) != 0)
-#define STR_EQ(x,y)	(strcasecmp((x),(y)) == 0)
-#define STR_NE(x,y)	(strcasecmp((x),(y)) != 0)
+#define	STRN_EQ(x,y,l)	(strncasecmp((x),(y),(l)) == 0)
+#define	STRN_NE(x,y,l)	(strncasecmp((x),(y),(l)) != 0)
+#define	STR_EQ(x,y)	(strcasecmp((x),(y)) == 0)
+#define	STR_NE(x,y)	(strcasecmp((x),(y)) != 0)
 
  /*
   * Initially, all above strings have the empty value. Information that
@@ -54,34 +61,36 @@
   * that we do not believe in is set to "paranoid".
   */
 
-#define STRING_UNKNOWN	"unknown"	/* lookup failed */
-#define STRING_PARANOID	"paranoid"	/* hostname conflict */
+#define	STRING_UNKNOWN	"unknown"	/* lookup failed */
+#define	STRING_PARANOID	"paranoid"	/* hostname conflict */
 
 extern char unknown[];
 extern char paranoid[];
 
-#define HOSTNAME_KNOWN(s) (STR_NE((s),unknown) && STR_NE((s),paranoid))
+#define	HOSTNAME_KNOWN(s) (STR_NE((s),unknown) && STR_NE((s),paranoid))
 
-#define NOT_INADDR(s) (s[strspn(s,"01234567890./")] != 0)
+#define	NOT_INADDR(s) (s[strspn(s,"01234567890./")] != 0)
 
 /* Global functions. */
 
 #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
-extern void fromhost();			/* get/validate client host info */
+void fromhost(struct request_info *);	/* get/validate client host info */
 #else
-#define fromhost sock_host		/* no TLI support needed */
+#define	fromhost sock_host		/* no TLI support needed */
 #endif
 
-extern int hosts_access();		/* access control */
-extern void shell_cmd();		/* execute shell command */
-extern char *percent_x();		/* do %<char> expansion */
-extern void rfc931();			/* client name from RFC 931 daemon */
-extern void clean_exit();		/* clean up and exit */
-extern void refuse();			/* clean up and exit */
-extern char *xgets();			/* fgets() on steroids */
-extern char *split_at();		/* strchr() and split */
-extern unsigned long dot_quad_addr();	/* restricted inet_addr() */
+int hosts_access(struct request_info *);			/* access control */
+int hosts_ctl(char *, char *, char *, char *);			/* wrapper around request_init() */
+void shell_cmd(char *);						/* execute shell command */
+char *percent_x(char *, int, char *, struct request_info *);	/* do %<char> expansion */
+void rfc931(TCPD_SOCKADDR *, TCPD_SOCKADDR *, char *);		/* client name from RFC 931 daemon */
+void clean_exit(struct request_info *);				/* clean up and exit */
+void refuse(struct request_info *);				/* clean up and exit */
+char *xgets(char *, int, FILE *);				/* fgets() on steroids */
 
+char *split_at(char *, int);					/* strchr() and split */
+unsigned long dot_quad_addr(char *);				/* restricted inet_addr() */
+
 /* Global variables. */
 
 extern int allow_severity;		/* for connection logging */
@@ -97,23 +106,18 @@
   * attributes. Each attribute has its own key.
   */
 
-#ifdef __STDC__
-extern struct request_info *request_init(struct request_info *,...);
-extern struct request_info *request_set(struct request_info *,...);
-#else
-extern struct request_info *request_init();	/* initialize request */
-extern struct request_info *request_set();	/* update request structure */
-#endif
+struct request_info *request_init(struct request_info *,...);	/* initialize request */
+struct request_info *request_set(struct request_info *,...);	/* update request structure */
 
-#define RQ_FILE		1		/* file descriptor */
-#define RQ_DAEMON	2		/* server process (argv[0]) */
-#define RQ_USER		3		/* client user name */
-#define RQ_CLIENT_NAME	4		/* client host name */
-#define RQ_CLIENT_ADDR	5		/* client host address */
-#define RQ_CLIENT_SIN	6		/* client endpoint (internal) */
-#define RQ_SERVER_NAME	7		/* server host name */
-#define RQ_SERVER_ADDR	8		/* server host address */
-#define RQ_SERVER_SIN	9		/* server endpoint (internal) */
+#define	RQ_FILE		1		/* file descriptor */
+#define	RQ_DAEMON	2		/* server process (argv[0]) */
+#define	RQ_USER		3		/* client user name */
+#define	RQ_CLIENT_NAME	4		/* client host name */
+#define	RQ_CLIENT_ADDR	5		/* client host address */
+#define	RQ_CLIENT_SIN	6		/* client endpoint (internal) */
+#define	RQ_SERVER_NAME	7		/* server host name */
+#define	RQ_SERVER_ADDR	8		/* server host address */
+#define	RQ_SERVER_SIN	9		/* server endpoint (internal) */
 
  /*
   * Routines for delayed evaluation of request attributes. Each attribute
@@ -123,27 +127,27 @@
   * host_info structures serve as caches for the lookup results.
   */
 
-extern char *eval_user();		/* client user */
-extern char *eval_hostname();		/* printable hostname */
-extern char *eval_hostaddr();		/* printable host address */
-extern char *eval_hostinfo();		/* host name or address */
-extern char *eval_client();		/* whatever is available */
-extern char *eval_server();		/* whatever is available */
-#define eval_daemon(r)	((r)->daemon)	/* daemon process name */
-#define eval_pid(r)	((r)->pid)	/* process id */
+char *eval_user(struct request_info *);		/* client user */
+char *eval_hostname(struct host_info *);	/* printable hostname */
+char *eval_hostaddr(struct host_info *);	/* printable host address */
+char *eval_hostinfo(struct host_info *);	/* host name or address */
+char *eval_client(struct request_info *);	/* whatever is available */
+char *eval_server(struct request_info *);	/* whatever is available */
+#define	eval_daemon(r)	((r)->daemon)	/* daemon process name */
+#define	eval_pid(r)	((r)->pid)	/* process id */
 
 /* Socket-specific methods, including DNS hostname lookups. */
 
-extern void sock_host();		/* look up endpoint addresses */
-extern void sock_hostname();		/* translate address to hostname */
-extern void sock_hostaddr();		/* address to printable address */
-#define sock_methods(r) \
+void sock_host(struct request_info *);		/* look up endpoint addresses */
+void sock_hostname(struct host_info *);		/* translate address to hostname */
+void sock_hostaddr(struct host_info *);		/* address to printable address */
+#define	sock_methods(r) \
 	{ (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
 
 /* The System V Transport-Level Interface (TLI) interface. */
 
 #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
-extern void tli_host();			/* look up endpoint addresses etc. */
+void tli_host(struct request_info *);		/* look up endpoint addresses etc. */
 #endif
 
  /*
@@ -152,13 +156,8 @@
   * everyone would have to include <setjmp.h>.
   */
 
-#ifdef __STDC__
-extern void tcpd_warn(char *, ...);	/* report problem and proceed */
-extern void tcpd_jump(char *, ...);	/* report problem and jump */
-#else
-extern void tcpd_warn();
-extern void tcpd_jump();
-#endif
+void tcpd_warn(char *, ...);		/* report problem and proceed */
+void tcpd_jump(char *, ...);		/* report problem and jump */
 
 struct tcpd_context {
     char   *file;			/* current file */
@@ -173,9 +172,9 @@
   * (-1) returns are here because zero is already taken by longjmp().
   */
 
-#define AC_PERMIT	1		/* permit access */
-#define AC_DENY		(-1)		/* deny_access */
-#define AC_ERROR	AC_DENY		/* XXX */
+#define	AC_PERMIT	1		/* permit access */
+#define	AC_DENY		(-1)		/* deny_access */
+#define	AC_ERROR	AC_DENY		/* XXX */
 
  /*
   * In verification mode an option function should just say what it would do,
@@ -184,42 +183,42 @@
   * behavior.
   */
 
-extern void process_options();		/* execute options */
-extern int dry_run;			/* verification flag */
+void process_options(char *, struct request_info *);	/* execute options */
+extern int dry_run;					/* verification flag */
 
 /* Bug workarounds. */
 
 #ifdef INET_ADDR_BUG			/* inet_addr() returns struct */
-#define inet_addr fix_inet_addr
-extern long fix_inet_addr();
+#define	inet_addr fix_inet_addr
+long fix_inet_addr(char *);
 #endif
 
 #ifdef BROKEN_FGETS			/* partial reads from sockets */
-#define fgets fix_fgets
-extern char *fix_fgets();
+#define	fgets fix_fgets
+char *fix_fgets(char *, int, FILE *);
 #endif
 
 #ifdef RECVFROM_BUG			/* no address family info */
-#define recvfrom fix_recvfrom
-extern int fix_recvfrom();
+#define	recvfrom fix_recvfrom
+int fix_recvfrom(int, char *, int, int, struct sockaddr *, int *);
 #endif
 
 #ifdef GETPEERNAME_BUG			/* claims success with UDP */
-#define getpeername fix_getpeername
-extern int fix_getpeername();
+#define	getpeername fix_getpeername
+int fix_getpeername(int, struct sockaddr *, int *);
 #endif
 
 #ifdef SOLARIS_24_GETHOSTBYNAME_BUG	/* lists addresses as aliases */
-#define gethostbyname fix_gethostbyname
-extern struct hostent *fix_gethostbyname();
+#define	gethostbyname fix_gethostbyname
+struct hostent *fix_gethostbyname(char *);
 #endif
 
 #ifdef USE_STRSEP			/* libc calls strtok() */
-#define strtok	fix_strtok
-extern char *fix_strtok();
+#define	strtok	fix_strtok
+char *fix_strtok(char *, char *);
 #endif
 
 #ifdef LIBC_CALLS_STRTOK		/* libc calls strtok() */
-#define strtok	my_strtok
-extern char *my_strtok();
+#define	strtok	my_strtok
+char *my_strtok(char *, char *);
 #endif

Modified: trunk/contrib/tcp_wrappers/tcpdchk.c
===================================================================
--- trunk/contrib/tcp_wrappers/tcpdchk.c	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/tcpdchk.c	2018-06-27 12:48:23 UTC (rev 11153)
@@ -13,7 +13,7 @@
   * 
   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
   *
-  * $FreeBSD$
+  * $FreeBSD: stable/10/contrib/tcp_wrappers/tcpdchk.c 63158 2000-07-14 17:15:34Z ume $
   */
 
 #ifndef lint

Modified: trunk/contrib/tcp_wrappers/tcpdmatch.c
===================================================================
--- trunk/contrib/tcp_wrappers/tcpdmatch.c	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/tcpdmatch.c	2018-06-27 12:48:23 UTC (rev 11153)
@@ -12,7 +12,7 @@
   * 
   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
   *
-  * $FreeBSD$
+  * $FreeBSD: stable/10/contrib/tcp_wrappers/tcpdmatch.c 63158 2000-07-14 17:15:34Z ume $
   */
 
 #ifndef lint

Modified: trunk/contrib/tcp_wrappers/tli-sequent.h
===================================================================
--- trunk/contrib/tcp_wrappers/tli-sequent.h	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/tli-sequent.h	2018-06-27 12:48:23 UTC (rev 11153)
@@ -1,7 +1,7 @@
 #ifdef __STDC__
-#define __P(X) X
+#define	__P(X) X
 #else
-#define __P(X) ()
+#define	__P(X) ()
 #endif
 
 extern int t_sync __P((int));

Modified: trunk/contrib/tcp_wrappers/tli.c
===================================================================
--- trunk/contrib/tcp_wrappers/tli.c	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/tli.c	2018-06-27 12:48:23 UTC (rev 11153)
@@ -13,7 +13,7 @@
   * 
   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
   *
-  * $FreeBSD$
+  * $FreeBSD: stable/10/contrib/tcp_wrappers/tli.c 56977 2000-02-03 10:27:03Z shin $
   */
 
 #ifndef lint

Modified: trunk/contrib/tcp_wrappers/update.c
===================================================================
--- trunk/contrib/tcp_wrappers/update.c	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/update.c	2018-06-27 12:48:23 UTC (rev 11153)
@@ -12,7 +12,7 @@
   * 
   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
   *
-  * $FreeBSD$
+  * $FreeBSD: stable/10/contrib/tcp_wrappers/update.c 311814 2017-01-09 20:14:02Z dim $
   */
 
 #ifndef lint
@@ -24,6 +24,7 @@
 #include <stdio.h>
 #include <syslog.h>
 #include <string.h>
+#include <unistd.h>
 
 /* Local stuff. */
 

Modified: trunk/contrib/tcp_wrappers/workarounds.c
===================================================================
--- trunk/contrib/tcp_wrappers/workarounds.c	2018-06-27 12:47:34 UTC (rev 11152)
+++ trunk/contrib/tcp_wrappers/workarounds.c	2018-06-27 12:48:23 UTC (rev 11153)
@@ -6,7 +6,7 @@
   * 
   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
   *
-  * $FreeBSD$
+  * $FreeBSD: stable/10/contrib/tcp_wrappers/workarounds.c 56977 2000-02-03 10:27:03Z shin $
   */
 
 #ifndef lint



More information about the Midnightbsd-cvs mailing list