printf-format audit. from sommrfeld@netbsd.org. sync with kame.

This commit is contained in:
itojun 2000-10-06 00:13:01 +00:00
parent fbc8920b4b
commit 74b478c63c
13 changed files with 60 additions and 46 deletions

View File

@ -1,5 +1,5 @@
/* $NetBSD: faithd.c,v 1.14 2000/09/14 00:36:10 itojun Exp $ */
/* $KAME: faithd.c,v 1.29 2000/09/12 05:20:35 itojun Exp $ */
/* $NetBSD: faithd.c,v 1.15 2000/10/06 00:13:01 itojun Exp $ */
/* $KAME: faithd.c,v 1.31 2000/10/05 22:20:37 itojun Exp $ */
/*
* Copyright (C) 1997 and 1998 WIDE Project.
@ -117,7 +117,8 @@ static int map4to6 __P((struct sockaddr_in *, struct sockaddr_in6 *));
static void sig_child __P((int));
static void sig_terminate __P((int));
static void start_daemon __P((void));
static void exit_stderr __P((const char *, ...));
static void exit_stderr __P((const char *, ...))
__attribute__((__format__(__printf__, 1, 2)));
#ifndef HAVE_GETIFADDRS
static unsigned int if_maxindex __P((void));
#endif

View File

@ -1,5 +1,5 @@
/* $NetBSD: faithd.h,v 1.5 2000/09/14 00:36:10 itojun Exp $ */
/* $KAME: faithd.h,v 1.5 2000/07/28 07:34:27 itojun Exp $ */
/* $NetBSD: faithd.h,v 1.6 2000/10/06 00:13:02 itojun Exp $ */
/* $KAME: faithd.h,v 1.6 2000/10/05 22:20:37 itojun Exp $ */
/*
* Copyright (C) 1997 and 1998 WIDE Project.
@ -39,8 +39,10 @@ extern int ftp_active __P((int, int, int *, int *));
extern int ftp_passive __P((int, int, int *, int *));
extern void rsh_relay __P((int, int));
extern void rsh_dual_relay __P((int, int));
extern void exit_success __P((const char *, ...));
extern void exit_failure __P((const char *, ...));
extern void exit_success __P((const char *, ...))
__attribute__((__format__(__printf__, 1, 2)));
extern void exit_failure __P((const char *, ...))
__attribute__((__format__(__printf__, 1, 2)));
#define DEFAULT_PORT_NAME "telnet"
#define DEFAULT_DIR "/usr/libexec"

View File

@ -1,4 +1,4 @@
/* $NetBSD: defs.h,v 1.5 2000/05/19 10:43:37 itojun Exp $ */
/* $NetBSD: defs.h,v 1.6 2000/10/06 00:13:02 itojun Exp $ */
/*
* Copyright (c) 1998 by the University of Oregon.
@ -323,7 +323,8 @@ extern void config_vifs_from_file __P((void));
/* debug.c */
extern char *packet_kind __P((u_int proto, u_int type, u_int code));
extern int debug_kind __P((u_int proto, u_int type, u_int code));
extern void log __P((int, int, char *, ...));
extern void log __P((int, int, char *, ...))
__attribute__((__format__(__printf__, 3, 4)));
extern void dump_mldqueriers __P((FILE *));
extern int log_level __P((u_int proto, u_int type, u_int code));
extern void dump __P((int i));

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.3 2000/05/19 10:43:37 itojun Exp $ */
/* $NetBSD: main.c,v 1.4 2000/10/06 00:13:02 itojun Exp $ */
/*
* Copyright (c) 1998 by the University of Oregon.
@ -659,7 +659,7 @@ restart(i)
int s;
#endif /* SNMP */
log(LOG_NOTICE, 0, "% restart", versionstring);
log(LOG_NOTICE, 0, "%s restart", versionstring);
/*
* reset all the entries

View File

@ -1,4 +1,4 @@
/* $NetBSD: mld6.c,v 1.7 2000/07/23 22:59:56 mycroft Exp $ */
/* $NetBSD: mld6.c,v 1.8 2000/10/06 00:13:02 itojun Exp $ */
/*
* Copyright (C) 1998 WIDE Project.
@ -343,6 +343,8 @@ int recvlen;
{
log(LOG_INFO, 0,
"RECV %s with an invalid scope: %s from %s",
packet_kind(IPPROTO_ICMPV6, mldh->mld6_type,
mldh->mld6_code),
inet6_fmt(&mldh->mld6_addr),
inet6_fmt(&src->sin6_addr));
return; /* discard */

View File

@ -1,4 +1,4 @@
/* $NetBSD: mld6_proto.c,v 1.4 2000/05/19 10:43:42 itojun Exp $ */
/* $NetBSD: mld6_proto.c,v 1.5 2000/10/06 00:13:02 itojun Exp $ */
/*
* Copyright (C) 1998 WIDE Project.
@ -228,7 +228,7 @@ accept_listener_query(src, dst, group, tmo)
IF_DEBUG(DEBUG_MLD)
log(LOG_DEBUG, 0,
"timer for grp %s on mif %d "
"set to %d",
"set to %ld",
inet6_fmt(group),
mifi, g->al_timer);
break;
@ -269,7 +269,7 @@ accept_listener_report(src, dst, group)
IF_DEBUG(DEBUG_MLD)
log(LOG_INFO, 0,
"accepting multicast listener report: "
"src %s, dst% s, grp %s",
"src %s, dst %s, grp %s",
inet6_fmt(&src->sin6_addr), inet6_fmt(dst),
inet6_fmt(group));
@ -341,7 +341,7 @@ accept_listener_done(src, dst, group)
IF_DEBUG(DEBUG_MLD)
log(LOG_INFO, 0,
"accepting listener done message: src %s, dst% s, grp %s",
"accepting listener done message: src %s, dst %s, grp %s",
inet6_fmt(&src->sin6_addr),
inet6_fmt(dst), inet6_fmt(group));
@ -360,7 +360,7 @@ accept_listener_done(src, dst, group)
if (inet6_equal(&group_sa, &g->al_addr)) {
IF_DEBUG(DEBUG_MLD)
log(LOG_DEBUG, 0,
"[accept_done_message] %d %d \n",
"[accept_done_message] %d %ld\n",
g->al_old, g->al_query);
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: pim6_proto.c,v 1.5 2000/05/19 10:43:43 itojun Exp $ */
/* $NetBSD: pim6_proto.c,v 1.6 2000/10/06 00:13:02 itojun Exp $ */
/*
* Copyright (C) 1998 WIDE Project.
@ -490,7 +490,7 @@ schedule_delayed_join(mrtentry_ptr, target)
#endif
IF_DEBUG(DEBUG_PIM_JOIN_PRUNE)
log(LOG_DEBUG, 0, "Scheduling join for src %s, grp %s, delay %d",
log(LOG_DEBUG, 0, "Scheduling join for src %s, grp %s, delay %ld",
inet6_fmt(&mrtentry_ptr->source->address.sin6_addr),
inet6_fmt(&mrtentry_ptr->group->group.sin6_addr),
random_delay);

View File

@ -1,4 +1,4 @@
/* $NetBSD: timer.c,v 1.6 2000/05/19 10:43:44 itojun Exp $ */
/* $NetBSD: timer.c,v 1.7 2000/10/06 00:13:02 itojun Exp $ */
/*
* Copyright (c) 1998 by the University of Oregon.
@ -238,7 +238,7 @@ age_routes()
*/
IF_DEBUG(DEBUG_MFC)
log(LOG_DEBUG, 0,
"Refreshing src %s, dst %s after %d bytes forwarded",
"Refreshing src %s, dst %s after %ld bytes forwarded",
inet6_fmt(&mrtentry_ptr->source->address.sin6_addr),
inet6_fmt(&mrtentry_ptr->group->group.sin6_addr),
mrtentry_ptr->sg_count.bytecnt);

View File

@ -1,4 +1,4 @@
/* $NetBSD: cftoken.l,v 1.2 2000/05/19 10:43:46 itojun Exp $ */
/* $NetBSD: cftoken.l,v 1.3 2000/10/06 00:13:02 itojun Exp $ */
%{
/*
@ -57,6 +57,13 @@ static void cfdebug_print __P((char *, char *, int));
#endif
extern int yylex __P((void));
static void yyerror0(char *s, va_list ap)
__attribute__((__format__(__printf__, 1, 0)));
void yyerror(char *s, ...)
__attribute__((__format__(__printf__, 1, 2)));
void yywarn(char *s, ...)
__attribute__((__format__(__printf__, 1, 2)));
%}
/* common seciton */

View File

@ -1,5 +1,5 @@
/* $NetBSD: route6d.c,v 1.17 2000/08/13 00:41:30 itojun Exp $ */
/* $KAME: route6d.c,v 1.35 2000/08/13 00:39:44 itojun Exp $ */
/* $NetBSD: route6d.c,v 1.18 2000/10/06 00:13:02 itojun Exp $ */
/* $KAME: route6d.c,v 1.36 2000/10/05 22:20:39 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: route6d.c,v 1.17 2000/08/13 00:41:30 itojun Exp $");
__RCSID("$NetBSD: route6d.c,v 1.18 2000/10/06 00:13:02 itojun Exp $");
#endif
#include <stdio.h>
@ -254,9 +254,12 @@ struct in6_addr *plen2mask __P((int));
struct riprt *rtsearch __P((struct netinfo6 *));
int ripinterval __P((int));
time_t ripsuptrig __P((void));
void fatal __P((const char *, ...));
void trace __P((int, const char *, ...));
void tracet __P((int, const char *, ...));
void fatal __P((const char *, ...))
__attribute__((__format__(__printf__, 1, 2)));
void trace __P((int, const char *, ...))
__attribute__((__format__(__printf__, 2, 3)));
void tracet __P((int, const char *, ...))
__attribute__((__format__(__printf__, 2, 3)));
unsigned int if_maxindex __P((void));
struct ifc *ifc_find __P((char *));
struct iff *iff_find __P((struct ifc *, int));
@ -531,7 +534,7 @@ init()
hints.ai_flags = AI_PASSIVE;
error = getaddrinfo(NULL, port, &hints, &res);
if (error)
fatal(gai_strerror(error));
fatal("%s", gai_strerror(error));
if (res->ai_next)
fatal(":: resolved to multiple address");
@ -564,7 +567,7 @@ init()
hints.ai_socktype = SOCK_DGRAM;
error = getaddrinfo(RIP6_DEST, port, &hints, &res);
if (error)
fatal(gai_strerror(error));
fatal("%s", gai_strerror(error));
if (res->ai_next)
fatal("%s resolved to multiple address", RIP6_DEST);
memcpy(&ripsin, res->ai_addr, res->ai_addrlen);

View File

@ -1,5 +1,5 @@
/* $NetBSD: dump.c,v 1.3 2000/08/13 06:20:02 itojun Exp $ */
/* $KAME: dump.c,v 1.7 2000/08/13 06:14:59 itojun Exp $ */
/* $NetBSD: dump.c,v 1.4 2000/10/06 00:13:02 itojun Exp $ */
/* $KAME: dump.c,v 1.8 2000/10/05 22:20:39 itojun Exp $ */
/*
* Copyright (C) 1999 WIDE Project.
@ -99,7 +99,7 @@ rtsold_dump_file(dumpfile)
char *dumpfile;
{
if ((fp = fopen(dumpfile, "w")) == NULL) {
warnmsg(LOG_WARNING, __FUNCTION__, "open a dump file(%s)",
warnmsg(LOG_WARNING, __FUNCTION__, "open a dump file(%s): %s",
dumpfile, strerror(errno));
return;
}

View File

@ -1,5 +1,5 @@
/* $NetBSD: rtsold.c,v 1.8 2000/08/13 18:19:13 itojun Exp $ */
/* $KAME: rtsold.c,v 1.26 2000/08/13 18:17:15 itojun Exp $ */
/* $NetBSD: rtsold.c,v 1.9 2000/10/06 00:13:02 itojun Exp $ */
/* $KAME: rtsold.c,v 1.27 2000/10/05 22:20:39 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -252,7 +252,7 @@ main(argc, argv)
if ((fp = fopen(pidfilename, "w")) == NULL)
warnmsg(LOG_ERR, __FUNCTION__,
"failed to open a log file(%s)",
"failed to open a log file(%s): %s",
pidfilename, strerror(errno));
else {
fprintf(fp, "%d\n", pid);
@ -552,8 +552,8 @@ rtsol_check_timer()
TIMEVAL_SUB(&rtsol_timer, &now, &returnval);
if (dflag > 1)
warnmsg(LOG_DEBUG, __FUNCTION__, "New timer is %d:%08d",
returnval.tv_sec, returnval.tv_usec);
warnmsg(LOG_DEBUG, __FUNCTION__, "New timer is %ld:%08ld",
(long)returnval.tv_sec, (long)returnval.tv_usec);
return(&returnval);
}
@ -704,7 +704,8 @@ warnmsg(priority, func, msg, va_alist)
}
} else {
snprintf(buf, sizeof(buf), "<%s> %s", func, msg);
vsyslog(priority, buf, ap);
msg = buf;
vsyslog(priority, msg, ap);
}
va_end(ap);
}

View File

@ -1,5 +1,5 @@
/* $NetBSD: rtsold.h,v 1.5 2000/08/13 06:20:03 itojun Exp $ */
/* $KAME: rtsold.h,v 1.9 2000/08/13 06:15:00 itojun Exp $ */
/* $NetBSD: rtsold.h,v 1.6 2000/10/06 00:13:03 itojun Exp $ */
/* $KAME: rtsold.h,v 1.10 2000/10/05 22:20:39 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -64,11 +64,8 @@ extern struct timeval tm_max;
extern int dflag;
struct ifinfo *find_ifinfo __P((int ifindex));
void rtsol_timer_update __P((struct ifinfo *ifinfo));
#ifdef __STDC__
extern void warnmsg __P((int, const char *, const char *, ...));
#else
extern void warnmsg __P((int, const char *, const char *, va_list));
#endif
extern void warnmsg __P((int, const char *, const char *, ...))
__attribute__((__format__(__printf__, 3, 4)));
/* if.c */
extern int ifinit __P((void));