*/
#include "includes.h"
-RCSID("$Id: clientloop.c,v 1.20 2000/04/14 10:30:30 markus Exp $");
+RCSID("$Id: clientloop.c,v 1.21 2000/04/19 07:05:48 deraadt Exp $");
#include "xmalloc.h"
#include "ssh.h"
void
client_process_input(fd_set * readset)
{
- int len, pid;
+ int len;
+ pid_t pid;
char buf[8192], *s;
/* Read input from stdin. */
*/
#include "includes.h"
-RCSID("$Id: login.c,v 1.12 2000/04/14 10:30:31 markus Exp $");
+RCSID("$Id: login.c,v 1.13 2000/04/19 07:05:49 deraadt Exp $");
#include <util.h>
#include <utmp.h>
*/
void
-record_login(int pid, const char *ttyname, const char *user, uid_t uid,
+record_login(pid_t pid, const char *ttyname, const char *user, uid_t uid,
const char *host, struct sockaddr * addr)
{
int fd;
/* Records that the user has logged out. */
void
-record_logout(int pid, const char *ttyname)
+record_logout(pid_t pid, const char *ttyname)
{
const char *line = ttyname + 5; /* /dev/ttyq8 -> ttyq8 */
if (logout(line))
* will exit after that, as soon as forwarded connections have terminated.
*/
-static int child_pid; /* Pid of the child. */
+static pid_t child_pid; /* Pid of the child. */
static volatile int child_terminated; /* The child has terminated. */
static volatile int child_wait_status; /* Status from wait(). */
sigchld_handler(int sig)
{
int save_errno = errno;
- int wait_pid;
+ pid_t wait_pid;
+
debug("Received SIGCHLD.");
wait_pid = wait((int *) &child_wait_status);
if (wait_pid != -1) {
* child program).
*/
void
-server_loop(int pid, int fdin_arg, int fdout_arg, int fderr_arg)
+server_loop(pid_t pid, int fdin_arg, int fdout_arg, int fderr_arg)
{
- int wait_status, wait_pid; /* Status and pid returned by wait(). */
+ int wait_status; /* Status returned by wait(). */
+ pid_t wait_pid; /* pid returned by wait(). */
int waiting_termination = 0; /* Have displayed waiting close message. */
unsigned int max_time_milliseconds;
unsigned int previous_stdout_buffer_bytes;
-/* $OpenBSD: ssh-agent.c,v 1.28 2000/04/14 10:30:33 markus Exp $ */
+/* $OpenBSD: ssh-agent.c,v 1.29 2000/04/19 07:05:49 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
*/
#include "includes.h"
-RCSID("$OpenBSD: ssh-agent.c,v 1.28 2000/04/14 10:30:33 markus Exp $");
+RCSID("$OpenBSD: ssh-agent.c,v 1.29 2000/04/19 07:05:49 deraadt Exp $");
#include "ssh.h"
#include "rsa.h"
int max_fd = 0;
/* pid of shell == parent of agent */
-int parent_pid = -1;
+pid_t parent_pid = -1;
/* pathname and directory for AUTH_SOCKET */
char socket_name[1024];
void
check_parent_exists(int sig)
{
- if (kill(parent_pid, 0) < 0) {
+ if (parent_pid != -1 && kill(parent_pid, 0) < 0) {
/* printf("Parent has died - Authentication agent exiting.\n"); */
exit(1);
}
}
pid = atoi(pidstr);
if (pid < 1) { /* XXX PID_MAX check too */
+ /* Yes, PID_MAX check please */
fprintf(stderr, "%s=\"%s\", which is not a good PID\n",
SSH_AGENTPID_ENV_NAME, pidstr);
exit(1);
*
*/
-/* RCSID("$Id: ssh.h,v 1.38 2000/04/14 10:30:33 markus Exp $"); */
+/* RCSID("$Id: ssh.h,v 1.39 2000/04/19 07:05:49 deraadt Exp $"); */
#ifndef SSH_H
#define SSH_H
* by login(1).
*/
void
-record_login(int pid, const char *ttyname, const char *user, uid_t uid,
+record_login(pid_t pid, const char *ttyname, const char *user, uid_t uid,
const char *host, struct sockaddr *addr);
/*
* Records that the user has logged out. This does many thigs normally done
* by login(1) or init.
*/
-void record_logout(int pid, const char *ttyname);
+void record_logout(pid_t pid, const char *ttyname);
/*------------ definitions for sshconnect.c ----------*/
* (of the child program), and reads from stdout and stderr (of the child
* program).
*/
-void server_loop(int pid, int fdin, int fdout, int fderr);
+void server_loop(pid_t pid, int fdin, int fdout, int fderr);
void server_loop2(void);
/* Client side main loop for the interactive session. */
*/
#include "includes.h"
-RCSID("$OpenBSD: sshconnect.c,v 1.68 2000/04/14 10:30:33 markus Exp $");
+RCSID("$OpenBSD: sshconnect.c,v 1.69 2000/04/19 07:05:50 deraadt Exp $");
#include <openssl/bn.h>
#include "xmalloc.h"
const char *cp;
char *command_string;
int pin[2], pout[2];
- int pid;
+ pid_t pid;
char strport[NI_MAXSERV];
/* Convert the port number into a string. */
*/
#include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.106 2000/04/17 12:31:47 markus Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.107 2000/04/19 07:05:50 deraadt Exp $");
#include "xmalloc.h"
#include "rsa.h"
{
extern char *optarg;
extern int optind;
- int opt, sock_in = 0, sock_out = 0, newsock, i, fdsetsz, pid, on = 1;
+ int opt, sock_in = 0, sock_out = 0, newsock, i, fdsetsz, on = 1;
+ pid_t pid;
socklen_t fromlen;
int silentrsa = 0;
fd_set *fdset;