From a07b05d796a73462ca8a9a706965bbe3fdccf7f6 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Thu, 21 Jul 1994 05:07:10 +0000 Subject: [PATCH] * Makefile.in: fix infinite recursion in rules * gss-client.c: * gss-misc.c: * gss-server.c: downgrade to K&R function definitions git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4007 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/gss-sample/ChangeLog | 7 +++++++ src/appl/gss-sample/Makefile.in | 10 ++++------ src/appl/gss-sample/gss-client.c | 32 +++++++++++++++++++++----------- src/appl/gss-sample/gss-misc.c | 20 +++++++++++++++----- src/appl/gss-sample/gss-server.c | 31 ++++++++++++++++++++----------- 5 files changed, 67 insertions(+), 33 deletions(-) diff --git a/src/appl/gss-sample/ChangeLog b/src/appl/gss-sample/ChangeLog index 3a76c9fb8..b85a33e69 100644 --- a/src/appl/gss-sample/ChangeLog +++ b/src/appl/gss-sample/ChangeLog @@ -1,3 +1,10 @@ +Thu Jul 21 01:02:28 1994 Tom Yu (tlyu at dragons-lair) + + * Makefile.in: fix infinite recursion in rules + * gss-client.c: + * gss-misc.c: + * gss-server.c: downgrade to K&R function definitions + Tue Jul 19 20:28:46 1994 Tom Yu (tlyu at dragons-lair) * Makefile.in: diff --git a/src/appl/gss-sample/Makefile.in b/src/appl/gss-sample/Makefile.in index ab8f21cd5..e21ccc7cd 100644 --- a/src/appl/gss-sample/Makefile.in +++ b/src/appl/gss-sample/Makefile.in @@ -5,7 +5,7 @@ ISODELIB=@ISODELIB@ COMERRLIB=$(BUILDTOP)/util/et/libcom_err.a DBMLIB= -all:: +all:: gss-server gss-client KLIB = $(TOPLIBD)/gssapi/libgssapi_krb5.a $(TOPLIBD)/libkrb5.a \ $(TOPLIBD)/libcrypto.a $(ISODELIB) $(COMERRLIB) $(DBMLIB) @@ -16,13 +16,11 @@ gss-server: gss-server.o gss-misc.o gss-client: gss-client.o gss-misc.o $(CC) $(CFLAGS) -o gss-client gss-client.o gss-misc.o $(KLIB) $(LIBS) -gss-client.o: $(srcdir)/gss-client.o - -gss-misc.o: $(srcdir)/gss-misc.o +gss-client.o: $(srcdir)/gss-client.c -gss-server.o: $(srcdir)/gss-server.o +gss-misc.o: $(srcdir)/gss-misc.c -all:: gss-server gss-client +gss-server.o: $(srcdir)/gss-server.c clean:: $(RM) gss-server gss-client diff --git a/src/appl/gss-sample/gss-client.c b/src/appl/gss-sample/gss-client.c index 264f451cc..c6f75c9a9 100644 --- a/src/appl/gss-sample/gss-client.c +++ b/src/appl/gss-sample/gss-client.c @@ -33,13 +33,13 @@ static char *rcsid = "$Header$"; #include #include -int establish_context(int s, char *service_name, gss_ctx_id_t *gss_context); -int connect_to_server(char *host, u_short port); -int call_server(char *host, u_short port, char *service_name, char *msg); +int establish_context(); +int connect_to_server(); +int call_server(); -int send_token(int s, gss_buffer_t tok); -int recv_token(int s, gss_buffer_t tok); -void display_status(char *msg, OM_uint32 maj_stat, OM_uint32 min_stat); +int send_token(); +int recv_token(); +void display_status(); usage() { @@ -47,7 +47,9 @@ usage() exit(1); } -main(int argc, char **argv) +main(argc, argv) + int argc; + char **argv; { char *service_name, *server_host, *msg; u_short port = 4444; @@ -99,7 +101,11 @@ main(int argc, char **argv) * verifies it with gss_verify. -1 is returned if any step fails, * otherwise 0 is returned. */ -int call_server(char *host, u_short port, char *service_name, char *msg) +int call_server(host, port, service_name, msg) + char *host; + u_short port; + char *service_name; + char *msg; { gss_ctx_id_t context; gss_buffer_desc in_buf, out_buf; @@ -174,7 +180,9 @@ int call_server(char *host, u_short port, char *service_name, char *msg) * opened and connected. If an error occurs, an error message is * displayed and -1 is returned. */ -int connect_to_server(char *host, u_short port) +int connect_to_server(host, port) + char *host; + u_short port; { struct sockaddr_in saddr; struct hostent *hp; @@ -226,8 +234,10 @@ int connect_to_server(char *host, u_short port) * unsuccessful, the GSS-API error messages are displayed on stderr * and -1 is returned. */ -int client_establish_context(int s, char *service_name, - gss_ctx_id_t *gss_context) +int client_establish_context(s, service_name, gss_context) + int s; + char *service_name; + gss_ctx_id_t *gss_context; { gss_buffer_desc send_tok, recv_tok, *token_ptr; gss_name_t target_name; diff --git a/src/appl/gss-sample/gss-misc.c b/src/appl/gss-sample/gss-misc.c index 24705ab87..284bcea4c 100644 --- a/src/appl/gss-sample/gss-misc.c +++ b/src/appl/gss-sample/gss-misc.c @@ -31,7 +31,7 @@ static char *rcsid = "$Header$"; #include #include -static void display_status_1(char *m, OM_uint32 code, int type); +static void display_status_1(); /* * Function: send_token @@ -51,7 +51,9 @@ static void display_status_1(char *m, OM_uint32 code, int type); * token data to the file descriptor s. It returns 0 on success, and * -1 if an error occurs or if it could not write all the data. */ -int send_token(int s, gss_buffer_t tok) +int send_token(s, tok) + int s; + gss_buffer_t tok; { int len, ret; @@ -101,7 +103,9 @@ int send_token(int s, gss_buffer_t tok) * gss_release_buffer. It returns 0 on success, and -1 if an error * occurs or if it could not read all the data. */ -int recv_token(int s, gss_buffer_t tok) +int recv_token(s, tok) + int s; + gss_buffer_t tok; { int ret; @@ -154,13 +158,19 @@ int recv_token(int s, gss_buffer_t tok) * displayed on stderr, each preceeded by "GSS-API error : " and * followed by a newline. */ -void display_status(char *msg, OM_uint32 maj_stat, OM_uint32 min_stat) +void display_status(msg, maj_stat, min_stat) + char *msg; + OM_uint32 maj_stat; + OM_uint32 min_stat; { display_status_1(msg, maj_stat, GSS_C_GSS_CODE); display_status_1(msg, min_stat, GSS_C_MECH_CODE); } -static void display_status_1(char *m, OM_uint32 code, int type) +static void display_status_1(m, code, type) + char *m; + OM_uint32 code; + int type; { OM_uint32 maj_stat, min_stat; gss_buffer_desc msg; diff --git a/src/appl/gss-sample/gss-server.c b/src/appl/gss-sample/gss-server.c index 523b2bd50..59229bd32 100644 --- a/src/appl/gss-sample/gss-server.c +++ b/src/appl/gss-sample/gss-server.c @@ -32,11 +32,11 @@ static char *rcsid = "$Header$"; #include #include -int create_socket(u_short port); +int create_socket(); -int send_token(int s, gss_buffer_t tok); -int recv_token(int s, gss_buffer_t tok); -void display_status(char *msg, OM_uint32 maj_stat, OM_uint32 min_stat); +int send_token(); +int recv_token(); +void display_status(); usage() { @@ -44,7 +44,9 @@ usage() exit(1); } -main(int argc, char **argv) +main(argc, argv) + int argc; + char **argv; { struct sockaddr_in saddr; char *service_name; @@ -92,7 +94,8 @@ main(int argc, char **argv) * A listening socket on the specified port and created and returned. * On error, an error message is displayed and -1 is returned. */ -int create_socket(u_short port) +int create_socket(port) + u_short port; { struct sockaddr_in saddr; int s; @@ -142,7 +145,9 @@ int create_socket(u_short port) * * If any error occurs, -1 is returned. */ -int sign_server(int s, char *service_name) +int sign_server(s, service_name) + int s; + char *service_name; { gss_cred_id_t server_creds; gss_buffer_desc client_name, xmit_buf, msg_buf; @@ -237,7 +242,9 @@ int sign_server(int s, char *service_name) * fails, an error message is displayed and -1 is returned; otherwise, * 0 is returned. */ -int server_acquire_creds(char *service_name, gss_cred_id_t *server_creds) +int server_acquire_creds(service_name, server_creds) + char *service_name; + gss_cred_id_t *server_creds; { gss_buffer_desc name_buf; gss_name_t server_name; @@ -288,9 +295,11 @@ int server_acquire_creds(char *service_name, gss_cred_id_t *server_creds) * in client_name and 0 is returned. If unsuccessful, an error * message is displayed and -1 is returned. */ -int server_establish_context(int s, gss_cred_id_t server_creds, - gss_ctx_id_t *context, gss_buffer_t - client_name) +int server_establish_context(s, server_creds, context, client_name) + int s; + gss_cred_id_t server_creds; + gss_ctx_id_t *context; + gss_buffer_t client_name; { gss_buffer_desc send_tok, recv_tok; gss_name_t client; -- 2.26.2