summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--deleted_files/usr/src/cmd/ssh/include/bsd-nextstep.h (renamed from usr/src/cmd/ssh/include/bsd-nextstep.h)0
-rw-r--r--deleted_files/usr/src/cmd/ssh/libopenbsd-compat/common/bsd-nextstep.c (renamed from usr/src/cmd/ssh/libopenbsd-compat/common/bsd-nextstep.c)0
-rw-r--r--usr/src/cmd/ssh/include/config.h3
-rw-r--r--usr/src/cmd/ssh/include/defines.h11
-rw-r--r--usr/src/cmd/ssh/include/includes.h6
-rw-r--r--usr/src/cmd/ssh/libopenbsd-compat/Makefile.com1
-rw-r--r--usr/src/cmd/ssh/libopenbsd-compat/common/llib-lopenbsd-compat8
-rw-r--r--usr/src/cmd/ssh/libssh/common/llib-lssh1
-rw-r--r--usr/src/cmd/ssh/libssh/common/uidswap.c14
-rw-r--r--usr/src/cmd/ssh/ssh-socks5-proxy-connect/ssh-socks5-proxy-connect.c18
-rw-r--r--usr/src/cmd/ssh/sshd/groupaccess.c4
-rw-r--r--usr/src/cmd/ssh/sshd/session.c5
12 files changed, 36 insertions, 35 deletions
diff --git a/usr/src/cmd/ssh/include/bsd-nextstep.h b/deleted_files/usr/src/cmd/ssh/include/bsd-nextstep.h
index 4aa776ee6e..4aa776ee6e 100644
--- a/usr/src/cmd/ssh/include/bsd-nextstep.h
+++ b/deleted_files/usr/src/cmd/ssh/include/bsd-nextstep.h
diff --git a/usr/src/cmd/ssh/libopenbsd-compat/common/bsd-nextstep.c b/deleted_files/usr/src/cmd/ssh/libopenbsd-compat/common/bsd-nextstep.c
index 90d578be29..90d578be29 100644
--- a/usr/src/cmd/ssh/libopenbsd-compat/common/bsd-nextstep.c
+++ b/deleted_files/usr/src/cmd/ssh/libopenbsd-compat/common/bsd-nextstep.c
diff --git a/usr/src/cmd/ssh/include/config.h b/usr/src/cmd/ssh/include/config.h
index a2a524204b..8c76573868 100644
--- a/usr/src/cmd/ssh/include/config.h
+++ b/usr/src/cmd/ssh/include/config.h
@@ -82,9 +82,6 @@ extern "C" {
/* Define if you have a broken realpath. */
/* #undef BROKEN_REALPATH */
-/* Define if you are on NeXT */
-/* #undef HAVE_NEXT */
-
/* Define if you are on NEWS-OS */
/* #undef HAVE_NEWS4 */
diff --git a/usr/src/cmd/ssh/include/defines.h b/usr/src/cmd/ssh/include/defines.h
index 4b8bbebed6..893cc902fc 100644
--- a/usr/src/cmd/ssh/include/defines.h
+++ b/usr/src/cmd/ssh/include/defines.h
@@ -78,11 +78,14 @@ enum
# define STDERR_FILENO 2
#endif
-#ifndef NGROUPS_MAX /* Disable groupaccess if NGROUP_MAX is not set */
-#ifdef NGROUPS
-#define NGROUPS_MAX NGROUPS
+/* Disable groupaccess if NGROUPS_UMAX, NGROUPS_MAX and NGROUPS are not set */
+#ifndef NGROUPS_UMAX
+#ifdef NGROUPS_MAX
+#define NGROUPS_UMAX NGROUPS_MAX
+#elif defined(NGROUPS)
+#define NGROUPS_UMAX NGROUPS
#else
-#define NGROUPS_MAX 0
+#define NGROUPS_UMAX 0
#endif
#endif
diff --git a/usr/src/cmd/ssh/include/includes.h b/usr/src/cmd/ssh/include/includes.h
index 308b581e15..bc18be79c9 100644
--- a/usr/src/cmd/ssh/include/includes.h
+++ b/usr/src/cmd/ssh/include/includes.h
@@ -24,7 +24,7 @@ extern "C" {
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -79,9 +79,6 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
#ifdef HAVE_MAILLOCK_H
# include <maillock.h> /* For _PATH_MAILDIR */
#endif
-#ifdef HAVE_NEXT
-# include <libc.h>
-#endif
#include <unistd.h> /* For STDIN_FILENO, etc */
#include <termios.h> /* Struct winsize */
@@ -182,7 +179,6 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
#include "version.h"
#include "openbsd-compat.h"
#include "bsd-cygwin_util.h"
-#include "bsd-nextstep.h"
#include "entropy.h"
#include "g11n.h"
diff --git a/usr/src/cmd/ssh/libopenbsd-compat/Makefile.com b/usr/src/cmd/ssh/libopenbsd-compat/Makefile.com
index eb665e83da..a7bc022857 100644
--- a/usr/src/cmd/ssh/libopenbsd-compat/Makefile.com
+++ b/usr/src/cmd/ssh/libopenbsd-compat/Makefile.com
@@ -35,7 +35,6 @@ OBJECTS = \
bsd-cygwin_util.o \
bsd-getpeereid.o \
bsd-misc.o \
- bsd-nextstep.o \
bsd-asprintf.o \
bsd-snprintf.o \
bsd-waitpid.o \
diff --git a/usr/src/cmd/ssh/libopenbsd-compat/common/llib-lopenbsd-compat b/usr/src/cmd/ssh/libopenbsd-compat/common/llib-lopenbsd-compat
index 16853ed734..bb8bf91220 100644
--- a/usr/src/cmd/ssh/libopenbsd-compat/common/llib-lopenbsd-compat
+++ b/usr/src/cmd/ssh/libopenbsd-compat/common/llib-lopenbsd-compat
@@ -5,9 +5,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -22,7 +21,7 @@
*
* CDDL HEADER END
*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
@@ -36,7 +35,6 @@
#include <bsd-cygwin_util.h>
#include <bsd-getpeereid.h>
#include <bsd-misc.h>
-#include <bsd-nextstep.h>
#include <bsd-snprintf.h>
#include <bsd-waitpid.h>
#include <config.h>
diff --git a/usr/src/cmd/ssh/libssh/common/llib-lssh b/usr/src/cmd/ssh/libssh/common/llib-lssh
index ed817d9385..0af5f574b7 100644
--- a/usr/src/cmd/ssh/libssh/common/llib-lssh
+++ b/usr/src/cmd/ssh/libssh/common/llib-lssh
@@ -42,7 +42,6 @@
#include <bsd-cygwin_util.h>
#include <bsd-getpeereid.h>
#include <bsd-misc.h>
-#include <bsd-nextstep.h>
#include <bsd-snprintf.h>
#include <bsd-waitpid.h>
#include <bufaux.h>
diff --git a/usr/src/cmd/ssh/libssh/common/uidswap.c b/usr/src/cmd/ssh/libssh/common/uidswap.c
index 42868df057..31acab9341 100644
--- a/usr/src/cmd/ssh/libssh/common/uidswap.c
+++ b/usr/src/cmd/ssh/libssh/common/uidswap.c
@@ -1,8 +1,4 @@
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
@@ -14,6 +10,10 @@
* incompatible with the protocol description in the RFC file, it must be
* called by a name other than "ssh" or "Secure Shell".
*/
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
#include "includes.h"
RCSID("$OpenBSD: uidswap.c,v 1.23 2002/07/15 17:15:31 stevesk Exp $");
@@ -44,7 +44,7 @@ static gid_t saved_egid = 0;
/* Saved effective uid. */
static int privileged = 0;
static int temporarily_use_uid_effective = 0;
-static gid_t saved_egroups[NGROUPS_MAX], user_groups[NGROUPS_MAX];
+static gid_t saved_egroups[NGROUPS_UMAX], user_groups[NGROUPS_UMAX];
static int saved_egroupslen = -1, user_groupslen = -1;
/*
@@ -74,7 +74,7 @@ temporarily_use_uid(struct passwd *pw)
privileged = 1;
temporarily_use_uid_effective = 1;
- saved_egroupslen = getgroups(NGROUPS_MAX, saved_egroups);
+ saved_egroupslen = getgroups(NGROUPS_UMAX, saved_egroups);
if (saved_egroupslen < 0)
fatal("getgroups: %.100s", strerror(errno));
@@ -83,7 +83,7 @@ temporarily_use_uid(struct passwd *pw)
if (initgroups(pw->pw_name, pw->pw_gid) < 0)
fatal("initgroups: %s: %.100s", pw->pw_name,
strerror(errno));
- user_groupslen = getgroups(NGROUPS_MAX, user_groups);
+ user_groupslen = getgroups(NGROUPS_UMAX, user_groups);
if (user_groupslen < 0)
fatal("getgroups: %.100s", strerror(errno));
}
diff --git a/usr/src/cmd/ssh/ssh-socks5-proxy-connect/ssh-socks5-proxy-connect.c b/usr/src/cmd/ssh/ssh-socks5-proxy-connect/ssh-socks5-proxy-connect.c
index d8ee2c54b8..131eb73fcc 100644
--- a/usr/src/cmd/ssh/ssh-socks5-proxy-connect/ssh-socks5-proxy-connect.c
+++ b/usr/src/cmd/ssh/ssh-socks5-proxy-connect/ssh-socks5-proxy-connect.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,7 +18,7 @@
*
* CDDL HEADER END
*
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -159,7 +158,16 @@ send_request(
exit(1);
}
- if (read(sockfd, &recv_buf, sizeof (recv_buf)) == -1) {
+ /*
+ * The maximum size of the protocol message we are waiting for is 10
+ * bytes -- VER[1], REP[1], RSV[1], ATYP[1], BND.ADDR[4] and
+ * BND.PORT[2]; see RFC 1928, section "6. Replies" for more details.
+ * Everything else is already a part of the data we are supposed to
+ * deliver to the requester. We know that BND.ADDR is exactly 4 bytes
+ * since as you can see below, we accept only ATYP == 1 which specifies
+ * that the IPv4 address is in a binary format.
+ */
+ if (read(sockfd, &recv_buf, 10) == -1) {
perror("read");
exit(1);
}
diff --git a/usr/src/cmd/ssh/sshd/groupaccess.c b/usr/src/cmd/ssh/sshd/groupaccess.c
index deed5fced7..728466112b 100644
--- a/usr/src/cmd/ssh/sshd/groupaccess.c
+++ b/usr/src/cmd/ssh/sshd/groupaccess.c
@@ -33,7 +33,7 @@ RCSID("$OpenBSD: groupaccess.c,v 1.5 2002/03/04 17:27:39 stevesk Exp $");
#include "log.h"
static int ngroups;
-static char *groups_byname[NGROUPS_MAX + 1]; /* +1 for base/primary group */
+static char *groups_byname[NGROUPS_UMAX + 1]; /* +1 for base/primary group */
/*
* Initialize group access list for user with primary (base) and
@@ -42,7 +42,7 @@ static char *groups_byname[NGROUPS_MAX + 1]; /* +1 for base/primary group */
int
ga_init(const char *user, gid_t base)
{
- gid_t groups_bygid[NGROUPS_MAX + 1];
+ gid_t groups_bygid[NGROUPS_UMAX + 1];
int i, j;
struct group *gr;
diff --git a/usr/src/cmd/ssh/sshd/session.c b/usr/src/cmd/ssh/sshd/session.c
index 04b1c1f7e0..c73d6ef4e3 100644
--- a/usr/src/cmd/ssh/sshd/session.c
+++ b/usr/src/cmd/ssh/sshd/session.c
@@ -1859,6 +1859,7 @@ session_x11_req(Session *s)
xfree(s->auth_data);
s->auth_proto = NULL;
s->auth_data = NULL;
+ return (success);
}
/*
@@ -1870,7 +1871,7 @@ session_x11_req(Session *s)
* means that we won't set XAUTHORITY variable in child's environment
* and xauth(1) will use the default location for the authority file.
*/
- if (success && mkdtemp(xauthdir) != NULL) {
+ if (mkdtemp(xauthdir) != NULL) {
s->auth_file = xmalloc(MAXPATHLEN);
snprintf(s->auth_file, MAXPATHLEN, "%s/xauthfile",
xauthdir);
@@ -1909,7 +1910,7 @@ session_x11_req(Session *s)
strerror(errno));
}
- return success;
+ return (success);
}
static int