From bb0fa5c59e45a83769463f88a2b17cbe981ad9d0 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Wed, 23 Aug 2000 22:57:08 +0000 Subject: [PATCH] * main.c (initialize_realms): For "cannot initialize realm" messages, tell the user to check the log file. Print out an error message as well as logging it if retrieving the default realm name fails. * kerberos_v4.c (kerberos_v4): Mask requested-life byte value with 0xff to avoid sign-extension problems. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12631 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kdc/ChangeLog | 10 ++++++++++ src/kdc/kerberos_v4.c | 2 +- src/kdc/main.c | 9 +++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/kdc/ChangeLog b/src/kdc/ChangeLog index e5243f7b0..c1d66bf66 100644 --- a/src/kdc/ChangeLog +++ b/src/kdc/ChangeLog @@ -1,3 +1,13 @@ +2000-08-23 Ken Raeburn + + * main.c (initialize_realms): For "cannot initialize realm" + messages, tell the user to check the log file. Print out an error + message as well as logging it if retrieving the default realm name + fails. + + * kerberos_v4.c (kerberos_v4): Mask requested-life byte value with + 0xff to avoid sign-extension problems. + 2000-07-03 Ezra Peisach * Makefile.in (rtest): Link in the kdb5 library. diff --git a/src/kdc/kerberos_v4.c b/src/kdc/kerberos_v4.c index 6629c3e35..2c9d9d023 100644 --- a/src/kdc/kerberos_v4.c +++ b/src/kdc/kerberos_v4.c @@ -689,7 +689,7 @@ kerberos_v4(client, pkt) } ptr = (char *) pkt_time_ws(pkt) + 4; - req_life = (u_long) (*ptr++); + req_life = (u_long) (*ptr++) & 0xff; service = ptr; str_length_check(service, SNAME_SZ); diff --git a/src/kdc/main.c b/src/kdc/main.c index 473b902d0..c26782f0c 100644 --- a/src/kdc/main.c +++ b/src/kdc/main.c @@ -615,7 +615,7 @@ initialize_realms(kcontext, argc, argv) if ((retval = init_realm(argv[0], rdatap, optarg, db_name, mkey_name, menctype, default_ports, manual))) { - fprintf(stderr,"%s: cannot initialize realm %s\n", + fprintf(stderr,"%s: cannot initialize realm %s - see log file for details\n", argv[0], optarg); exit(1); } @@ -692,13 +692,15 @@ initialize_realms(kcontext, argc, argv) if ((retval = krb5_get_default_realm(kcontext, &lrealm))) { com_err(argv[0], retval, "while attempting to retrieve default realm"); + fprintf (stderr, "%s: %s, attempting to retrieve default realm\n", + argv[0], error_message (retval)); exit(1); } if ((rdatap = (kdc_realm_t *) malloc(sizeof(kdc_realm_t)))) { if ((retval = init_realm(argv[0], rdatap, lrealm, db_name, mkey_name, menctype, default_ports, manual))) { - fprintf(stderr,"%s: cannot initialize realm %s\n", + fprintf(stderr,"%s: cannot initialize realm %s - see log file for details\n", argv[0], lrealm); exit(1); } @@ -794,6 +796,9 @@ int main(argc, argv) exit(1); } krb5_klog_init(kcontext, "kdc", argv[0], 1); + /* N.B.: After this point, com_err sends output to the KDC log + file, and not to stderr. */ + initialize_kdc5_error_table(); /* -- 2.26.2