- markus@cvs.openbsd.org 2001/06/27 02:12:54
     [serverloop.c serverloop.h session.c session.h]
     quick hack to make ssh2 work again.
diff --git a/ChangeLog b/ChangeLog
index cb26d0d..cc1f240 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -76,6 +76,13 @@
    - dugsong@cvs.openbsd.org 2001/06/26 17:41:49
      [servconf.c]
      #include <kafs.h>
+   - markus@cvs.openbsd.org 2001/06/26 20:14:11
+     [key.c key.h ssh.c sshconnect1.c sshconnect2.c]
+     add smartcard support to the client, too (now you can use both
+     the agent and the client).
+   - markus@cvs.openbsd.org 2001/06/27 02:12:54
+     [serverloop.c serverloop.h session.c session.h]
+     quick hack to make ssh2 work again.
  
 20010629
  - (bal) Removed net_aton() since we don't use it any more
@@ -5903,4 +5910,4 @@
  - Wrote replacements for strlcpy and mkdtemp
  - Released 1.0pre1
 
-$Id: ChangeLog,v 1.1361 2001/07/04 04:48:36 mouring Exp $
+$Id: ChangeLog,v 1.1362 2001/07/04 04:53:53 mouring Exp $
diff --git a/serverloop.c b/serverloop.c
index 2eb8603..ecc7763 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -35,7 +35,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: serverloop.c,v 1.71 2001/06/25 08:25:39 markus Exp $");
+RCSID("$OpenBSD: serverloop.c,v 1.72 2001/06/27 02:12:52 markus Exp $");
 
 #include "xmalloc.h"
 #include "packet.h"
@@ -59,6 +59,7 @@
 
 /* XXX */
 extern Kex *xxx_kex;
+static Authctxt *xxx_authctxt;
 
 static Buffer stdin_buffer;	/* Buffer for stdin data. */
 static Buffer stdout_buffer;	/* Buffer for stdout data. */
@@ -658,7 +659,7 @@
 }
 
 void
-server_loop2(void)
+server_loop2(Authctxt *authctxt)
 {
 	fd_set *readset = NULL, *writeset = NULL;
 	int rekeying = 0, max_fd, status;
@@ -672,6 +673,7 @@
 	connection_out = packet_get_connection_out();
 
 	max_fd = MAX(connection_in, connection_out);
+	xxx_authctxt = authctxt;
 
 	server_init_dispatch();
 
@@ -818,7 +820,7 @@
 		error("server_request_session: channel_new failed");
 		return NULL;
 	}
-	if (session_open(c->self) != 1) {
+	if (session_open(xxx_authctxt, c->self) != 1) {
 		debug("session open failed, free channel %d", c->self);
 		channel_free(c);
 		return NULL;
diff --git a/serverloop.h b/serverloop.h
index 9ea2b38..f419198 100644
--- a/serverloop.h
+++ b/serverloop.h
@@ -1,4 +1,4 @@
-/*	$OpenBSD: serverloop.h,v 1.4 2001/06/26 17:27:24 markus Exp $	*/
+/*	$OpenBSD: serverloop.h,v 1.5 2001/06/27 02:12:53 markus Exp $	*/
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -22,6 +22,6 @@
 #define SERVERLOOP_H
 
 void    server_loop(pid_t, int, int, int);
-void    server_loop2(void);
+void    server_loop2(Authctxt *);
 
 #endif
diff --git a/session.c b/session.c
index 5a6afa7..818f321 100644
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: session.c,v 1.96 2001/06/26 16:15:24 dugsong Exp $");
+RCSID("$OpenBSD: session.c,v 1.97 2001/06/27 02:12:53 markus Exp $");
 
 #include "ssh.h"
 #include "ssh1.h"
@@ -547,9 +547,9 @@
 
 	/* Fork the child. */
 	if ((pid = fork()) == 0) {
+
 		/* Child.  Reinitialize the log because the pid has changed. */
 		log_init(__progname, options.log_level, options.log_facility, log_stderr);
-
 		/* Close the master side of the pseudo tty. */
 		close(ptyfd);
 
@@ -1562,7 +1562,7 @@
 }
 
 int
-session_open(int chanid)
+session_open(Authctxt *authctxt, int chanid)
 {
 	Session *s = session_new();
 	debug("session_open: channel %d", chanid);
@@ -1570,7 +1570,8 @@
 		error("no more sessions");
 		return 0;
 	}
-	s->pw = auth_get_user();
+	s->authctxt = authctxt;
+	s->pw = authctxt->pw;
 	if (s->pw == NULL)
 		fatal("no user for session %d", s->self);
 	debug("session_open: session %d: link with channel %d", s->self, chanid);
@@ -2052,5 +2053,5 @@
 static void
 do_authenticated2(Authctxt *authctxt)
 {
-	server_loop2();
+	server_loop2(authctxt);
 }
diff --git a/session.h b/session.h
index 39ab7d0..fd91ac1 100644
--- a/session.h
+++ b/session.h
@@ -1,4 +1,4 @@
-/*	$OpenBSD: session.h,v 1.9 2001/06/26 17:27:24 markus Exp $	*/
+/*	$OpenBSD: session.h,v 1.10 2001/06/27 02:12:54 markus Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001 Markus Friedl.  All rights reserved.
@@ -28,7 +28,7 @@
 
 void	 do_authenticated(Authctxt *);
 
-int	 session_open(int);
+int	 session_open(Authctxt*, int);
 void	 session_input_channel_req(int, void *);
 void	 session_close_by_pid(pid_t, int);
 void	 session_close_by_channel(int, void *);