git: 14f102eacc84 - main - tcp_wrappers: Use ANSI (c89) function definitions
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 21 Mar 2023 14:11:51 UTC
The branch main has been updated by emaste:
URL: https://cgit.FreeBSD.org/src/commit/?id=14f102eacc8434a5a1f96466752578a4167140c9
commit 14f102eacc8434a5a1f96466752578a4167140c9
Author: Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-03-21 14:08:28 +0000
Commit: Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-03-21 14:09:34 +0000
tcp_wrappers: Use ANSI (c89) function definitions
Although this code is in contrib/ there is no active upstream.
Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36047
---
contrib/tcp_wrappers/clean_exit.c | 3 +-
contrib/tcp_wrappers/diag.c | 6 +---
contrib/tcp_wrappers/environ.c | 32 +++++-------------
contrib/tcp_wrappers/eval.c | 18 ++++------
contrib/tcp_wrappers/fakelog.c | 10 ++----
contrib/tcp_wrappers/fix_options.c | 3 +-
contrib/tcp_wrappers/fromhost.c | 3 +-
contrib/tcp_wrappers/hosts_access.c | 44 +++++++------------------
contrib/tcp_wrappers/hosts_ctl.c | 6 +---
contrib/tcp_wrappers/inetcf.c | 19 +++--------
contrib/tcp_wrappers/misc.c | 12 ++-----
contrib/tcp_wrappers/miscd.c | 4 +--
contrib/tcp_wrappers/myvsyslog.c | 5 +--
contrib/tcp_wrappers/ncr.c | 3 +-
contrib/tcp_wrappers/options.c | 65 ++++++++++---------------------------
contrib/tcp_wrappers/percent_m.c | 4 +--
contrib/tcp_wrappers/percent_x.c | 7 ++--
contrib/tcp_wrappers/ptx.c | 6 ++--
contrib/tcp_wrappers/refuse.c | 3 +-
contrib/tcp_wrappers/rfc931.c | 14 +++-----
contrib/tcp_wrappers/safe_finger.c | 10 ++----
contrib/tcp_wrappers/scaffold.c | 22 ++++---------
contrib/tcp_wrappers/setenv.c | 5 +--
contrib/tcp_wrappers/shell_cmd.c | 3 +-
contrib/tcp_wrappers/socket.c | 12 +++----
contrib/tcp_wrappers/strcasecmp.c | 7 ++--
contrib/tcp_wrappers/tcpd.c | 4 +--
contrib/tcp_wrappers/tcpdchk.c | 33 ++++++-------------
contrib/tcp_wrappers/tcpdmatch.c | 15 +++------
contrib/tcp_wrappers/tli-sequent.c | 8 ++---
contrib/tcp_wrappers/tli.c | 18 ++++------
contrib/tcp_wrappers/try-from.c | 4 +--
contrib/tcp_wrappers/update.c | 5 ++-
contrib/tcp_wrappers/vfprintf.c | 9 ++---
contrib/tcp_wrappers/workarounds.c | 36 +++++---------------
35 files changed, 128 insertions(+), 330 deletions(-)
diff --git a/contrib/tcp_wrappers/clean_exit.c b/contrib/tcp_wrappers/clean_exit.c
index 41caaf030665..04b1626d1a72 100644
--- a/contrib/tcp_wrappers/clean_exit.c
+++ b/contrib/tcp_wrappers/clean_exit.c
@@ -21,8 +21,7 @@ extern void exit();
/* clean_exit - clean up and exit */
-void clean_exit(request)
-struct request_info *request;
+void clean_exit(struct request_info *request)
{
/*
diff --git a/contrib/tcp_wrappers/diag.c b/contrib/tcp_wrappers/diag.c
index ac3df07a202e..f3b8b1aaf589 100644
--- a/contrib/tcp_wrappers/diag.c
+++ b/contrib/tcp_wrappers/diag.c
@@ -29,11 +29,7 @@ jmp_buf tcpd_buf;
/* tcpd_diag - centralize error reporter */
-static void tcpd_diag(severity, tag, format, ap)
-int severity;
-char *tag;
-char *format;
-va_list ap;
+static void tcpd_diag(int severity, char *tag, char *format, va_list ap)
{
char fmt[BUFSIZ];
diff --git a/contrib/tcp_wrappers/environ.c b/contrib/tcp_wrappers/environ.c
index e7f846ddd6b7..93499189d3fb 100644
--- a/contrib/tcp_wrappers/environ.c
+++ b/contrib/tcp_wrappers/environ.c
@@ -37,8 +37,7 @@ static int allocated = 0; /* environ is, or is not, allocated */
/* namelength - determine length of name in "name=whatever" */
-static int namelength(name)
-char *name;
+static int namelength(char *name)
{
char *equal;
@@ -48,9 +47,7 @@ char *name;
/* findenv - given name, locate name=value */
-static char **findenv(name, len)
-char *name;
-int len;
+static char **findenv(char *name, int len)
{
char **envp;
@@ -62,8 +59,7 @@ int len;
/* getenv - given name, locate value */
-char *getenv(name)
-char *name;
+char *getenv(char *name)
{
int len = namelength(name);
char **envp = findenv(name, len);
@@ -73,8 +69,7 @@ char *name;
/* putenv - update or append environment (name,value) pair */
-int putenv(nameval)
-char *nameval;
+int putenv(char *nameval)
{
char *equal = strchr(nameval, '=');
char *value = (equal ? equal : "");
@@ -84,8 +79,7 @@ char *nameval;
/* unsetenv - remove variable from environment */
-void unsetenv(name)
-char *name;
+void unsetenv(char *name)
{
char **envp;
@@ -96,10 +90,7 @@ char *name;
/* setenv - update or append environment (name,value) pair */
-int setenv(name, value, clobber)
-char *name;
-char *value;
-int clobber;
+int setenv(char *name, char *value, int clobber)
{
char *destination;
char **envp;
@@ -133,9 +124,7 @@ int clobber;
/* cmalloc - malloc and copy block of memory */
-static char *cmalloc(new_len, old, old_len)
-char *old;
-int old_len;
+static char *cmalloc(int new_len, char *old, int old_len)
{
char *new = malloc(new_len);
@@ -146,8 +135,7 @@ int old_len;
/* addenv - append environment entry */
-static int addenv(nameval)
-char *nameval;
+static int addenv(char *nameval)
{
char **envp;
int n_used; /* number of environment entries */
@@ -190,9 +178,7 @@ static void printenv()
printf("%s\n", *envp);
}
-int main(argc, argv)
-int argc;
-char **argv;
+int main(int argc, char **argv)
{
char *cp;
int changed = 0;
diff --git a/contrib/tcp_wrappers/eval.c b/contrib/tcp_wrappers/eval.c
index d68358f3b9c3..cb4ef0650fa7 100644
--- a/contrib/tcp_wrappers/eval.c
+++ b/contrib/tcp_wrappers/eval.c
@@ -42,8 +42,7 @@ char paranoid[] = STRING_PARANOID;
/* eval_user - look up user name */
-char *eval_user(request)
-struct request_info *request;
+char *eval_user(struct request_info *request)
{
if (request->user[0] == 0) {
strcpy(request->user, unknown);
@@ -55,8 +54,7 @@ struct request_info *request;
/* eval_hostaddr - look up printable address */
-char *eval_hostaddr(host)
-struct host_info *host;
+char *eval_hostaddr(struct host_info *host)
{
if (host->addr[0] == 0) {
strcpy(host->addr, unknown);
@@ -68,8 +66,7 @@ struct host_info *host;
/* eval_hostname - look up host name */
-char *eval_hostname(host)
-struct host_info *host;
+char *eval_hostname(struct host_info *host)
{
if (host->name[0] == 0) {
strcpy(host->name, unknown);
@@ -81,8 +78,7 @@ struct host_info *host;
/* eval_hostinfo - return string with host name (preferred) or address */
-char *eval_hostinfo(host)
-struct host_info *host;
+char *eval_hostinfo(struct host_info *host)
{
char *hostname;
@@ -100,8 +96,7 @@ struct host_info *host;
/* eval_client - return string with as much about the client as we know */
-char *eval_client(request)
-struct request_info *request;
+char *eval_client(struct request_info *request)
{
static char both[2 * STRING_LENGTH];
char *hostinfo = eval_hostinfo(request->client);
@@ -120,8 +115,7 @@ struct request_info *request;
/* eval_server - return string with as much about the server as we know */
-char *eval_server(request)
-struct request_info *request;
+char *eval_server(struct request_info *request)
{
static char both[2 * STRING_LENGTH];
char *host = eval_hostinfo(request->server);
diff --git a/contrib/tcp_wrappers/fakelog.c b/contrib/tcp_wrappers/fakelog.c
index 97802dba7fb1..ad4a420ff557 100644
--- a/contrib/tcp_wrappers/fakelog.c
+++ b/contrib/tcp_wrappers/fakelog.c
@@ -17,20 +17,14 @@ static char sccsid[] = "@(#) fakelog.c 1.3 94/12/28 17:42:21";
/* ARGSUSED */
-void openlog(name, logopt, facility)
-char *name;
-int logopt;
-int facility;
+void openlog(char *name, int logopt, int facility)
{
/* void */
}
/* vsyslog - format one record */
-void vsyslog(severity, fmt, ap)
-int severity;
-char *fmt;
-va_list ap;
+void vsyslog(int severity, char *fmt, va_list ap)
{
char buf[BUFSIZ];
diff --git a/contrib/tcp_wrappers/fix_options.c b/contrib/tcp_wrappers/fix_options.c
index b31c61a0382d..76ddaae419b4 100644
--- a/contrib/tcp_wrappers/fix_options.c
+++ b/contrib/tcp_wrappers/fix_options.c
@@ -35,8 +35,7 @@ static char sccsid[] = "@(#) fix_options.c 1.6 97/04/08 02:29:19";
/* fix_options - get rid of IP-level socket options */
void
-fix_options(request)
-struct request_info *request;
+fix_options(struct request_info *request)
{
#ifdef IP_OPTIONS
unsigned char optbuf[BUFFER_SIZE / 3], *cp;
diff --git a/contrib/tcp_wrappers/fromhost.c b/contrib/tcp_wrappers/fromhost.c
index a46c506e7915..ca065badbd4f 100644
--- a/contrib/tcp_wrappers/fromhost.c
+++ b/contrib/tcp_wrappers/fromhost.c
@@ -28,8 +28,7 @@ static char sccsid[] = "@(#) fromhost.c 1.17 94/12/28 17:42:23";
/* fromhost - find out what network API we should use */
-void fromhost(request)
-struct request_info *request;
+void fromhost(struct request_info *request)
{
/*
diff --git a/contrib/tcp_wrappers/hosts_access.c b/contrib/tcp_wrappers/hosts_access.c
index 140225fabace..05c62d194091 100644
--- a/contrib/tcp_wrappers/hosts_access.c
+++ b/contrib/tcp_wrappers/hosts_access.c
@@ -108,8 +108,7 @@ int yp_get_default_domain(char **);
/* hosts_access - host access control facility */
-int hosts_access(request)
-struct request_info *request;
+int hosts_access(struct request_info *request)
{
int verdict;
@@ -142,9 +141,7 @@ struct request_info *request;
/* table_match - match table entries with (daemon, client) pair */
-static int table_match(table, request)
-char *table;
-struct request_info *request;
+static int table_match(char *table, struct request_info *request)
{
FILE *fp;
char sv_list[BUFLEN]; /* becomes list of daemons */
@@ -237,9 +234,7 @@ static int list_match(char *list, struct request_info *request,
/* server_match - match server information */
-static int server_match(tok, request)
-char *tok;
-struct request_info *request;
+static int server_match(char *tok, struct request_info *request)
{
char *host;
@@ -253,9 +248,7 @@ struct request_info *request;
/* client_match - match client information */
-static int client_match(tok, request)
-char *tok;
-struct request_info *request;
+static int client_match(char *tok, struct request_info *request)
{
char *host;
@@ -269,9 +262,7 @@ struct request_info *request;
/* hostfile_match - look up host patterns from file */
-static int hostfile_match(path, host)
-char *path;
-struct host_info *host;
+static int hostfile_match(char *path, struct host_info *host)
{
char tok[BUFSIZ];
int match = NO;
@@ -289,9 +280,7 @@ struct host_info *host;
/* host_match - match host name and/or address against pattern */
-static int host_match(tok, host)
-char *tok;
-struct host_info *host;
+static int host_match(char *tok, struct host_info *host)
{
char *mask;
@@ -332,9 +321,7 @@ struct host_info *host;
/* string_match - match string against pattern */
-static int string_match(tok, string)
-char *tok;
-char *string;
+static int string_match(char *tok, char *string)
{
int n;
@@ -393,22 +380,16 @@ char *string;
/* masked_match - match address against netnumber/netmask */
#ifdef INET6
-static int masked_match(net_tok, mask_tok, string)
-char *net_tok;
-char *mask_tok;
-char *string;
+static int masked_match(char *net_tok, char *mask_tok, char *string)
{
return (masked_match4(net_tok, mask_tok, string) ||
masked_match6(net_tok, mask_tok, string));
}
-static int masked_match4(net_tok, mask_tok, string)
+static int masked_match4(char *net_tok, char *mask_tok, char *string)
#else
-static int masked_match(net_tok, mask_tok, string)
+static int masked_match(char *net_tok, char *mask_tok, char *string)
#endif
-char *net_tok;
-char *mask_tok;
-char *string;
{
#ifdef INET6
u_int32_t net;
@@ -439,10 +420,7 @@ char *string;
}
#ifdef INET6
-static int masked_match6(net_tok, mask_tok, string)
-char *net_tok;
-char *mask_tok;
-char *string;
+static int masked_match6(char *net_tok, char *mask_tok, char *string)
{
struct addrinfo hints, *res;
struct sockaddr_in6 net, addr;
diff --git a/contrib/tcp_wrappers/hosts_ctl.c b/contrib/tcp_wrappers/hosts_ctl.c
index e57f30aaa4a4..5477c49fdcdd 100644
--- a/contrib/tcp_wrappers/hosts_ctl.c
+++ b/contrib/tcp_wrappers/hosts_ctl.c
@@ -21,11 +21,7 @@ static char sccsid[] = "@(#) hosts_ctl.c 1.4 94/12/28 17:42:27";
/* hosts_ctl - limited interface to the hosts_access() routine */
-int hosts_ctl(daemon, name, addr, user)
-char *daemon;
-char *name;
-char *addr;
-char *user;
+int hosts_ctl(char *daemon, char *name, char *addr, char *user)
{
struct request_info request;
diff --git a/contrib/tcp_wrappers/inetcf.c b/contrib/tcp_wrappers/inetcf.c
index d68faa06b127..44854c0f6f34 100644
--- a/contrib/tcp_wrappers/inetcf.c
+++ b/contrib/tcp_wrappers/inetcf.c
@@ -55,8 +55,7 @@ static char whitespace[] = " \t\r\n";
/* inet_conf - read in and examine inetd.conf (or tlid.conf) entries */
-char *inet_cfg(conf)
-char *conf;
+char *inet_cfg(char *conf)
{
char buf[BUFSIZ];
FILE *fp;
@@ -159,11 +158,7 @@ char *conf;
/* inet_chk - examine one inetd.conf (tlid.conf?) entry */
-static void inet_chk(protocol, path, arg0, arg1)
-char *protocol;
-char *path;
-char *arg0;
-char *arg1;
+static void inet_chk(char *protocol, char *path, char *arg0, char *arg1)
{
char daemon[BUFSIZ];
struct stat st;
@@ -274,9 +269,7 @@ char *arg1;
/* inet_set - remember service status */
-void inet_set(name, type)
-char *name;
-int type;
+void inet_set(char *name, int type)
{
struct inet_ent *ip =
(struct inet_ent *) malloc(sizeof(struct inet_ent) + strlen(name));
@@ -293,8 +286,7 @@ int type;
/* inet_get - look up service status */
-int inet_get(name)
-char *name;
+int inet_get(char *name)
{
struct inet_ent *ip;
@@ -310,8 +302,7 @@ char *name;
/* base_name - compute last pathname component */
-static char *base_name(path)
-char *path;
+static char *base_name(char *path)
{
char *cp;
diff --git a/contrib/tcp_wrappers/misc.c b/contrib/tcp_wrappers/misc.c
index 258d7091adce..c5fb1c6e92fc 100644
--- a/contrib/tcp_wrappers/misc.c
+++ b/contrib/tcp_wrappers/misc.c
@@ -25,10 +25,7 @@ static char sccsic[] = "@(#) misc.c 1.2 96/02/11 17:01:29";
/* xgets - fgets() with backslash-newline stripping */
-char *xgets(ptr, len, fp)
-char *ptr;
-int len;
-FILE *fp;
+char *xgets(char *ptr, int len, FILE *fp)
{
int got;
char *start = ptr;
@@ -52,9 +49,7 @@ FILE *fp;
/* split_at - break string at delimiter or return NULL */
-char *split_at(string, delimiter)
-char *string;
-int delimiter;
+char *split_at(char *string, int delimiter)
{
char *cp;
@@ -87,8 +82,7 @@ int delimiter;
/* dot_quad_addr - convert dotted quad to internal form */
-unsigned long dot_quad_addr(str)
-char *str;
+unsigned long dot_quad_addr(char *str)
{
int in_run = 0;
int runs = 0;
diff --git a/contrib/tcp_wrappers/miscd.c b/contrib/tcp_wrappers/miscd.c
index 1ab835c45061..4e7db2402cd6 100644
--- a/contrib/tcp_wrappers/miscd.c
+++ b/contrib/tcp_wrappers/miscd.c
@@ -43,9 +43,7 @@ static char sccsid[] = "@(#) miscd.c 1.10 96/02/11 17:01:30";
int allow_severity = SEVERITY; /* run-time adjustable */
int deny_severity = LOG_WARNING; /* ditto */
-main(argc, argv)
-int argc;
-char **argv;
+main(int argc, char **argv)
{
struct request_info request;
char path[MAXPATHNAMELEN];
diff --git a/contrib/tcp_wrappers/myvsyslog.c b/contrib/tcp_wrappers/myvsyslog.c
index 20401f1f371b..d8cf9fd7b65f 100644
--- a/contrib/tcp_wrappers/myvsyslog.c
+++ b/contrib/tcp_wrappers/myvsyslog.c
@@ -18,10 +18,7 @@ static char sccsid[] = "@(#) myvsyslog.c 1.1 94/12/28 17:42:33";
#include "tcpd.h"
#include "mystdarg.h"
-myvsyslog(severity, format, ap)
-int severity;
-char *format;
-va_list ap;
+myvsyslog(int severity, char *format, va_list ap)
{
char fbuf[BUFSIZ];
char obuf[3 * STRING_LENGTH];
diff --git a/contrib/tcp_wrappers/ncr.c b/contrib/tcp_wrappers/ncr.c
index b903fb85a565..e62a48948ce5 100644
--- a/contrib/tcp_wrappers/ncr.c
+++ b/contrib/tcp_wrappers/ncr.c
@@ -24,8 +24,7 @@ static char sccsid[] = "@(#) ncr.c 1.1 94/12/28 17:42:34";
/* fromhost - tear down the streams stack then rebuild it */
-void fromhost(request)
-struct request_info *request;
+void fromhost(struct request_info *request)
{
int i;
int num_mod;
diff --git a/contrib/tcp_wrappers/options.c b/contrib/tcp_wrappers/options.c
index 64ad355faa61..481ba2d372d5 100644
--- a/contrib/tcp_wrappers/options.c
+++ b/contrib/tcp_wrappers/options.c
@@ -95,7 +95,8 @@ static void banners_option(); /* execute "banners path" option */
struct option {
char *name; /* keyword name, case is ignored */
- void (*func) (); /* function that does the real work */
+ void (*func) (char *value, struct request_info *request);
+ /* function that does the real work */
int flags; /* see below... */
};
@@ -132,9 +133,7 @@ static struct option option_table[] = {
/* process_options - process access control options */
-void process_options(options, request)
-char *options;
-struct request_info *request;
+void process_options(char *options, struct request_info *request)
{
char *key;
char *value;
@@ -218,9 +217,7 @@ struct request_info *request;
/* banners_option - expand %<char>, terminate each line with CRLF */
-static void banners_option(value, request)
-char *value;
-struct request_info *request;
+static void banners_option(char *value, struct request_info *request)
{
char path[MAXPATHNAMELEN];
char ibuf[BUFSIZ];
@@ -250,9 +247,7 @@ struct request_info *request;
/* ARGSUSED */
-static void group_option(value, request)
-char *value;
-struct request_info *request;
+static void group_option(char *value, struct request_info *request)
{
struct group *grp;
struct group *getgrnam();
@@ -269,9 +264,7 @@ struct request_info *request;
/* ARGSUSED */
-static void user_option(value, request)
-char *value;
-struct request_info *request;
+static void user_option(char *value, struct request_info *request)
{
struct passwd *pwd;
struct passwd *getpwnam();
@@ -291,9 +284,7 @@ struct request_info *request;
/* ARGSUSED */
-static void umask_option(value, request)
-char *value;
-struct request_info *request;
+static void umask_option(char *value, struct request_info *request)
{
unsigned mask;
char junk;
@@ -307,9 +298,7 @@ struct request_info *request;
/* ARGSUSED */
-static void spawn_option(value, request)
-char *value;
-struct request_info *request;
+static void spawn_option(char *value, struct request_info *request)
{
if (dry_run == 0)
shell_cmd(value);
@@ -319,9 +308,7 @@ struct request_info *request;
/* ARGSUSED */
-static void linger_option(value, request)
-char *value;
-struct request_info *request;
+static void linger_option(char *value, struct request_info *request)
{
struct linger linger;
char junk;
@@ -341,9 +328,7 @@ struct request_info *request;
/* ARGSUSED */
-static void keepalive_option(value, request)
-char *value;
-struct request_info *request;
+static void keepalive_option(char *value, struct request_info *request)
{
static int on = 1;
@@ -356,9 +341,7 @@ struct request_info *request;
/* ARGSUSED */
-static void nice_option(value, request)
-char *value;
-struct request_info *request;
+static void nice_option(char *value, struct request_info *request)
{
int niceval = 10;
char junk;
@@ -371,9 +354,7 @@ struct request_info *request;
/* twist_option - replace process by shell command */
-static void twist_option(value, request)
-char *value;
-struct request_info *request;
+static void twist_option(char *value, struct request_info *request)
{
char *error;
@@ -409,9 +390,7 @@ struct request_info *request;
/* rfc931_option - look up remote user name */
-static void rfc931_option(value, request)
-char *value;
-struct request_info *request;
+static void rfc931_option(char *value, struct request_info *request)
{
int timeout;
char junk;
@@ -428,9 +407,7 @@ struct request_info *request;
/* ARGSUSED */
-static void setenv_option(value, request)
-char *value;
-struct request_info *request;
+static void setenv_option(char *value, struct request_info *request)
{
char *var_value;
@@ -442,9 +419,7 @@ struct request_info *request;
/* severity_map - lookup facility or severity value */
-static int severity_map(table, name)
-const CODE *table;
-char *name;
+static int severity_map(const CODE *table, char *name)
{
const CODE *t;
int ret = -1;
@@ -464,9 +439,7 @@ char *name;
/* ARGSUSED */
-static void severity_option(value, request)
-char *value;
-struct request_info *request;
+static void severity_option(char *value, struct request_info *request)
{
char *level = split_at(value, '.');
@@ -477,8 +450,7 @@ struct request_info *request;
/* get_field - return pointer to next field in string */
-static char *get_field(string)
-char *string;
+static char *get_field(char *string)
{
static char *last = "";
char *src;
@@ -520,8 +492,7 @@ char *string;
/* chop_string - strip leading and trailing blanks from string */
-static char *chop_string(string)
-register char *string;
+static char *chop_string(register char *string)
{
char *start = 0;
char *end;
diff --git a/contrib/tcp_wrappers/percent_m.c b/contrib/tcp_wrappers/percent_m.c
index 1019b82d8c36..1cedbd9c4c0c 100644
--- a/contrib/tcp_wrappers/percent_m.c
+++ b/contrib/tcp_wrappers/percent_m.c
@@ -19,9 +19,7 @@ extern int sys_nerr;
#include "mystdarg.h"
-char *percent_m(obuf, ibuf)
-char *obuf;
-char *ibuf;
+char *percent_m(char *obuf, char *ibuf)
{
char *bp = obuf;
char *cp = ibuf;
diff --git a/contrib/tcp_wrappers/percent_x.c b/contrib/tcp_wrappers/percent_x.c
index 9b37329cf369..433dc4f9a153 100644
--- a/contrib/tcp_wrappers/percent_x.c
+++ b/contrib/tcp_wrappers/percent_x.c
@@ -29,11 +29,8 @@ extern void exit();
/* percent_x - do %<char> expansion, abort if result buffer is too small */
-char *percent_x(result, result_len, string, request)
-char *result;
-int result_len;
-char *string;
-struct request_info *request;
+char *percent_x(char *result, int result_len, char *string,
+ struct request_info *request)
{
char *bp = result;
char *end = result + result_len - 1; /* end of result buffer */
diff --git a/contrib/tcp_wrappers/ptx.c b/contrib/tcp_wrappers/ptx.c
index b9c312b82cdc..e8ea7ed08676 100644
--- a/contrib/tcp_wrappers/ptx.c
+++ b/contrib/tcp_wrappers/ptx.c
@@ -35,8 +35,7 @@ static void ptx_sink();
/* tli_host - determine TLI endpoint info, PTX version */
-void tli_host(request)
-struct request_info *request;
+void tli_host(struct request_info *request)
{
static struct sockaddr_in client;
static struct sockaddr_in server;
@@ -81,8 +80,7 @@ struct request_info *request;
/* ptx_sink - absorb unreceived IP datagram */
-static void ptx_sink(fd)
-int fd;
+static void ptx_sink(int fd)
{
char buf[BUFSIZ];
struct sockaddr sa;
diff --git a/contrib/tcp_wrappers/refuse.c b/contrib/tcp_wrappers/refuse.c
index fd04e08ae9bf..833ecbe7e3e1 100644
--- a/contrib/tcp_wrappers/refuse.c
+++ b/contrib/tcp_wrappers/refuse.c
@@ -24,8 +24,7 @@ static char sccsid[] = "@(#) refuse.c 1.5 94/12/28 17:42:39";
/* refuse - refuse request */
-void refuse(request)
-struct request_info *request;
+void refuse(struct request_info *request)
{
#ifdef INET6
syslog(deny_severity, "refused connect from %s (%s)",
diff --git a/contrib/tcp_wrappers/rfc931.c b/contrib/tcp_wrappers/rfc931.c
index 033254b61261..e2adafb8f6ff 100644
--- a/contrib/tcp_wrappers/rfc931.c
+++ b/contrib/tcp_wrappers/rfc931.c
@@ -44,10 +44,7 @@ static jmp_buf timebuf;
/* fsocket - open stdio stream on top of socket */
-static FILE *fsocket(domain, type, protocol)
-int domain;
-int type;
-int protocol;
+static FILE *fsocket(int domain, int type, int protocol)
{
int s;
FILE *fp;
@@ -73,15 +70,12 @@ static void timeout(int sig)
/* rfc931 - return remote user name, given socket structures */
-void rfc931(rmt_sin, our_sin, dest)
#ifdef INET6
-struct sockaddr *rmt_sin;
-struct sockaddr *our_sin;
+void rfc931(struct sockaddr *rmt_sin, struct sockaddr *our_sin, char *dest)
#else
-struct sockaddr_in *rmt_sin;
-struct sockaddr_in *our_sin;
+void rfc931(struct sockaddr_in *rmt_sin, struct sockaddr_in *our_sin,
+ char *dest)
#endif
-char *dest;
{
unsigned rmt_port;
unsigned our_port;
diff --git a/contrib/tcp_wrappers/safe_finger.c b/contrib/tcp_wrappers/safe_finger.c
index 7b8f3cd638a8..dba8f1bf023d 100644
--- a/contrib/tcp_wrappers/safe_finger.c
+++ b/contrib/tcp_wrappers/safe_finger.c
@@ -49,9 +49,7 @@ int sig;
exit(0);
}
-main(argc, argv)
-int argc;
-char **argv;
+main(int argc, char **argv)
{
int c;
int line_length = 0;
@@ -135,8 +133,7 @@ char **argv;
/* perror_exit - report system error text and terminate */
-void perror_exit(text)
-char *text;
+void perror_exit(char *text)
{
perror(text);
exit(1);
@@ -144,8 +141,7 @@ char *text;
/* pipe_stdin - pipe stdin through program (from my ANSI to OLD C converter) */
-int pipe_stdin(argv)
-char **argv;
+int pipe_stdin(char **argv)
{
int pipefds[2];
int pid;
diff --git a/contrib/tcp_wrappers/scaffold.c b/contrib/tcp_wrappers/scaffold.c
index 325f702a53d4..cb4211fc98ac 100644
--- a/contrib/tcp_wrappers/scaffold.c
+++ b/contrib/tcp_wrappers/scaffold.c
@@ -43,8 +43,7 @@ int deny_severity = LOG_WARNING;
#ifndef INET6
/* dup_hostent - create hostent in one memory block */
-static struct hostent *dup_hostent(hp)
-struct hostent *hp;
+static struct hostent *dup_hostent(struct hostent *hp)
{
struct hostent_block {
struct hostent host;
@@ -80,8 +79,7 @@ struct hostent *hp;
/* find_inet_addr - find all addresses for this host, result to free() */
#ifdef INET6
-struct addrinfo *find_inet_addr(host)
-char *host;
+struct addrinfo *find_inet_addr(char *host)
{
struct addrinfo hints, *res;
@@ -115,8 +113,7 @@ char *host;
return (res);
}
#else
-struct hostent *find_inet_addr(host)
-char *host;
+struct hostent *find_inet_addr(char *host)
{
struct in_addr addr;
struct hostent *hp;
@@ -161,8 +158,7 @@ char *host;
/* check_dns - give each address thorough workout, return address count */
-int check_dns(host)
-char *host;
+int check_dns(char *host)
{
struct request_info request;
#ifdef INET6
@@ -215,8 +211,7 @@ char *host;
/* ARGSUSED */
-void shell_cmd(command)
-char *command;
+void shell_cmd(char *command)
{
if (hosts_access_verbose)
printf("command: %s", command);
@@ -226,17 +221,14 @@ char *command;
/* ARGSUSED */
-void clean_exit(request)
-struct request_info *request;
+void clean_exit(struct request_info *request)
{
exit(0);
}
/* check_path - examine accessibility */
-int check_path(path, st)
-char *path;
-struct stat *st;
+int check_path(char *path, struct stat *st)
{
struct stat stbuf;
char buf[BUFSIZ];
diff --git a/contrib/tcp_wrappers/setenv.c b/contrib/tcp_wrappers/setenv.c
index 03c706280c64..6f5720d3a849 100644
--- a/contrib/tcp_wrappers/setenv.c
+++ b/contrib/tcp_wrappers/setenv.c
@@ -16,10 +16,7 @@ static char sccsid[] = "@(#) setenv.c 1.1 93/03/07 22:47:58";
*** 514 LINES SKIPPED ***