summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-12-27 23:54:55 +1100
committerDamien Miller <djm@mindrot.org>1999-12-27 23:54:55 +1100
commit68e45de53b72087a77069a61c4e789e2012cd706 (patch)
treeb65e919ad35f4b6b8ba1119a1506ed42dc8eb352
parent6a5d4d61bd6109c61bbbb6b7cd48422466260319 (diff)
- OpenBSD CVS updates:
- [packet.h auth-rhosts.c] check format string for packet_disconnect and packet_send_debug, too - [channels.c] use packet_get_maxsize for channels. consistence.
-rw-r--r--ChangeLog5
-rw-r--r--auth-rhosts.c4
-rw-r--r--channels.c17
-rw-r--r--packet.h6
4 files changed, 18 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 7ce91f304..984e15505 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,11 @@
9 - Explained spurious PAM auth warning workaround in UPGRADING 9 - Explained spurious PAM auth warning workaround in UPGRADING
10 - Use last few chars of tty line as ut_id 10 - Use last few chars of tty line as ut_id
11 - New SuSE RPM spec file from Chris Saia <csaia@wtower.com> 11 - New SuSE RPM spec file from Chris Saia <csaia@wtower.com>
12 - OpenBSD CVS updates:
13 - [packet.h auth-rhosts.c]
14 check format string for packet_disconnect and packet_send_debug, too
15 - [channels.c]
16 use packet_get_maxsize for channels. consistence.
12 17
1319991226 1819991226
14 - Enabled utmpx support by default for Solaris 19 - Enabled utmpx support by default for Solaris
diff --git a/auth-rhosts.c b/auth-rhosts.c
index 2f12f1347..318bcfefe 100644
--- a/auth-rhosts.c
+++ b/auth-rhosts.c
@@ -16,7 +16,7 @@
16 */ 16 */
17 17
18#include "includes.h" 18#include "includes.h"
19RCSID("$Id: auth-rhosts.c,v 1.6 1999/11/25 00:54:57 damien Exp $"); 19RCSID("$Id: auth-rhosts.c,v 1.7 1999/12/27 12:54:55 damien Exp $");
20 20
21#include "packet.h" 21#include "packet.h"
22#include "ssh.h" 22#include "ssh.h"
@@ -205,7 +205,7 @@ auth_rhosts(struct passwd *pw, const char *client_user)
205 if (stat(pw->pw_dir, &st) < 0) { 205 if (stat(pw->pw_dir, &st) < 0) {
206 log("Rhosts authentication refused for %.100s: no home directory %.200s", 206 log("Rhosts authentication refused for %.100s: no home directory %.200s",
207 pw->pw_name, pw->pw_dir); 207 pw->pw_name, pw->pw_dir);
208 packet_send_debug("Rhosts authentication refused for %.100: no home directory %.200s", 208 packet_send_debug("Rhosts authentication refused for %.100s: no home directory %.200s",
209 pw->pw_name, pw->pw_dir); 209 pw->pw_name, pw->pw_dir);
210 return 0; 210 return 0;
211 } 211 }
diff --git a/channels.c b/channels.c
index 539dff3a5..8455518e2 100644
--- a/channels.c
+++ b/channels.c
@@ -16,7 +16,7 @@
16 */ 16 */
17 17
18#include "includes.h" 18#include "includes.h"
19RCSID("$Id: channels.c,v 1.13 1999/12/21 00:18:08 damien Exp $"); 19RCSID("$Id: channels.c,v 1.14 1999/12/27 12:54:55 damien Exp $");
20 20
21#include "ssh.h" 21#include "ssh.h"
22#include "packet.h" 22#include "packet.h"
@@ -251,7 +251,7 @@ redo:
251 packet_put_int(ch->remote_id); 251 packet_put_int(ch->remote_id);
252 packet_send(); 252 packet_send();
253 ch->type = SSH_CHANNEL_CLOSED; 253 ch->type = SSH_CHANNEL_CLOSED;
254 debug("Closing channel %d after input drain.", i); 254 debug("Closing channel %d after input drain.", ch->self);
255 break; 255 break;
256 } 256 }
257 break; 257 break;
@@ -443,17 +443,16 @@ channel_after_select(fd_set * readset, fd_set * writeset)
443 * for connections from clients. 443 * for connections from clients.
444 */ 444 */
445 if (FD_ISSET(ch->sock, readset)) { 445 if (FD_ISSET(ch->sock, readset)) {
446 int nchan; 446 addrlen = sizeof(addr);
447 len = sizeof(addr); 447 newsock = accept(ch->sock, &addr, &addrlen);
448 newsock = accept(ch->sock, &addr, &len);
449 if (newsock < 0) { 448 if (newsock < 0) {
450 error("accept from auth socket: %.100s", strerror(errno)); 449 error("accept from auth socket: %.100s", strerror(errno));
451 break; 450 break;
452 } 451 }
453 nchan = channel_allocate(SSH_CHANNEL_OPENING, newsock, 452 newch = channel_allocate(SSH_CHANNEL_OPENING, newsock,
454 xstrdup("accepted auth socket")); 453 xstrdup("accepted auth socket"));
455 packet_start(SSH_SMSG_AGENT_OPEN); 454 packet_start(SSH_SMSG_AGENT_OPEN);
456 packet_put_int(nchan); 455 packet_put_int(newch);
457 packet_send(); 456 packet_send();
458 } 457 }
459 break; 458 break;
@@ -547,8 +546,8 @@ channel_output_poll()
547 len = 512; 546 len = 512;
548 } else { 547 } else {
549 /* Keep the packets at reasonable size. */ 548 /* Keep the packets at reasonable size. */
550 if (len > 16384) 549 if (len > packet_get_maxsize()/2)
551 len = 16384; 550 len = packet_get_maxsize()/2;
552 } 551 }
553 packet_start(SSH_MSG_CHANNEL_DATA); 552 packet_start(SSH_MSG_CHANNEL_DATA);
554 packet_put_int(ch->remote_id); 553 packet_put_int(ch->remote_id);
diff --git a/packet.h b/packet.h
index e6ae671a4..84c8ee756 100644
--- a/packet.h
+++ b/packet.h
@@ -13,7 +13,7 @@
13 * 13 *
14 */ 14 */
15 15
16/* RCSID("$Id: packet.h,v 1.7 1999/11/25 00:54:59 damien Exp $"); */ 16/* RCSID("$Id: packet.h,v 1.8 1999/12/27 12:54:55 damien Exp $"); */
17 17
18#ifndef PACKET_H 18#ifndef PACKET_H
19#define PACKET_H 19#define PACKET_H
@@ -151,7 +151,7 @@ char *packet_get_string(unsigned int *length_ptr);
151 * The error message should not contain a newline. The total length of the 151 * The error message should not contain a newline. The total length of the
152 * message must not exceed 1024 bytes. 152 * message must not exceed 1024 bytes.
153 */ 153 */
154void packet_disconnect(const char *fmt,...); 154void packet_disconnect(const char *fmt,...) __attribute__((format(printf, 1, 2)));;
155 155
156/* 156/*
157 * Sends a diagnostic message to the other side. This message can be sent at 157 * Sends a diagnostic message to the other side. This message can be sent at
@@ -163,7 +163,7 @@ void packet_disconnect(const char *fmt,...);
163 * remote side protocol flags do not indicate that it supports SSH_MSG_DEBUG, 163 * remote side protocol flags do not indicate that it supports SSH_MSG_DEBUG,
164 * this will do nothing. 164 * this will do nothing.
165 */ 165 */
166void packet_send_debug(const char *fmt,...); 166void packet_send_debug(const char *fmt,...) __attribute__((format(printf, 1, 2)));;
167 167
168/* Checks if there is any buffered output, and tries to write some of the output. */ 168/* Checks if there is any buffered output, and tries to write some of the output. */
169void packet_write_poll(void); 169void packet_write_poll(void);