freebsd-nq/contrib/tcp_wrappers/fakelog.c

63 lines
1012 B
C
Raw Normal View History

/*
* This module intercepts syslog() library calls and redirects their output
* to the standard output stream. For interactive testing.
*
* Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
*/
#ifndef lint
static char sccsid[] = "@(#) fakelog.c 1.3 94/12/28 17:42:21";
#endif
#include <stdio.h>
#include "mystdarg.h"
/* openlog - dummy */
/* ARGSUSED */
TCP Wrappers: tcpdchk (tcp wrapper configuration checker) and tcpdmatch (tcp wrapper oracle) warning fixes via edits to the C code files contrib/tcp_wrappers/fakelog.c Warnings for each of functions: openlog( ), vsyslog( ), VARARGS( ), closelog( ) warning: type specifier missing, defaults to 'int' [-Wimplicit-int] warning: control reaches end of non-void function [-Wreturn-type] Fixes: Explicitly added specification of function type to void for each function, suppressing both warnings for each function listed contrib/tcp_wrappers/inetcf.c Warnings: warning: incompativle redeclaration of library function 'malloc' note: 'malloc' is a builtin with type 'void *(unsigned long)' warning: implicit declaration of function 'check_path' is invalid in C99 [-Wimplicit-function-declaration] Fixes: Removed redeclaration of malloc on line 21 Included library <stdlib.h> in the code which contains the malloc( ) function in it's library Included scaffold.h header file in the code that contains check-path( ) function contrib/tcp_wrappers/scaffold.c Warnings: warning: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Wimplicit-function-declaration] note: include the header <stdlib.h> or explicitly provide a declaration for 'exit' Fixes: Included <stdlib.h> in the code which contains the exit( ) function in it's library contrib/tcp_wrappers/tcpdchk.c Warnings: warning: implicit declaration of function 'getopt' is invalid in C99 [-Wimplicit-function-declaration] warning: implicit declaration of function 'atoi' is invalid in C99 [-Wimplicit-function-declaration] Fixes: Included the specific function <getopt.h> library to the code Included<stdlib.h> to the code which contains the atoi( ) function in the library contrib/tcp_wrappers/tcpdmatch.c Warnings: warning: implicit declaration of function 'getopt' is invalid in C99 [-Wimplicit-function-declaration] Fixes: Included<stdlib.h> to the code which contains the getopt( ) function in the library Submitted by: Aaron Prieger <aprieger@llnw.com> Reviewed by: vangyzen Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D10995
2017-06-16 22:32:23 +00:00
void openlog(name, logopt, facility)
char *name;
int logopt;
int facility;
{
/* void */
}
/* vsyslog - format one record */
TCP Wrappers: tcpdchk (tcp wrapper configuration checker) and tcpdmatch (tcp wrapper oracle) warning fixes via edits to the C code files contrib/tcp_wrappers/fakelog.c Warnings for each of functions: openlog( ), vsyslog( ), VARARGS( ), closelog( ) warning: type specifier missing, defaults to 'int' [-Wimplicit-int] warning: control reaches end of non-void function [-Wreturn-type] Fixes: Explicitly added specification of function type to void for each function, suppressing both warnings for each function listed contrib/tcp_wrappers/inetcf.c Warnings: warning: incompativle redeclaration of library function 'malloc' note: 'malloc' is a builtin with type 'void *(unsigned long)' warning: implicit declaration of function 'check_path' is invalid in C99 [-Wimplicit-function-declaration] Fixes: Removed redeclaration of malloc on line 21 Included library <stdlib.h> in the code which contains the malloc( ) function in it's library Included scaffold.h header file in the code that contains check-path( ) function contrib/tcp_wrappers/scaffold.c Warnings: warning: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Wimplicit-function-declaration] note: include the header <stdlib.h> or explicitly provide a declaration for 'exit' Fixes: Included <stdlib.h> in the code which contains the exit( ) function in it's library contrib/tcp_wrappers/tcpdchk.c Warnings: warning: implicit declaration of function 'getopt' is invalid in C99 [-Wimplicit-function-declaration] warning: implicit declaration of function 'atoi' is invalid in C99 [-Wimplicit-function-declaration] Fixes: Included the specific function <getopt.h> library to the code Included<stdlib.h> to the code which contains the atoi( ) function in the library contrib/tcp_wrappers/tcpdmatch.c Warnings: warning: implicit declaration of function 'getopt' is invalid in C99 [-Wimplicit-function-declaration] Fixes: Included<stdlib.h> to the code which contains the getopt( ) function in the library Submitted by: Aaron Prieger <aprieger@llnw.com> Reviewed by: vangyzen Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D10995
2017-06-16 22:32:23 +00:00
void vsyslog(severity, fmt, ap)
int severity;
char *fmt;
va_list ap;
{
char buf[BUFSIZ];
vprintf(percent_m(buf, fmt), ap);
printf("\n");
fflush(stdout);
}
/* syslog - format one record */
/* VARARGS */
TCP Wrappers: tcpdchk (tcp wrapper configuration checker) and tcpdmatch (tcp wrapper oracle) warning fixes via edits to the C code files contrib/tcp_wrappers/fakelog.c Warnings for each of functions: openlog( ), vsyslog( ), VARARGS( ), closelog( ) warning: type specifier missing, defaults to 'int' [-Wimplicit-int] warning: control reaches end of non-void function [-Wreturn-type] Fixes: Explicitly added specification of function type to void for each function, suppressing both warnings for each function listed contrib/tcp_wrappers/inetcf.c Warnings: warning: incompativle redeclaration of library function 'malloc' note: 'malloc' is a builtin with type 'void *(unsigned long)' warning: implicit declaration of function 'check_path' is invalid in C99 [-Wimplicit-function-declaration] Fixes: Removed redeclaration of malloc on line 21 Included library <stdlib.h> in the code which contains the malloc( ) function in it's library Included scaffold.h header file in the code that contains check-path( ) function contrib/tcp_wrappers/scaffold.c Warnings: warning: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Wimplicit-function-declaration] note: include the header <stdlib.h> or explicitly provide a declaration for 'exit' Fixes: Included <stdlib.h> in the code which contains the exit( ) function in it's library contrib/tcp_wrappers/tcpdchk.c Warnings: warning: implicit declaration of function 'getopt' is invalid in C99 [-Wimplicit-function-declaration] warning: implicit declaration of function 'atoi' is invalid in C99 [-Wimplicit-function-declaration] Fixes: Included the specific function <getopt.h> library to the code Included<stdlib.h> to the code which contains the atoi( ) function in the library contrib/tcp_wrappers/tcpdmatch.c Warnings: warning: implicit declaration of function 'getopt' is invalid in C99 [-Wimplicit-function-declaration] Fixes: Included<stdlib.h> to the code which contains the getopt( ) function in the library Submitted by: Aaron Prieger <aprieger@llnw.com> Reviewed by: vangyzen Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D10995
2017-06-16 22:32:23 +00:00
void VARARGS(syslog, int, severity)
{
va_list ap;
char *fmt;
VASTART(ap, int, severity);
fmt = va_arg(ap, char *);
vsyslog(severity, fmt, ap);
VAEND(ap);
}
/* closelog - dummy */
TCP Wrappers: tcpdchk (tcp wrapper configuration checker) and tcpdmatch (tcp wrapper oracle) warning fixes via edits to the C code files contrib/tcp_wrappers/fakelog.c Warnings for each of functions: openlog( ), vsyslog( ), VARARGS( ), closelog( ) warning: type specifier missing, defaults to 'int' [-Wimplicit-int] warning: control reaches end of non-void function [-Wreturn-type] Fixes: Explicitly added specification of function type to void for each function, suppressing both warnings for each function listed contrib/tcp_wrappers/inetcf.c Warnings: warning: incompativle redeclaration of library function 'malloc' note: 'malloc' is a builtin with type 'void *(unsigned long)' warning: implicit declaration of function 'check_path' is invalid in C99 [-Wimplicit-function-declaration] Fixes: Removed redeclaration of malloc on line 21 Included library <stdlib.h> in the code which contains the malloc( ) function in it's library Included scaffold.h header file in the code that contains check-path( ) function contrib/tcp_wrappers/scaffold.c Warnings: warning: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Wimplicit-function-declaration] note: include the header <stdlib.h> or explicitly provide a declaration for 'exit' Fixes: Included <stdlib.h> in the code which contains the exit( ) function in it's library contrib/tcp_wrappers/tcpdchk.c Warnings: warning: implicit declaration of function 'getopt' is invalid in C99 [-Wimplicit-function-declaration] warning: implicit declaration of function 'atoi' is invalid in C99 [-Wimplicit-function-declaration] Fixes: Included the specific function <getopt.h> library to the code Included<stdlib.h> to the code which contains the atoi( ) function in the library contrib/tcp_wrappers/tcpdmatch.c Warnings: warning: implicit declaration of function 'getopt' is invalid in C99 [-Wimplicit-function-declaration] Fixes: Included<stdlib.h> to the code which contains the getopt( ) function in the library Submitted by: Aaron Prieger <aprieger@llnw.com> Reviewed by: vangyzen Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D10995
2017-06-16 22:32:23 +00:00
void closelog()
{
/* void */
}