From: Ezra Peisach Date: Thu, 20 Apr 1995 17:14:26 +0000 (+0000) Subject: Modify usage to reflect reality. Modified getopt call to recognize the already X-Git-Tag: krb5-1.0-beta5~346 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=efe50e697bf4005499e43f95598d967946114d90;p=krb5.git Modify usage to reflect reality. Modified getopt call to recognize the already coded -r option. Cleanup memory on exit and set exit status to number of errors found. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5393 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/tests/hammer/ChangeLog b/src/tests/hammer/ChangeLog index 6773ba47d..edb513379 100644 --- a/src/tests/hammer/ChangeLog +++ b/src/tests/hammer/ChangeLog @@ -1,3 +1,9 @@ +Thu Apr 20 13:06:53 1995 Ezra Peisach + + * kdc_hammer.c (usage()): Removed -M as not used. + (main()): Add missing option to getopt call. + On exit, close the ccache, free context, and exit + with status set to number of errors encountered. Mon Mar 27 07:56:26 1995 Chris Provenzano (proven@mit.edu) diff --git a/src/tests/hammer/kdc5_hammer.c b/src/tests/hammer/kdc5_hammer.c index 9a16d5a98..099715fc8 100644 --- a/src/tests/hammer/kdc5_hammer.c +++ b/src/tests/hammer/kdc5_hammer.c @@ -78,7 +78,7 @@ int status; fprintf(stderr, "usage: %s -p prefix -n num_to_check [-d dbpathname] [-r realmname]\n", who); - fprintf(stderr, "\t [-D depth] [-k keytype] [-e etype] [-M mkeyname]\n"); + fprintf(stderr, "\t [-D depth] [-k keytype] [-e etype]\n"); fprintf(stderr, "\t [-P preauth type] [-R repeat_count]\n"); exit(status); @@ -123,7 +123,7 @@ main(argc, argv) errors = 0; keytypedone = 0; - while ((option = getopt(argc, argv, "D:p:n:c:R:k:P:e:bv")) != EOF) { + while ((option = getopt(argc, argv, "D:p:n:c:R:k:P:e:bvr:")) != EOF) { switch (option) { case 'b': brief = 1; @@ -254,6 +254,12 @@ main(argc, argv) } } fprintf (stderr, "\nTried %d. Got %d errors.\n", n_tried, errors); + + (void) krb5_cc_close(test_context, ccache); + + krb5_free_context(test_context); + + exit(errors); } @@ -319,7 +325,7 @@ int verify_cs_pair(context, p_client_str, p_client, service, hostname, p_num, c_depth, s_depth); else fprintf(stderr, "\tclient %s for server %s\n", p_client_str, - hostname); + service); /* Initialize variables */ memset((char *)&creds, 0, sizeof(creds)); @@ -405,6 +411,8 @@ cleanup_keyblock: cleanup_rdata: krb5_xfree(request_data.data); + krb5_free_cred_contents(context, credsp); + return retval; }