summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--auth2.c14
-rw-r--r--channels.c24
-rw-r--r--clientloop.c13
-rw-r--r--sshconnect2.c6
5 files changed, 38 insertions, 29 deletions
diff --git a/ChangeLog b/ChangeLog
index 50f959226..65d5ba7b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,16 @@
6 - (djm) Ignore SIGPIPEs from serverloop to child. Fixes crashes with 6 - (djm) Ignore SIGPIPEs from serverloop to child. Fixes crashes with
7 very short lived X connections. Bug report from Tobias Oetiker 7 very short lived X connections. Bug report from Tobias Oetiker
8 <oetiker@ee.ethz.ch>. Fix from Markus Friedl <markus@cvs.openbsd.org> 8 <oetiker@ee.ethz.ch>. Fix from Markus Friedl <markus@cvs.openbsd.org>
9 - (djm) CVS OpenBSD sync:
10 - markus@cvs.openbsd.org 2000/09/26 13:59:59
11 [clientloop.c]
12 use debug2
13 - markus@cvs.openbsd.org 2000/09/27 15:41:34
14 [auth2.c sshconnect2.c]
15 use key_type()
16 - markus@cvs.openbsd.org 2000/09/28 12:03:18
17 [channels.c]
18 debug -> debug2 cleanup
9 19
1020000929 2020000929
11 - (djm) Fix SSH2 not terminating until all background tasks done problem. 21 - (djm) Fix SSH2 not terminating until all background tasks done problem.
diff --git a/auth2.c b/auth2.c
index 6ac5d2527..2c8c0bfdd 100644
--- a/auth2.c
+++ b/auth2.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: auth2.c,v 1.15 2000/09/21 11:25:32 markus Exp $"); 26RCSID("$OpenBSD: auth2.c,v 1.16 2000/09/27 21:41:34 markus Exp $");
27 27
28#include <openssl/dsa.h> 28#include <openssl/dsa.h>
29#include <openssl/rsa.h> 29#include <openssl/rsa.h>
@@ -472,8 +472,10 @@ user_dsa_key_allowed(struct passwd *pw, Key *key)
472 if (fstat(fileno(f), &st) < 0 || 472 if (fstat(fileno(f), &st) < 0 ||
473 (st.st_uid != 0 && st.st_uid != pw->pw_uid) || 473 (st.st_uid != 0 && st.st_uid != pw->pw_uid) ||
474 (st.st_mode & 022) != 0) { 474 (st.st_mode & 022) != 0) {
475 snprintf(buf, sizeof buf, "DSA authentication refused for %.100s: " 475 snprintf(buf, sizeof buf,
476 "bad ownership or modes for '%s'.", pw->pw_name, file); 476 "%s authentication refused for %.100s: "
477 "bad ownership or modes for '%s'.",
478 key_type(key), pw->pw_name, file);
477 fail = 1; 479 fail = 1;
478 } else { 480 } else {
479 /* Check path to SSH_USER_PERMITTED_KEYS */ 481 /* Check path to SSH_USER_PERMITTED_KEYS */
@@ -488,9 +490,9 @@ user_dsa_key_allowed(struct passwd *pw, Key *key)
488 (st.st_uid != 0 && st.st_uid != pw->pw_uid) || 490 (st.st_uid != 0 && st.st_uid != pw->pw_uid) ||
489 (st.st_mode & 022) != 0) { 491 (st.st_mode & 022) != 0) {
490 snprintf(buf, sizeof buf, 492 snprintf(buf, sizeof buf,
491 "DSA authentication refused for %.100s: " 493 "%s authentication refused for %.100s: "
492 "bad ownership or modes for '%s'.", 494 "bad ownership or modes for '%s'.",
493 pw->pw_name, line); 495 key_type(key), pw->pw_name, line);
494 fail = 1; 496 fail = 1;
495 break; 497 break;
496 } 498 }
@@ -504,7 +506,7 @@ user_dsa_key_allowed(struct passwd *pw, Key *key)
504 } 506 }
505 } 507 }
506 found_key = 0; 508 found_key = 0;
507 found = key_new(KEY_DSA); 509 found = key_new(key->type);
508 510
509 while (fgets(line, sizeof(line), f)) { 511 while (fgets(line, sizeof(line), f)) {
510 char *cp, *options = NULL; 512 char *cp, *options = NULL;
diff --git a/channels.c b/channels.c
index df56e9496..c842aa231 100644
--- a/channels.c
+++ b/channels.c
@@ -40,7 +40,7 @@
40 */ 40 */
41 41
42#include "includes.h" 42#include "includes.h"
43RCSID("$OpenBSD: channels.c,v 1.69 2000/09/21 11:25:33 markus Exp $"); 43RCSID("$OpenBSD: channels.c,v 1.70 2000/09/28 18:03:18 markus Exp $");
44 44
45#include "ssh.h" 45#include "ssh.h"
46#include "packet.h" 46#include "packet.h"
@@ -234,7 +234,7 @@ channel_new(char *ctype, int type, int rfd, int wfd, int efd,
234 /* There are no free slots. Take last+1 slot and expand the array. */ 234 /* There are no free slots. Take last+1 slot and expand the array. */
235 found = channels_alloc; 235 found = channels_alloc;
236 channels_alloc += 10; 236 channels_alloc += 10;
237 debug("channel: expanding %d", channels_alloc); 237 debug2("channel: expanding %d", channels_alloc);
238 channels = xrealloc(channels, channels_alloc * sizeof(Channel)); 238 channels = xrealloc(channels, channels_alloc * sizeof(Channel));
239 for (i = found; i < channels_alloc; i++) 239 for (i = found; i < channels_alloc; i++)
240 channels[i].type = SSH_CHANNEL_FREE; 240 channels[i].type = SSH_CHANNEL_FREE;
@@ -737,7 +737,7 @@ channel_handle_efd(Channel *c, fd_set * readset, fd_set * writeset)
737 buffer_len(&c->extended) > 0) { 737 buffer_len(&c->extended) > 0) {
738 len = write(c->efd, buffer_ptr(&c->extended), 738 len = write(c->efd, buffer_ptr(&c->extended),
739 buffer_len(&c->extended)); 739 buffer_len(&c->extended));
740 debug("channel %d: written %d to efd %d", 740 debug2("channel %d: written %d to efd %d",
741 c->self, len, c->efd); 741 c->self, len, c->efd);
742 if (len > 0) { 742 if (len > 0) {
743 buffer_consume(&c->extended, len); 743 buffer_consume(&c->extended, len);
@@ -746,7 +746,7 @@ channel_handle_efd(Channel *c, fd_set * readset, fd_set * writeset)
746 } else if (c->extended_usage == CHAN_EXTENDED_READ && 746 } else if (c->extended_usage == CHAN_EXTENDED_READ &&
747 FD_ISSET(c->efd, readset)) { 747 FD_ISSET(c->efd, readset)) {
748 len = read(c->efd, buf, sizeof(buf)); 748 len = read(c->efd, buf, sizeof(buf));
749 debug("channel %d: read %d from efd %d", 749 debug2("channel %d: read %d from efd %d",
750 c->self, len, c->efd); 750 c->self, len, c->efd);
751 if (len == 0) { 751 if (len == 0) {
752 debug("channel %d: closing efd %d", 752 debug("channel %d: closing efd %d",
@@ -769,7 +769,7 @@ channel_check_window(Channel *c, fd_set * readset, fd_set * writeset)
769 packet_put_int(c->remote_id); 769 packet_put_int(c->remote_id);
770 packet_put_int(c->local_consumed); 770 packet_put_int(c->local_consumed);
771 packet_send(); 771 packet_send();
772 debug("channel %d: window %d sent adjust %d", 772 debug2("channel %d: window %d sent adjust %d",
773 c->self, c->local_window, 773 c->self, c->local_window,
774 c->local_consumed); 774 c->local_consumed);
775 c->local_window += c->local_consumed; 775 c->local_window += c->local_consumed;
@@ -1076,7 +1076,7 @@ channel_input_extended_data(int type, int plen, void *ctxt)
1076 xfree(data); 1076 xfree(data);
1077 return; 1077 return;
1078 } 1078 }
1079 debug("channel %d: rcvd ext data %d", c->self, data_len); 1079 debug2("channel %d: rcvd ext data %d", c->self, data_len);
1080 c->local_window -= data_len; 1080 c->local_window -= data_len;
1081 buffer_append(&c->extended, data, data_len); 1081 buffer_append(&c->extended, data, data_len);
1082 xfree(data); 1082 xfree(data);
@@ -1218,9 +1218,9 @@ channel_input_open_confirmation(int type, int plen, void *ctxt)
1218 c->remote_maxpacket = packet_get_int(); 1218 c->remote_maxpacket = packet_get_int();
1219 packet_done(); 1219 packet_done();
1220 if (c->cb_fn != NULL && c->cb_event == type) { 1220 if (c->cb_fn != NULL && c->cb_event == type) {
1221 debug("callback start"); 1221 debug2("callback start");
1222 c->cb_fn(c->self, c->cb_arg); 1222 c->cb_fn(c->self, c->cb_arg);
1223 debug("callback done"); 1223 debug2("callback done");
1224 } 1224 }
1225 debug("channel %d: open confirm rwindow %d rmax %d", c->self, 1225 debug("channel %d: open confirm rwindow %d rmax %d", c->self,
1226 c->remote_window, c->remote_maxpacket); 1226 c->remote_window, c->remote_maxpacket);
@@ -1269,13 +1269,13 @@ channel_input_channel_request(int type, int plen, void *ctxt)
1269 packet_disconnect("Received request for " 1269 packet_disconnect("Received request for "
1270 "non-open channel %d.", id); 1270 "non-open channel %d.", id);
1271 if (c->cb_fn != NULL && c->cb_event == type) { 1271 if (c->cb_fn != NULL && c->cb_event == type) {
1272 debug("callback start"); 1272 debug2("callback start");
1273 c->cb_fn(c->self, c->cb_arg); 1273 c->cb_fn(c->self, c->cb_arg);
1274 debug("callback done"); 1274 debug2("callback done");
1275 } else { 1275 } else {
1276 char *service = packet_get_string(NULL); 1276 char *service = packet_get_string(NULL);
1277 debug("channel: %d rcvd request for %s", c->self, service); 1277 debug("channel: %d rcvd request for %s", c->self, service);
1278debug("cb_fn %p cb_event %d", c->cb_fn , c->cb_event); 1278 debug("cb_fn %p cb_event %d", c->cb_fn , c->cb_event);
1279 xfree(service); 1279 xfree(service);
1280 } 1280 }
1281} 1281}
@@ -1300,7 +1300,7 @@ channel_input_window_adjust(int type, int plen, void *ctxt)
1300 } 1300 }
1301 adjust = packet_get_int(); 1301 adjust = packet_get_int();
1302 packet_done(); 1302 packet_done();
1303 debug("channel %d: rcvd adjust %d", id, adjust); 1303 debug2("channel %d: rcvd adjust %d", id, adjust);
1304 c->remote_window += adjust; 1304 c->remote_window += adjust;
1305} 1305}
1306 1306
diff --git a/clientloop.c b/clientloop.c
index 845307eba..90a781ec4 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -59,7 +59,7 @@
59 */ 59 */
60 60
61#include "includes.h" 61#include "includes.h"
62RCSID("$OpenBSD: clientloop.c,v 1.36 2000/09/21 11:25:33 markus Exp $"); 62RCSID("$OpenBSD: clientloop.c,v 1.37 2000/09/26 19:59:58 markus Exp $");
63 63
64#include "xmalloc.h" 64#include "xmalloc.h"
65#include "ssh.h" 65#include "ssh.h"
@@ -333,7 +333,7 @@ client_check_window_change()
333 if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) < 0) 333 if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) < 0)
334 return; 334 return;
335 335
336 debug("client_check_window_change: changed"); 336 debug2("client_check_window_change: changed");
337 337
338 if (compat20) { 338 if (compat20) {
339 channel_request_start(session_ident, "window-change", 0); 339 channel_request_start(session_ident, "window-change", 0);
@@ -360,8 +360,6 @@ client_check_window_change()
360void 360void
361client_wait_until_can_do_something(fd_set * readset, fd_set * writeset) 361client_wait_until_can_do_something(fd_set * readset, fd_set * writeset)
362{ 362{
363 /*debug("client_wait_until_can_do_something"); */
364
365 /* Initialize select masks. */ 363 /* Initialize select masks. */
366 FD_ZERO(readset); 364 FD_ZERO(readset);
367 FD_ZERO(writeset); 365 FD_ZERO(writeset);
@@ -480,7 +478,6 @@ client_process_net_input(fd_set * readset)
480 if (FD_ISSET(connection_in, readset)) { 478 if (FD_ISSET(connection_in, readset)) {
481 /* Read as much as possible. */ 479 /* Read as much as possible. */
482 len = read(connection_in, buf, sizeof(buf)); 480 len = read(connection_in, buf, sizeof(buf));
483/*debug("read connection_in len %d", len); XXX */
484 if (len == 0) { 481 if (len == 0) {
485 /* Received EOF. The remote host has closed the connection. */ 482 /* Received EOF. The remote host has closed the connection. */
486 snprintf(buf, sizeof buf, "Connection to %.300s closed by remote host.\r\n", 483 snprintf(buf, sizeof buf, "Connection to %.300s closed by remote host.\r\n",
@@ -852,7 +849,7 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
852 client_process_buffered_input_packets(); 849 client_process_buffered_input_packets();
853 850
854 if (compat20 && !channel_still_open()) { 851 if (compat20 && !channel_still_open()) {
855 debug("!channel_still_open."); 852 debug2("!channel_still_open.");
856 break; 853 break;
857 } 854 }
858 855
@@ -1042,7 +1039,7 @@ client_input_channel_open(int type, int plen, void *ctxt)
1042 int originator_port; 1039 int originator_port;
1043 originator = packet_get_string(NULL); 1040 originator = packet_get_string(NULL);
1044 if (datafellows & SSH_BUG_X11FWD) { 1041 if (datafellows & SSH_BUG_X11FWD) {
1045 debug("buggy server: x11 request w/o originator_port"); 1042 debug2("buggy server: x11 request w/o originator_port");
1046 originator_port = 0; 1043 originator_port = 0;
1047 } else { 1044 } else {
1048 originator_port = packet_get_int(); 1045 originator_port = packet_get_int();
@@ -1172,7 +1169,7 @@ client_input_channel_req(int id, void *arg)
1172void 1169void
1173client_set_session_ident(int id) 1170client_set_session_ident(int id)
1174{ 1171{
1175 debug("client_set_session_ident: id %d", id); 1172 debug2("client_set_session_ident: id %d", id);
1176 session_ident = id; 1173 session_ident = id;
1177 channel_register_callback(id, SSH2_MSG_CHANNEL_REQUEST, 1174 channel_register_callback(id, SSH2_MSG_CHANNEL_REQUEST,
1178 client_input_channel_req, (void *)0); 1175 client_input_channel_req, (void *)0);
diff --git a/sshconnect2.c b/sshconnect2.c
index 855833c06..eee09a19c 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: sshconnect2.c,v 1.20 2000/09/21 11:25:07 markus Exp $"); 26RCSID("$OpenBSD: sshconnect2.c,v 1.21 2000/09/27 21:41:34 markus Exp $");
27 27
28#include <openssl/bn.h> 28#include <openssl/bn.h>
29#include <openssl/rsa.h> 29#include <openssl/rsa.h>
@@ -534,8 +534,8 @@ userauth_pubkey_identity(Authctxt *authctxt, char *filename)
534 char *passphrase; 534 char *passphrase;
535 char prompt[300]; 535 char prompt[300];
536 snprintf(prompt, sizeof prompt, 536 snprintf(prompt, sizeof prompt,
537 "Enter passphrase for DSA key '%.100s': ", 537 "Enter passphrase for %s key '%.100s': ",
538 filename); 538 key_type(k), filename);
539 for (i = 0; i < options.number_of_password_prompts; i++) { 539 for (i = 0; i < options.number_of_password_prompts; i++) {
540 passphrase = read_passphrase(prompt, 0); 540 passphrase = read_passphrase(prompt, 0);
541 if (strcmp(passphrase, "") != 0) { 541 if (strcmp(passphrase, "") != 0) {