- Avoid WCOREDUMP complation errors for systems that lack it
- Avoid SIGCHLD warnings from entropy commands
- Fix HAVE_PAM_GETENVLIST setting from Simon Wilkinson <sxw@dcs.ed.ac.uk>
+ - OpenBSD CVS update:
+ - markus@cvs.openbsd.org
+ [ssh.c]
+ fix usage()
+ [ssh2.h]
+ draft-ietf-secsh-architecture-05.txt
+ [ssh.1]
+ document ssh -T -N (ssh2 only)
+ [channels.c serverloop.c ssh.h sshconnect.c sshd.c aux.c]
+ enable nonblocking IO for sshd w/ proto 1, too; split out common code
+ [aux.c]
+ missing include
20000513
- Fix for non-recognised DSA keys from Arkadiusz Miskiewicz
TARGETS=ssh sshd ssh-add ssh-keygen ssh-agent scp $(EXTRA_TARGETS)
-LIBSSH_OBJS=atomicio.o authfd.o authfile.o bufaux.o buffer.o canohost.o channels.o cipher.o compat.o compress.o crc32.o deattack.o dispatch.o dsa.o fingerprint.o hmac.o hostfile.o key.o kex.o log.o match.o mpaux.o nchan.o packet.o radix.o entropy.o readpass.o rsa.o tildexpand.o ttymodes.o uidswap.o uuencode.o xmalloc.o
+LIBSSH_OBJS=atomicio.o authfd.o authfile.o aux.o bufaux.o buffer.o canohost.o channels.o cipher.o compat.o compress.o crc32.o deattack.o dispatch.o dsa.o fingerprint.o hmac.o hostfile.o key.o kex.o log.o match.o mpaux.o nchan.o packet.o radix.o entropy.o readpass.o rsa.o tildexpand.o ttymodes.o uidswap.o uuencode.o xmalloc.o
LIBOPENBSD_COMPAT_OBJS=bsd-base64.o bsd-bindresvport.o bsd-daemon.o bsd-misc.o bsd-mktemp.o bsd-rresvport.o bsd-setenv.o bsd-snprintf.o bsd-strlcat.o bsd-strlcpy.o fake-getaddrinfo.o fake-getnameinfo.o
--- /dev/null
+#include "includes.h"
+RCSID("$OpenBSD: aux.c,v 1.2 2000/05/17 09:47:59 markus Exp $");
+
+#include "ssh.h"
+
+char *
+chop(char *s)
+{
+ char *t = s;
+ while (*t) {
+ if(*t == '\n' || *t == '\r') {
+ *t = '\0';
+ return s;
+ }
+ t++;
+ }
+ return s;
+
+}
+
+void
+set_nonblock(int fd)
+{
+ int val;
+ val = fcntl(fd, F_GETFL, 0);
+ if (val < 0) {
+ error("fcntl(%d, F_GETFL, 0): %s", fd, strerror(errno));
+ return;
+ }
+ if (val & O_NONBLOCK)
+ return;
+ debug("fd %d setting O_NONBLOCK", fd);
+ val |= O_NONBLOCK;
+ if (fcntl(fd, F_SETFL, val) == -1)
+ error("fcntl(%d, F_SETFL, O_NONBLOCK): %s", fd, strerror(errno));
+}
*/
#include "includes.h"
-RCSID("$Id: channels.c,v 1.30 2000/05/09 01:02:59 damien Exp $");
+RCSID("$Id: channels.c,v 1.31 2000/05/17 12:34:23 damien Exp $");
#include "ssh.h"
#include "packet.h"
return c;
}
-void
-set_nonblock(int fd)
-{
- int val;
- val = fcntl(fd, F_GETFL, 0);
- if (val < 0) {
- error("fcntl(%d, F_GETFL, 0): %s", fd, strerror(errno));
- return;
- }
- if (val & O_NONBLOCK)
- return;
- debug("fd %d setting O_NONBLOCK", fd);
- val |= O_NONBLOCK;
- if (fcntl(fd, F_SETFL, val) == -1)
- error("fcntl(%d, F_SETFL, O_NONBLOCK): %s", fd, strerror(errno));
-}
-
/*
* Register filedescriptors for a channel, used when allocating a channel or
* when the channel consumer/producer is ready, e.g. shell exec'd
if (len == 0) {
verbose("Connection closed by remote host.");
fatal_cleanup();
+ } else if (len < 0) {
+ if (errno != EINTR && errno != EAGAIN) {
+ verbose("Read error from remote host: %.100s", strerror(errno));
+ fatal_cleanup();
+ }
+ } else {
+ /* Buffer any received data. */
+ packet_process_incoming(buf, len);
}
- /*
- * There is a kernel bug on Solaris that causes select to
- * sometimes wake up even though there is no data available.
- */
- if (len < 0 && errno == EAGAIN)
- len = 0;
-
- if (len < 0) {
- verbose("Read error from remote host: %.100s", strerror(errno));
- fatal_cleanup();
- }
- /* Buffer any received data. */
- packet_process_incoming(buf, len);
}
if (compat20)
return;
/* Read and buffer any available stdout data from the program. */
if (!fdout_eof && FD_ISSET(fdout, readset)) {
len = read(fdout, buf, sizeof(buf));
- if (len <= 0)
+ if (len < 0 && (errno == EINTR || errno == EAGAIN)) {
+ /* do nothing */
+ } else if (len <= 0) {
fdout_eof = 1;
- else {
+ } else {
buffer_append(&stdout_buffer, buf, len);
fdout_bytes += len;
}
/* Read and buffer any available stderr data from the program. */
if (!fderr_eof && FD_ISSET(fderr, readset)) {
len = read(fderr, buf, sizeof(buf));
- if (len <= 0)
+ if (len < 0 && (errno == EINTR || errno == EAGAIN)) {
+ /* do nothing */
+ } else if (len <= 0) {
fderr_eof = 1;
- else
+ } else {
buffer_append(&stderr_buffer, buf, len);
+ }
}
}
if (!compat20 && fdin != -1 && FD_ISSET(fdin, writeset)) {
len = write(fdin, buffer_ptr(&stdin_buffer),
buffer_len(&stdin_buffer));
- if (len <= 0) {
+ if (len < 0 && (errno == EINTR || errno == EAGAIN)) {
+ /* do nothing */
+ } else if (len <= 0) {
#ifdef USE_PIPES
close(fdin);
#else
fdin = fdin_arg;
fdout = fdout_arg;
fderr = fderr_arg;
+
+ /* nonblocking IO */
+ set_nonblock(fdin);
+ set_nonblock(fdout);
+ set_nonblock(fderr);
+
connection_in = packet_get_connection_in();
connection_out = packet_get_connection_out();
.\"
.\" Created: Sat Apr 22 21:55:14 1995 ylo
.\"
-.\" $Id: ssh.1,v 1.25 2000/05/09 01:03:02 damien Exp $
+.\" $Id: ssh.1,v 1.26 2000/05/17 12:34:24 damien Exp $
.\"
.Dd September 25, 1999
.Dt SSH 1
.Op Ar command
.Pp
.Nm ssh
-.Op Fl afgknqtvxCPX246
+.Op Fl afgknqtvxCNPTX246
.Op Fl c Ar cipher_spec
.Op Fl e Ar escape_char
.Op Fl i Ar identity_file
needs to ask for a password or passphrase; see also the
.Fl f
option.)
+.It Fl N
+Do not execute a remote command.
+This is usefull if you just want to forward ports
+(protocol version 2 only).
.It Fl o Ar option
Can be used to give options in the format used in the config file.
This is useful for specifying options for which there is no separate
This can be used to execute arbitrary
screen-based programs on a remote machine, which can be very useful,
e.g., when implementing menu services.
+.It Fl T
+Disable pseudo-tty allocation (protocol version 2 only).
.It Fl v
Verbose mode.
Causes
*/
#include "includes.h"
-RCSID("$Id: ssh.c,v 1.30 2000/05/09 01:03:02 damien Exp $");
+RCSID("$Id: ssh.c,v 1.31 2000/05/17 12:34:24 damien Exp $");
#include <openssl/evp.h>
#include <openssl/dsa.h>
#ifdef AFS
fprintf(stderr, " -k Disable Kerberos ticket and AFS token forwarding.\n");
#endif /* AFS */
+ fprintf(stderr, " -X Enable X11 connection forwarding.\n");
fprintf(stderr, " -x Disable X11 connection forwarding.\n");
fprintf(stderr, " -i file Identity for RSA authentication (default: ~/.ssh/identity).\n");
fprintf(stderr, " -t Tty; allocate a tty even if command is given.\n");
*
*/
-/* RCSID("$Id: ssh.h,v 1.39 2000/05/09 01:03:02 damien Exp $"); */
+/* RCSID("$Id: ssh.h,v 1.40 2000/05/17 12:34:24 damien Exp $"); */
#ifndef SSH_H
#define SSH_H
*/
char *tilde_expand_filename(const char *filename, uid_t my_uid);
+/* remove newline at end of string */
+char *chop(char *s);
+
+/* set filedescriptor to non-blocking */
+void set_nonblock(int fd);
+
/*
* Performs the interactive session. This handles data transmission between
* the client and the program. Note that the notion of stdin, stdout, and
/*
- * draft-ietf-secsh-architecture-04.txt
+ * draft-ietf-secsh-architecture-05.txt
*
* Transport layer protocol:
*
*
* 192-255 Local extensions
*/
+/* RCSID("$OpenBSD: ssh2.h,v 1.3 2000/05/15 07:03:12 markus Exp $"); */
/* transport layer: generic */
#define SSH2_DISCONNECT_PROTOCOL_ERROR 2
#define SSH2_DISCONNECT_KEY_EXCHANGE_FAILED 3
#define SSH2_DISCONNECT_HOST_AUTHENTICATION_FAILED 4
+#define SSH2_DISCONNECT_RESERVED 4
#define SSH2_DISCONNECT_MAC_ERROR 5
#define SSH2_DISCONNECT_COMPRESSION_ERROR 6
#define SSH2_DISCONNECT_SERVICE_NOT_AVAILABLE 7
#define SSH2_DISCONNECT_HOST_KEY_NOT_VERIFIABLE 9
#define SSH2_DISCONNECT_CONNECTION_LOST 10
#define SSH2_DISCONNECT_BY_APPLICATION 11
+#define SSH2_DISCONNECT_TOO_MANY_CONNECTIONS 12
+#define SSH2_DISCONNECT_AUTH_CANCELLED_BY_USER 13
+#define SSH2_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE 14
+#define SSH2_DISCONNECT_ILLEGAL_USER_NAME 15
/* misc */
*/
#include "includes.h"
-RCSID("$OpenBSD: sshconnect.c,v 1.72 2000/05/04 09:50:22 markus Exp $");
+RCSID("$OpenBSD: sshconnect.c,v 1.73 2000/05/17 08:20:15 markus Exp $");
#include <openssl/bn.h>
#include <openssl/dsa.h>
return 1;
}
-char *
-chop(char *s)
-{
- char *t = s;
- while (*t) {
- if(*t == '\n' || *t == '\r') {
- *t = '\0';
- return s;
- }
- t++;
- }
- return s;
-
-}
-
/*
* Waits for the server identification string, and sends our own
* identification string.
*/
#include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.115 2000/05/03 10:21:49 markus Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.116 2000/05/17 08:20:16 markus Exp $");
#include "xmalloc.h"
#include "rsa.h"
errno = save_errno;
}
-char *
-chop(char *s)
-{
- char *t = s;
- while (*t) {
- if(*t == '\n' || *t == '\r') {
- *t = '\0';
- return s;
- }
- t++;
- }
- return s;
-
-}
-
void
sshd_exchange_identification(int sock_in, int sock_out)
{