- More OpenBSD updates:

- deraadt@cvs.openbsd.org 2000/08/24 15:46:59
     [scp.c]
     off_t in sink, to fix files > 2GB, i think, test is still running ;-)
   - deraadt@cvs.openbsd.org 2000/08/25 10:10:06
     [session.c]
     Wall
   - markus@cvs.openbsd.org  2000/08/26 04:33:43
     [compat.c]
     ssh.com-2.3.0
   - markus@cvs.openbsd.org  2000/08/27 12:18:05
     [compat.c]
     compatibility with future ssh.com versions
   - deraadt@cvs.openbsd.org 2000/08/27 21:50:55
     [auth-krb4.c session.c ssh-add.c sshconnect.c uidswap.c]
     print uid/gid as unsigned
   - markus@cvs.openbsd.org  2000/08/28 13:51:00
     [ssh.c]
     enable -n and -f for ssh2
   - markus@cvs.openbsd.org  2000/08/28 14:19:53
     [ssh.c]
     allow combination of -N and -f
   - markus@cvs.openbsd.org  2000/08/28 14:20:56
     [util.c]
     util.c
   - markus@cvs.openbsd.org  2000/08/28 14:22:02
     [util.c]
     undo
   - markus@cvs.openbsd.org  2000/08/28 14:23:38
     [util.c]
     don't complain if setting NONBLOCK fails with ENODEV
This commit is contained in:
Damien Miller 2000-08-29 11:33:50 +11:00
parent 4e0f5e1ec9
commit caf6dd6d21
17 changed files with 99 additions and 41 deletions

View File

@ -2,6 +2,37 @@
- (djm) Fix ^C ignored issue on Solaris. Diagnosis from Gert - (djm) Fix ^C ignored issue on Solaris. Diagnosis from Gert
Doering <gert@greenie.muc.de>, John Horne <J.Horne@plymouth.ac.uk> and Doering <gert@greenie.muc.de>, John Horne <J.Horne@plymouth.ac.uk> and
Garrick James <garrick@james.net> Garrick James <garrick@james.net>
- More OpenBSD updates:
- deraadt@cvs.openbsd.org 2000/08/24 15:46:59
[scp.c]
off_t in sink, to fix files > 2GB, i think, test is still running ;-)
- deraadt@cvs.openbsd.org 2000/08/25 10:10:06
[session.c]
Wall
- markus@cvs.openbsd.org 2000/08/26 04:33:43
[compat.c]
ssh.com-2.3.0
- markus@cvs.openbsd.org 2000/08/27 12:18:05
[compat.c]
compatibility with future ssh.com versions
- deraadt@cvs.openbsd.org 2000/08/27 21:50:55
[auth-krb4.c session.c ssh-add.c sshconnect.c uidswap.c]
print uid/gid as unsigned
- markus@cvs.openbsd.org 2000/08/28 13:51:00
[ssh.c]
enable -n and -f for ssh2
- markus@cvs.openbsd.org 2000/08/28 14:19:53
[ssh.c]
allow combination of -N and -f
- markus@cvs.openbsd.org 2000/08/28 14:20:56
[util.c]
util.c
- markus@cvs.openbsd.org 2000/08/28 14:22:02
[util.c]
undo
- markus@cvs.openbsd.org 2000/08/28 14:23:38
[util.c]
don't complain if setting NONBLOCK fails with ENODEV
20000823 20000823
- (djm) Define USE_PIPES to avoid socketpair problems on HPUX 10 and SunOS 4 - (djm) Define USE_PIPES to avoid socketpair problems on HPUX 10 and SunOS 4

View File

@ -203,6 +203,7 @@
#undef MAIL_DIRECTORY #undef MAIL_DIRECTORY
/* Data types */ /* Data types */
#undef HAVE_U_INT
#undef HAVE_INTXX_T #undef HAVE_INTXX_T
#undef HAVE_U_INTXX_T #undef HAVE_U_INTXX_T
#undef HAVE_UINTXX_T #undef HAVE_UINTXX_T

View File

@ -9,7 +9,7 @@
#include "ssh.h" #include "ssh.h"
#include "servconf.h" #include "servconf.h"
RCSID("$OpenBSD: auth-krb4.c,v 1.16 2000/08/02 17:27:04 provos Exp $"); RCSID("$OpenBSD: auth-krb4.c,v 1.17 2000/08/28 03:50:54 deraadt Exp $");
#ifdef KRB4 #ifdef KRB4
char *ticket = NULL; char *ticket = NULL;
@ -154,7 +154,7 @@ krb4_init(uid_t uid)
if (lstat("/ticket", &st) != -1) if (lstat("/ticket", &st) != -1)
tkt_root = "/ticket/"; tkt_root = "/ticket/";
#endif /* AFS */ #endif /* AFS */
snprintf(ticket, MAXPATHLEN, "%s%d_%d", tkt_root, uid, getpid()); snprintf(ticket, MAXPATHLEN, "%s%u_%d", tkt_root, uid, getpid());
(void) krb_set_tkt_string(ticket); (void) krb_set_tkt_string(ticket);
} }
/* Register ticket cleanup in case of fatal error. */ /* Register ticket cleanup in case of fatal error. */

View File

@ -28,7 +28,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: compat.c,v 1.19 2000/07/09 01:27:32 ho Exp $"); RCSID("$OpenBSD: compat.c,v 1.21 2000/08/27 18:18:04 markus Exp $");
#include "ssh.h" #include "ssh.h"
#include "packet.h" #include "packet.h"
@ -61,11 +61,12 @@ compat_datafellows(const char *version)
char *version; char *version;
int bugs; int bugs;
} check[] = { } check[] = {
{"2.2.0", SSH_BUG_HMAC|SSH_COMPAT_SESSIONID_ENCODING},
{"2.1.0", SSH_BUG_SIGBLOB|SSH_BUG_HMAC}, {"2.1.0", SSH_BUG_SIGBLOB|SSH_BUG_HMAC},
{"2.0.1", SSH_BUG_SIGBLOB|SSH_BUG_HMAC|SSH_BUG_PUBKEYAUTH|SSH_BUG_X11FWD}, {"2.0.1", SSH_BUG_SIGBLOB|SSH_BUG_HMAC|SSH_BUG_PUBKEYAUTH|SSH_BUG_X11FWD},
{"2.", SSH_BUG_HMAC|SSH_COMPAT_SESSIONID_ENCODING},
{NULL, 0} {NULL, 0}
}; };
/* process table, return first match */
for (i = 0; check[i].version; i++) { for (i = 0; check[i].version; i++) {
len = strlen(check[i].version); len = strlen(check[i].version);
if (strlen(version) >= len && if (strlen(version) >= len &&

View File

@ -465,6 +465,19 @@ AC_CHECK_SIZEOF(long int, 4)
AC_CHECK_SIZEOF(long long int, 8) AC_CHECK_SIZEOF(long long int, 8)
# More checks for data types # More checks for data types
AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
AC_TRY_COMPILE(
[ #include <sys/types.h> ],
[ u_int a; a = 1;],
[ ac_cv_have_u_int="yes" ],
[ ac_cv_have_u_int="no" ]
)
])
if test "x$ac_cv_have_u_int" = "xyes" ; then
AC_DEFINE(HAVE_U_INT)
have_u_int=1
fi
AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [ AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
AC_TRY_COMPILE( AC_TRY_COMPILE(
[ #include <sys/types.h> ], [ #include <sys/types.h> ],
@ -491,7 +504,6 @@ if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
have_u_intxx_t=1 have_u_intxx_t=1
fi fi
if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
test "x$ac_cv_header_sys_bitypes_h" = "xyes") test "x$ac_cv_header_sys_bitypes_h" = "xyes")
then then

View File

@ -102,6 +102,11 @@ enum
/* If sys/types.h does not supply intXX_t, supply them ourselves */ /* If sys/types.h does not supply intXX_t, supply them ourselves */
/* (or die trying) */ /* (or die trying) */
#ifndef HAVE_U_INT
typedef unsigned int u_int;
#endif
#ifndef HAVE_INTXX_T #ifndef HAVE_INTXX_T
# if (SIZEOF_CHAR == 1) # if (SIZEOF_CHAR == 1)
typedef char int8_t; typedef char int8_t;

5
scp.c
View File

@ -47,7 +47,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: scp.c,v 1.35 2000/08/19 02:50:07 deraadt Exp $"); RCSID("$OpenBSD: scp.c,v 1.36 2000/08/24 21:46:59 deraadt Exp $");
#include "ssh.h" #include "ssh.h"
#include "xmalloc.h" #include "xmalloc.h"
@ -680,7 +680,8 @@ sink(argc, argv)
BUF *bp; BUF *bp;
off_t i, j; off_t i, j;
int amt, count, exists, first, mask, mode, ofd, omode; int amt, count, exists, first, mask, mode, ofd, omode;
int setimes, size, targisdir, wrerrno = 0; off_t size;
int setimes, targisdir, wrerrno = 0;
char ch, *cp, *np, *targ, *why, *vect[1], buf[2048]; char ch, *cp, *np, *targ, *why, *vect[1], buf[2048];
struct utimbuf ut; struct utimbuf ut;
int dummy_usec; int dummy_usec;

View File

@ -8,7 +8,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: session.c,v 1.29 2000/08/21 16:23:31 millert Exp $"); RCSID("$OpenBSD: session.c,v 1.31 2000/08/28 03:50:54 deraadt Exp $");
#include "xmalloc.h" #include "xmalloc.h"
#include "ssh.h" #include "ssh.h"
@ -1014,7 +1014,7 @@ do_child(const char *command, struct passwd * pw, const char *term,
#endif /* HAVE_OSF_SIA */ #endif /* HAVE_OSF_SIA */
if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid) if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid)
fatal("Failed to set uids to %d.", (int) pw->pw_uid); fatal("Failed to set uids to %u.", (u_int) pw->pw_uid);
} }
/* /*
* Get the shell from the password data. An empty shell field is * Get the shell from the password data. An empty shell field is
@ -1229,7 +1229,7 @@ do_child(const char *command, struct passwd * pw, const char *term,
if (screen != NULL) if (screen != NULL)
fprintf(stderr, fprintf(stderr,
"Adding %.*s/unix%s %s %s\n", "Adding %.*s/unix%s %s %s\n",
screen-display, display, (int)(screen-display), display,
screen, auth_proto, auth_data); screen, auth_proto, auth_data);
} }
snprintf(cmd, sizeof cmd, "%s -q -", snprintf(cmd, sizeof cmd, "%s -q -",
@ -1240,7 +1240,7 @@ do_child(const char *command, struct passwd * pw, const char *term,
auth_proto, auth_data); auth_proto, auth_data);
if (screen != NULL) if (screen != NULL)
fprintf(f, "add %.*s/unix%s %s %s\n", fprintf(f, "add %.*s/unix%s %s %s\n",
screen-display, display, (int)(screen-display), display,
screen, auth_proto, auth_data); screen, auth_proto, auth_data);
pclose(f); pclose(f);
} else { } else {

View File

@ -9,7 +9,7 @@
.\" .\"
.\" Created: Sat Apr 22 23:55:14 1995 ylo .\" Created: Sat Apr 22 23:55:14 1995 ylo
.\" .\"
.\" $Id: ssh-add.1,v 1.14 2000/08/23 00:46:24 djm Exp $ .\" $Id: ssh-add.1,v 1.15 2000/08/29 00:33:51 djm Exp $
.\" .\"
.Dd September 25, 1999 .Dd September 25, 1999
.Dt SSH-ADD 1 .Dt SSH-ADD 1

View File

@ -10,7 +10,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: ssh-add.c,v 1.19 2000/08/19 21:34:43 markus Exp $"); RCSID("$OpenBSD: ssh-add.c,v 1.20 2000/08/28 03:50:54 deraadt Exp $");
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/rsa.h> #include <openssl/rsa.h>
@ -260,7 +260,8 @@ main(int argc, char **argv)
if (no_files) { if (no_files) {
pw = getpwuid(getuid()); pw = getpwuid(getuid());
if (!pw) { if (!pw) {
fprintf(stderr, "No user found with uid %d\n", (int) getuid()); fprintf(stderr, "No user found with uid %u\n",
(u_int)getuid());
ssh_close_authentication_connection(ac); ssh_close_authentication_connection(ac);
exit(1); exit(1);
} }

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: ssh-agent.1,v 1.14 2000/08/19 21:34:43 markus Exp $ .\" $OpenBSD: ssh-agent.1,v 1.15 2000/08/25 16:16:15 deraadt Exp $
.\" .\"
.\" -*- nroff -*- .\" -*- nroff -*-
.\" .\"

2
ssh.1
View File

@ -9,7 +9,7 @@
.\" .\"
.\" Created: Sat Apr 22 21:55:14 1995 ylo .\" Created: Sat Apr 22 21:55:14 1995 ylo
.\" .\"
.\" $Id: ssh.1,v 1.29 2000/08/18 03:59:06 djm Exp $ .\" $Id: ssh.1,v 1.30 2000/08/29 00:33:51 djm Exp $
.\" .\"
.Dd September 25, 1999 .Dd September 25, 1999
.Dt SSH 1 .Dt SSH 1

28
ssh.c
View File

@ -11,7 +11,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: ssh.c,v 1.61 2000/08/20 18:42:40 millert Exp $"); RCSID("$OpenBSD: ssh.c,v 1.63 2000/08/28 20:19:52 markus Exp $");
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/dsa.h> #include <openssl/dsa.h>
@ -461,7 +461,7 @@ main(int ac, char **av)
} }
/* Cannot fork to background if no command. */ /* Cannot fork to background if no command. */
if (fork_after_authentication_flag && buffer_len(&command) == 0) if (fork_after_authentication_flag && buffer_len(&command) == 0 && !no_shell_flag)
fatal("Cannot fork into background without a command to execute."); fatal("Cannot fork into background without a command to execute.");
/* Allocate a tty by default if no command specified. */ /* Allocate a tty by default if no command specified. */
@ -959,21 +959,25 @@ ssh_session2(void)
int window, packetmax, id; int window, packetmax, id;
int in, out, err; int in, out, err;
if (stdin_null_flag) {
in = open("/dev/null", O_RDONLY);
} else {
in = dup(STDIN_FILENO);
}
out = dup(STDOUT_FILENO);
err = dup(STDERR_FILENO);
if (in < 0 || out < 0 || err < 0)
fatal("dup() in/out/err failed");
/* should be pre-session */
init_local_fwd();
/* If requested, let ssh continue in the background. */ /* If requested, let ssh continue in the background. */
if (fork_after_authentication_flag) if (fork_after_authentication_flag)
if (daemon(1, 1) < 0) if (daemon(1, 1) < 0)
fatal("daemon() failed: %.200s", strerror(errno)); fatal("daemon() failed: %.200s", strerror(errno));
in = dup(STDIN_FILENO);
out = dup(STDOUT_FILENO);
err = dup(STDERR_FILENO);
if (in < 0 || out < 0 || err < 0)
fatal("dump in/out/err failed");
/* should be pre-session */
init_local_fwd();
window = 32*1024; window = 32*1024;
if (tty_flag) { if (tty_flag) {
packetmax = window/8; packetmax = window/8;

View File

@ -8,7 +8,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: sshconnect.c,v 1.76 2000/06/17 20:30:10 markus Exp $"); RCSID("$OpenBSD: sshconnect.c,v 1.77 2000/08/28 03:50:54 deraadt Exp $");
#include <openssl/bn.h> #include <openssl/bn.h>
#include <openssl/dsa.h> #include <openssl/dsa.h>
@ -193,8 +193,8 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
int gaierr; int gaierr;
struct linger linger; struct linger linger;
debug("ssh_connect: getuid %d geteuid %d anon %d", debug("ssh_connect: getuid %u geteuid %u anon %d",
(int) getuid(), (int) geteuid(), anonymous); (u_int) getuid(), (u_int) geteuid(), anonymous);
/* Get default port if port has not been set. */ /* Get default port if port has not been set. */
if (port == 0) { if (port == 0) {
@ -669,7 +669,7 @@ ssh_login(int host_key_valid, RSA *own_host_key, const char *orighost,
/* Get local user name. Use it as server user if no user name was given. */ /* Get local user name. Use it as server user if no user name was given. */
pw = getpwuid(original_real_uid); pw = getpwuid(original_real_uid);
if (!pw) if (!pw)
fatal("User id %d not found from user database.", original_real_uid); fatal("User id %u not found from user database.", original_real_uid);
local_user = xstrdup(pw->pw_name); local_user = xstrdup(pw->pw_name);
server_user = options.user ? options.user : local_user; server_user = options.user ? options.user : local_user;

2
sshd.8
View File

@ -9,7 +9,7 @@
.\" .\"
.\" Created: Sat Apr 22 21:55:14 1995 ylo .\" Created: Sat Apr 22 21:55:14 1995 ylo
.\" .\"
.\" $Id: sshd.8,v 1.26 2000/08/18 03:59:06 djm Exp $ .\" $Id: sshd.8,v 1.27 2000/08/29 00:33:51 djm Exp $
.\" .\"
.Dd September 25, 1999 .Dd September 25, 1999
.Dt SSHD 8 .Dt SSHD 8

View File

@ -7,7 +7,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: uidswap.c,v 1.7 2000/06/20 01:39:45 markus Exp $"); RCSID("$OpenBSD: uidswap.c,v 1.8 2000/08/28 03:50:54 deraadt Exp $");
#include "ssh.h" #include "ssh.h"
#include "uidswap.h" #include "uidswap.h"
@ -47,15 +47,15 @@ temporarily_use_uid(uid_t uid)
/* Set the effective uid to the given (unprivileged) uid. */ /* Set the effective uid to the given (unprivileged) uid. */
if (seteuid(uid) == -1) if (seteuid(uid) == -1)
debug("seteuid %d: %.100s", (int) uid, strerror(errno)); debug("seteuid %u: %.100s", (u_int) uid, strerror(errno));
#else /* SAVED_IDS_WORK_WITH_SETUID */ #else /* SAVED_IDS_WORK_WITH_SETUID */
/* Propagate the privileged uid to all of our uids. */ /* Propagate the privileged uid to all of our uids. */
if (setuid(geteuid()) < 0) if (setuid(geteuid()) < 0)
debug("setuid %d: %.100s", (int) geteuid(), strerror(errno)); debug("setuid %u: %.100s", (u_int) geteuid(), strerror(errno));
/* Set the effective uid to the given (unprivileged) uid. */ /* Set the effective uid to the given (unprivileged) uid. */
if (seteuid(uid) == -1) if (seteuid(uid) == -1)
debug("seteuid %d: %.100s", (int) uid, strerror(errno)); debug("seteuid %u: %.100s", (u_int) uid, strerror(errno));
#endif /* SAVED_IDS_WORK_WITH_SETEUID */ #endif /* SAVED_IDS_WORK_WITH_SETEUID */
} }
@ -68,7 +68,7 @@ restore_uid()
#ifdef SAVED_IDS_WORK_WITH_SETEUID #ifdef SAVED_IDS_WORK_WITH_SETEUID
/* Set the effective uid back to the saved uid. */ /* Set the effective uid back to the saved uid. */
if (seteuid(saved_euid) < 0) if (seteuid(saved_euid) < 0)
debug("seteuid %d: %.100s", (int) saved_euid, strerror(errno)); debug("seteuid %u: %.100s", (u_int) saved_euid, strerror(errno));
#else /* SAVED_IDS_WORK_WITH_SETEUID */ #else /* SAVED_IDS_WORK_WITH_SETEUID */
/* /*
* We are unable to restore the real uid to its unprivileged value. * We are unable to restore the real uid to its unprivileged value.
@ -95,5 +95,5 @@ permanently_set_uid(uid_t uid)
#endif /* WITH_IRIX_AUDIT */ #endif /* WITH_IRIX_AUDIT */
if (setuid(uid) < 0) if (setuid(uid) < 0)
debug("setuid %d: %.100s", (int) uid, strerror(errno)); debug("setuid %u: %.100s", (u_int) uid, strerror(errno));
} }

6
util.c
View File

@ -1,5 +1,5 @@
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: util.c,v 1.1 2000/08/01 19:01:42 provos Exp $"); RCSID("$OpenBSD: util.c,v 1.4 2000/08/28 20:23:37 markus Exp $");
#include "ssh.h" #include "ssh.h"
@ -37,7 +37,9 @@ set_nonblock(int fd)
debug("fd %d setting O_NONBLOCK", fd); debug("fd %d setting O_NONBLOCK", fd);
val |= O_NONBLOCK; val |= O_NONBLOCK;
if (fcntl(fd, F_SETFL, val) == -1) if (fcntl(fd, F_SETFL, val) == -1)
error("fcntl(%d, F_SETFL, O_NONBLOCK): %s", fd, strerror(errno)); if (errno != ENODEV)
error("fcntl(%d, F_SETFL, O_NONBLOCK): %s",
fd, strerror(errno));
} }
/* Characters considered whitespace in strsep calls. */ /* Characters considered whitespace in strsep calls. */