Module Name: src
Committed By: riz
Date: Mon Apr 23 23:40:41 UTC 2012
Modified Files:
src/lib/libc/stdlib [netbsd-6]: jemalloc.c
src/lib/libintl [netbsd-6]: gettext.c textdomain.c
src/lib/libkvm [netbsd-6]: kvm_getloadavg.c
src/lib/librmt [netbsd-6]: rmtlib.c
src/lib/librumpclient [netbsd-6]: rumpclient.c
src/lib/libskey [netbsd-6]: skeysubr.c
src/lib/libwrap [netbsd-6]: clean_exit.c diag.c eval.c fix_options.c
hosts_access.c hosts_ctl.c misc.c options.c percent_x.c refuse.c
rfc931.c shell_cmd.c socket.c tcpd.h update.c
src/lib/liby [netbsd-6]: yyerror.c
Log Message:
Back out changes committed as part of ticket #195 which were apparently
not intended as part of the pullup request. Should fix netbsd-6 build.
To generate a diff of this commit:
cvs rdiff -u -r1.24.6.1 -r1.24.6.2 src/lib/libc/stdlib/jemalloc.c
cvs rdiff -u -r1.26.2.1 -r1.26.2.2 src/lib/libintl/gettext.c
cvs rdiff -u -r1.12.30.1 -r1.12.30.2 src/lib/libintl/textdomain.c
cvs rdiff -u -r1.10.8.1 -r1.10.8.2 src/lib/libkvm/kvm_getloadavg.c
cvs rdiff -u -r1.25.4.1 -r1.25.4.2 src/lib/librmt/rmtlib.c
cvs rdiff -u -r1.47.2.1 -r1.47.2.2 src/lib/librumpclient/rumpclient.c
cvs rdiff -u -r1.26.42.1 -r1.26.42.2 src/lib/libskey/skeysubr.c
cvs rdiff -u -r1.4.66.1 -r1.4.66.2 src/lib/libwrap/clean_exit.c \
src/lib/libwrap/hosts_ctl.c src/lib/libwrap/percent_x.c \
src/lib/libwrap/refuse.c
cvs rdiff -u -r1.8.50.1 -r1.8.50.2 src/lib/libwrap/diag.c
cvs rdiff -u -r1.6.56.1 -r1.6.56.2 src/lib/libwrap/eval.c
cvs rdiff -u -r1.10.44.1 -r1.10.44.2 src/lib/libwrap/fix_options.c
cvs rdiff -u -r1.19.10.1 -r1.19.10.2 src/lib/libwrap/hosts_access.c
cvs rdiff -u -r1.9.56.1 -r1.9.56.2 src/lib/libwrap/misc.c
cvs rdiff -u -r1.14.44.1 -r1.14.44.2 src/lib/libwrap/options.c
cvs rdiff -u -r1.8.56.1 -r1.8.56.2 src/lib/libwrap/rfc931.c \
src/lib/libwrap/update.c
cvs rdiff -u -r1.5.58.1 -r1.5.58.2 src/lib/libwrap/shell_cmd.c
cvs rdiff -u -r1.18.44.1 -r1.18.44.2 src/lib/libwrap/socket.c
cvs rdiff -u -r1.12.56.1 -r1.12.56.2 src/lib/libwrap/tcpd.h
cvs rdiff -u -r1.8.56.1 -r1.8.56.2 src/lib/liby/yyerror.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/stdlib/jemalloc.c
diff -u src/lib/libc/stdlib/jemalloc.c:1.24.6.1 src/lib/libc/stdlib/jemalloc.c:1.24.6.2
--- src/lib/libc/stdlib/jemalloc.c:1.24.6.1 Mon Apr 23 16:49:02 2012
+++ src/lib/libc/stdlib/jemalloc.c Mon Apr 23 23:40:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: jemalloc.c,v 1.24.6.1 2012/04/23 16:49:02 riz Exp $ */
+/* $NetBSD: jemalloc.c,v 1.24.6.2 2012/04/23 23:40:40 riz Exp $ */
/*-
* Copyright (C) 2006,2007 Jason Evans <[email protected]>.
@@ -118,7 +118,7 @@
#include <sys/cdefs.h>
/* __FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.147 2007/06/15 22:00:16 jasone Exp $"); */
-__RCSID("$NetBSD: jemalloc.c,v 1.24.6.1 2012/04/23 16:49:02 riz Exp $");
+__RCSID("$NetBSD: jemalloc.c,v 1.24.6.2 2012/04/23 23:40:40 riz Exp $");
#ifdef __FreeBSD__
#include "libc_private.h"
@@ -3227,8 +3227,7 @@ malloc_print_stats(void)
"");
_malloc_message("Chunk size: ", umax2s(chunksize, s), "", "");
- _malloc_message(" (2^", umax2s((size_t)opt_chunk_2pow, s),
- ")\n", "");
+ _malloc_message(" (2^", umax2s(opt_chunk_2pow, s), ")\n", "");
#ifdef MALLOC_STATS
{
Index: src/lib/libintl/gettext.c
diff -u src/lib/libintl/gettext.c:1.26.2.1 src/lib/libintl/gettext.c:1.26.2.2
--- src/lib/libintl/gettext.c:1.26.2.1 Mon Apr 23 16:48:59 2012
+++ src/lib/libintl/gettext.c Mon Apr 23 23:40:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: gettext.c,v 1.26.2.1 2012/04/23 16:48:59 riz Exp $ */
+/* $NetBSD: gettext.c,v 1.26.2.2 2012/04/23 23:40:40 riz Exp $ */
/*-
* Copyright (c) 2000, 2001 Citrus Project,
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: gettext.c,v 1.26.2.1 2012/04/23 16:48:59 riz Exp $");
+__RCSID("$NetBSD: gettext.c,v 1.26.2.2 2012/04/23 23:40:40 riz Exp $");
#include <sys/param.h>
#include <sys/stat.h>
@@ -303,8 +303,8 @@ static int
get_sysdep_string_table(struct mosysdepstr_h **table_h, uint32_t *ofstable,
uint32_t nstrings, uint32_t magic, char *base)
{
- unsigned int i;
- int j, count;
+ int i, j;
+ int count;
size_t l;
struct mosysdepstr *table;
@@ -398,7 +398,7 @@ setup_sysdep_stuffs(struct mo *mo, struc
uint32_t magic;
struct moentry *stable;
size_t l;
- unsigned int i;
+ int i;
char *v;
uint32_t *ofstable;
@@ -480,7 +480,7 @@ mapit(const char *path, struct domainbin
struct moentry_h *p;
struct mo *mo;
size_t l, headerlen;
- unsigned int i;
+ int i;
char *v;
struct mohandle *mohandle = &db->mohandle;
@@ -772,7 +772,7 @@ lookup_bsearch(const char *msgid, struct
/* avoid possible infinite loop, when the data is not sorted */
if (omiddle == middle)
break;
- if ((size_t)middle >= mohandle->mo.mo_nstring)
+ if (middle < 0 || middle >= mohandle->mo.mo_nstring)
break;
n = strcmp(msgid, mohandle->mo.mo_otable[middle].off);
Index: src/lib/libintl/textdomain.c
diff -u src/lib/libintl/textdomain.c:1.12.30.1 src/lib/libintl/textdomain.c:1.12.30.2
--- src/lib/libintl/textdomain.c:1.12.30.1 Mon Apr 23 16:49:00 2012
+++ src/lib/libintl/textdomain.c Mon Apr 23 23:40:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: textdomain.c,v 1.12.30.1 2012/04/23 16:49:00 riz Exp $ */
+/* $NetBSD: textdomain.c,v 1.12.30.2 2012/04/23 23:40:40 riz Exp $ */
/*-
* Copyright (c) 2000, 2001 Citrus Project,
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: textdomain.c,v 1.12.30.1 2012/04/23 16:49:00 riz Exp $");
+__RCSID("$NetBSD: textdomain.c,v 1.12.30.2 2012/04/23 23:40:40 riz Exp $");
#include <sys/param.h>
@@ -39,8 +39,7 @@ __RCSID("$NetBSD: textdomain.c,v 1.12.30
#include "pathnames.h"
static struct domainbinding __default_binding = {
- .path = { _PATH_TEXTDOMAIN },
- .domainname = { DEFAULT_DOMAINNAME },
+ NULL, DEFAULT_DOMAINNAME, _PATH_TEXTDOMAIN,
};
struct domainbinding *__bindings = &__default_binding;
char __current_domainname[PATH_MAX] = DEFAULT_DOMAINNAME;
Index: src/lib/libkvm/kvm_getloadavg.c
diff -u src/lib/libkvm/kvm_getloadavg.c:1.10.8.1 src/lib/libkvm/kvm_getloadavg.c:1.10.8.2
--- src/lib/libkvm/kvm_getloadavg.c:1.10.8.1 Mon Apr 23 16:48:53 2012
+++ src/lib/libkvm/kvm_getloadavg.c Mon Apr 23 23:40:40 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: kvm_getloadavg.c,v 1.10.8.1 2012/04/23 16:48:53 riz Exp $ */
+/* $NetBSD: kvm_getloadavg.c,v 1.10.8.2 2012/04/23 23:40:40 riz Exp $ */
/*-
* Copyright (c) 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)kvm_getloadavg.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: kvm_getloadavg.c,v 1.10.8.1 2012/04/23 16:48:53 riz Exp $");
+__RCSID("$NetBSD: kvm_getloadavg.c,v 1.10.8.2 2012/04/23 23:40:40 riz Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -56,11 +56,11 @@ __RCSID("$NetBSD: kvm_getloadavg.c,v 1.1
#include "kvm_private.h"
static struct nlist nl[] = {
- { .n_name = "_averunnable" },
+ { "_averunnable" },
#define X_AVERUNNABLE 0
- { .n_name = "_fscale" },
+ { "_fscale" },
#define X_FSCALE 1
- { .n_name = "" },
+ { "" },
};
/*
Index: src/lib/librmt/rmtlib.c
diff -u src/lib/librmt/rmtlib.c:1.25.4.1 src/lib/librmt/rmtlib.c:1.25.4.2
--- src/lib/librmt/rmtlib.c:1.25.4.1 Mon Apr 23 16:49:03 2012
+++ src/lib/librmt/rmtlib.c Mon Apr 23 23:40:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: rmtlib.c,v 1.25.4.1 2012/04/23 16:49:03 riz Exp $ */
+/* $NetBSD: rmtlib.c,v 1.25.4.2 2012/04/23 23:40:41 riz Exp $ */
/*
* rmt --- remote tape emulator subroutines
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: rmtlib.c,v 1.25.4.1 2012/04/23 16:49:03 riz Exp $");
+__RCSID("$NetBSD: rmtlib.c,v 1.25.4.2 2012/04/23 23:40:41 riz Exp $");
#define RMTIOCTL 1
/* #define USE_REXEC 1 */ /* rexec code courtesy of Dan Kegel, srs!dan */
@@ -114,7 +114,7 @@ command(int fildes, const char *buf)
blen = strlen(buf);
pstat = signal(SIGPIPE, SIG_IGN);
- if ((size_t)write(WRITE(fildes), buf, blen) == blen) {
+ if (write(WRITE(fildes), buf, blen) == blen) {
signal(SIGPIPE, pstat);
return 0;
}
@@ -254,7 +254,7 @@ _rmt_open(const char *path, int oflag, i
char device[BUFMAGIC];
char login[BUFMAGIC];
char *sys, *dev, *user;
- const char *rshpath, *rsh;
+ char *rshpath, *rsh;
_DIAGASSERT(path != NULL);
@@ -422,7 +422,7 @@ _rmt_read(int fildes, void *buf, size_t
if (command(fildes, buffer) == -1 || (rv = status(fildes)) == -1)
return -1;
- if (rv > (int)nbyte)
+ if (rv > nbyte)
rv = (int)nbyte;
for (rc = rv, p = buf; rc > 0; rc -= nread, p += nread) {
@@ -453,7 +453,7 @@ _rmt_write(int fildes, const void *buf,
return -1;
pstat = signal(SIGPIPE, SIG_IGN);
- if ((size_t)write(WRITE(fildes), buf, nbyte) == nbyte) {
+ if (write(WRITE(fildes), buf, nbyte) == nbyte) {
signal(SIGPIPE, pstat);
return status(fildes);
}
Index: src/lib/librumpclient/rumpclient.c
diff -u src/lib/librumpclient/rumpclient.c:1.47.2.1 src/lib/librumpclient/rumpclient.c:1.47.2.2
--- src/lib/librumpclient/rumpclient.c:1.47.2.1 Mon Apr 23 16:49:03 2012
+++ src/lib/librumpclient/rumpclient.c Mon Apr 23 23:40:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpclient.c,v 1.47.2.1 2012/04/23 16:49:03 riz Exp $ */
+/* $NetBSD: rumpclient.c,v 1.47.2.2 2012/04/23 23:40:41 riz Exp $ */
/*
* Copyright (c) 2010, 2011 Antti Kantee. All Rights Reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: rumpclient.c,v 1.47.2.1 2012/04/23 16:49:03 riz Exp $");
+__RCSID("$NetBSD: rumpclient.c,v 1.47.2.2 2012/04/23 23:40:41 riz Exp $");
#include <sys/param.h>
#include <sys/event.h>
@@ -588,8 +588,8 @@ static int
dupgood(int myfd, int mustchange)
{
int ofds[4];
+ int i;
int sverrno;
- unsigned int i;
for (i = 0; (myfd <= 2 || mustchange) && myfd != -1; i++) {
assert(i < __arraycount(ofds));
@@ -605,7 +605,7 @@ dupgood(int myfd, int mustchange)
if (myfd == -1 && i > 0)
sverrno = errno;
- while (i-- > 0) {
+ for (i--; i >= 0; i--) {
host_close(ofds[i]);
}
@@ -740,7 +740,7 @@ rumpclient__dlsym(void *handle, const ch
return dlsym(handle, symbol);
}
-__weak_alias(rumphijack_dlsym,rumpclient__dlsym)
+__weak_alias(rumphijack_dlsym,rumpclient__dlsym);
static pid_t init_done = 0;
Index: src/lib/libskey/skeysubr.c
diff -u src/lib/libskey/skeysubr.c:1.26.42.1 src/lib/libskey/skeysubr.c:1.26.42.2
--- src/lib/libskey/skeysubr.c:1.26.42.1 Mon Apr 23 16:48:52 2012
+++ src/lib/libskey/skeysubr.c Mon Apr 23 23:40:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: skeysubr.c,v 1.26.42.1 2012/04/23 16:48:52 riz Exp $ */
+/* $NetBSD: skeysubr.c,v 1.26.42.2 2012/04/23 23:40:41 riz Exp $ */
/* S/KEY v1.1b (skeysubr.c)
*
@@ -15,7 +15,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: skeysubr.c,v 1.26.42.1 2012/04/23 16:48:52 riz Exp $");
+__RCSID("$NetBSD: skeysubr.c,v 1.26.42.2 2012/04/23 23:40:41 riz Exp $");
#include <ctype.h>
#include <stdio.h>
@@ -69,7 +69,7 @@ static struct skey_algorithm_table skey_
#if 0
{ "rmd160", keycrunch_rmd160, f_rmd160 },
#endif
- { NULL, NULL, NULL }
+ { NULL }
};
/*
@@ -479,7 +479,7 @@ const char *skey_set_algorithm(const cha
}
/* Get current hash type */
-const char *skey_get_algorithm(void)
+const char *skey_get_algorithm()
{
return(skey_algorithm_table[skey_hash_type].name);
}
Index: src/lib/libwrap/clean_exit.c
diff -u src/lib/libwrap/clean_exit.c:1.4.66.1 src/lib/libwrap/clean_exit.c:1.4.66.2
--- src/lib/libwrap/clean_exit.c:1.4.66.1 Mon Apr 23 16:48:57 2012
+++ src/lib/libwrap/clean_exit.c Mon Apr 23 23:40:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: clean_exit.c,v 1.4.66.1 2012/04/23 16:48:57 riz Exp $ */
+/* $NetBSD: clean_exit.c,v 1.4.66.2 2012/04/23 23:40:41 riz Exp $ */
/*
* clean_exit() cleans up and terminates the program. It should be called
@@ -15,7 +15,7 @@
#if 0
static char sccsid[] = "@(#) clean_exit.c 1.4 94/12/28 17:42:19";
#else
-__RCSID("$NetBSD: clean_exit.c,v 1.4.66.1 2012/04/23 16:48:57 riz Exp $");
+__RCSID("$NetBSD: clean_exit.c,v 1.4.66.2 2012/04/23 23:40:41 riz Exp $");
#endif
#endif
@@ -27,8 +27,8 @@ __RCSID("$NetBSD: clean_exit.c,v 1.4.66.
/* clean_exit - clean up and exit */
-void
-clean_exit(struct request_info *request)
+void clean_exit(request)
+struct request_info *request;
{
/*
Index: src/lib/libwrap/hosts_ctl.c
diff -u src/lib/libwrap/hosts_ctl.c:1.4.66.1 src/lib/libwrap/hosts_ctl.c:1.4.66.2
--- src/lib/libwrap/hosts_ctl.c:1.4.66.1 Mon Apr 23 16:48:54 2012
+++ src/lib/libwrap/hosts_ctl.c Mon Apr 23 23:40:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: hosts_ctl.c,v 1.4.66.1 2012/04/23 16:48:54 riz Exp $ */
+/* $NetBSD: hosts_ctl.c,v 1.4.66.2 2012/04/23 23:40:41 riz Exp $ */
/*
* hosts_ctl() combines common applications of the host access control
@@ -18,7 +18,7 @@
#if 0
static char sccsid[] = "@(#) hosts_ctl.c 1.4 94/12/28 17:42:27";
#else
-__RCSID("$NetBSD: hosts_ctl.c,v 1.4.66.1 2012/04/23 16:48:54 riz Exp $");
+__RCSID("$NetBSD: hosts_ctl.c,v 1.4.66.2 2012/04/23 23:40:41 riz Exp $");
#endif
#endif
@@ -28,8 +28,11 @@ __RCSID("$NetBSD: hosts_ctl.c,v 1.4.66.1
/* hosts_ctl - limited interface to the hosts_access() routine */
-int
-hosts_ctl(char *daemon, char *name, char *addr, char *user)
+int hosts_ctl(daemon, name, addr, user)
+char *daemon;
+char *name;
+char *addr;
+char *user;
{
struct request_info request;
Index: src/lib/libwrap/percent_x.c
diff -u src/lib/libwrap/percent_x.c:1.4.66.1 src/lib/libwrap/percent_x.c:1.4.66.2
--- src/lib/libwrap/percent_x.c:1.4.66.1 Mon Apr 23 16:48:54 2012
+++ src/lib/libwrap/percent_x.c Mon Apr 23 23:40:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: percent_x.c,v 1.4.66.1 2012/04/23 16:48:54 riz Exp $ */
+/* $NetBSD: percent_x.c,v 1.4.66.2 2012/04/23 23:40:41 riz Exp $ */
/*
* percent_x() takes a string and performs %<char> expansions. It aborts the
@@ -17,7 +17,7 @@
#if 0
static char sccsid[] = "@(#) percent_x.c 1.4 94/12/28 17:42:37";
#else
-__RCSID("$NetBSD: percent_x.c,v 1.4.66.1 2012/04/23 16:48:54 riz Exp $");
+__RCSID("$NetBSD: percent_x.c,v 1.4.66.2 2012/04/23 23:40:41 riz Exp $");
#endif
#endif
@@ -35,17 +35,19 @@ __RCSID("$NetBSD: percent_x.c,v 1.4.66.1
/* percent_x - do %<char> expansion, abort if result buffer is too small */
-char *
-percent_x(char *result, int result_len, char *string,
- struct request_info *request)
+char *percent_x(result, result_len, string, request)
+char *result;
+int result_len;
+char *string;
+struct request_info *request;
{
char *bp = result;
char *end = result + result_len - 1; /* end of result buffer */
char *expansion;
- size_t expansion_len;
- static const char ok_chars[] = "1234567890!@%-_=+:,./"
- "abcdefghijklmnopqrstuvwxyz"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ int expansion_len;
+ static char ok_chars[] = "1234567890!@%-_=+:,./\
+abcdefghijklmnopqrstuvwxyz\
+ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char *str = string;
char *cp;
int ch;
@@ -70,8 +72,7 @@ percent_x(char *result, int result_len,
ch == 'p' ? eval_pid(request) :
ch == 's' ? eval_server(request) :
ch == 'u' ? eval_user(request) :
- ch == '%' ? __UNCONST("%")
- : (tcpd_warn("unrecognized %%%c", ch), __UNCONST(""));
+ ch == '%' ? "%" : (tcpd_warn("unrecognized %%%c", ch), "");
for (cp = expansion; *(cp += strspn(cp, ok_chars)); /* */ )
*cp = '_';
expansion_len = cp - expansion;
Index: src/lib/libwrap/refuse.c
diff -u src/lib/libwrap/refuse.c:1.4.66.1 src/lib/libwrap/refuse.c:1.4.66.2
--- src/lib/libwrap/refuse.c:1.4.66.1 Mon Apr 23 16:48:57 2012
+++ src/lib/libwrap/refuse.c Mon Apr 23 23:40:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: refuse.c,v 1.4.66.1 2012/04/23 16:48:57 riz Exp $ */
+/* $NetBSD: refuse.c,v 1.4.66.2 2012/04/23 23:40:41 riz Exp $ */
/*
* refuse() reports a refused connection, and takes the consequences: in
@@ -14,7 +14,7 @@
#if 0
static char sccsid[] = "@(#) refuse.c 1.5 94/12/28 17:42:39";
#else
-__RCSID("$NetBSD: refuse.c,v 1.4.66.1 2012/04/23 16:48:57 riz Exp $");
+__RCSID("$NetBSD: refuse.c,v 1.4.66.2 2012/04/23 23:40:41 riz Exp $");
#endif
#endif
@@ -29,8 +29,8 @@ __RCSID("$NetBSD: refuse.c,v 1.4.66.1 20
/* refuse - refuse request */
-void
-refuse(struct request_info *request)
+void refuse(request)
+struct request_info *request;
{
syslog(deny_severity, "refused connect from %s", eval_client(request));
clean_exit(request);
Index: src/lib/libwrap/diag.c
diff -u src/lib/libwrap/diag.c:1.8.50.1 src/lib/libwrap/diag.c:1.8.50.2
--- src/lib/libwrap/diag.c:1.8.50.1 Mon Apr 23 16:48:57 2012
+++ src/lib/libwrap/diag.c Mon Apr 23 23:40:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: diag.c,v 1.8.50.1 2012/04/23 16:48:57 riz Exp $ */
+/* $NetBSD: diag.c,v 1.8.50.2 2012/04/23 23:40:41 riz Exp $ */
/*
* Routines to report various classes of problems. Each report is decorated
@@ -16,14 +16,13 @@
#if 0
static char sccsid[] = "@(#) diag.c 1.1 94/12/28 17:42:20";
#else
-__RCSID("$NetBSD: diag.c,v 1.8.50.1 2012/04/23 16:48:57 riz Exp $");
+__RCSID("$NetBSD: diag.c,v 1.8.50.2 2012/04/23 23:40:41 riz Exp $");
#endif
#endif
/* System libraries */
#include <syslog.h>
-#include <stdarg.h>
#include <stdio.h>
#include <setjmp.h>
#include <string.h>
@@ -32,22 +31,25 @@ __RCSID("$NetBSD: diag.c,v 1.8.50.1 2012
/* Local stuff */
#include "tcpd.h"
+#include "mystdarg.h"
struct tcpd_context tcpd_context;
jmp_buf tcpd_buf;
-static void tcpd_diag(int, const char *, const char *, va_list)
+static void tcpd_diag __P((int, char *, char *, va_list))
__attribute__((__format__(__printf__, 3, 0)));
/* tcpd_diag - centralize error reporter */
-static void
-tcpd_diag(int severity, const char *tag, const char *format, va_list ap)
+static void tcpd_diag(severity, tag, format, ap)
+int severity;
+char *tag;
+char *format;
+va_list ap;
{
char fmt[BUFSIZ];
char buf[BUFSIZ];
- size_t i, o;
- int oerrno;
+ int i, o, oerrno;
/* save errno in case we need it */
oerrno = errno;
@@ -81,25 +83,23 @@ tcpd_diag(int severity, const char *tag,
/* tcpd_warn - report problem of some sort and proceed */
-void
-tcpd_warn(const char *format, ...)
+void VARARGS(tcpd_warn, char *, format)
{
va_list ap;
- va_start(ap, format);
+ VASTART(ap, char *, format);
tcpd_diag(LOG_ERR, "warning", format, ap);
- va_end(ap);
+ VAEND(ap);
}
/* tcpd_jump - report serious problem and jump */
-void
-tcpd_jump(const char *format, ...)
+void VARARGS(tcpd_jump, char *, format)
{
va_list ap;
- va_start(ap, format);
+ VASTART(ap, char *, format);
tcpd_diag(LOG_ERR, "error", format, ap);
- va_end(ap);
+ VAEND(ap);
longjmp(tcpd_buf, AC_ERROR);
}
Index: src/lib/libwrap/eval.c
diff -u src/lib/libwrap/eval.c:1.6.56.1 src/lib/libwrap/eval.c:1.6.56.2
--- src/lib/libwrap/eval.c:1.6.56.1 Mon Apr 23 16:48:56 2012
+++ src/lib/libwrap/eval.c Mon Apr 23 23:40:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: eval.c,v 1.6.56.1 2012/04/23 16:48:56 riz Exp $ */
+/* $NetBSD: eval.c,v 1.6.56.2 2012/04/23 23:40:41 riz Exp $ */
/*
* Routines for controlled evaluation of host names, user names, and so on.
@@ -25,7 +25,7 @@
#if 0
static char sccsid[] = "@(#) eval.c 1.3 95/01/30 19:51:45";
#else
-__RCSID("$NetBSD: eval.c,v 1.6.56.1 2012/04/23 16:48:56 riz Exp $");
+__RCSID("$NetBSD: eval.c,v 1.6.56.2 2012/04/23 23:40:41 riz Exp $");
#endif
#endif
@@ -49,8 +49,8 @@ char paranoid[] = STRING_PARANOID;
/* eval_user - look up user name */
-char *
-eval_user(struct request_info *request)
+char *eval_user(request)
+struct request_info *request;
{
if (request->user[0] == 0) {
(void)strlcpy(request->user, unknown, sizeof(request->user));
@@ -62,8 +62,8 @@ eval_user(struct request_info *request)
/* eval_hostaddr - look up printable address */
-char *
-eval_hostaddr(struct host_info *host)
+char *eval_hostaddr(host)
+struct host_info *host;
{
if (host->addr[0] == 0) {
(void)strlcpy(host->addr, unknown, sizeof(host->addr));
@@ -75,8 +75,8 @@ eval_hostaddr(struct host_info *host)
/* eval_hostname - look up host name */
-char *
-eval_hostname(struct host_info *host)
+char *eval_hostname(host)
+struct host_info *host;
{
if (host->name[0] == 0) {
(void)strlcpy(host->name, unknown, sizeof(host->name));
@@ -88,8 +88,8 @@ eval_hostname(struct host_info *host)
/* eval_hostinfo - return string with host name (preferred) or address */
-char *
-eval_hostinfo(struct host_info *host)
+char *eval_hostinfo(host)
+struct host_info *host;
{
char *hostname;
@@ -107,8 +107,8 @@ eval_hostinfo(struct host_info *host)
/* eval_client - return string with as much about the client as we know */
-char *
-eval_client(struct request_info *request)
+char *eval_client(request)
+struct request_info *request;
{
static char both[2 * STRING_LENGTH];
char *hostinfo = eval_hostinfo(request->client);
@@ -127,8 +127,8 @@ eval_client(struct request_info *request
/* eval_server - return string with as much about the server as we know */
-char *
-eval_server(struct request_info *request)
+char *eval_server(request)
+struct request_info *request;
{
static char both[2 * STRING_LENGTH];
char *host = eval_hostinfo(request->server);
Index: src/lib/libwrap/fix_options.c
diff -u src/lib/libwrap/fix_options.c:1.10.44.1 src/lib/libwrap/fix_options.c:1.10.44.2
--- src/lib/libwrap/fix_options.c:1.10.44.1 Mon Apr 23 16:48:54 2012
+++ src/lib/libwrap/fix_options.c Mon Apr 23 23:40:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: fix_options.c,v 1.10.44.1 2012/04/23 16:48:54 riz Exp $ */
+/* $NetBSD: fix_options.c,v 1.10.44.2 2012/04/23 23:40:41 riz Exp $ */
/*
* Routine to disable IP-level socket options. This code was taken from 4.4BSD
@@ -12,7 +12,7 @@
#if 0
static char sccsid[] = "@(#) fix_options.c 1.6 97/04/08 02:29:19";
#else
-__RCSID("$NetBSD: fix_options.c,v 1.10.44.1 2012/04/23 16:48:54 riz Exp $");
+__RCSID("$NetBSD: fix_options.c,v 1.10.44.2 2012/04/23 23:40:41 riz Exp $");
#endif
#endif
@@ -40,7 +40,8 @@ __RCSID("$NetBSD: fix_options.c,v 1.10.4
/* fix_options - get rid of IP-level socket options */
void
-fix_options(struct request_info *request)
+fix_options(request)
+struct request_info *request;
{
#ifdef IP_OPTIONS
unsigned char optbuf[BUFFER_SIZE / 3], *cp;
Index: src/lib/libwrap/hosts_access.c
diff -u src/lib/libwrap/hosts_access.c:1.19.10.1 src/lib/libwrap/hosts_access.c:1.19.10.2
--- src/lib/libwrap/hosts_access.c:1.19.10.1 Mon Apr 23 16:48:53 2012
+++ src/lib/libwrap/hosts_access.c Mon Apr 23 23:40:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: hosts_access.c,v 1.19.10.1 2012/04/23 16:48:53 riz Exp $ */
+/* $NetBSD: hosts_access.c,v 1.19.10.2 2012/04/23 23:40:41 riz Exp $ */
/*
* This module implements a simple access control language that is based on
@@ -24,7 +24,7 @@
#if 0
static char sccsid[] = "@(#) hosts_access.c 1.21 97/02/12 02:13:22";
#else
-__RCSID("$NetBSD: hosts_access.c,v 1.19.10.1 2012/04/23 16:48:53 riz Exp $");
+__RCSID("$NetBSD: hosts_access.c,v 1.19.10.2 2012/04/23 23:40:41 riz Exp $");
#endif
#endif
@@ -72,8 +72,8 @@ static char sep[] = ", \t\r\n";
* verification mode.
*/
-const char *hosts_allow_table = HOSTS_ALLOW;
-const char *hosts_deny_table = HOSTS_DENY;
+char *hosts_allow_table = HOSTS_ALLOW;
+char *hosts_deny_table = HOSTS_DENY;
int hosts_access_verbose = 0;
/*
@@ -84,19 +84,19 @@ int resident = (-1); /* -1, 0: unkn
/* Forward declarations. */
-static int table_match(const char *, struct request_info *);
-static int list_match(char *, struct request_info *,
- int (*)(char *, struct request_info *));
-static int server_match(char *, struct request_info *);
-static int client_match(char *, struct request_info *);
-static int host_match(char *, struct host_info *);
-static int hostfile_match(char *, struct host_info *);
-static int rbl_match(char *, char *);
-static int string_match(char *, char *);
-static int masked_match(char *, char *, char *);
-static int masked_match4(char *, char *, char *);
+static int table_match __P((char *, struct request_info *));
+static int list_match __P((char *, struct request_info *,
+ int (*)(char *, struct request_info *)));
+static int server_match __P((char *, struct request_info *));
+static int client_match __P((char *, struct request_info *));
+static int host_match __P((char *, struct host_info *));
+static int hostfile_match __P((char *, struct host_info *));
+static int rbl_match __P((char *, char *));
+static int string_match __P((char *, char *));
+static int masked_match __P((char *, char *, char *));
+static int masked_match4 __P((char *, char *, char *));
#ifdef INET6
-static int masked_match6(char *, char *, char *);
+static int masked_match6 __P((char *, char *, char *));
#endif
/* Size of logical line buffer. */
@@ -105,8 +105,8 @@ static int masked_match6(char *, char *,
/* hosts_access - host access control facility */
-int
-hosts_access(struct request_info *request)
+int hosts_access(request)
+struct request_info *request;
{
int verdict;
@@ -139,8 +139,9 @@ hosts_access(struct request_info *reques
/* table_match - match table entries with (daemon, client) pair */
-static int
-table_match(const char *table, struct request_info *request)
+static int table_match(table, request)
+char *table;
+struct request_info *request;
{
FILE *fp;
char sv_list[BUFLEN]; /* becomes list of daemons */
@@ -197,9 +198,10 @@ table_match(const char *table, struct re
/* list_match - match a request against a list of patterns with exceptions */
-static int
-list_match(char *list, struct request_info *request,
- int (*match_fn)(char *, struct request_info *))
+static int list_match(list, request, match_fn)
+char *list;
+struct request_info *request;
+int (*match_fn) __P((char *, struct request_info *));
{
char *tok;
static char *last;
@@ -232,8 +234,9 @@ list_match(char *list, struct request_in
/* server_match - match server information */
-static int
-server_match(char *tok, struct request_info *request)
+static int server_match(tok, request)
+char *tok;
+struct request_info *request;
{
char *host;
@@ -247,8 +250,9 @@ server_match(char *tok, struct request_i
/* client_match - match client information */
-static int
-client_match(char *tok, struct request_info *request)
+static int client_match(tok, request)
+char *tok;
+struct request_info *request;
{
char *host;
@@ -262,8 +266,9 @@ client_match(char *tok, struct request_i
/* host_match - match host name and/or address against pattern */
-static int
-host_match(char *tok, struct host_info *host)
+static int host_match(tok, host)
+char *tok;
+struct host_info *host;
{
char *mask;
@@ -306,8 +311,9 @@ host_match(char *tok, struct host_info *
/* hostfile_match - look up host patterns from file */
-static int
-hostfile_match(char *path, struct host_info *host)
+static int hostfile_match(path, host)
+char *path;
+struct host_info *host;
{
char tok[BUFSIZ];
int match = NO;
@@ -325,10 +331,9 @@ hostfile_match(char *path, struct host_i
/* rbl_match() - match host by looking up in RBL domain */
-static int
-rbl_match(
- char *rbl_domain, /* RBL domain */
- char *rbl_hostaddr) /* hostaddr */
+static int rbl_match(rbl_domain, rbl_hostaddr)
+char *rbl_domain; /* RBL domain */
+char *rbl_hostaddr; /* hostaddr */
{
char *rbl_name;
unsigned long host_address;
@@ -363,8 +368,9 @@ rbl_match(
/* string_match - match string against pattern */
-static int
-string_match(char *tok, char *string)
+static int string_match(tok, string)
+char *tok;
+char *string;
{
int n;
@@ -384,8 +390,10 @@ string_match(char *tok, char *string)
/* masked_match - match address against netnumber/netmask */
-static int
-masked_match(char *net_tok, char *mask_tok, char *string)
+static int masked_match(net_tok, mask_tok, string)
+char *net_tok;
+char *mask_tok;
+char *string;
{
#ifndef INET6
return masked_match4(net_tok, mask_tok, string);
@@ -395,17 +403,19 @@ masked_match(char *net_tok, char *mask_t
* If we could get rid of shortened IPv4 form, we could just always use
* masked_match6().
*/
- if (dot_quad_addr(net_tok, NULL) != -1 &&
- dot_quad_addr(mask_tok, NULL) != -1 &&
- dot_quad_addr(string, NULL) != -1) {
+ if (dot_quad_addr(net_tok, NULL) != INADDR_NONE &&
+ dot_quad_addr(mask_tok, NULL) != INADDR_NONE &&
+ dot_quad_addr(string, NULL) != INADDR_NONE) {
return masked_match4(net_tok, mask_tok, string);
} else
return masked_match6(net_tok, mask_tok, string);
#endif
}
-static int
-masked_match4(char *net_tok, char *mask_tok, char *string)
+static int masked_match4(net_tok, mask_tok, string)
+char *net_tok;
+char *mask_tok;
+char *string;
{
unsigned long net;
unsigned long mask;
@@ -432,8 +442,10 @@ masked_match4(char *net_tok, char *mask_
}
#ifdef INET6
-static int
-masked_match6(char *net_tok, char *mask_tok, char *string)
+static int masked_match6(net_tok, mask_tok, string)
+char *net_tok;
+char *mask_tok;
+char *string;
{
union {
struct sockaddr sa;
@@ -443,9 +455,9 @@ masked_match6(char *net_tok, char *mask_
struct addrinfo hints, *res;
unsigned long masklen;
char *ep;
- size_t i;
+ int i;
char *np, *mp, *ap;
- size_t alen;
+ int alen;
memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_UNSPEC;
Index: src/lib/libwrap/misc.c
diff -u src/lib/libwrap/misc.c:1.9.56.1 src/lib/libwrap/misc.c:1.9.56.2
--- src/lib/libwrap/misc.c:1.9.56.1 Mon Apr 23 16:48:53 2012
+++ src/lib/libwrap/misc.c Mon Apr 23 23:40:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: misc.c,v 1.9.56.1 2012/04/23 16:48:53 riz Exp $ */
+/* $NetBSD: misc.c,v 1.9.56.2 2012/04/23 23:40:41 riz Exp $ */
/*
* Misc routines that are used by tcpd and by tcpdchk.
@@ -11,7 +11,7 @@
#if 0
static char sccsic[] = "@(#) misc.c 1.2 96/02/11 17:01:29";
#else
-__RCSID("$NetBSD: misc.c,v 1.9.56.1 2012/04/23 16:48:53 riz Exp $");
+__RCSID("$NetBSD: misc.c,v 1.9.56.2 2012/04/23 23:40:41 riz Exp $");
#endif
#endif
@@ -26,8 +26,10 @@ __RCSID("$NetBSD: misc.c,v 1.9.56.1 2012
/* xgets - fgets() with backslash-newline stripping */
-char *
-xgets(char *ptr, int len, FILE *fp)
+char *xgets(ptr, len, fp)
+char *ptr;
+int len;
+FILE *fp;
{
int got;
char *start = ptr;
@@ -51,8 +53,9 @@ xgets(char *ptr, int len, FILE *fp)
/* split_at - break string at delimiter or return NULL */
-char *
-split_at(char *string, int delimiter)
+char *split_at(string, delimiter)
+char *string;
+int delimiter;
{
char *cp;
int bracket;
@@ -79,8 +82,9 @@ split_at(char *string, int delimiter)
/* dot_quad_addr - convert dotted quad to internal form */
-int
-dot_quad_addr(char *str, unsigned long *addr)
+int dot_quad_addr(str, addr)
+char *str;
+unsigned long *addr;
{
struct in_addr a;
Index: src/lib/libwrap/options.c
diff -u src/lib/libwrap/options.c:1.14.44.1 src/lib/libwrap/options.c:1.14.44.2
--- src/lib/libwrap/options.c:1.14.44.1 Mon Apr 23 16:48:54 2012
+++ src/lib/libwrap/options.c Mon Apr 23 23:40:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: options.c,v 1.14.44.1 2012/04/23 16:48:54 riz Exp $ */
+/* $NetBSD: options.c,v 1.14.44.2 2012/04/23 23:40:41 riz Exp $ */
/*
* General skeleton for adding options to the access control language. The
@@ -35,7 +35,7 @@
#if 0
static char sccsid[] = "@(#) options.c 1.17 96/02/11 17:01:31";
#else
-__RCSID("$NetBSD: options.c,v 1.14.44.1 2012/04/23 16:48:54 riz Exp $");
+__RCSID("$NetBSD: options.c,v 1.14.44.2 2012/04/23 23:40:41 riz Exp $");
#endif
#endif
@@ -72,50 +72,50 @@ static char whitespace_eq[] = "= \t\r\n"
#define whitespace (whitespace_eq + 1)
static char *get_field /* chew :-delimited field off string */
- (char *);
+ __P((char *));
static char *chop_string /* strip leading and trailing blanks */
- (char *);
+ __P((char *));
struct syslog_names;
static int severity_map
- (const struct syslog_names *, char *);
+ __P((struct syslog_names *, char *));
/* List of functions that implement the options. Add yours here. */
static void user_option /* execute "user name.group" option */
- (char *, struct request_info *);
+ __P((char *, struct request_info *));
static void group_option /* execute "group name" option */
- (char *, struct request_info *);
+ __P((char *, struct request_info *));
static void umask_option /* execute "umask mask" option */
- (char *, struct request_info *);
+ __P((char *, struct request_info *));
static void linger_option /* execute "linger time" option */
- (char *, struct request_info *);
+ __P((char *, struct request_info *));
static void keepalive_option /* execute "keepalive" option */
- (char *, struct request_info *);
+ __P((char *, struct request_info *));
static void spawn_option /* execute "spawn command" option */
- (char *, struct request_info *);
+ __P((char *, struct request_info *));
static void twist_option /* execute "twist command" option */
- (char *, struct request_info *);
+ __P((char *, struct request_info *));
static void rfc931_option /* execute "rfc931" option */
- (char *, struct request_info *);
+ __P((char *, struct request_info *));
static void setenv_option /* execute "setenv name value" */
- (char *, struct request_info *);
+ __P((char *, struct request_info *));
static void nice_option /* execute "nice" option */
- (char *, struct request_info *);
+ __P((char *, struct request_info *));
static void severity_option /* execute "severity value" */
- (char *, struct request_info *);
+ __P((char *, struct request_info *));
static void allow_option /* execute "allow" option */
- (char *, struct request_info *);
+ __P((char *, struct request_info *));
static void deny_option /* execute "deny" option */
- (char *, struct request_info *);
+ __P((char *, struct request_info *));
static void banners_option /* execute "banners path" option */
- (char *, struct request_info *);
+ __P((char *, struct request_info *));
/* Structure of the options table. */
struct option {
- const char *name; /* keyword name, case is ignored */
+ char *name; /* keyword name, case is ignored */
void (*func) /* function that does the real work */
- (char *, struct request_info *);
+ __P((char *, struct request_info *));
int flags; /* see below... */
};
@@ -152,8 +152,9 @@ static struct option option_table[] = {
/* process_options - process access control options */
-void
-process_options(char *options, struct request_info *request)
+void process_options(options, request)
+char *options;
+struct request_info *request;
{
char *key;
char *value;
@@ -217,8 +218,9 @@ process_options(char *options, struct re
/* ARGSUSED */
-static void
-allow_option(char *value, struct request_info *request)
+static void allow_option(value, request)
+char *value;
+struct request_info *request;
{
longjmp(tcpd_buf, AC_PERMIT);
}
@@ -227,16 +229,18 @@ allow_option(char *value, struct request
/* ARGSUSED */
-static void
-deny_option(char *value, struct request_info *request)
+static void deny_option(value, request)
+char *value;
+struct request_info *request;
{
longjmp(tcpd_buf, AC_DENY);
}
/* banners_option - expand %<char>, terminate each line with CRLF */
-static void
-banners_option(char *value, struct request_info *request)
+static void banners_option(value, request)
+char *value;
+struct request_info *request;
{
char path[MAXPATHLEN];
char ibuf[BUFSIZ];
@@ -266,8 +270,9 @@ banners_option(char *value, struct reque
/* ARGSUSED */
-static void
-group_option(char *value, struct request_info *request)
+static void group_option(value, request)
+char *value;
+struct request_info *request;
{
struct group grs, *grp;
char grbuf[1024];
@@ -284,8 +289,9 @@ group_option(char *value, struct request
/* ARGSUSED */
-static void
-user_option(char *value, struct request_info *request)
+static void user_option(value, request)
+char *value;
+struct request_info *request;
{
struct passwd *pwd, pws;
char *group;
@@ -305,8 +311,9 @@ user_option(char *value, struct request_
/* ARGSUSED */
-static void
-umask_option(char *value, struct request_info *request)
+static void umask_option(value, request)
+char *value;
+struct request_info *request;
{
unsigned mask;
char junk;
@@ -320,8 +327,9 @@ umask_option(char *value, struct request
/* ARGSUSED */
-static void
-spawn_option(char *value, struct request_info *request)
+static void spawn_option(value, request)
+char *value;
+struct request_info *request;
{
if (dry_run == 0)
shell_cmd(value);
@@ -331,8 +339,9 @@ spawn_option(char *value, struct request
/* ARGSUSED */
-static void
-linger_option(char *value, struct request_info *request)
+static void linger_option(value, request)
+char *value;
+struct request_info *request;
{
struct linger linger;
char junk;
@@ -352,8 +361,9 @@ linger_option(char *value, struct reques
/* ARGSUSED */
-static void
-keepalive_option(char *value, struct request_info *request)
+static void keepalive_option(value, request)
+char *value;
+struct request_info *request;
{
static int on = 1;
@@ -366,8 +376,9 @@ keepalive_option(char *value, struct req
/* ARGSUSED */
-static void
-nice_option(char *value, struct request_info *request)
+static void nice_option(value, request)
+char *value;
+struct request_info *request;
{
int niceval = 10;
char junk;
@@ -380,8 +391,9 @@ nice_option(char *value, struct request_
/* twist_option - replace process by shell command */
-static void
-twist_option(char *value, struct request_info *request)
+static void twist_option(value, request)
+char *value;
+struct request_info *request;
{
if (dry_run != 0) {
dry_run = 0;
@@ -413,8 +425,9 @@ twist_option(char *value, struct request
/* rfc931_option - look up remote user name */
-static void
-rfc931_option(char *value, struct request_info *request)
+static void rfc931_option(value, request)
+char *value;
+struct request_info *request;
{
int timeout;
char junk;
@@ -431,8 +444,9 @@ rfc931_option(char *value, struct reques
/* ARGSUSED */
-static void
-setenv_option(char *value, struct request_info *request)
+static void setenv_option(value, request)
+char *value;
+struct request_info *request;
{
char *var_value;
@@ -448,11 +462,11 @@ setenv_option(char *value, struct reques
*/
struct syslog_names {
- const char *name;
- int value;
+ char *name;
+ int value;
};
-static const struct syslog_names log_fac[] = {
+static struct syslog_names log_fac[] = {
#ifdef LOG_KERN
{ "kern", LOG_KERN },
#endif
@@ -513,7 +527,7 @@ static const struct syslog_names log_fac
{ NULL, 0 }
};
-static const struct syslog_names log_sev[] = {
+static struct syslog_names log_sev[] = {
#ifdef LOG_EMERG
{ "emerg", LOG_EMERG },
#endif
@@ -543,10 +557,11 @@ static const struct syslog_names log_sev
/* severity_map - lookup facility or severity value */
-static int
-severity_map(const struct syslog_names *table, char *name)
+static int severity_map(table, name)
+struct syslog_names *table;
+char *name;
{
- const struct syslog_names *t;
+ struct syslog_names *t;
for (t = table; t->name; t++)
if (STR_EQ(t->name, name))
@@ -560,8 +575,9 @@ severity_map(const struct syslog_names *
/* ARGSUSED */
-static void
-severity_option(char *value, struct request_info *request)
+static void severity_option(value, request)
+char *value;
+struct request_info *request;
{
char *level = split_at(value, '.');
@@ -572,11 +588,10 @@ severity_option(char *value, struct requ
/* get_field - return pointer to next field in string */
-static char *
-get_field(char *string)
+static char *get_field(string)
+char *string;
{
- static char nul = '\0';
- static char *last = &nul;
+ static char *last = "";
char *src;
char *dst;
char *ret;
@@ -616,8 +631,8 @@ get_field(char *string)
/* chop_string - strip leading and trailing blanks from string */
-static char *
-chop_string(register char *string)
+static char *chop_string(string)
+register char *string;
{
char *start = NULL;
char *end = NULL;
Index: src/lib/libwrap/rfc931.c
diff -u src/lib/libwrap/rfc931.c:1.8.56.1 src/lib/libwrap/rfc931.c:1.8.56.2
--- src/lib/libwrap/rfc931.c:1.8.56.1 Mon Apr 23 16:48:56 2012
+++ src/lib/libwrap/rfc931.c Mon Apr 23 23:40:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: rfc931.c,v 1.8.56.1 2012/04/23 16:48:56 riz Exp $ */
+/* $NetBSD: rfc931.c,v 1.8.56.2 2012/04/23 23:40:41 riz Exp $ */
/*
* rfc931() speaks a common subset of the RFC 931, AUTH, TAP, IDENT and RFC
@@ -16,7 +16,7 @@
#if 0
static char sccsid[] = "@(#) rfc931.c 1.10 95/01/02 16:11:34";
#else
-__RCSID("$NetBSD: rfc931.c,v 1.8.56.1 2012/04/23 16:48:56 riz Exp $");
+__RCSID("$NetBSD: rfc931.c,v 1.8.56.2 2012/04/23 23:40:41 riz Exp $");
#endif
#endif
@@ -44,13 +44,15 @@ int rfc931_timeout = RFC931_TIMEOUT;
static jmp_buf timebuf;
-static FILE *fsocket(int, int, int);
-static void timeout(int);
+static FILE *fsocket __P((int, int, int));
+static void timeout __P((int));
/* fsocket - open stdio stream on top of socket */
-static FILE *
-fsocket(int domain, int type, int protocol)
+static FILE *fsocket(domain, type, protocol)
+int domain;
+int type;
+int protocol;
{
int s;
FILE *fp;
@@ -69,16 +71,18 @@ fsocket(int domain, int type, int protoc
/* timeout - handle timeouts */
-static void
-timeout(int sig)
+static void timeout(sig)
+int sig;
{
longjmp(timebuf, sig);
}
/* rfc931 - return remote user name, given socket structures */
-void
-rfc931(struct sockaddr *rmt_sin, struct sockaddr *our_sin, char *dest)
+void rfc931(rmt_sin, our_sin, dest)
+struct sockaddr *rmt_sin;
+struct sockaddr *our_sin;
+char *dest;
{
unsigned rmt_port;
unsigned our_port;
@@ -89,9 +93,9 @@ rfc931(struct sockaddr *rmt_sin, struct
char *cp;
char *result = unknown;
FILE *fp;
- volatile int salen;
- u_short * volatile rmt_portp;
- u_short * volatile our_portp;
+ int salen;
+ u_short *rmt_portp;
+ u_short *our_portp;
/* address family must be the same */
if (rmt_sin->sa_family != our_sin->sa_family) {
Index: src/lib/libwrap/update.c
diff -u src/lib/libwrap/update.c:1.8.56.1 src/lib/libwrap/update.c:1.8.56.2
--- src/lib/libwrap/update.c:1.8.56.1 Mon Apr 23 16:48:53 2012
+++ src/lib/libwrap/update.c Mon Apr 23 23:40:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: update.c,v 1.8.56.1 2012/04/23 16:48:53 riz Exp $ */
+/* $NetBSD: update.c,v 1.8.56.2 2012/04/23 23:40:41 riz Exp $ */
/*
* Routines for controlled update/initialization of request structures.
@@ -20,7 +20,7 @@
#if 0
static char sccsid[] = "@(#) update.c 1.1 94/12/28 17:42:56";
#else
-__RCSID("$NetBSD: update.c,v 1.8.56.1 2012/04/23 16:48:53 riz Exp $");
+__RCSID("$NetBSD: update.c,v 1.8.56.2 2012/04/23 23:40:41 riz Exp $");
#endif
#endif
@@ -36,12 +36,13 @@ __RCSID("$NetBSD: update.c,v 1.8.56.1 20
#include "mystdarg.h"
#include "tcpd.h"
-static struct request_info *request_fill(struct request_info *, va_list);
+static struct request_info *request_fill __P((struct request_info *, va_list));
/* request_fill - request update engine */
-static struct request_info *
-request_fill(struct request_info *request, va_list ap)
+static struct request_info *request_fill(request, ap)
+struct request_info *request;
+va_list ap;
{
int key;
char *ptr;
Index: src/lib/libwrap/shell_cmd.c
diff -u src/lib/libwrap/shell_cmd.c:1.5.58.1 src/lib/libwrap/shell_cmd.c:1.5.58.2
--- src/lib/libwrap/shell_cmd.c:1.5.58.1 Mon Apr 23 16:48:54 2012
+++ src/lib/libwrap/shell_cmd.c Mon Apr 23 23:40:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: shell_cmd.c,v 1.5.58.1 2012/04/23 16:48:54 riz Exp $ */
+/* $NetBSD: shell_cmd.c,v 1.5.58.2 2012/04/23 23:40:41 riz Exp $ */
/*
* shell_cmd() takes a shell command after %<character> substitutions. The
@@ -15,7 +15,7 @@
#if 0
static char sccsid[] = "@(#) shell_cmd.c 1.5 94/12/28 17:42:44";
#else
-__RCSID("$NetBSD: shell_cmd.c,v 1.5.58.1 2012/04/23 16:48:54 riz Exp $");
+__RCSID("$NetBSD: shell_cmd.c,v 1.5.58.2 2012/04/23 23:40:41 riz Exp $");
#endif
#endif
@@ -42,8 +42,8 @@ static void do_child __P((char *));
/* shell_cmd - execute shell command */
-void
-shell_cmd(char *command)
+void shell_cmd(command)
+char *command;
{
int child_pid;
int wait_pid;
@@ -68,8 +68,8 @@ shell_cmd(char *command)
/* do_child - exec command with { stdin, stdout, stderr } to /dev/null */
-static void
-do_child(char *command)
+static void do_child(command)
+char *command;
{
int tmp_fd;
Index: src/lib/libwrap/socket.c
diff -u src/lib/libwrap/socket.c:1.18.44.1 src/lib/libwrap/socket.c:1.18.44.2
--- src/lib/libwrap/socket.c:1.18.44.1 Mon Apr 23 16:48:54 2012
+++ src/lib/libwrap/socket.c Mon Apr 23 23:40:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: socket.c,v 1.18.44.1 2012/04/23 16:48:54 riz Exp $ */
+/* $NetBSD: socket.c,v 1.18.44.2 2012/04/23 23:40:41 riz Exp $ */
/*
* This module determines the type of socket (datagram, stream), the client
@@ -22,7 +22,7 @@
#if 0
static char sccsid[] = "@(#) socket.c 1.15 97/03/21 19:27:24";
#else
-__RCSID("$NetBSD: socket.c,v 1.18.44.1 2012/04/23 16:48:54 riz Exp $");
+__RCSID("$NetBSD: socket.c,v 1.18.44.2 2012/04/23 23:40:41 riz Exp $");
#endif
#endif
@@ -77,8 +77,8 @@ const char *name;
/* sock_host - look up endpoint addresses and install conversion methods */
-void
-sock_host(struct request_info *request)
+void sock_host(request)
+struct request_info *request;
{
static struct sockaddr_storage client;
static struct sockaddr_storage server;
@@ -134,8 +134,8 @@ sock_host(struct request_info *request)
/* sock_hostaddr - map endpoint address to printable form */
-void
-sock_hostaddr(struct host_info *host)
+void sock_hostaddr(host)
+struct host_info *host;
{
struct sockaddr *sa = host->sin;
@@ -148,8 +148,8 @@ sock_hostaddr(struct host_info *host)
/* sock_hostname - map endpoint address to host name */
-void
-sock_hostname(struct host_info *host)
+void sock_hostname(host)
+struct host_info *host;
{
struct sockaddr *sa = host->sin;
char h1[NI_MAXHOST], h2[NI_MAXHOST];
@@ -275,8 +275,8 @@ sock_hostname(struct host_info *host)
/* sock_sink - absorb unreceived IP datagram */
-static void
-sock_sink(int fd)
+static void sock_sink(fd)
+int fd;
{
char buf[BUFSIZ];
struct sockaddr_storage ss;
Index: src/lib/libwrap/tcpd.h
diff -u src/lib/libwrap/tcpd.h:1.12.56.1 src/lib/libwrap/tcpd.h:1.12.56.2
--- src/lib/libwrap/tcpd.h:1.12.56.1 Mon Apr 23 16:48:56 2012
+++ src/lib/libwrap/tcpd.h Mon Apr 23 23:40:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: tcpd.h,v 1.12.56.1 2012/04/23 16:48:56 riz Exp $ */
+/* $NetBSD: tcpd.h,v 1.12.56.2 2012/04/23 23:40:41 riz Exp $ */
/*
* @(#) tcpd.h 1.5 96/03/19 16:22:24
*
@@ -29,10 +29,14 @@ struct request_info {
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)(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)(void); /* cleanup function or 0 */
+ void (*sink) /* datagram sink function or 0 */
+ __P((int));
+ void (*hostname) /* address to printable hostname */
+ __P((struct host_info *));
+ void (*hostaddr) /* address to printable address */
+ __P((struct host_info *));
+ void (*cleanup) /* cleanup function or 0 */
+ __P((void));
struct netconfig *config; /* netdir handle */
};
@@ -70,32 +74,32 @@ __BEGIN_DECLS
#define fromhost sock_host /* no TLI support needed */
extern int hosts_access /* access control */
- (struct request_info *);
+ __P((struct request_info *));
extern int hosts_ctl /* limited interface to hosts_access */
- (char *, char *, char *, char *);
+ __P((char *, char *, char *, char *));
extern void shell_cmd /* execute shell command */
- (char *);
+ __P((char *));
extern char *percent_x /* do %<char> expansion */
- (char *, int, char *, struct request_info *);
+ __P((char *, int, char *, struct request_info *));
extern void rfc931 /* client name from RFC 931 daemon */
- (struct sockaddr *, struct sockaddr *, char *);
+ __P((struct sockaddr *, struct sockaddr *, char *));
extern void clean_exit /* clean up and exit */
- (struct request_info *);
+ __P((struct request_info *));
extern void refuse /* clean up and exit */
- (struct request_info *);
+ __P((struct request_info *));
extern char *xgets /* fgets() on steroids */
- (char *, int, FILE *);
+ __P((char *, int, FILE *));
extern char *split_at /* strchr() and split */
- (char *, int);
+ __P((char *, int));
extern int dot_quad_addr /* restricted inet_aton() */
- (char *, unsigned long *);
+ __P((char *, unsigned long *));
/* Global variables. */
extern int allow_severity; /* for connection logging */
extern int deny_severity; /* for connection logging */
-extern const char *hosts_allow_table; /* for verification mode redirection */
-extern const char *hosts_deny_table; /* for verification mode redirection */
+extern char *hosts_allow_table; /* for verification mode redirection */
+extern char *hosts_deny_table; /* for verification mode redirection */
extern int hosts_access_verbose; /* for verbose matching mode */
extern int rfc931_timeout; /* user lookup timeout */
extern int resident; /* > 0 if resident process */
@@ -106,9 +110,9 @@ extern int resident; /* > 0 if residen
*/
extern struct request_info *request_init /* initialize request */
- (struct request_info *,...);
+ __P((struct request_info *,...));
extern struct request_info *request_set /* update request structure */
- (struct request_info *,...);
+ __P((struct request_info *,...));
#define RQ_FILE 1 /* file descriptor */
#define RQ_DAEMON 2 /* server process (argv[0]) */
@@ -129,28 +133,28 @@ extern struct request_info *request_set
*/
extern char *eval_user /* client user */
- (struct request_info *);
+ __P((struct request_info *));
extern char *eval_hostname /* printable hostname */
- (struct host_info *);
+ __P((struct host_info *));
extern char *eval_hostaddr /* printable host address */
- (struct host_info *);
+ __P((struct host_info *));
extern char *eval_hostinfo /* host name or address */
- (struct host_info *);
+ __P((struct host_info *));
extern char *eval_client /* whatever is available */
- (struct request_info *);
+ __P((struct request_info *));
extern char *eval_server /* whatever is available */
- (struct request_info *);
+ __P((struct request_info *));
#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 */
- (struct request_info *);
+ __P((struct request_info *));
extern void sock_hostname /* translate address to hostname */
- (struct host_info *);
+ __P((struct host_info *));
extern void sock_hostaddr /* address to printable address */
- (struct host_info *);
+ __P((struct host_info *));
#define sock_methods(r) \
{ (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
@@ -158,7 +162,7 @@ extern void sock_hostaddr /* address to
#if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
extern void tli_host /* look up endpoint addresses etc. */
- (struct request_info *);
+ __P((struct request_info *));
#endif
/*
@@ -168,15 +172,15 @@ extern void tli_host /* look up endpoi
*/
extern void tcpd_warn /* report problem and proceed */
- (const char *, ...)
+ __P((char *, ...))
__attribute__((__format__(__printf__, 1, 2)));
extern void tcpd_jump /* report problem and jump */
- (const char *, ...)
+ __P((char *, ...))
__attribute__((__format__(__printf__, 1, 2)));
__END_DECLS
struct tcpd_context {
- const char *file; /* current file */
+ char *file; /* current file */
int line; /* current line */
};
__BEGIN_DECLS
@@ -203,8 +207,8 @@ __END_DECLS
__BEGIN_DECLS
extern void process_options /* execute options */
- (char *, struct request_info *);
+ __P((char *, struct request_info *));
extern int dry_run; /* verification flag */
extern void fix_options /* get rid of IP-level socket options */
- (struct request_info *);
+ __P((struct request_info *));
__END_DECLS
Index: src/lib/liby/yyerror.c
diff -u src/lib/liby/yyerror.c:1.8.56.1 src/lib/liby/yyerror.c:1.8.56.2
--- src/lib/liby/yyerror.c:1.8.56.1 Mon Apr 23 16:48:57 2012
+++ src/lib/liby/yyerror.c Mon Apr 23 23:40:41 2012
@@ -32,17 +32,18 @@
#if 0
static char sccsid[] = "@(#)yyerror.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: yyerror.c,v 1.8.56.1 2012/04/23 16:48:57 riz Exp $");
+__RCSID("$NetBSD: yyerror.c,v 1.8.56.2 2012/04/23 23:40:41 riz Exp $");
#endif
#endif /* not lint */
#include <assert.h>
#include <stdio.h>
-int yyerror(char *);
+int yyerror __P((char *));
int
-yyerror(char *msg)
+yyerror(msg)
+ char *msg;
{
_DIAGASSERT(msg != NULL);