summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--clientloop.c5
-rw-r--r--login.c6
-rw-r--r--serverloop.c10
-rw-r--r--session.c10
-rw-r--r--ssh-agent.c9
-rw-r--r--ssh.h8
-rw-r--r--sshconnect.c4
-rw-r--r--sshd.c5
9 files changed, 39 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index a32d02954..168e583b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
120000420 120000420
2 - Make fixpaths work with perl4, patch from Andre Lucas 2 - Make fixpaths work with perl4, patch from Andre Lucas
3 <andre.lucas@dial.pipex.com> 3 <andre.lucas@dial.pipex.com>
4 - Sync with OpenBSD CVS:
5 [clientloop.c login.c serverloop.c ssh-agent.c ssh.h sshconnect.c sshd.c]
6 - pid_t
7 [session.c]
8 - remove bogus chan_read_failed. this could cause data
9 corruption (missing data) at end of a SSH2 session.
4 10
520000419 1120000419
6 - OpenBSD CVS updates 12 - OpenBSD CVS updates
diff --git a/clientloop.c b/clientloop.c
index cc25ca550..0296dac77 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -16,7 +16,7 @@
16 */ 16 */
17 17
18#include "includes.h" 18#include "includes.h"
19RCSID("$Id: clientloop.c,v 1.11 2000/04/16 01:18:41 damien Exp $"); 19RCSID("$Id: clientloop.c,v 1.12 2000/04/19 21:42:21 damien Exp $");
20 20
21#include "xmalloc.h" 21#include "xmalloc.h"
22#include "ssh.h" 22#include "ssh.h"
@@ -471,7 +471,8 @@ client_process_net_input(fd_set * readset)
471void 471void
472client_process_input(fd_set * readset) 472client_process_input(fd_set * readset)
473{ 473{
474 int len, pid; 474 int len;
475 pid_t pid;
475 char buf[8192], *s; 476 char buf[8192], *s;
476 477
477 /* Read input from stdin. */ 478 /* Read input from stdin. */
diff --git a/login.c b/login.c
index b4a8bafca..de2c89cba 100644
--- a/login.c
+++ b/login.c
@@ -18,7 +18,7 @@
18 */ 18 */
19 19
20#include "includes.h" 20#include "includes.h"
21RCSID("$Id: login.c,v 1.23 2000/04/16 01:18:43 damien Exp $"); 21RCSID("$Id: login.c,v 1.24 2000/04/19 21:42:22 damien Exp $");
22 22
23#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX) 23#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
24# include <utmpx.h> 24# include <utmpx.h>
@@ -136,7 +136,7 @@ get_last_login_time(uid_t uid, const char *logname,
136 */ 136 */
137 137
138void 138void
139record_login(int pid, const char *ttyname, const char *user, uid_t uid, 139record_login(pid_t pid, const char *ttyname, const char *user, uid_t uid,
140 const char *host, struct sockaddr * addr) 140 const char *host, struct sockaddr * addr)
141{ 141{
142#if defined(_PATH_LASTLOG) && !defined(DISABLE_LASTLOG) 142#if defined(_PATH_LASTLOG) && !defined(DISABLE_LASTLOG)
@@ -274,7 +274,7 @@ record_login(int pid, const char *ttyname, const char *user, uid_t uid,
274/* Records that the user has logged out. */ 274/* Records that the user has logged out. */
275 275
276void 276void
277record_logout(int pid, const char *ttyname) 277record_logout(pid_t pid, const char *ttyname)
278{ 278{
279#ifdef HAVE_LIBUTIL_LOGIN 279#ifdef HAVE_LIBUTIL_LOGIN
280 const char *line = ttyname + 5; /* /dev/ttyq8 -> ttyq8 */ 280 const char *line = ttyname + 5; /* /dev/ttyq8 -> ttyq8 */
diff --git a/serverloop.c b/serverloop.c
index a7abbe404..1a76b8da8 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -52,7 +52,7 @@ static int max_fd; /* Max file descriptor number for select(). */
52 * that the child's output gets a chance to drain before it is yanked. 52 * that the child's output gets a chance to drain before it is yanked.
53 */ 53 */
54 54
55static int child_pid; /* Pid of the child. */ 55static pid_t child_pid; /* Pid of the child. */
56static volatile int child_terminated; /* The child has terminated. */ 56static volatile int child_terminated; /* The child has terminated. */
57static volatile int child_has_selected; /* Child has had chance to drain. */ 57static volatile int child_has_selected; /* Child has had chance to drain. */
58static volatile int child_wait_status; /* Status from wait(). */ 58static volatile int child_wait_status; /* Status from wait(). */
@@ -63,7 +63,8 @@ void
63sigchld_handler(int sig) 63sigchld_handler(int sig)
64{ 64{
65 int save_errno = errno; 65 int save_errno = errno;
66 int wait_pid; 66 pid_t wait_pid;
67
67 debug("Received SIGCHLD."); 68 debug("Received SIGCHLD.");
68 wait_pid = wait((int *) &child_wait_status); 69 wait_pid = wait((int *) &child_wait_status);
69 if (wait_pid != -1) { 70 if (wait_pid != -1) {
@@ -373,9 +374,10 @@ process_buffered_input_packets()
373 * child program). 374 * child program).
374 */ 375 */
375void 376void
376server_loop(int pid, int fdin_arg, int fdout_arg, int fderr_arg) 377server_loop(pid_t pid, int fdin_arg, int fdout_arg, int fderr_arg)
377{ 378{
378 int wait_status, wait_pid; /* Status and pid returned by wait(). */ 379 int wait_status; /* Status returned by wait(). */
380 pid_t wait_pid; /* pid returned by wait(). */
379 int waiting_termination = 0; /* Have displayed waiting close message. */ 381 int waiting_termination = 0; /* Have displayed waiting close message. */
380 unsigned int max_time_milliseconds; 382 unsigned int max_time_milliseconds;
381 unsigned int previous_stdout_buffer_bytes; 383 unsigned int previous_stdout_buffer_bytes;
diff --git a/session.c b/session.c
index 24bc25c6f..840a4e9e8 100644
--- a/session.c
+++ b/session.c
@@ -8,7 +8,7 @@
8 */ 8 */
9 9
10#include "includes.h" 10#include "includes.h"
11RCSID("$OpenBSD: session.c,v 1.4 2000/04/14 10:30:33 markus Exp $"); 11RCSID("$OpenBSD: session.c,v 1.5 2000/04/19 09:24:39 markus Exp $");
12 12
13#include "xmalloc.h" 13#include "xmalloc.h"
14#include "ssh.h" 14#include "ssh.h"
@@ -1388,8 +1388,12 @@ session_exit_message(Session *s, int status)
1388 /* disconnect channel */ 1388 /* disconnect channel */
1389 debug("session_exit_message: release channel %d", s->chanid); 1389 debug("session_exit_message: release channel %d", s->chanid);
1390 channel_cancel_cleanup(s->chanid); 1390 channel_cancel_cleanup(s->chanid);
1391 if (c->istate == CHAN_INPUT_OPEN) 1391 /*
1392 chan_read_failed(c); 1392 * emulate a write failure with 'chan_write_failed', nobody will be
1393 * interested in data we write.
1394 * Note that we must not call 'chan_read_failed', since there could
1395 * be some more data waiting in the pipe.
1396 */
1393 chan_write_failed(c); 1397 chan_write_failed(c);
1394 s->chanid = -1; 1398 s->chanid = -1;
1395} 1399}
diff --git a/ssh-agent.c b/ssh-agent.c
index fac2a2c38..5a265e6b8 100644
--- a/ssh-agent.c
+++ b/ssh-agent.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-agent.c,v 1.28 2000/04/14 10:30:33 markus Exp $ */ 1/* $OpenBSD: ssh-agent.c,v 1.29 2000/04/19 07:05:49 deraadt Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -9,7 +9,7 @@
9 */ 9 */
10 10
11#include "includes.h" 11#include "includes.h"
12RCSID("$OpenBSD: ssh-agent.c,v 1.28 2000/04/14 10:30:33 markus Exp $"); 12RCSID("$OpenBSD: ssh-agent.c,v 1.29 2000/04/19 07:05:49 deraadt Exp $");
13 13
14#include "ssh.h" 14#include "ssh.h"
15#include "rsa.h" 15#include "rsa.h"
@@ -46,7 +46,7 @@ Identity *identities = NULL;
46int max_fd = 0; 46int max_fd = 0;
47 47
48/* pid of shell == parent of agent */ 48/* pid of shell == parent of agent */
49int parent_pid = -1; 49pid_t parent_pid = -1;
50 50
51/* pathname and directory for AUTH_SOCKET */ 51/* pathname and directory for AUTH_SOCKET */
52char socket_name[1024]; 52char socket_name[1024];
@@ -464,7 +464,7 @@ after_select(fd_set *readset, fd_set *writeset)
464void 464void
465check_parent_exists(int sig) 465check_parent_exists(int sig)
466{ 466{
467 if (kill(parent_pid, 0) < 0) { 467 if (parent_pid != -1 && kill(parent_pid, 0) < 0) {
468 /* printf("Parent has died - Authentication agent exiting.\n"); */ 468 /* printf("Parent has died - Authentication agent exiting.\n"); */
469 exit(1); 469 exit(1);
470 } 470 }
@@ -550,6 +550,7 @@ main(int ac, char **av)
550 } 550 }
551 pid = atoi(pidstr); 551 pid = atoi(pidstr);
552 if (pid < 1) { /* XXX PID_MAX check too */ 552 if (pid < 1) { /* XXX PID_MAX check too */
553 /* Yes, PID_MAX check please */
553 fprintf(stderr, "%s=\"%s\", which is not a good PID\n", 554 fprintf(stderr, "%s=\"%s\", which is not a good PID\n",
554 SSH_AGENTPID_ENV_NAME, pidstr); 555 SSH_AGENTPID_ENV_NAME, pidstr);
555 exit(1); 556 exit(1);
diff --git a/ssh.h b/ssh.h
index 57fcf57b9..7bc0c5618 100644
--- a/ssh.h
+++ b/ssh.h
@@ -13,7 +13,7 @@
13 * 13 *
14 */ 14 */
15 15
16/* RCSID("$Id: ssh.h,v 1.32 2000/04/16 01:18:47 damien Exp $"); */ 16/* RCSID("$Id: ssh.h,v 1.33 2000/04/19 21:42:22 damien Exp $"); */
17 17
18#ifndef SSH_H 18#ifndef SSH_H
19#define SSH_H 19#define SSH_H
@@ -288,14 +288,14 @@ get_last_login_time(uid_t uid, const char *logname,
288 * by login(1). 288 * by login(1).
289 */ 289 */
290void 290void
291record_login(int pid, const char *ttyname, const char *user, uid_t uid, 291record_login(pid_t pid, const char *ttyname, const char *user, uid_t uid,
292 const char *host, struct sockaddr *addr); 292 const char *host, struct sockaddr *addr);
293 293
294/* 294/*
295 * Records that the user has logged out. This does many thigs normally done 295 * Records that the user has logged out. This does many thigs normally done
296 * by login(1) or init. 296 * by login(1) or init.
297 */ 297 */
298void record_logout(int pid, const char *ttyname); 298void record_logout(pid_t pid, const char *ttyname);
299 299
300/*------------ definitions for sshconnect.c ----------*/ 300/*------------ definitions for sshconnect.c ----------*/
301 301
@@ -504,7 +504,7 @@ char *tilde_expand_filename(const char *filename, uid_t my_uid);
504 * (of the child program), and reads from stdout and stderr (of the child 504 * (of the child program), and reads from stdout and stderr (of the child
505 * program). 505 * program).
506 */ 506 */
507void server_loop(int pid, int fdin, int fdout, int fderr); 507void server_loop(pid_t pid, int fdin, int fdout, int fderr);
508void server_loop2(void); 508void server_loop2(void);
509 509
510/* Client side main loop for the interactive session. */ 510/* Client side main loop for the interactive session. */
diff --git a/sshconnect.c b/sshconnect.c
index 3c5c990f2..f58289e7b 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -10,7 +10,7 @@
10 */ 10 */
11 11
12#include "includes.h" 12#include "includes.h"
13RCSID("$OpenBSD: sshconnect.c,v 1.68 2000/04/14 10:30:33 markus Exp $"); 13RCSID("$OpenBSD: sshconnect.c,v 1.69 2000/04/19 07:05:50 deraadt Exp $");
14 14
15#include <openssl/bn.h> 15#include <openssl/bn.h>
16#include "xmalloc.h" 16#include "xmalloc.h"
@@ -62,7 +62,7 @@ ssh_proxy_connect(const char *host, u_short port, uid_t original_real_uid,
62 const char *cp; 62 const char *cp;
63 char *command_string; 63 char *command_string;
64 int pin[2], pout[2]; 64 int pin[2], pout[2];
65 int pid; 65 pid_t pid;
66 char strport[NI_MAXSERV]; 66 char strport[NI_MAXSERV];
67 67
68 /* Convert the port number into a string. */ 68 /* Convert the port number into a string. */
diff --git a/sshd.c b/sshd.c
index 3b75b884e..c1dcdd8e9 100644
--- a/sshd.c
+++ b/sshd.c
@@ -14,7 +14,7 @@
14 */ 14 */
15 15
16#include "includes.h" 16#include "includes.h"
17RCSID("$OpenBSD: sshd.c,v 1.106 2000/04/17 12:31:47 markus Exp $"); 17RCSID("$OpenBSD: sshd.c,v 1.107 2000/04/19 07:05:50 deraadt Exp $");
18 18
19#include "xmalloc.h" 19#include "xmalloc.h"
20#include "rsa.h" 20#include "rsa.h"
@@ -396,7 +396,8 @@ main(int ac, char **av)
396{ 396{
397 extern char *optarg; 397 extern char *optarg;
398 extern int optind; 398 extern int optind;
399 int opt, sock_in = 0, sock_out = 0, newsock, i, fdsetsz, pid, on = 1; 399 int opt, sock_in = 0, sock_out = 0, newsock, i, fdsetsz, on = 1;
400 pid_t pid;
400 socklen_t fromlen; 401 socklen_t fromlen;
401 int silentrsa = 0; 402 int silentrsa = 0;
402 fd_set *fdset; 403 fd_set *fdset;