summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2006-08-18 09:15:21 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2006-08-18 09:15:21 +0000
commit99cc0124184da5f0a7f5d24653c894da1ee52221 (patch)
tree15df455155284b86e59722fa1f6405b51b8c2a6e
parentf3844d4b1ca1b63f603efbe4be5265dc8e340603 (diff)
delay authentication related cleanups until we're authenticated and
all alarms have been cancelled; ok deraadt
-rw-r--r--usr.bin/ssh/auth.h3
-rw-r--r--usr.bin/ssh/session.c4
-rw-r--r--usr.bin/ssh/sshd.c3
3 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/ssh/auth.h b/usr.bin/ssh/auth.h
index 39c9e532271..bbef7fbe20f 100644
--- a/usr.bin/ssh/auth.h
+++ b/usr.bin/ssh/auth.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth.h,v 1.57 2006/08/03 03:34:41 deraadt Exp $ */
+/* $OpenBSD: auth.h,v 1.58 2006/08/18 09:15:20 markus Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
@@ -48,6 +48,7 @@ typedef struct KbdintDevice KbdintDevice;
struct Authctxt {
sig_atomic_t success;
+ int authenticated; /* authenticated and alarms cancelled */
int postponed; /* authentication needs another step */
int valid; /* user exists and is allowed to login */
int attempt;
diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c
index 0dd09cdfc07..9183c951d8e 100644
--- a/usr.bin/ssh/session.c
+++ b/usr.bin/ssh/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.217 2006/08/04 20:46:05 stevesk Exp $ */
+/* $OpenBSD: session.c,v 1.218 2006/08/18 09:15:20 markus Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
@@ -2020,7 +2020,7 @@ do_cleanup(Authctxt *authctxt)
return;
called = 1;
- if (authctxt == NULL)
+ if (authctxt == NULL || !authctxt->authenticated)
return;
#ifdef KRB5
if (options.kerberos_ticket_cleanup &&
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c
index 043b502381e..23f9fd66922 100644
--- a/usr.bin/ssh/sshd.c
+++ b/usr.bin/ssh/sshd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshd.c,v 1.346 2006/08/18 09:13:26 deraadt Exp $ */
+/* $OpenBSD: sshd.c,v 1.347 2006/08/18 09:15:20 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1705,6 +1705,7 @@ main(int ac, char **av)
*/
alarm(0);
signal(SIGALRM, SIG_DFL);
+ authctxt->authenticated = 1;
if (startup_pipe != -1) {
close(startup_pipe);
startup_pipe = -1;