From 7bff1a9b5e6a0958ebc8201542eb6d359d987a1e Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sat, 24 Dec 2005 14:59:12 +1100 Subject: - djm@cvs.openbsd.org 2005/12/24 02:27:41 [session.c sshd.c] eliminate some code duplicated in privsep and non-privsep paths, and explicitly clear SIGALRM handler; "groovy" deraadt@ --- ChangeLog | 6 +++++- session.c | 11 +---------- sshd.c | 20 ++++++++++++-------- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index aa210591e..3b7c6f700 100644 --- a/ChangeLog +++ b/ChangeLog @@ -43,6 +43,10 @@ - jmc@cvs.openbsd.org 2005/12/23 23:46:23 [ssh.1] less mark up for -c; + - djm@cvs.openbsd.org 2005/12/24 02:27:41 + [session.c sshd.c] + eliminate some code duplicated in privsep and non-privsep paths, and + explicitly clear SIGALRM handler; "groovy" deraadt@ 20051220 - (dtucker) OpenBSD CVS Sync @@ -3545,4 +3549,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4050 2005/12/24 03:56:47 djm Exp $ +$Id: ChangeLog,v 1.4051 2005/12/24 03:59:12 djm Exp $ diff --git a/session.c b/session.c index 8826fabaa..2bf904404 100644 --- a/session.c +++ b/session.c @@ -33,7 +33,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: session.c,v 1.190 2005/12/17 21:13:05 stevesk Exp $"); +RCSID("$OpenBSD: session.c,v 1.191 2005/12/24 02:27:41 djm Exp $"); #include "ssh.h" #include "ssh1.h" @@ -209,15 +209,6 @@ do_authenticated(Authctxt *authctxt) { setproctitle("%s", authctxt->pw->pw_name); - /* - * Cancel the alarm we set to limit the time taken for - * authentication. - */ - alarm(0); - if (startup_pipe != -1) { - close(startup_pipe); - startup_pipe = -1; - } /* setup the channel layer */ if (!no_port_forwarding_flag && options.allow_tcp_forwarding) channel_permit_all_opens(); diff --git a/sshd.c b/sshd.c index f0fdf5a83..def90d827 100644 --- a/sshd.c +++ b/sshd.c @@ -42,7 +42,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshd.c,v 1.317 2005/10/30 08:52:18 djm Exp $"); +RCSID("$OpenBSD: sshd.c,v 1.318 2005/12/24 02:27:41 djm Exp $"); #include #include @@ -637,13 +637,6 @@ privsep_postauth(Authctxt *authctxt) goto skip; } - /* Authentication complete */ - alarm(0); - if (startup_pipe != -1) { - close(startup_pipe); - startup_pipe = -1; - } - /* New socket pair */ monitor_reinit(pmonitor); @@ -1732,6 +1725,17 @@ main(int ac, char **av) } authenticated: + /* + * Cancel the alarm we set to limit the time taken for + * authentication. + */ + alarm(0); + signal(SIGALRM, SIG_DFL); + if (startup_pipe != -1) { + close(startup_pipe); + startup_pipe = -1; + } + #ifdef SSH_AUDIT_EVENTS audit_event(SSH_AUTH_SUCCESS); #endif -- cgit v1.2.3