From b380ef3fa7ea37f56513c27d2d7e95d2fab5c7ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Groenvall?= Date: Mon, 2 Oct 1995 22:21:32 +0000 Subject: [PATCH] x git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@138 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/xnlock/xnlock.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/appl/xnlock/xnlock.c b/appl/xnlock/xnlock.c index 4c895a8cd..5fe7d0343 100644 --- a/appl/xnlock/xnlock.c +++ b/appl/xnlock/xnlock.c @@ -796,12 +796,13 @@ main (int argc, char **argv) #ifdef KERBEROS { - int code; + int code = KSUCCESS; char *file; strcpy(name, pw->pw_name); /* Unix name is default name */ if ((file = getenv("KRBTKFILE")) == 0) file = TKT_FILE; - if (tf_init(file, R_TKT_FIL) == KSUCCESS) + code = tf_init(file, R_TKT_FIL); + if (code == KSUCCESS) { (void) tf_close(); if ((code = krb_get_tf_realm(file, realm)) == KSUCCESS && @@ -813,12 +814,12 @@ main (int argc, char **argv) dest_tkt(); /* Nuke old ticket file */ creat(file, 0600); /* but keep a place holder */ } - else - { - code = krb_get_lrealm(realm, 1); - if (code != KSUCCESS) - realm[0] = 0; /* No kerberos today */ - } + } + if (code != KSUCCESS) + { + code = krb_get_lrealm(realm, 1); + if (code != KSUCCESS) + realm[0] = 0; /* No kerberos today */ } } #endif /* KERBEROS */