- (bal) Changed from GNU rx to PCRE on suggestion from djm.

- (bal) Integrated Sony NEWS-OS patches from NAKAJI Hirouyuki
   <nakaji@tutrp.tut.ac.jp>
This commit is contained in:
Ben Lindstrom 2000-10-18 00:02:25 +00:00
parent 2594de81d3
commit b5628647ad
10 changed files with 112 additions and 7 deletions

View File

@ -4,6 +4,9 @@
- (djm) Don't rely on atomicio's retval to determine length of askpass
supplied passphrase. Problem report from Lutz Jaenicke
<Lutz.Jaenicke@aet.TU-Cottbus.DE>
- (bal) Changed from GNU rx to PCRE on suggestion from djm.
- (bal) Integrated Sony NEWS-OS patches from NAKAJI Hirouyuki
<nakaji@tutrp.tut.ac.jp>
20001016
- (djm) Sync with OpenBSD:

View File

@ -40,8 +40,8 @@ ftp://ftp.gnu.org/gnu/make/
OpenSSH has only been tested with GNU make. It may work with other
'make' programs, but you are on your own.
GNU rx:
ftp:://ftp.gnu.org/gnu/rx/
pcre (POSIX Regular Expression library):
ftp://ftp.cus.cam.ac.uk/pub/software/programs/pcre/
Most platforms do not required this. However older 4.3 BSD do not
have a posix regex library.

View File

@ -52,8 +52,8 @@
/* Define if you are on Cygwin */
#undef HAVE_CYGWIN
/* Define if you lack native POSIX regex and you are using GNU rx library */
#undef HAVE_LIBRX
/* Define if you lack native POSIX regex and you are using PCRE */
#undef HAVE_LIBPCRE
/* Define if you have a broken realpath. */
#undef BROKEN_REALPATH
@ -61,6 +61,9 @@
/* Define if you are on NeXT */
#undef HAVE_NEXT
/* Define if you are on NEWS-OS */
#undef HAVE_NEWS4
/* Define if you want to disable PAM support */
#undef DISABLE_PAM
@ -254,6 +257,9 @@
/* Use IPv4 for connection by default, IPv6 can still if explicity asked */
#undef IPV4_DEFAULT
/* If you have no atexit() but xatexit(), and want to use xatexit() */
#undef HAVE_XATEXIT
/* getaddrinfo is broken (if present) */
#undef BROKEN_GETADDRINFO

View File

@ -29,8 +29,8 @@ RCSID("$OpenBSD: compat.c,v 1.25 2000/10/14 12:16:56 markus Exp $");
#include "packet.h"
#include "xmalloc.h"
#include "compat.h"
#ifdef HAVE_LIBRX
# include <rxposix.h>
#ifdef HAVE_LIBPCRE
# include <pcreposix.h>
#else /* Use native regex libraries */
# include <regex.h>
#endif /* HAVE_LIBRX */

View File

@ -119,6 +119,13 @@ case "$host" in
AC_DEFINE(PAM_TTY_KLUDGE)
inet6_default_4in6=yes
;;
mips-sony-bsd|mips-sony-newsos4)
AC_DEFINE(HAVE_NEWS4)
SONY=1
AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
AC_MSG_ERROR([*** libiberty missing - please install first ***])
)
;;
*-*-netbsd*)
need_dash_r=1
;;
@ -257,7 +264,8 @@ AC_ARG_WITH(libs,
# Checks for libraries.
AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
AC_CHECK_LIB(rx, regcomp, AC_DEFINE(HAVE_LIBRX) LIBS="$LIBS -lrx")
AC_CHECK_LIB(pcre, pcre_info,
AC_DEFINE(HAVE_LIBPCRE) LIBS="$LIBS -lpcreposix -lpcre")
if test -z "$no_libsocket" ; then
AC_CHECK_LIB(nsl, yp_match, , )
@ -490,6 +498,11 @@ else
fi
fi
# Cheap hack to ensure NEWS-OS libraries are arranged right.
if test ! -z "$SONY" ; then
LIBS="$LIBS -liberty";
fi
# Checks for data types
AC_CHECK_SIZEOF(char, 1)
AC_CHECK_SIZEOF(short int, 2)

View File

@ -354,6 +354,10 @@ struct winsize {
#if !defined(HAVE_ATEXIT) && defined(HAVE_ON_EXIT)
# define atexit(a) on_exit(a)
#else
# if defined(HAVE_XATEXIT)
# define atexit(a) xatexit(a)
# endif /* defined(HAVE_XATEXIT) */
#endif /* !defined(HAVE_ATEXIT) && defined(HAVE_ON_EXIT) */
#if defined(HAVE_VHANGUP) && !defined(BROKEN_VHANGUP)

View File

@ -20,6 +20,7 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
#include "config.h"
#include "next-posix.h"
#include "news4-posix.h"
#include <sys/types.h>
#include <sys/socket.h>

39
news4-posix.c Normal file
View File

@ -0,0 +1,39 @@
#include "config.h"
#ifdef HAVE_NEWS4
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/fcntl.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <sys/file.h>
#include <errno.h>
#include <termios.h>
#include <sys/wait.h>
#include "xmalloc.h"
#include "ssh.h"
#include "news4-posix.h"
int
waitpid(int pid, int *stat_loc, int options)
{
if (pid <= 0) {
if (pid != -1) {
errno = EINVAL;
return -1;
}
pid = 0; /* wait4() expects pid=0 for indiscriminate wait. */
}
return wait4(pid, (union wait *)stat_loc, options, NULL);
}
#endif /* HAVE_NEWS4 */

35
news4-posix.h Normal file
View File

@ -0,0 +1,35 @@
/*
* Defines and prototypes specific to News4 system
*/
#ifndef _NEWS4_POSIX_H
#define _NEWS4_POSIX_H
#ifdef HAVE_NEWS4
#include <sys/wait.h>
typedef long clock_t;
/* FILE */
#define O_NONBLOCK 00004 /* non-blocking open */
/* WAITPID */
#undef WIFEXITED
#undef WIFSTOPPED
#undef WIFSIGNALED
#define _W_INT(w) (*(int*)&(w)) /* convert union wait to int */
#define WIFEXITED(w) (!((_W_INT(w)) & 0377))
#define WIFSTOPPED(w) ((_W_INT(w)) & 0100)
#define WIFSIGNALED(w) (!WIFEXITED(w) && !WIFSTOPPED(w))
#define WEXITSTATUS(w) (int)(WIFEXITED(w) ? ((_W_INT(w) >> 8) & 0377) : -1)
#define WTERMSIG(w) (int)(WIFSIGNALED(w) ? (_W_INT(w) & 0177) : -1)
#define WCOREFLAG 0x80
#define WCOREDUMP(w) ((_W_INT(w)) & WCOREFLAG)
int waitpid(int pid,int *stat_loc,int options);
#define setsid() setpgrp(0, getpid())
#endif /* HAVE_NEWS4 */
#endif /* _NEWS4_POSIX_H */

4
pty.c
View File

@ -242,6 +242,10 @@ pty_make_controlling_tty(int *ttyfd, const char *ttyname)
*/
ioctl(*ttyfd, TIOCSCTTY, NULL);
#endif /* TIOCSCTTY */
#ifdef HAVE_NEWS4
if (setpgrp(0,0) < 0)
error("SETPGRP %s",strerror(errno));
#endif /* HAVE_NEWS4 */
#ifdef USE_VHANGUP
old = signal(SIGHUP, SIG_IGN);
vhangup();