From: Mitchell Berger Date: Wed, 20 Jun 2001 03:58:06 +0000 (+0000) Subject: * krb524d.c: Call krb5_klog_init before the first point where the X-Git-Tag: krb5-1.3-alpha1~1373 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=badc7c09ee8017ac48a8b4289000de6ff756cc3f;p=krb5.git * krb524d.c: Call krb5_klog_init before the first point where the klog facility may be used, delete ifdef'd out code to make that call from later in the file, conditionalize kadm5_destroy on the handle being non-null, and correct an indentation error. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13394 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/krb524/ChangeLog b/src/krb524/ChangeLog index ba597d54f..daa28c780 100644 --- a/src/krb524/ChangeLog +++ b/src/krb524/ChangeLog @@ -1,3 +1,10 @@ +2001-06-20 Mitchell Berger + + * krb524d.c: Call krb5_klog_init before the first point where the + klog facility may be used, delete ifdef'd out code to make that + call from later in the file, conditionalize kadm5_destroy on the + handle being non-null, and correct an indentation error. + 2001-06-19 Ken Raeburn * sendmsg.c (krb524_sendto_kdc): Use new locate_server interface. diff --git a/src/krb524/krb524d.c b/src/krb524/krb524d.c index 29d29e4c4..f1d0822d4 100644 --- a/src/krb524/krb524d.c +++ b/src/krb524/krb524d.c @@ -46,7 +46,7 @@ char *whoami; int signalled = 0; static int debug = 0; -void *handle; +void *handle = NULL; int use_keytab, use_master; char *keytab = NULL; @@ -148,6 +148,8 @@ int main(argc, argv) signal(SIGHUP, SIG_IGN); signal(SIGTERM, request_exit); + krb5_klog_init(context, "krb524d", whoami, !nofork); + if (use_keytab) init_keytab(context); if (use_master) @@ -180,10 +182,6 @@ int main(argc, argv) com_err(whoami, errno, "while detaching from tty"); cleanup_and_exit(1, context); } -#if 0 - if (!nofork) - krb5_klog_init(context, "krb524d", argv[0], !nofork); -#endif while (1) { FD_ZERO(&rfds); @@ -222,7 +220,7 @@ void cleanup_and_exit(ret, context) int ret; krb5_context context; { - if (use_master) { + if (use_master && handle) { (void) kadm5_destroy(handle); } if (use_keytab) krb5_kt_close(context, kt); @@ -391,7 +389,7 @@ write_msg: ret = errno; if (debug) printf("reply written\n"); -/* If we have keys to clean up, do so.*/ + /* If we have keys to clean up, do so.*/ if (v5_service_key.contents) krb5_free_keyblock_contents(context, &v5_service_key); if (v4_service_key.contents)