Compare commits

...
10 Commits
Author SHA1 Message Date
Darren Tucker bfad290773 - (dtucker) [configure.ac] Bug #536: Test for and work around openpty/
controlling tty problem on Linux (fixes "could not set controlling tty"
   errors).
2003-08-21 18:23:13 +10:00
Darren Tucker e3cc3c04e3 - (dtucker) [acconfig.h configure.ac monitor_fdpass.c] Bug #544: ignore
invalid cmsg_type on Linux 1.x and 2.0 kernels, privsep should now work.

Missed acconfig.h, whoops.
2003-08-21 17:56:29 +10:00
Darren Tucker 25fbd62837 - (dtucker) [acconfig.h configure.ac sshd.c] STREAMS_PUSH_ACQUIRES_CTTY ->
SSHD_ACQUIRES_CTTY.
2003-08-21 17:42:33 +10:00
Darren Tucker acc0d05cbc - (dtucker) [configure.ac monitor_fdpass.c] Bug #544: ignore invalid cmsg_type
on Linux 1.x and 2.0 kernels, privsep should now work.
2003-08-21 17:38:20 +10:00
Darren Tucker 1df4bb2b64 - (dtucker) [defines.h] Bug #336: Add CMSG_DATA and CMSG_FIRSTHDR macros if
not already defined (eg Linux with some versions of libc5), based on those
   from OpenBSD.
2003-08-21 17:08:43 +10:00
Darren Tucker 92339b2489 - (dtucker) [openbsd-compat/realpath.c] strcat -> strlcat, rootd -> needslash
to fix check for ENAMETOOLONG (OpenBSD realpath.c rev 1.10).
2003-08-21 16:41:41 +10:00
Darren Tucker a5d45a4cd3 - (dtucker) [configure.ac] Bug #600: Check that getrusage is declared before
searching libraries for it.  Fixes build errors on NCR MP-RAS.
 - (dtucker) [configure.ac] Define STREAMS_PUSH_ACQUIRES_CTTY for NCR MP-RAS
   and Reliant Unix.  Fixes "can't set controlling tty errors".
2003-08-21 16:16:21 +10:00
Darren Tucker a982aceea3 - (dtucker) [sshd.c] Bug #529: sshd doesn't work correctly after SIGHUP
(copy argv correctly), fix by djm from -current.
2003-08-21 16:11:30 +10:00
Darren Tucker 0fc114918c - (dtucker) [regress/authorized_keys_root regress/copy.1 regress/copy.2]
Remove temp data files from cvs.
2003-08-21 16:08:13 +10:00
Damien Miller fad82e8999 - (djm) Add back radix.o (used by AFS support), after it went missing from
Makefile many moons ago
 - (djm) Apply "owl-always-auth" patch from Openwall/Solar Designer
 - (djm) Fix blibpath specification for AIX/gcc
 - (djm) Some systems have basename in -lgen. Fix from [email protected]
2003-04-29 19:12:07 +10:00
21 changed files with 206 additions and 147 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ Theo de Raadt, and Dug Song - Creators of OpenSSH
Alain St-Denis <[email protected]> - Irix fix
Alexandre Oliva <[email protected]> - AIX fixes
Andre Lucas <andre[email protected].com> - new login code, many fixes
Andre Lucas <andre@ae-35.com> - new login code, many fixes
Andreas Steinmetz <[email protected]> - Shadow password expiry support
Andrew McGill <[email protected]> - SCO fixes
Andrew Morgan <[email protected]> - PAM bugfixes
@@ -91,5 +91,5 @@ Apologies to anyone I have missed.
Damien Miller <[email protected]>
$Id: CREDITS,v 1.67 2002/07/28 20:31:19 stevesk Exp $
$Id: CREDITS,v 1.67.6.1 2003/04/29 09:12:07 djm Exp $
+28 -53
View File
@@ -1,56 +1,31 @@
20030428
- (bal) [defines.h progressmeter.c scp.c] Some more culling of non 64bit
hacked code.
20030821
- (dtucker) [regress/authorized_keys_root regress/copy.1 regress/copy.2]
Remove temp data files from cvs.
- (dtucker) [sshd.c] Bug #529: sshd doesn't work correctly after SIGHUP
(copy argv correctly), fix by djm from -current.
- (dtucker) [configure.ac] Bug #600: Check that getrusage is declared before
searching libraries for it. Fixes build errors on NCR MP-RAS.
- (dtucker) [configure.ac] Define STREAMS_PUSH_ACQUIRES_CTTY for NCR MP-RAS
and Reliant Unix. Fixes "can't set controlling tty errors".
- (dtucker) [openbsd-compat/realpath.c] strcat -> strlcat, rootd -> needslash
to fix check for ENAMETOOLONG (OpenBSD realpath.c rev 1.10).
- (dtucker) [defines.h] Bug #336: Add CMSG_DATA and CMSG_FIRSTHDR macros if
not already defined (eg Linux with some versions of libc5), based on those
from OpenBSD.
- (dtucker) [acconfig.h configure.ac monitor_fdpass.c] Bug #544: ignore
invalid cmsg_type on Linux 1.x and 2.0 kernels, privsep should now work.
- (dtucker) [acconfig.h configure.ac sshd.c] STREAMS_PUSH_ACQUIRES_CTTY ->
SSHD_ACQUIRES_CTTY.
- (dtucker) [configure.ac] Bug #536: Test for and work around openpty/
controlling tty problem on Linux (fixes "could not set controlling tty"
errors).
20030427
- (bal) Bug #541: return; was dropped by mistake. Reported by
[email protected]
- (bal) Since we don't support platforms lacking u_int_64. We may
as well clean out some of those evil #ifdefs
- (bal) auth1.c minor resync while looking at the code.
- (bal) auth2.c same changed as above.
20030409
- (djm) Bug #539: Specify creation mode with O_CREAT for lastlog. Report
from [email protected]
- (djm) Make the spec work with Redhat 9.0 (which renames sharutils)
- (djm) OpenBSD CVS Sync
- [email protected] 2003/04/02 09:48:07
[clientloop.c monitor.c monitor_wrap.c packet.c packet.h readconf.c]
[readconf.h serverloop.c sshconnect2.c]
reapply rekeying chage, tested by henning@, ok djm@
- [email protected] 2003/04/02 14:36:26
[ssh-keysign.c]
potential segfault if KEY_UNSPEC; [email protected]; bug #526
- [email protected] 2003/04/03 07:25:27
[progressmeter.c]
$OpenBSD$
- [email protected] 2003/04/03 10:17:35
[progressmeter.c]
remove $OpenBSD$, as other *.c does not have it.
- [email protected] 2003/04/07 08:29:57
[monitor_wrap.c]
typo: get correct counters; introduced during rekeying change.
- [email protected] 2003/04/07 21:58:05
[progressmeter.c]
The UCB copyright here is incorrect. This code did not originate
at UCB, it was written by Luke Mewburn. Updated the copyright at
the author's request. markus@ OK
- [email protected] 2003/04/08 20:21:29
[*.c *.h]
rename log() into logit() to avoid name conflict. markus ok, from
netbsd
- (djm) XXX - Performed locally using:
"perl -p -i -e 's/(\s|^)log\(/$1logit\(/g' *.c *.h"
- [email protected] 2003/04/09 08:23:52
[servconf.c]
Don't include <krb.h> when compiling with Kerberos 5 support
- (djm) Fix up missing include for packet.c
- (djm) Fix missed log => logit occurance (reference by function pointer)
20030402
- (bal) if IP_TOS is not found or broken don't try to compile in
packet_set_tos() function call. bug #527
20030429
- (djm) Add back radix.o (used by AFS support), after it went missing from
Makefile many moons ago
- (djm) Apply "owl-always-auth" patch from Openwall/Solar Designer
- (djm) Fix blibpath specification for AIX/gcc
- (djm) Some systems have basename in -lgen. Fix from [email protected]
20030401
- (djm) OpenBSD CVS Sync
@@ -1349,4 +1324,4 @@
save auth method before monitor_reset_key_state(); bugzilla bug #284;
ok provos@
$Id: ChangeLog,v 1.2663 2003/04/28 23:30:43 mouring Exp $
$Id: ChangeLog,v 1.2648.2.10 2003/08/21 08:23:13 dtucker Exp $
+2 -2
View File
@@ -1,4 +1,4 @@
# $Id: Makefile.in,v 1.228 2003/03/21 00:34:34 mouring Exp $
# $Id: Makefile.in,v 1.228.2.1 2003/04/29 09:12:08 djm Exp $
# uncomment if you run a non bourne compatable shell. Ie. csh
#SHELL = @SH@
@@ -62,7 +62,7 @@ TARGETS=ssh$(EXEEXT) sshd$(EXEEXT) ssh-add$(EXEEXT) ssh-keygen$(EXEEXT) ssh-keys
LIBSSH_OBJS=authfd.o authfile.o bufaux.o buffer.o canohost.o channels.o \
cipher.o compat.o compress.o crc32.o deattack.o fatal.o \
hostfile.o log.o match.o mpaux.o nchan.o packet.o readpass.o \
hostfile.o log.o match.o mpaux.o nchan.o packet.o radix.o readpass.o \
rsa.o tildexpand.o ttymodes.o xmalloc.o atomicio.o \
key.o dispatch.o kex.o mac.o uuencode.o misc.o \
rijndael.o ssh-dss.o ssh-rsa.o dh.o kexdh.o kexgex.o \
+6 -3
View File
@@ -1,4 +1,4 @@
/* $Id: acconfig.h,v 1.149 2003/03/10 00:38:10 djm Exp $ */
/* $Id: acconfig.h,v 1.149.4.2 2003/08/21 07:56:29 dtucker Exp $ */
#ifndef _CONFIG_H
#define _CONFIG_H
@@ -374,8 +374,11 @@
/* Some systems put this outside of libc */
#undef HAVE_NANOSLEEP
/* Pushing STREAMS modules incorrectly acquires a controlling TTY */
#undef STREAMS_PUSH_ACQUIRES_CTTY
/* Define if sshd somehow reacquires a controlling TTY after setsid() */
#undef SSHD_ACQUIRES_CTTY
/* Define if cmsg_type is not passed correctly */
#undef BROKEN_CMSG_TYPE
@BOTTOM@
+10 -10
View File
@@ -38,7 +38,7 @@ extern char *__progname;
extern int use_privsep;
RCSID("$Id: auth-pam.c,v 1.56 2003/04/09 10:59:48 djm Exp $");
RCSID("$Id: auth-pam.c,v 1.55.4.1 2003/04/29 09:12:08 djm Exp $");
#define NEW_AUTHTOK_MSG \
"Warning: Your password has expired, please change it now."
@@ -182,7 +182,7 @@ void do_pam_cleanup_proc(void *context)
if (__pamh && session_opened) {
pam_retval = pam_close_session(__pamh, 0);
if (pam_retval != PAM_SUCCESS)
logit("Cannot close PAM session[%d]: %.200s",
log("Cannot close PAM session[%d]: %.200s",
pam_retval, PAM_STRERROR(__pamh, pam_retval));
}
@@ -196,12 +196,12 @@ void do_pam_cleanup_proc(void *context)
if (__pamh) {
pam_retval = pam_end(__pamh, pam_retval);
if (pam_retval != PAM_SUCCESS)
logit("Cannot release PAM authentication[%d]: %.200s",
log("Cannot release PAM authentication[%d]: %.200s",
pam_retval, PAM_STRERROR(__pamh, pam_retval));
}
}
/* Attempt password authentation using PAM */
/* Attempt password authentication using PAM */
int auth_pam_password(Authctxt *authctxt, const char *password)
{
extern ServerOptions options;
@@ -215,13 +215,13 @@ int auth_pam_password(Authctxt *authctxt, const char *password)
pamstate = INITIAL_LOGIN;
pam_retval = do_pam_authenticate(
options.permit_empty_passwd == 0 ? PAM_DISALLOW_NULL_AUTHTOK : 0);
if (pam_retval == PAM_SUCCESS) {
debug("PAM Password authentication accepted for "
"user \"%.100s\"", pw->pw_name);
if (pam_retval == PAM_SUCCESS && pw) {
debug("PAM password authentication accepted for "
"%.100s", pw->pw_name);
return 1;
} else {
debug("PAM Password authentication for \"%.100s\" "
"failed[%d]: %s", pw->pw_name, pam_retval,
debug("PAM password authentication failed for "
"%.100s: %s", pw ? pw->pw_name : "an illegal user",
PAM_STRERROR(__pamh, pam_retval));
return 0;
}
@@ -261,7 +261,7 @@ int do_pam_account(char *username, char *remote_user)
break;
#endif
default:
logit("PAM rejected by account configuration[%d]: "
log("PAM rejected by account configuration[%d]: "
"%.200s", pam_retval, PAM_STRERROR(__pamh,
pam_retval));
return(0);
+10 -5
View File
@@ -93,6 +93,7 @@ int
auth_password(Authctxt *authctxt, const char *password)
{
struct passwd * pw = authctxt->pw;
int ok = authctxt->valid;
#if !defined(USE_PAM) && !defined(HAVE_OSF_SIA)
char *encrypted_password;
char *pw_password;
@@ -115,19 +116,23 @@ auth_password(Authctxt *authctxt, const char *password)
/* deny if no user. */
if (pw == NULL)
return 0;
ok = 0;
#ifndef HAVE_CYGWIN
if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES)
return 0;
if (pw && pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES)
ok = 0;
#endif
if (*password == '\0' && options.permit_empty_passwd == 0)
return 0;
ok = 0;
#if defined(USE_PAM)
return auth_pam_password(authctxt, password);
return auth_pam_password(authctxt, password) && ok;
#elif defined(HAVE_OSF_SIA)
if (!ok)
return 0;
return auth_sia_password(authctxt, password);
#else
if (!ok)
return 0;
# ifdef KRB5
if (options.kerberos_authentication == 1) {
int ret = auth_krb5_password(authctxt, password);
+1 -1
View File
@@ -100,7 +100,7 @@ userauth_none(Authctxt *authctxt)
if (check_nt_auth(1, authctxt->pw) == 0)
return(0);
#endif
return (authctxt->valid ? PRIVSEP(auth_password(authctxt, "")) : 0);
return PRIVSEP(auth_password(authctxt, "")) && authctxt->valid;
}
Authmethod method_none = {
+4 -4
View File
@@ -44,14 +44,14 @@ userauth_passwd(Authctxt *authctxt)
u_int len;
change = packet_get_char();
if (change)
logit("password change not supported");
log("password change not supported");
password = packet_get_string(&len);
packet_check_eom();
if (authctxt->valid &&
if (PRIVSEP(auth_password(authctxt, password)) == 1 && authctxt->valid
#ifdef HAVE_CYGWIN
check_nt_auth(1, authctxt->pw) &&
&& check_nt_auth(1, authctxt->pw)
#endif
PRIVSEP(auth_password(authctxt, password)) == 1)
)
authenticated = 1;
memset(password, 0, len);
xfree(password);
+78 -19
View File
@@ -1,4 +1,4 @@
# $Id: configure.ac,v 1.113 2003/03/21 01:18:09 mouring Exp $
# $Id: configure.ac,v 1.113.2.5 2003/08/21 08:23:13 dtucker Exp $
AC_INIT
AC_CONFIG_SRCDIR([ssh.c])
@@ -57,20 +57,24 @@ case "$host" in
AFS_LIBS="-lld"
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
if (test "$LD" != "gcc" && test -z "$blibpath"); then
AC_MSG_CHECKING([if linkage editor ($LD) accepts -blibpath])
saved_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -blibpath:/usr/lib:/lib:/usr/local/lib"
AC_TRY_LINK([],
[],
[
AC_MSG_RESULT(yes)
blibpath="/usr/lib:/lib:/usr/local/lib"
],
[ AC_MSG_RESULT(no) ]
)
LDFLAGS="$saved_LDFLAGS"
AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
if (test -z "$blibpath"); then
blibpath="/usr/lib:/lib:/usr/local/lib"
fi
saved_LDFLAGS="$LDFLAGS"
for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
if (test -z "$blibflags"); then
LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
AC_TRY_LINK([], [], [blibflags=$tryflags])
fi
done
if (test -z "$blibflags"); then
AC_MSG_RESULT(not found)
AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
else
AC_MSG_RESULT($blibflags)
fi
LDFLAGS="$saved_LDFLAGS"
AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
[AC_CHECK_LIB(s,authenticate,
[ AC_DEFINE(WITH_AIXAUTHENTICATE)
@@ -179,11 +183,16 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
*-*-linux*)
no_dev_ptmx=1
check_for_libcrypt_later=1
check_for_openpty_ctty_bug=1
AC_DEFINE(DONT_TRY_OTHER_AF)
AC_DEFINE(PAM_TTY_KLUDGE)
AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV)
AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
inet6_default_4in6=yes
case `uname -r` in
1.*|2.0.*)
AC_DEFINE(BROKEN_CMSG_TYPE)
esac
;;
mips-sony-bsd|mips-sony-newsos4)
AC_DEFINE(HAVE_NEWS4)
@@ -216,7 +225,7 @@ mips-sony-bsd|mips-sony-newsos4)
AC_DEFINE(LOGIN_NEEDS_UTMPX)
AC_DEFINE(LOGIN_NEEDS_TERM)
AC_DEFINE(PAM_TTY_KLUDGE)
AC_DEFINE(STREAMS_PUSH_ACQUIRES_CTTY)
AC_DEFINE(SSHD_ACQUIRES_CTTY)
# hardwire lastlog location (can't detect it on some versions)
conf_lastlog_location="/var/adm/lastlog"
AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
@@ -243,6 +252,7 @@ mips-sony-bsd|mips-sony-newsos4)
LDFLAGS="$LDFLAGS -L/usr/local/lib"
LIBS="$LIBS -lc89"
AC_DEFINE(USE_PIPES)
AC_DEFINE(SSHD_ACQUIRES_CTTY)
;;
*-sni-sysv*)
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
@@ -251,6 +261,7 @@ mips-sony-bsd|mips-sony-newsos4)
IPADDR_IN_DISPLAY=yes
AC_DEFINE(USE_PIPES)
AC_DEFINE(IP_TOS_IS_BROKEN)
AC_DEFINE(SSHD_ACQUIRES_CTTY)
# /usr/ucblib/libucb.a no longer needed on ReliantUNIX
# Attention: always take care to bind libsocket and libnsl before libc,
# otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
@@ -607,7 +618,7 @@ AC_CHECK_FUNCS(\
arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename bcopy \
bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
getpeereid _getpty getrlimit getrusage getttyent glob inet_aton \
getpeereid _getpty getrlimit getttyent glob inet_aton \
inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openpty pstat \
readpassphrase realpath recvmsg rresvport_af sendmsg setdtablesize \
@@ -618,9 +629,11 @@ AC_CHECK_FUNCS(\
)
AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
dnl Make sure strsep prototype is defined before defining HAVE_STRSEP
dnl Make sure prototypes are defined for these before using them.
AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
dnl IRIX and Solaris 2.5.1 have dirname() in libgen
AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
@@ -721,6 +734,52 @@ unlink(template); exit(0);
)
fi
if test ! -z "$check_for_openpty_ctty_bug"; then
AC_MSG_CHECKING(if openpty correctly handles controlling tty)
AC_TRY_RUN(
[
#include <stdio.h>
#include <sys/fcntl.h>
#include <sys/types.h>
#include <sys/wait.h>
int
main()
{
pid_t pid;
int fd, ptyfd, ttyfd, status;
pid = fork();
if (pid < 0) { /* failed */
exit(1);
} else if (pid > 0) { /* parent */
waitpid(pid, &status, 0);
if (WIFEXITED(status))
exit(WEXITSTATUS(status));
else
exit(2);
} else { /* child */
close(0); close(1); close(2);
setsid();
openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
fd = open("/dev/tty", O_RDWR | O_NOCTTY);
if (fd >= 0)
exit(3); /* Acquired ctty: broken */
else
exit(0); /* Did not acquire ctty: OK */
}
}
],
[
AC_MSG_RESULT(yes)
],
[
AC_MSG_RESULT(no)
AC_DEFINE(SSHD_ACQUIRES_CTTY)
]
)
fi
AC_FUNC_GETPGRP
# Check for PAM libs
@@ -2473,8 +2532,8 @@ fi
if test ! -z "$blibpath" ; then
LDFLAGS="$LDFLAGS -blibpath:$blibpath"
AC_MSG_WARN([Please check and edit -blibpath in LDFLAGS in Makefile])
LDFLAGS="$LDFLAGS $blibflags$blibpath"
AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
fi
dnl remove pam and dl because they are in $LIBPAM
+2 -2
View File
@@ -17,7 +17,7 @@
#old cvs stuff. please update before use. may be deprecated.
%define use_stable 1
%if %{use_stable}
%define version 3.6.1p1
%define version 3.6.1p2
%define cvs %{nil}
%define release 2
%else
@@ -364,4 +364,4 @@ fi
* Mon Jan 01 1998 ...
Template Version: 1.31
$Id: openssh.spec,v 1.42 2003/04/01 11:46:53 djm Exp $
$Id: openssh.spec,v 1.42.2.1 2003/04/29 09:12:08 djm Exp $
+3 -3
View File
@@ -1,5 +1,5 @@
%define ver 3.6.1p1
%define rel 2
%define ver 3.6.1p2
%define rel 1
# OpenSSH privilege separation requires a user & group ID
%define sshd_uid 74
@@ -87,7 +87,7 @@ PreReq: initscripts >= 5.00
%else
PreReq: initscripts >= 5.20
%endif
BuildPreReq: perl, openssl-devel, tcp_wrappers
BuildPreReq: perl, openssl-devel, sharutils, tcp_wrappers
BuildPreReq: /bin/login
%if ! %{build6x}
BuildPreReq: glibc-devel, pam
+1 -1
View File
@@ -1,6 +1,6 @@
Summary: OpenSSH, a free Secure Shell (SSH) protocol implementation
Name: openssh
Version: 3.6.1p1
Version: 3.6.1p2
URL: http://www.openssh.com/
Release: 1
Source0: openssh-%{version}.tar.gz
+25 -1
View File
@@ -1,7 +1,7 @@
#ifndef _DEFINES_H
#define _DEFINES_H
/* $Id: defines.h,v 1.98 2003/04/28 23:30:43 mouring Exp $ */
/* $Id: defines.h,v 1.97.4.1 2003/08/21 07:08:43 dtucker Exp $ */
/* Constants */
@@ -188,21 +188,28 @@ typedef unsigned long u_int32_t;
#ifndef HAVE_INT64_T
# if (SIZEOF_LONG_INT == 8)
typedef long int int64_t;
# define HAVE_INT64_T 1
# else
# if (SIZEOF_LONG_LONG_INT == 8)
typedef long long int int64_t;
# define HAVE_INT64_T 1
# endif
# endif
#endif
#ifndef HAVE_U_INT64_T
# if (SIZEOF_LONG_INT == 8)
typedef unsigned long int u_int64_t;
# define HAVE_U_INT64_T 1
# else
# if (SIZEOF_LONG_LONG_INT == 8)
typedef unsigned long long int u_int64_t;
# define HAVE_U_INT64_T 1
# endif
# endif
#endif
#if !defined(HAVE_LONG_LONG_INT) && (SIZEOF_LONG_LONG_INT == 8)
# define HAVE_LONG_LONG_INT 1
#endif
#ifndef HAVE_U_CHAR
typedef unsigned char u_char;
@@ -413,6 +420,23 @@ struct winsize {
#define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len))
#endif
/* given pointer to struct cmsghdr, return pointer to data */
#ifndef CMSG_DATA
#define CMSG_DATA(cmsg) ((u_char *)(cmsg) + __CMSG_ALIGN(sizeof(struct cmsghdr)))
#endif /* CMSG_DATA */
/*
* RFC 2292 requires to check msg_controllen, in case that the kernel returns
* an empty list for some reasons.
*/
#ifndef CMSG_FIRSTHDR
#define CMSG_FIRSTHDR(mhdr) \
((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
(struct cmsghdr *)(mhdr)->msg_control : \
(struct cmsghdr *)NULL)
#endif /* CMSG_FIRSTHDR */
/* Function replacement / compatibility hacks */
#if !defined(HAVE_GETADDRINFO) && (defined(HAVE_OGETADDRINFO) || defined(HAVE_NGETADDRINFO))
+6 -14
View File
@@ -25,7 +25,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: monitor.c,v 1.37 2003/04/02 09:48:07 markus Exp $");
RCSID("$OpenBSD: monitor.c,v 1.36 2003/04/01 10:22:21 markus Exp $");
#include <openssl/dh.h>
@@ -606,7 +606,7 @@ mm_answer_authpassword(int socket, Buffer *m)
passwd = buffer_get_string(m, &plen);
/* Only authenticate if the context is valid */
authenticated = options.password_authentication &&
authctxt->valid && auth_password(authctxt, passwd);
auth_password(authctxt, passwd) && authctxt->valid;
memset(passwd, 0, strlen(passwd));
xfree(passwd);
@@ -870,7 +870,7 @@ monitor_valid_userblob(u_char *data, u_int datalen)
fail++;
p = buffer_get_string(&b, NULL);
if (strcmp(authctxt->user, p) != 0) {
logit("wrong user name passed to monitor: expected %s != %.100s",
log("wrong user name passed to monitor: expected %s != %.100s",
authctxt->user, p);
fail++;
}
@@ -918,7 +918,7 @@ monitor_valid_hostbasedblob(u_char *data, u_int datalen, char *cuser,
fail++;
p = buffer_get_string(&b, NULL);
if (strcmp(authctxt->user, p) != 0) {
logit("wrong user name passed to monitor: expected %s != %.100s",
log("wrong user name passed to monitor: expected %s != %.100s",
authctxt->user, p);
fail++;
}
@@ -1497,8 +1497,6 @@ mm_get_keystate(struct monitor *pmonitor)
Buffer m;
u_char *blob, *p;
u_int bloblen, plen;
u_int32_t seqnr, packets;
u_int64_t blocks;
debug3("%s: Waiting for new keys", __func__);
@@ -1528,14 +1526,8 @@ mm_get_keystate(struct monitor *pmonitor)
xfree(blob);
/* Now get sequence numbers for the packets */
seqnr = buffer_get_int(&m);
blocks = buffer_get_int64(&m);
packets = buffer_get_int(&m);
packet_set_state(MODE_OUT, seqnr, blocks, packets);
seqnr = buffer_get_int(&m);
blocks = buffer_get_int64(&m);
packets = buffer_get_int(&m);
packet_set_state(MODE_IN, seqnr, blocks, packets);
packet_set_seqnr(MODE_OUT, buffer_get_int(&m));
packet_set_seqnr(MODE_IN, buffer_get_int(&m));
skip:
/* Get the key context */
+2
View File
@@ -113,9 +113,11 @@ mm_receive_fd(int socket)
fatal("%s: no fd", __func__);
#else
cmsg = CMSG_FIRSTHDR(&msg);
#ifndef BROKEN_CMSG_TYPE
if (cmsg->cmsg_type != SCM_RIGHTS)
fatal("%s: expected type %d got %d", __func__,
SCM_RIGHTS, cmsg->cmsg_type);
#endif
fd = (*(int *)CMSG_DATA(cmsg));
#endif
return fd;
+8 -8
View File
@@ -32,7 +32,7 @@
#if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH)
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: realpath.c,v 1.7 2002/05/24 21:22:37 deraadt Exp $";
static char *rcsid = "$OpenBSD: realpath.c,v 1.10 2003/08/01 21:04:59 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -62,7 +62,7 @@ char *
realpath(const char *path, char *resolved)
{
struct stat sb;
int fd, n, rootd, serrno = 0;
int fd, n, needslash, serrno = 0;
char *p, *q, wbuf[MAXPATHLEN], start[MAXPATHLEN];
int symlinks = 0;
@@ -138,18 +138,18 @@ loop:
* happens if the last component is empty, or the dirname is root.
*/
if (resolved[0] == '/' && resolved[1] == '\0')
rootd = 1;
needslash = 0;
else
rootd = 0;
needslash = 1;
if (*wbuf) {
if (strlen(resolved) + strlen(wbuf) + rootd + 1 > MAXPATHLEN) {
if (strlen(resolved) + strlen(wbuf) + needslash >= MAXPATHLEN) {
serrno = ENAMETOOLONG;
goto err1;
}
if (rootd == 0)
(void)strcat(resolved, "/");
(void)strcat(resolved, wbuf);
if (needslash)
strlcat(resolved, "/", MAXPATHLEN);
strlcat(resolved, wbuf, MAXPATHLEN);
}
/* Go back to where we came from. */
-2
View File
@@ -1,2 +0,0 @@
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAt6ttBacbgvLPsF1VWWfT51t55/5Mj62Xp8EaoH5SNSaLiGIgrrja077lKEept75U4uKFUYU5JJX9GPE9A7Y43LXv+/A6Jm4rEj/U0s4H8tf0UmzVC3t6xh0sRK0hYVNILyoHnIAgdY8CmOiybw7p6DxJY8MRAehD3n9+kFcachU= root@xenon
1024 35 132789427207755621599908461558918671787816692978751485815532032934821830960131244604702969298486352138126114080367609979552547448841583955126231410604842765726397407176910594168641969541792069550006878863592030567875913190224374005367884774859544943329148178663694126456638431428703289837638970464685771819219 root@xenon
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+17 -16
View File
@@ -258,11 +258,11 @@ sighup_handler(int sig)
static void
sighup_restart(void)
{
logit("Received SIGHUP; restarting.");
log("Received SIGHUP; restarting.");
close_listen_socks();
close_startup_pipes();
execv(saved_argv[0], saved_argv);
logit("RESTART FAILED: av[0]='%.100s', error: %.100s.", saved_argv[0],
log("RESTART FAILED: av[0]='%.100s', error: %.100s.", saved_argv[0],
strerror(errno));
exit(1);
}
@@ -376,7 +376,7 @@ sshd_exchange_identification(int sock_in, int sock_out)
if (atomicio(write, sock_out, server_version_string,
strlen(server_version_string))
!= strlen(server_version_string)) {
logit("Could not write ident string to %s", get_remote_ipaddr());
log("Could not write ident string to %s", get_remote_ipaddr());
fatal_cleanup();
}
@@ -384,7 +384,7 @@ sshd_exchange_identification(int sock_in, int sock_out)
memset(buf, 0, sizeof(buf));
for (i = 0; i < sizeof(buf) - 1; i++) {
if (atomicio(read, sock_in, &buf[i], 1) != 1) {
logit("Did not receive identification string from %s",
log("Did not receive identification string from %s",
get_remote_ipaddr());
fatal_cleanup();
}
@@ -415,7 +415,7 @@ sshd_exchange_identification(int sock_in, int sock_out)
(void) atomicio(write, sock_out, s, strlen(s));
close(sock_in);
close(sock_out);
logit("Bad protocol version identification '%.100s' from %s",
log("Bad protocol version identification '%.100s' from %s",
client_version_string, get_remote_ipaddr());
fatal_cleanup();
}
@@ -425,13 +425,13 @@ sshd_exchange_identification(int sock_in, int sock_out)
compat_datafellows(remote_version);
if (datafellows & SSH_BUG_PROBE) {
logit("probed from %s with %s. Don't panic.",
log("probed from %s with %s. Don't panic.",
get_remote_ipaddr(), client_version_string);
fatal_cleanup();
}
if (datafellows & SSH_BUG_SCANNER) {
logit("scanned from %s with %s. Don't panic.",
log("scanned from %s with %s. Don't panic.",
get_remote_ipaddr(), client_version_string);
fatal_cleanup();
}
@@ -476,7 +476,7 @@ sshd_exchange_identification(int sock_in, int sock_out)
(void) atomicio(write, sock_out, s, strlen(s));
close(sock_in);
close(sock_out);
logit("Protocol major versions differ for %s: %.200s vs. %.200s",
log("Protocol major versions differ for %s: %.200s vs. %.200s",
get_remote_ipaddr(),
server_version_string, client_version_string);
fatal_cleanup();
@@ -830,9 +830,10 @@ main(int ac, char **av)
/* Save argv. Duplicate so setproctitle emulation doesn't clobber it */
saved_argc = ac;
saved_argv = av;
saved_argv = xmalloc(sizeof(*saved_argv) * ac);
saved_argv = xmalloc(sizeof(*saved_argv) * (ac + 1));
for (i = 0; i < ac; i++)
saved_argv[i] = xstrdup(av[i]);
saved_argv[i] = NULL;
#ifndef HAVE_SETPROCTITLE
/* Prepare for later setproctitle emulation */
@@ -1010,15 +1011,15 @@ main(int ac, char **av)
key_type(key));
}
if ((options.protocol & SSH_PROTO_1) && !sensitive_data.have_ssh1_key) {
logit("Disabling protocol version 1. Could not load host key");
log("Disabling protocol version 1. Could not load host key");
options.protocol &= ~SSH_PROTO_1;
}
if ((options.protocol & SSH_PROTO_2) && !sensitive_data.have_ssh2_key) {
logit("Disabling protocol version 2. Could not load host key");
log("Disabling protocol version 2. Could not load host key");
options.protocol &= ~SSH_PROTO_2;
}
if (!(options.protocol & (SSH_PROTO_1|SSH_PROTO_2))) {
logit("sshd: no hostkeys available -- exiting.");
log("sshd: no hostkeys available -- exiting.");
exit(1);
}
@@ -1186,7 +1187,7 @@ main(int ac, char **av)
num_listen_socks++;
/* Start listening on the port. */
logit("Server listening on %s port %s.", ntop, strport);
log("Server listening on %s port %s.", ntop, strport);
if (listen(listen_sock, 5) < 0)
fatal("listen: %.100s", strerror(errno));
@@ -1262,7 +1263,7 @@ main(int ac, char **av)
if (ret < 0 && errno != EINTR)
error("select: %.100s", strerror(errno));
if (received_sigterm) {
logit("Received signal %d; terminating.",
log("Received signal %d; terminating.",
(int) received_sigterm);
close_listen_socks();
unlink(options.pid_file);
@@ -1400,7 +1401,7 @@ main(int ac, char **av)
* setlogin() affects the entire process group. We don't
* want the child to be able to affect the parent.
*/
#if !defined(STREAMS_PUSH_ACQUIRES_CTTY)
#if !defined(SSHD_ACQUIRES_CTTY)
/*
* If setsid is called on Solaris, sshd will acquire the controlling
* terminal while pushing STREAMS modules. This will prevent the
@@ -1750,7 +1751,7 @@ do_ssh1_kex(void)
u_char *buf = xmalloc(bytes);
MD5_CTX md;
logit("do_connection: generating a fake encryption key");
log("do_connection: generating a fake encryption key");
BN_bn2bin(session_key_int, buf);
MD5_Init(&md);
MD5_Update(&md, buf, bytes);
+1 -1
View File
@@ -1,3 +1,3 @@
/* $OpenBSD: version.h,v 1.37 2003/04/01 10:56:46 markus Exp $ */
#define SSH_VERSION "OpenSSH_3.6.1p1"
#define SSH_VERSION "OpenSSH_3.6.1p2"