summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2001-05-30 20:15:58 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2001-05-30 20:15:58 +0000
commit35c750c1b9b4ff0097fbf2af4700176902c92f5a (patch)
treec1d94e254dc111993309070f756d5e9af2a3432a
parent92a910146a231eff9948091ddd7b164f5cea5b73 (diff)
do not access the database after tokendb_close() is called; ok millert@
-rw-r--r--libexec/login_token/tokendb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libexec/login_token/tokendb.c b/libexec/login_token/tokendb.c
index 6648119a8f4..775ce998e17 100644
--- a/libexec/login_token/tokendb.c
+++ b/libexec/login_token/tokendb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tokendb.c,v 1.2 2000/12/20 01:52:12 millert Exp $ */
+/* $OpenBSD: tokendb.c,v 1.3 2001/05/30 20:15:57 markus Exp $ */
/*-
* Copyright (c) 1995 Migration Associates Corp. All Rights Reserved
@@ -82,17 +82,18 @@ tokendb_getrec(char *username, TOKENDB_Rec *tokenrec)
return(-1);
status = (tokendb->get)(tokendb, &key, &data, 0);
- tokendb_close();
-
switch (status) {
case 1:
+ tokendb_close();
return(ENOENT);
case -1:
+ tokendb_close();
return(-1);
}
memcpy(tokenrec, data.data, sizeof(TOKENDB_Rec));
if ((tokenrec->flags & TOKEN_USEMODES) == 0)
tokenrec->mode = tt->modes & ~TOKEN_RIM;
+ tokendb_close();
return (0);
}