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
This commit is contained in:
Ed Maste 2023-03-21 10:08:28 -04:00
parent 87bb53cb53
commit 14f102eacc
35 changed files with 128 additions and 330 deletions

View file

@ -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)
{
/*

View file

@ -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];

View file

@ -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;

View file

@ -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);

View file

@ -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];

View file

@ -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;

View file

@ -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)
{
/*

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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];

View file

@ -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];

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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 */

View file

@ -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;

View file

@ -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)",

View file

@ -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;

View file

@ -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;

View file

@ -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];

View file

@ -16,10 +16,7 @@ static char sccsid[] = "@(#) setenv.c 1.1 93/03/07 22:47:58";
/* setenv - update or insert environment (name,value) pair */
int setenv(name, value, clobber)
char *name;
char *value;
int clobber;
int setenv(char *name, char *value, int clobber)
{
char *malloc();
char *getenv();

View file

@ -36,8 +36,7 @@ static void do_child(char *command);
/* shell_cmd - execute shell command */
void shell_cmd(command)
char *command;
void shell_cmd(char *command)
{
int child_pid;
int wait_pid;

View file

@ -52,8 +52,7 @@ static void sock_sink(int);
* that lack DNS-style trailing dot magic, such as local files or NIS maps.
*/
static struct hostent *gethostbyname_dot(name)
char *name;
static struct hostent *gethostbyname_dot(char *name)
{
char dot_name[MAXHOSTNAMELEN + 1];
@ -75,8 +74,7 @@ char *name;
/* sock_host - look up endpoint addresses and install conversion methods */
void sock_host(request)
struct request_info *request;
void sock_host(struct request_info *request)
{
#ifdef INET6
static struct sockaddr_storage client;
@ -139,8 +137,7 @@ struct request_info *request;
/* sock_hostaddr - map endpoint address to printable form */
void sock_hostaddr(host)
struct host_info *host;
void sock_hostaddr(struct host_info *host)
{
#ifdef INET6
struct sockaddr *sin = host->sin;
@ -166,8 +163,7 @@ struct host_info *host;
/* sock_hostname - map endpoint address to host name */
void sock_hostname(host)
struct host_info *host;
void sock_hostname(struct host_info *host)
{
#ifdef INET6
struct sockaddr *sin = host->sin;

View file

@ -66,8 +66,7 @@ static u_char charmap[] = {
'\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377',
};
strcasecmp(s1, s2)
char *s1, *s2;
strcasecmp(char *s1, char *s2)
{
register u_char *cm = charmap,
*us1 = (u_char *)s1,
@ -79,9 +78,7 @@ strcasecmp(s1, s2)
return(cm[*us1] - cm[*--us2]);
}
strncasecmp(s1, s2, n)
char *s1, *s2;
register int n;
strncasecmp(char *s1, char *s2, register int n)
{
register u_char *cm = charmap,
*us1 = (u_char *)s1,

View file

@ -44,9 +44,7 @@ static char sccsid[] = "@(#) tcpd.c 1.10 96/02/11 17:01:32";
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];

View file

@ -89,9 +89,7 @@ static char *myname;
static int allow_check;
static char *inetcf;
int main(argc, argv)
int argc;
char **argv;
int main(int argc, char **argv)
{
struct request_info request;
struct stat st;
@ -192,9 +190,7 @@ static void usage(void)
/* parse_table - like table_match(), but examines _all_ entries */
static void parse_table(table, request)
char *table;
struct request_info *request;
static void parse_table(char *table, struct request_info *request)
{
FILE *fp;
int real_verdict;
@ -268,9 +264,7 @@ struct request_info *request;
/* print_list - pretty-print a list */
static void print_list(title, list)
char *title;
char *list;
static void print_list(char *title, char *list)
{
char buf[BUFLEN];
char *cp;
@ -290,8 +284,7 @@ char *list;
/* check_daemon_list - criticize daemon list */
static void check_daemon_list(list)
char *list;
static void check_daemon_list(char *list)
{
char buf[BUFLEN];
char *cp;
@ -318,8 +311,7 @@ char *list;
/* check_client_list - criticize client list */
static void check_client_list(list)
char *list;
static void check_client_list(char *list)
{
char buf[BUFLEN];
char *cp;
@ -347,8 +339,7 @@ char *list;
/* check_daemon - criticize daemon pattern */
static void check_daemon(pat)
char *pat;
static void check_daemon(char *pat)
{
if (pat[0] == '@') {
tcpd_warn("%s: daemon name begins with \"@\"", pat);
@ -381,8 +372,7 @@ char *pat;
/* check_user - criticize user pattern */
static void check_user(pat)
char *pat;
static void check_user(char *pat)
{
if (pat[0] == '@') { /* @netgroup */
tcpd_warn("%s: user name begins with \"@\"", pat);
@ -404,8 +394,7 @@ char *pat;
}
#ifdef INET6
static int is_inet6_addr(pat)
char *pat;
static int is_inet6_addr(char *pat)
{
struct addrinfo hints, *res;
int len, ret;
@ -430,8 +419,7 @@ static int is_inet6_addr(pat)
/* check_host - criticize host pattern */
static int check_host(pat)
char *pat;
static int check_host(char *pat)
{
char buf[BUFSIZ];
char *mask;
@ -515,8 +503,7 @@ char *pat;
/* reserved_name - determine if name is reserved */
static int reserved_name(pat)
char *pat;
static int reserved_name(char *pat)
{
return (STR_EQ(pat, unknown)
|| STR_EQ(pat, "KNOWN")

View file

@ -53,9 +53,7 @@ static void tcpdmatch(struct request_info *request);
/* The main program */
int main(argc, argv)
int argc;
char **argv;
int main(int argc, char **argv)
{
#ifdef INET6
struct addrinfo hints, *hp, *res;
@ -316,8 +314,7 @@ char **argv;
/* Explain how to use this program */
static void usage(myname)
char *myname;
static void usage(char *myname)
{
fprintf(stderr, "usage: %s [-d] [-i inet_conf] daemon[@host] [user@]host\n",
myname);
@ -328,10 +325,7 @@ char *myname;
/* Print interesting expansions */
static void expand(text, pattern, request)
char *text;
char *pattern;
struct request_info *request;
static void expand(char *text, char *pattern, struct request_info *request)
{
char buf[BUFSIZ];
@ -341,8 +335,7 @@ struct request_info *request;
/* Try out a (server,client) pair */
static void tcpdmatch(request)
struct request_info *request;
static void tcpdmatch(struct request_info *request)
{
int verdict;

View file

@ -48,8 +48,7 @@ static void tli_sink();
/* tli_host - determine endpoint info */
int tli_host(request)
struct request_info *request;
int tli_host(struct request_info *request)
{
static struct sockaddr_in client;
static struct sockaddr_in server;
@ -144,7 +143,7 @@ struct request_info *request;
/* tli_error - convert tli error number to text */
static char *tli_error()
static char *tli_error(void)
{
static char buf[40];
@ -167,8 +166,7 @@ static char *tli_error()
/* tli_sink - absorb unreceived datagram */
static void tli_sink(fd)
int fd;
static void tli_sink(int fd)
{
struct t_unitdata *unit;
int flags;

View file

@ -63,8 +63,7 @@ static void tli_sink();
/* tli_host - look up endpoint addresses and install conversion methods */
void tli_host(request)
struct request_info *request;
void tli_host(struct request_info *request)
{
#ifdef INET6
static struct sockaddr_storage client;
@ -118,8 +117,7 @@ struct request_info *request;
/* tli_cleanup - cleanup some dynamically-allocated data structures */
static void tli_cleanup(request)
struct request_info *request;
static void tli_cleanup(struct request_info *request)
{
if (request->config != 0)
freenetconfigent(request->config);
@ -131,8 +129,7 @@ struct request_info *request;
/* tli_endpoints - determine TLI client and server endpoint information */
static void tli_endpoints(request)
struct request_info *request;
static void tli_endpoints(struct request_info *request)
{
struct t_unitdata *server;
struct t_unitdata *client;
@ -240,8 +237,7 @@ int fd;
/* tli_hostaddr - map TLI transport address to printable address */
static void tli_hostaddr(host)
struct host_info *host;
static void tli_hostaddr(struct host_info *host)
{
struct request_info *request = host->request;
struct netconfig *config = request->config;
@ -257,8 +253,7 @@ struct host_info *host;
/* tli_hostname - map TLI transport address to hostname */
static void tli_hostname(host)
struct host_info *host;
static void tli_hostname(struct host_info *host)
{
struct request_info *request = host->request;
struct netconfig *config = request->config;
@ -346,8 +341,7 @@ static char *tli_error()
/* tli_sink - absorb unreceived datagram */
static void tli_sink(fd)
int fd;
static void tli_sink(int fd)
{
struct t_unitdata *unit;
int flags;

View file

@ -37,9 +37,7 @@ static char sccsid[] = "@(#) try-from.c 1.2 94/12/28 17:42:55";
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 buf[BUFSIZ];

View file

@ -33,9 +33,8 @@ static char sccsid[] = "@(#) update.c 1.1 94/12/28 17:42:56";
/* request_fill - request update engine */
static struct request_info *request_fill(request, ap)
struct request_info *request;
va_list ap;
static struct request_info *request_fill(struct request_info *request,
va_list ap)
{
int key;
char *ptr;

View file

@ -20,10 +20,7 @@ static char sccsid[] = "@(#) vfprintf.c 1.2 94/03/23 17:44:46";
/* vfprintf - print variable-length argument list to stream */
int vfprintf(fp, format, ap)
FILE *fp;
char *format;
va_list ap;
int vfprintf(FILE *fp, char *format, va_list ap)
{
char fmt[BUFSIZ]; /* format specifier */
register char *fmtp;
@ -117,9 +114,7 @@ va_list ap;
/* vprintf - print variable-length argument list to stdout */
vprintf(format, ap)
char *format;
va_list ap;
vprintf(char *format, va_list ap)
{
return (vfprintf(stdout, format, ap));
}

View file

@ -59,8 +59,7 @@ char sccsid[] = "@(#) workarounds.c 1.6 96/03/19 16:22:25";
#undef inet_addr
long fix_inet_addr(string)
char *string;
long fix_inet_addr(char *string)
{
return (inet_addr(string).s_addr);
}
@ -80,10 +79,7 @@ char *string;
#undef fgets
char *fix_fgets(buf, len, fp)
char *buf;
int len;
FILE *fp;
char *fix_fgets(char *buf, int len, FILE *fp)
{
char *cp = buf;
int c;
@ -123,13 +119,8 @@ FILE *fp;
#undef recvfrom
int fix_recvfrom(sock, buf, buflen, flags, from, fromlen)
int sock;
char *buf;
int buflen;
int flags;
struct sockaddr *from;
int *fromlen;
int fix_recvfrom(int sock, char *buf, int buflen, int flags,
struct sockaddr *from, int *fromlen)
{
int ret;
@ -163,10 +154,7 @@ int *fromlen;
#undef getpeername
int fix_getpeername(sock, sa, len)
int sock;
struct sockaddr *sa;
int *len;
int fix_getpeername(int sock, struct sockaddr *sa, int *len)
{
int ret;
#ifdef INET6
@ -202,8 +190,7 @@ int *len;
#ifdef USE_GETDOMAIN
int yp_get_default_domain(ptr)
char **ptr;
int yp_get_default_domain(char **ptr)
{
static char mydomain[MAXHOSTNAMELEN];
@ -231,8 +218,7 @@ char **ptr;
#undef gethostbyname
struct hostent *fix_gethostbyname(name)
char *name;
struct hostent *fix_gethostbyname(char *name)
{
struct hostent *hp;
struct in_addr addr;
@ -269,9 +255,7 @@ char *name;
#ifdef USE_STRSEP
char *fix_strtok(buf, sep)
char *buf;
char *sep;
char *fix_strtok(char *buf, char *sep)
{
static char *state;
char *result;
@ -294,9 +278,7 @@ char *sep;
#ifdef LIBC_CALLS_STRTOK
char *my_strtok(buf, sep)
char *buf;
char *sep;
char *my_strtok(char *buf, char *sep)
{
static char *state;
char *result;