diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | serverloop.c | 8 | ||||
-rw-r--r-- | serverloop.h | 4 | ||||
-rw-r--r-- | session.c | 11 | ||||
-rw-r--r-- | session.h | 4 |
5 files changed, 23 insertions, 13 deletions
@@ -76,6 +76,13 @@ | |||
76 | - dugsong@cvs.openbsd.org 2001/06/26 17:41:49 | 76 | - dugsong@cvs.openbsd.org 2001/06/26 17:41:49 |
77 | [servconf.c] | 77 | [servconf.c] |
78 | #include <kafs.h> | 78 | #include <kafs.h> |
79 | - markus@cvs.openbsd.org 2001/06/26 20:14:11 | ||
80 | [key.c key.h ssh.c sshconnect1.c sshconnect2.c] | ||
81 | add smartcard support to the client, too (now you can use both | ||
82 | the agent and the client). | ||
83 | - markus@cvs.openbsd.org 2001/06/27 02:12:54 | ||
84 | [serverloop.c serverloop.h session.c session.h] | ||
85 | quick hack to make ssh2 work again. | ||
79 | 86 | ||
80 | 20010629 | 87 | 20010629 |
81 | - (bal) Removed net_aton() since we don't use it any more | 88 | - (bal) Removed net_aton() since we don't use it any more |
@@ -5903,4 +5910,4 @@ | |||
5903 | - Wrote replacements for strlcpy and mkdtemp | 5910 | - Wrote replacements for strlcpy and mkdtemp |
5904 | - Released 1.0pre1 | 5911 | - Released 1.0pre1 |
5905 | 5912 | ||
5906 | $Id: ChangeLog,v 1.1361 2001/07/04 04:48:36 mouring Exp $ | 5913 | $Id: ChangeLog,v 1.1362 2001/07/04 04:53:53 mouring Exp $ |
diff --git a/serverloop.c b/serverloop.c index 2eb8603d1..ecc7763a4 100644 --- a/serverloop.c +++ b/serverloop.c | |||
@@ -35,7 +35,7 @@ | |||
35 | */ | 35 | */ |
36 | 36 | ||
37 | #include "includes.h" | 37 | #include "includes.h" |
38 | RCSID("$OpenBSD: serverloop.c,v 1.71 2001/06/25 08:25:39 markus Exp $"); | 38 | RCSID("$OpenBSD: serverloop.c,v 1.72 2001/06/27 02:12:52 markus Exp $"); |
39 | 39 | ||
40 | #include "xmalloc.h" | 40 | #include "xmalloc.h" |
41 | #include "packet.h" | 41 | #include "packet.h" |
@@ -59,6 +59,7 @@ extern ServerOptions options; | |||
59 | 59 | ||
60 | /* XXX */ | 60 | /* XXX */ |
61 | extern Kex *xxx_kex; | 61 | extern Kex *xxx_kex; |
62 | static Authctxt *xxx_authctxt; | ||
62 | 63 | ||
63 | static Buffer stdin_buffer; /* Buffer for stdin data. */ | 64 | static Buffer stdin_buffer; /* Buffer for stdin data. */ |
64 | static Buffer stdout_buffer; /* Buffer for stdout data. */ | 65 | static Buffer stdout_buffer; /* Buffer for stdout data. */ |
@@ -658,7 +659,7 @@ server_loop(pid_t pid, int fdin_arg, int fdout_arg, int fderr_arg) | |||
658 | } | 659 | } |
659 | 660 | ||
660 | void | 661 | void |
661 | server_loop2(void) | 662 | server_loop2(Authctxt *authctxt) |
662 | { | 663 | { |
663 | fd_set *readset = NULL, *writeset = NULL; | 664 | fd_set *readset = NULL, *writeset = NULL; |
664 | int rekeying = 0, max_fd, status; | 665 | int rekeying = 0, max_fd, status; |
@@ -672,6 +673,7 @@ server_loop2(void) | |||
672 | connection_out = packet_get_connection_out(); | 673 | connection_out = packet_get_connection_out(); |
673 | 674 | ||
674 | max_fd = MAX(connection_in, connection_out); | 675 | max_fd = MAX(connection_in, connection_out); |
676 | xxx_authctxt = authctxt; | ||
675 | 677 | ||
676 | server_init_dispatch(); | 678 | server_init_dispatch(); |
677 | 679 | ||
@@ -818,7 +820,7 @@ server_request_session(char *ctype) | |||
818 | error("server_request_session: channel_new failed"); | 820 | error("server_request_session: channel_new failed"); |
819 | return NULL; | 821 | return NULL; |
820 | } | 822 | } |
821 | if (session_open(c->self) != 1) { | 823 | if (session_open(xxx_authctxt, c->self) != 1) { |
822 | debug("session open failed, free channel %d", c->self); | 824 | debug("session open failed, free channel %d", c->self); |
823 | channel_free(c); | 825 | channel_free(c); |
824 | return NULL; | 826 | return NULL; |
diff --git a/serverloop.h b/serverloop.h index 9ea2b38d4..f419198d1 100644 --- a/serverloop.h +++ b/serverloop.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: serverloop.h,v 1.4 2001/06/26 17:27:24 markus Exp $ */ | 1 | /* $OpenBSD: serverloop.h,v 1.5 2001/06/27 02:12:53 markus Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
@@ -22,6 +22,6 @@ | |||
22 | #define SERVERLOOP_H | 22 | #define SERVERLOOP_H |
23 | 23 | ||
24 | void server_loop(pid_t, int, int, int); | 24 | void server_loop(pid_t, int, int, int); |
25 | void server_loop2(void); | 25 | void server_loop2(Authctxt *); |
26 | 26 | ||
27 | #endif | 27 | #endif |
@@ -33,7 +33,7 @@ | |||
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include "includes.h" | 35 | #include "includes.h" |
36 | RCSID("$OpenBSD: session.c,v 1.96 2001/06/26 16:15:24 dugsong Exp $"); | 36 | RCSID("$OpenBSD: session.c,v 1.97 2001/06/27 02:12:53 markus Exp $"); |
37 | 37 | ||
38 | #include "ssh.h" | 38 | #include "ssh.h" |
39 | #include "ssh1.h" | 39 | #include "ssh1.h" |
@@ -547,9 +547,9 @@ do_exec_pty(Session *s, const char *command) | |||
547 | 547 | ||
548 | /* Fork the child. */ | 548 | /* Fork the child. */ |
549 | if ((pid = fork()) == 0) { | 549 | if ((pid = fork()) == 0) { |
550 | |||
550 | /* Child. Reinitialize the log because the pid has changed. */ | 551 | /* Child. Reinitialize the log because the pid has changed. */ |
551 | log_init(__progname, options.log_level, options.log_facility, log_stderr); | 552 | log_init(__progname, options.log_level, options.log_facility, log_stderr); |
552 | |||
553 | /* Close the master side of the pseudo tty. */ | 553 | /* Close the master side of the pseudo tty. */ |
554 | close(ptyfd); | 554 | close(ptyfd); |
555 | 555 | ||
@@ -1562,7 +1562,7 @@ session_dump(void) | |||
1562 | } | 1562 | } |
1563 | 1563 | ||
1564 | int | 1564 | int |
1565 | session_open(int chanid) | 1565 | session_open(Authctxt *authctxt, int chanid) |
1566 | { | 1566 | { |
1567 | Session *s = session_new(); | 1567 | Session *s = session_new(); |
1568 | debug("session_open: channel %d", chanid); | 1568 | debug("session_open: channel %d", chanid); |
@@ -1570,7 +1570,8 @@ session_open(int chanid) | |||
1570 | error("no more sessions"); | 1570 | error("no more sessions"); |
1571 | return 0; | 1571 | return 0; |
1572 | } | 1572 | } |
1573 | s->pw = auth_get_user(); | 1573 | s->authctxt = authctxt; |
1574 | s->pw = authctxt->pw; | ||
1574 | if (s->pw == NULL) | 1575 | if (s->pw == NULL) |
1575 | fatal("no user for session %d", s->self); | 1576 | fatal("no user for session %d", s->self); |
1576 | debug("session_open: session %d: link with channel %d", s->self, chanid); | 1577 | debug("session_open: session %d: link with channel %d", s->self, chanid); |
@@ -2052,5 +2053,5 @@ session_setup_x11fwd(Session *s) | |||
2052 | static void | 2053 | static void |
2053 | do_authenticated2(Authctxt *authctxt) | 2054 | do_authenticated2(Authctxt *authctxt) |
2054 | { | 2055 | { |
2055 | server_loop2(); | 2056 | server_loop2(authctxt); |
2056 | } | 2057 | } |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: session.h,v 1.9 2001/06/26 17:27:24 markus Exp $ */ | 1 | /* $OpenBSD: session.h,v 1.10 2001/06/27 02:12:54 markus Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. | 4 | * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. |
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | void do_authenticated(Authctxt *); | 29 | void do_authenticated(Authctxt *); |
30 | 30 | ||
31 | int session_open(int); | 31 | int session_open(Authctxt*, int); |
32 | void session_input_channel_req(int, void *); | 32 | void session_input_channel_req(int, void *); |
33 | void session_close_by_pid(pid_t, int); | 33 | void session_close_by_pid(pid_t, int); |
34 | void session_close_by_channel(int, void *); | 34 | void session_close_by_channel(int, void *); |