From: Ezra Peisach Date: Fri, 8 Jun 2001 16:12:07 +0000 (+0000) Subject: * client.c: Include unistd.h for getopt() prototype X-Git-Tag: krb5-1.3-alpha1~1450 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8b0ccf987cb18ee4a0563c7ceb4957dfb9788736;p=krb5.git * client.c: Include unistd.h for getopt() prototype * configure.in: Check for unistd.h. * server.c: Include unistd.h for getopt() prototype. Fix rpc_test_badauth() prototype to be consistant with error handler. Declare main as returning int. If POSIX_SIGNALS is defined, the handler expects an argument. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13312 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/rpc/unit-test/ChangeLog b/src/lib/rpc/unit-test/ChangeLog index e8d21818d..ac312fdd2 100644 --- a/src/lib/rpc/unit-test/ChangeLog +++ b/src/lib/rpc/unit-test/ChangeLog @@ -1,3 +1,14 @@ +2001-06-08 Ezra Peisach + + * client.c: Include unistd.h for getopt() prototype. + + * configure.in: Check for unistd.h. + + * server.c: Include unistd.h for getopt() prototype. Fix + rpc_test_badauth() prototype to be consistant with error + handler. Declare main as returning int. If POSIX_SIGNALS is + defined, the handler expects an argument. + 2001-06-07 Ezra Peisach * server.c (log_badauth_display_status_1): Do not assume that diff --git a/src/lib/rpc/unit-test/client.c b/src/lib/rpc/unit-test/client.c index 1c3e9c3dd..ad1c60773 100644 --- a/src/lib/rpc/unit-test/client.c +++ b/src/lib/rpc/unit-test/client.c @@ -2,99 +2,6 @@ * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved. * * $Id$ - * $Source$ - * - * $Log$ - * Revision 1.18 2001/06/05 16:27:38 epeisach - * * client.c (main): Missing arguments to printf fixed. - * - * Revision 1.17 2001/04/24 17:05:34 epeisach - * * client.c (main): Ensure that end of string is NULL terminated - * instead of assuming buffer initialized to 0. Include - * for memset prototype. - * - * Revision 1.16 1998/02/14 02:29:42 tlyu - * * client.c: Update header locations. Rename of xdr_free. - * - * * rpc_test.h: Update header locations. - * - * * server.c: Update header locations. - * - * Revision 1.15 1998/02/12 21:40:16 tlyu - * * client.c (main): Tweak the kludge variable - * krb5_gss_dbg_clietn_expcreds so we can send expired creds to the - * server. - * - * Revision 1.14 1996/11/12 21:29:54 bjaspan - * * lib/helpers.exp, client.c, server.c, config/unix.exp, - * Makefile.in: test GSS-RPC with both TCP and UDP transport layers - * [krb5-libs/180] - * - * Revision 1.13 1996/07/22 20:41:40 marc - * this commit includes all the changes on the OV_9510_INTEGRATION and - * OV_MERGE branches. This includes, but is not limited to, the new openvision - * admin system, and major changes to gssapi to add functionality, and bring - * the implementation in line with rfc1964. before committing, the - * code was built and tested for netbsd and solaris. - * - * Revision 1.12.4.1 1996/07/18 04:20:03 marc - * merged in changes from OV_9510_BP to OV_9510_FINAL1 - * - * Revision 1.12.2.1 1996/06/20 23:41:56 marc - * File added to the repository on a branch - * - * Revision 1.12 1996/05/12 06:58:10 marc - * type renamings for compatibility with beta6 - * - * Revision 1.11 1996/02/12 15:58:42 grier - * [secure/3570] - * long conversion - * - * Revision 1.10 1995/12/07 17:37:03 jik - * Use "rpc_test" instead of "rpc-test", to avoid problems with rpcgen on - * some systems. See PR 3553. - * - * Revision 1.9 1994/09/21 18:38:56 bjaspan - * [secure-rpc/2536: unit test client.c: memory initialization and out-of-bounds reference bugs] - * [secure-releng/2537: audit secure-rpc/2536: minor memory problems in unit-test client] - * - * Sandbox: - * - * 1. Don't allow the count specifie on the command line to be bigger - * than the size of the buffer use for testing. - * 2. When initializing the buffer for the lengths test, initialize it to - * count bytes. - * - * Revision 1.9 1994/09/19 01:28:04 root - * 1. Don't allow the count specifie on the command line to be bigger - * than the size of the buffer use for testing. - * 2. When initializing the buffer for the lengths test, initialize it to - * count bytes. - * - * Revision 1.8 1994/04/06 22:13:01 jik - * Change -auth_once to -o, add -a, -m and -s arguments to set - * auth_debug_gssapi, svc_debug_gssapi and misc_debug_gssapi variables. - * - * Revision 1.7 1994/04/05 20:50:09 bjaspan - * fix typo that causes coredump when server blocks/fails - * - * Revision 1.6 1993/12/08 21:44:45 bjaspan - * test fix for secure-rpc/586, improve arg handlng - * - * Revision 1.5 1993/12/06 21:23:30 bjaspan - * accept count arg for RPC_TEST_LENGTHS - * - * Revision 1.4 1993/12/01 23:41:45 bjaspan - * don't free echo_resp if call fails - * - * Revision 1.3 1993/11/15 19:53:09 bjaspan - * test auto-syncrhonization - * - * Revision 1.2 1993/11/12 02:33:43 bjaspan - * use clnt_pcreateerror for auth failures - * - * Revision 1.1 1993/11/03 23:53:58 bjaspan - * Initial revision * */ @@ -104,6 +11,9 @@ static char *rcsid = "$Header$"; #include #include +#ifdef HAVE_UNISTD_H +#include +#endif #include #include #include diff --git a/src/lib/rpc/unit-test/configure.in b/src/lib/rpc/unit-test/configure.in index f8ecf3541..63c960336 100644 --- a/src/lib/rpc/unit-test/configure.in +++ b/src/lib/rpc/unit-test/configure.in @@ -2,6 +2,7 @@ AC_INIT(client.c) CONFIG_RULES dnl set $(host) AC_CANONICAL_HOST +AC_CHECK_HEADERS(unistd.h) dnl The following are tests for the presence of programs required for testing AC_CHECK_PROG(RUNTEST,runtest,runtest) AC_CHECK_PROG(PERL,perl,perl) diff --git a/src/lib/rpc/unit-test/server.c b/src/lib/rpc/unit-test/server.c index 5f2e4b9a5..115e1895e 100644 --- a/src/lib/rpc/unit-test/server.c +++ b/src/lib/rpc/unit-test/server.c @@ -11,6 +11,9 @@ static char *rcsid = "$Header$"; #include #include +#ifdef HAVE_UNISTD_H +#include +#endif #include #include #include @@ -27,7 +30,7 @@ extern void rpc_test_prog_1(); extern int svc_debug_gssapi, misc_debug_gssapi; void rpc_test_badauth(OM_uint32 major, OM_uint32 minor, - struct sockaddr_in *addr, void *data); + struct sockaddr_in *addr, caddr_t data); void log_miscerr(struct svc_req *rqst, struct rpc_msg *msg, char *error, char *data); void log_badauth_display_status(OM_uint32 major, OM_uint32 minor); @@ -46,11 +49,16 @@ void usage() exit(1); } +#ifdef POSIX_SIGNALS +void handlesig(int dummy) +#else void handlesig(void) +#endif { exit(0); } +int main(int argc, char **argv) { int c, prot; @@ -194,7 +202,7 @@ static void rpc_test_badverf(gss_name_t client, gss_name_t server, * Logs the GSS-API error to stdout. */ void rpc_test_badauth(OM_uint32 major, OM_uint32 minor, - struct sockaddr_in *addr, void *data) + struct sockaddr_in *addr, caddr_t data) { char *a;