diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | compat.c | 10 | ||||
-rw-r--r-- | compat.h | 3 | ||||
-rw-r--r-- | ssh.c | 25 |
4 files changed, 28 insertions, 16 deletions
@@ -8,6 +8,10 @@ | |||
8 | - markus@cvs.openbsd.org 2001/09/20 13:46:48 | 8 | - markus@cvs.openbsd.org 2001/09/20 13:46:48 |
9 | [auth2.c] | 9 | [auth2.c] |
10 | key_read returns now -1 or 1 | 10 | key_read returns now -1 or 1 |
11 | - markus@cvs.openbsd.org 2001/09/20 13:50:40 | ||
12 | [compat.c compat.h ssh.c] | ||
13 | bug compat: request a dummy channel for -N (no shell) sessions + | ||
14 | cleanup; vinschen@redhat.com | ||
11 | 15 | ||
12 | 20010919 | 16 | 20010919 |
13 | - (bal) OpenBSD Sync | 17 | - (bal) OpenBSD Sync |
@@ -6541,4 +6545,4 @@ | |||
6541 | - Wrote replacements for strlcpy and mkdtemp | 6545 | - Wrote replacements for strlcpy and mkdtemp |
6542 | - Released 1.0pre1 | 6546 | - Released 1.0pre1 |
6543 | 6547 | ||
6544 | $Id: ChangeLog,v 1.1552 2001/09/20 23:11:26 mouring Exp $ | 6548 | $Id: ChangeLog,v 1.1553 2001/09/20 23:13:49 mouring Exp $ |
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: compat.c,v 1.52 2001/09/17 21:09:47 markus Exp $"); | 26 | RCSID("$OpenBSD: compat.c,v 1.53 2001/09/20 13:50:40 markus Exp $"); |
27 | 27 | ||
28 | #ifdef HAVE_LIBPCRE | 28 | #ifdef HAVE_LIBPCRE |
29 | # include <pcreposix.h> | 29 | # include <pcreposix.h> |
@@ -93,18 +93,20 @@ compat_datafellows(const char *version) | |||
93 | SSH_OLD_SESSIONID|SSH_BUG_DEBUG| | 93 | SSH_OLD_SESSIONID|SSH_BUG_DEBUG| |
94 | SSH_BUG_PKSERVICE|SSH_BUG_X11FWD| | 94 | SSH_BUG_PKSERVICE|SSH_BUG_X11FWD| |
95 | SSH_BUG_PKOK|SSH_BUG_RSASIGMD5| | 95 | SSH_BUG_PKOK|SSH_BUG_RSASIGMD5| |
96 | SSH_BUG_HBSERVICE|SSH_BUG_OPENFAILURE }, | 96 | SSH_BUG_HBSERVICE|SSH_BUG_OPENFAILURE| |
97 | SSH_BUG_DUMMYCHAN }, | ||
97 | { "^2\\.0\\.1[1-2]", SSH_BUG_SIGBLOB|SSH_BUG_HMAC| | 98 | { "^2\\.0\\.1[1-2]", SSH_BUG_SIGBLOB|SSH_BUG_HMAC| |
98 | SSH_OLD_SESSIONID|SSH_BUG_DEBUG| | 99 | SSH_OLD_SESSIONID|SSH_BUG_DEBUG| |
99 | SSH_BUG_PKSERVICE|SSH_BUG_X11FWD| | 100 | SSH_BUG_PKSERVICE|SSH_BUG_X11FWD| |
100 | SSH_BUG_PKAUTH|SSH_BUG_PKOK| | 101 | SSH_BUG_PKAUTH|SSH_BUG_PKOK| |
101 | SSH_BUG_RSASIGMD5|SSH_BUG_OPENFAILURE }, | 102 | SSH_BUG_RSASIGMD5|SSH_BUG_OPENFAILURE| |
103 | SSH_BUG_DUMMYCHAN }, | ||
102 | { "^2\\.0\\.", SSH_BUG_SIGBLOB|SSH_BUG_HMAC| | 104 | { "^2\\.0\\.", SSH_BUG_SIGBLOB|SSH_BUG_HMAC| |
103 | SSH_OLD_SESSIONID|SSH_BUG_DEBUG| | 105 | SSH_OLD_SESSIONID|SSH_BUG_DEBUG| |
104 | SSH_BUG_PKSERVICE|SSH_BUG_X11FWD| | 106 | SSH_BUG_PKSERVICE|SSH_BUG_X11FWD| |
105 | SSH_BUG_PKAUTH|SSH_BUG_PKOK| | 107 | SSH_BUG_PKAUTH|SSH_BUG_PKOK| |
106 | SSH_BUG_RSASIGMD5|SSH_BUG_OPENFAILURE| | 108 | SSH_BUG_RSASIGMD5|SSH_BUG_OPENFAILURE| |
107 | SSH_BUG_DERIVEKEY }, | 109 | SSH_BUG_DERIVEKEY|SSH_BUG_DUMMYCHAN }, |
108 | { "^2\\.[23]\\.0", SSH_BUG_HMAC|SSH_BUG_DEBUG| | 110 | { "^2\\.[23]\\.0", SSH_BUG_HMAC|SSH_BUG_DEBUG| |
109 | SSH_BUG_RSASIGMD5 }, | 111 | SSH_BUG_RSASIGMD5 }, |
110 | { "^2\\.3\\.", SSH_BUG_DEBUG|SSH_BUG_RSASIGMD5 }, | 112 | { "^2\\.3\\.", SSH_BUG_DEBUG|SSH_BUG_RSASIGMD5 }, |
@@ -21,7 +21,7 @@ | |||
21 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 21 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
23 | */ | 23 | */ |
24 | /* RCSID("$OpenBSD: compat.h,v 1.28 2001/06/26 17:27:23 markus Exp $"); */ | 24 | /* RCSID("$OpenBSD: compat.h,v 1.29 2001/09/20 13:50:40 markus Exp $"); */ |
25 | 25 | ||
26 | #ifndef COMPAT_H | 26 | #ifndef COMPAT_H |
27 | #define COMPAT_H | 27 | #define COMPAT_H |
@@ -50,6 +50,7 @@ | |||
50 | #define SSH_BUG_HBSERVICE 0x00010000 | 50 | #define SSH_BUG_HBSERVICE 0x00010000 |
51 | #define SSH_BUG_OPENFAILURE 0x00020000 | 51 | #define SSH_BUG_OPENFAILURE 0x00020000 |
52 | #define SSH_BUG_DERIVEKEY 0x00040000 | 52 | #define SSH_BUG_DERIVEKEY 0x00040000 |
53 | #define SSH_BUG_DUMMYCHAN 0x00100000 | ||
53 | 54 | ||
54 | void enable_compat13(void); | 55 | void enable_compat13(void); |
55 | void enable_compat20(void); | 56 | void enable_compat20(void); |
@@ -39,7 +39,7 @@ | |||
39 | */ | 39 | */ |
40 | 40 | ||
41 | #include "includes.h" | 41 | #include "includes.h" |
42 | RCSID("$OpenBSD: ssh.c,v 1.142 2001/09/03 20:58:33 stevesk Exp $"); | 42 | RCSID("$OpenBSD: ssh.c,v 1.143 2001/09/20 13:50:40 markus Exp $"); |
43 | 43 | ||
44 | #include <openssl/evp.h> | 44 | #include <openssl/evp.h> |
45 | #include <openssl/err.h> | 45 | #include <openssl/err.h> |
@@ -1032,14 +1032,15 @@ client_subsystem_reply(int type, int plen, void *ctxt) | |||
1032 | len, buffer_ptr(&command), id); | 1032 | len, buffer_ptr(&command), id); |
1033 | } | 1033 | } |
1034 | 1034 | ||
1035 | /* request pty/x11/agent/tcpfwd/shell for channel */ | ||
1035 | static void | 1036 | static void |
1036 | ssh_session2_callback(int id, void *arg) | 1037 | ssh_session2_setup(int id, void *arg) |
1037 | { | 1038 | { |
1038 | int len; | 1039 | int len; |
1039 | int interactive = 0; | 1040 | int interactive = 0; |
1040 | struct termios tio; | 1041 | struct termios tio; |
1041 | 1042 | ||
1042 | debug("client_init id %d arg %ld", id, (long)arg); | 1043 | debug("ssh_session2_setup: id %d", id); |
1043 | 1044 | ||
1044 | if (tty_flag) { | 1045 | if (tty_flag) { |
1045 | struct winsize ws; | 1046 | struct winsize ws; |
@@ -1108,8 +1109,9 @@ ssh_session2_callback(int id, void *arg) | |||
1108 | packet_set_interactive(interactive); | 1109 | packet_set_interactive(interactive); |
1109 | } | 1110 | } |
1110 | 1111 | ||
1112 | /* open new channel for a session */ | ||
1111 | static int | 1113 | static int |
1112 | ssh_session2_command(void) | 1114 | ssh_session2_open(void) |
1113 | { | 1115 | { |
1114 | Channel *c; | 1116 | Channel *c; |
1115 | int window, packetmax, in, out, err; | 1117 | int window, packetmax, in, out, err; |
@@ -1144,13 +1146,15 @@ ssh_session2_command(void) | |||
1144 | window, packetmax, CHAN_EXTENDED_WRITE, | 1146 | window, packetmax, CHAN_EXTENDED_WRITE, |
1145 | xstrdup("client-session"), /*nonblock*/0); | 1147 | xstrdup("client-session"), /*nonblock*/0); |
1146 | if (c == NULL) | 1148 | if (c == NULL) |
1147 | fatal("ssh_session2_command: channel_new failed"); | 1149 | fatal("ssh_session2_open: channel_new failed"); |
1148 | 1150 | ||
1149 | debug3("ssh_session2_command: channel_new: %d", c->self); | 1151 | debug3("ssh_session2_open: channel_new: %d", c->self); |
1150 | 1152 | ||
1151 | channel_send_open(c->self); | 1153 | channel_send_open(c->self); |
1152 | channel_register_callback(c->self, SSH2_MSG_CHANNEL_OPEN_CONFIRMATION, | 1154 | if (!no_shell_flag) |
1153 | ssh_session2_callback, (void *)0); | 1155 | channel_register_callback(c->self, |
1156 | SSH2_MSG_CHANNEL_OPEN_CONFIRMATION, | ||
1157 | ssh_session2_setup, (void *)0); | ||
1154 | 1158 | ||
1155 | return c->self; | 1159 | return c->self; |
1156 | } | 1160 | } |
@@ -1158,12 +1162,13 @@ ssh_session2_command(void) | |||
1158 | static int | 1162 | static int |
1159 | ssh_session2(void) | 1163 | ssh_session2(void) |
1160 | { | 1164 | { |
1161 | int id; | 1165 | int id = -1; |
1162 | 1166 | ||
1163 | /* XXX should be pre-session */ | 1167 | /* XXX should be pre-session */ |
1164 | ssh_init_forwarding(); | 1168 | ssh_init_forwarding(); |
1165 | 1169 | ||
1166 | id = no_shell_flag ? -1 : ssh_session2_command(); | 1170 | if (!no_shell_flag || (datafellows & SSH_BUG_DUMMYCHAN)) |
1171 | id = ssh_session2_open(); | ||
1167 | 1172 | ||
1168 | /* If requested, let ssh continue in the background. */ | 1173 | /* If requested, let ssh continue in the background. */ |
1169 | if (fork_after_authentication_flag) | 1174 | if (fork_after_authentication_flag) |