From 1be5b46c7eefbf91acd458823030f0991da59331 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Mon, 30 Mar 1998 21:52:25 +0000 Subject: [PATCH] * kdc5_hammer.c (usage): Change usage to refelect reality Add parenthesis around assignements in conditionals. gcc -Wall cleanups git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10509 dc483132-0cff-0310-8789-dd5450dbe970 --- src/tests/hammer/ChangeLog | 5 ++++ src/tests/hammer/kdc5_hammer.c | 48 +++++++++++++++++----------------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/src/tests/hammer/ChangeLog b/src/tests/hammer/ChangeLog index 506097b07..8d652e76e 100644 --- a/src/tests/hammer/ChangeLog +++ b/src/tests/hammer/ChangeLog @@ -1,3 +1,8 @@ +Mon Mar 30 16:48:17 1998 Ezra Peisach + + * kdc5_hammer.c (usage): Change usage to refelect reality + Add parenthesis around assignements in conditionals. + Wed Feb 18 16:29:34 1998 Tom Yu * Makefile.in: Remove trailing slash from thisconfigdir. Fix up diff --git a/src/tests/hammer/kdc5_hammer.c b/src/tests/hammer/kdc5_hammer.c index e0d1636b8..9769f0541 100644 --- a/src/tests/hammer/kdc5_hammer.c +++ b/src/tests/hammer/kdc5_hammer.c @@ -85,10 +85,10 @@ char *who; int status; { fprintf(stderr, - "usage: %s -p prefix -n num_to_check [-d dbpathname] [-r realmname]\n", + "usage: %s -p prefix -n num_to_check [-c cachename] [-r realmname]\n", who); fprintf(stderr, "\t [-D depth] [-k enctype]\n"); - fprintf(stderr, "\t [-P preauth type] [-R repeat_count]\n"); + fprintf(stderr, "\t [-P preauth type] [-R repeat_count] [-t] [-b] [-v] \n"); exit(status); } @@ -112,7 +112,7 @@ struct h_timer tgs_req_times = { 0.0, 1000000.0, -1.0, 0 }; (((float) (tend_time.tv_usec - \ tstart_time.tv_usec))/1000000.0))) -void +int main(argc, argv) int argc; char **argv; @@ -206,7 +206,7 @@ main(argc, argv) enctype = DEFAULT_KDC_ENCTYPE; if (!cur_realm) { - if (retval = krb5_get_default_realm(test_context, &cur_realm)) { + if ((retval = krb5_get_default_realm(test_context, &cur_realm))) { com_err(prog, retval, "while retrieving default realm name"); exit(1); } @@ -219,7 +219,7 @@ main(argc, argv) } if (ccache == NULL) { - if (code = krb5_cc_default(test_context, &ccache)) { + if ((code = krb5_cc_default(test_context, &ccache))) { com_err(prog, code, "while getting default ccache"); exit(1); } @@ -307,18 +307,18 @@ get_server_key(context, server, enctype, key) krb5_data salt; krb5_data pwd; - if (retval = krb5_principal2salt(context, server, &salt)) + if ((retval = krb5_principal2salt(context, server, &salt))) return retval; - if (retval = krb5_unparse_name(context, server, &string)) + if ((retval = krb5_unparse_name(context, server, &string))) goto cleanup_salt; pwd.data = string; pwd.length = strlen(string); - if (*key = (krb5_keyblock *)malloc(sizeof(krb5_keyblock))) { + if ((*key = (krb5_keyblock *)malloc(sizeof(krb5_keyblock)))) { krb5_use_enctype(context, &eblock, enctype); - if (retval = krb5_string_to_key(context, &eblock, *key, &pwd, &salt)) + if ((retval = krb5_string_to_key(context, &eblock, *key, &pwd, &salt))) free(*key); } else retval = ENOMEM; @@ -373,14 +373,14 @@ int verify_cs_pair(context, p_client_str, p_client, service, hostname, return(retval); /* obtain ticket & session key */ - if (retval = krb5_cc_get_principal(context, ccache, &creds.client)) { + if ((retval = krb5_cc_get_principal(context, ccache, &creds.client))) { com_err(prog, retval, "while getting client princ for %s", hostname); krb5_free_cred_contents(context, &creds); return retval; } - if (retval = krb5_get_credentials(context, 0, - ccache, &creds, &credsp)) { + if ((retval = krb5_get_credentials(context, 0, + ccache, &creds, &credsp))) { com_err(prog, retval, "while getting creds for %s", hostname); krb5_free_cred_contents(context, &creds); return retval; @@ -391,8 +391,8 @@ int verify_cs_pair(context, p_client_str, p_client, service, hostname, if (do_timer) swatch_on(); - if (retval = krb5_mk_req_extended(context, &auth_context, 0, NULL, - credsp, &request_data)) { + if ((retval = krb5_mk_req_extended(context, &auth_context, 0, NULL, + credsp, &request_data))) { com_err(prog, retval, "while preparing AP_REQ for %s", hostname); krb5_auth_con_free(context, auth_context); return retval; @@ -402,8 +402,8 @@ int verify_cs_pair(context, p_client_str, p_client, service, hostname, auth_context = NULL; /* Do server side now */ - if (retval = get_server_key(context, credsp->server, - credsp->keyblock.enctype, &keyblock)) { + if ((retval = get_server_key(context, credsp->server, + credsp->keyblock.enctype, &keyblock))) { com_err(prog, retval, "while getting server key for %s", hostname); goto cleanup_rdata; } @@ -418,8 +418,8 @@ int verify_cs_pair(context, p_client_str, p_client, service, hostname, goto cleanup_keyblock; } - if (retval = krb5_rd_req(context, &auth_context, &request_data, - NULL /* server */, 0, NULL, &ticket)) { + if ((retval = krb5_rd_req(context, &auth_context, &request_data, + NULL /* server */, 0, NULL, &ticket))) { com_err(prog, retval, "while decoding AP_REQ for %s", hostname); krb5_auth_con_free(context, auth_context); goto cleanup_keyblock; @@ -439,8 +439,8 @@ int verify_cs_pair(context, p_client_str, p_client, service, hostname, if (!(krb5_principal_compare(context,ticket->enc_part2->client,p_client))){ char *returned_client; - if (retval = krb5_unparse_name(context, ticket->enc_part2->client, - &returned_client)) + if ((retval = krb5_unparse_name(context, ticket->enc_part2->client, + &returned_client))) com_err (prog, retval, "Client not as expected, but cannot unparse client name"); else @@ -481,27 +481,27 @@ int get_tgt (context, p_client_str, p_client, ccache) if (!brief) fprintf(stderr, "\tgetting TGT for %s\n", p_client_str); - if (code = krb5_timeofday(context, &start)) { + if ((code = krb5_timeofday(context, &start))) { com_err(prog, code, "while getting time of day"); return(-1); } memset((char *)&my_creds, 0, sizeof(my_creds)); - if (code = krb5_parse_name (context, p_client_str, p_client)) { + if ((code = krb5_parse_name (context, p_client_str, p_client))) { com_err (prog, code, "when parsing name %s", p_client_str); return(-1); } - if (code = krb5_build_principal_ext(context, &tgt_server, + if ((code = krb5_build_principal_ext(context, &tgt_server, krb5_princ_realm(context, *p_client)->length, krb5_princ_realm(context, *p_client)->data, tgtname.length, tgtname.data, krb5_princ_realm(context, *p_client)->length, krb5_princ_realm(context, *p_client)->data, - 0)) { + 0))) { com_err(prog, code, "when setting up tgt principal"); return(-1); } -- 2.26.2