From 95376cfaffbbe95f04b116ee05dda778da9667b5 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Fri, 24 Mar 1995 22:42:59 +0000 Subject: [PATCH] kinit.c (main): Remove the call to krb5_os_localaddr() since get_in_tkt_XXXX will default appropriately. kinit.c (main): Kinit will print an error when there are two many arguments. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5237 dc483132-0cff-0310-8789-dd5450dbe970 --- src/clients/kinit/ChangeLog | 8 ++++++++ src/clients/kinit/kinit.c | 18 ++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/clients/kinit/ChangeLog b/src/clients/kinit/ChangeLog index 7fc5207a1..d852c5d7a 100644 --- a/src/clients/kinit/ChangeLog +++ b/src/clients/kinit/ChangeLog @@ -1,3 +1,11 @@ +Fri Mar 24 14:45:00 1995 + + * kinit.c (main): Remove the call to krb5_os_localaddr() since + get_in_tkt_XXXX will default appropriately. + + * kinit.c (main): Kinit will print an error when there are two + many arguments. + Thu Mar 2 12:31:49 1995 Theodore Y. Ts'o * Makefile.in (ISODELIB): Remove reference to $(ISODELIB). diff --git a/src/clients/kinit/kinit.c b/src/clients/kinit/kinit.c index 9a2572223..e1516b3c1 100644 --- a/src/clients/kinit/kinit.c +++ b/src/clients/kinit/kinit.c @@ -73,7 +73,6 @@ main(argc, argv) int options = KRB5_DEFAULT_OPTIONS; int option; int errflg = 0; - krb5_address **my_addresses; krb5_error_code code; krb5_principal me; krb5_principal server; @@ -155,6 +154,12 @@ main(argc, argv) } } + if (argc - optind > 1) { + fprintf(stderr, "Extra arguments (starting with \"%s\").\n", + argv[optind+1]); + errflg++; + } + if (errflg) { fprintf(stderr, "Usage: %s [-r time] [-puf] [-l lifetime] [-c cachename] [-k] [-t keytab] [principal]\n", argv[0]); exit(2); @@ -231,11 +236,6 @@ main(argc, argv) my_creds.server = server; - code = krb5_os_localaddr(&my_addresses); - if (code != 0) { - com_err (argv[0], code, "when getting my address"); - exit(1); - } if (code = krb5_timeofday(kcontext, &now)) { com_err(argv[0], code, "while getting time of day"); exit(1); @@ -258,22 +258,20 @@ main(argc, argv) fprintf(stderr, "Error while reading password for '%s'\n", client_name); memset(password, 0, sizeof(password)); - krb5_free_addresses(kcontext, my_addresses); exit(1); } - code = krb5_get_in_tkt_with_password(kcontext, options, my_addresses, + code = krb5_get_in_tkt_with_password(kcontext, options, 0, NULL, preauth, password, ccache, &my_creds, 0); memset(password, 0, sizeof(password)); } else { - code = krb5_get_in_tkt_with_keytab(kcontext, options, my_addresses, + code = krb5_get_in_tkt_with_keytab(kcontext, options, 0, NULL, preauth, keytab, ccache, &my_creds, 0); } krb5_free_principal(kcontext, server); - krb5_free_addresses(kcontext, my_addresses); if (code) { if (code == KRB5KRB_AP_ERR_BAD_INTEGRITY) -- 2.26.2