summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2000-10-18 00:02:25 +0000
committerBen Lindstrom <mouring@eviladmin.org>2000-10-18 00:02:25 +0000
commitb5628647ad1e48d026064e5acc0d8dc0b8021cfa (patch)
tree645c6dc3a5b3b0e24ec4f7308e9fc1b7823bb0fa
parent2594de81d301188108c1accbd4f937a86d70db1c (diff)
- (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>
-rw-r--r--ChangeLog3
-rw-r--r--INSTALL4
-rw-r--r--acconfig.h10
-rw-r--r--compat.c4
-rw-r--r--configure.in15
-rw-r--r--defines.h4
-rw-r--r--includes.h1
-rw-r--r--news4-posix.c39
-rw-r--r--news4-posix.h35
-rw-r--r--pty.c4
10 files changed, 112 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 2070718cc..3d3a04a93 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,9 @@
4 - (djm) Don't rely on atomicio's retval to determine length of askpass 4 - (djm) Don't rely on atomicio's retval to determine length of askpass
5 supplied passphrase. Problem report from Lutz Jaenicke 5 supplied passphrase. Problem report from Lutz Jaenicke
6 <Lutz.Jaenicke@aet.TU-Cottbus.DE> 6 <Lutz.Jaenicke@aet.TU-Cottbus.DE>
7 - (bal) Changed from GNU rx to PCRE on suggestion from djm.
8 - (bal) Integrated Sony NEWS-OS patches from NAKAJI Hirouyuki
9 <nakaji@tutrp.tut.ac.jp>
7 10
820001016 1120001016
9 - (djm) Sync with OpenBSD: 12 - (djm) Sync with OpenBSD:
diff --git a/INSTALL b/INSTALL
index b201eccd5..9112b92b5 100644
--- a/INSTALL
+++ b/INSTALL
@@ -40,8 +40,8 @@ ftp://ftp.gnu.org/gnu/make/
40OpenSSH has only been tested with GNU make. It may work with other 40OpenSSH has only been tested with GNU make. It may work with other
41'make' programs, but you are on your own. 41'make' programs, but you are on your own.
42 42
43GNU rx: 43pcre (POSIX Regular Expression library):
44ftp:://ftp.gnu.org/gnu/rx/ 44ftp://ftp.cus.cam.ac.uk/pub/software/programs/pcre/
45 45
46Most platforms do not required this. However older 4.3 BSD do not 46Most platforms do not required this. However older 4.3 BSD do not
47have a posix regex library. 47have a posix regex library.
diff --git a/acconfig.h b/acconfig.h
index d212b90f7..0837eb3f4 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -52,8 +52,8 @@
52/* Define if you are on Cygwin */ 52/* Define if you are on Cygwin */
53#undef HAVE_CYGWIN 53#undef HAVE_CYGWIN
54 54
55/* Define if you lack native POSIX regex and you are using GNU rx library */ 55/* Define if you lack native POSIX regex and you are using PCRE */
56#undef HAVE_LIBRX 56#undef HAVE_LIBPCRE
57 57
58/* Define if you have a broken realpath. */ 58/* Define if you have a broken realpath. */
59#undef BROKEN_REALPATH 59#undef BROKEN_REALPATH
@@ -61,6 +61,9 @@
61/* Define if you are on NeXT */ 61/* Define if you are on NeXT */
62#undef HAVE_NEXT 62#undef HAVE_NEXT
63 63
64/* Define if you are on NEWS-OS */
65#undef HAVE_NEWS4
66
64/* Define if you want to disable PAM support */ 67/* Define if you want to disable PAM support */
65#undef DISABLE_PAM 68#undef DISABLE_PAM
66 69
@@ -254,6 +257,9 @@
254/* Use IPv4 for connection by default, IPv6 can still if explicity asked */ 257/* Use IPv4 for connection by default, IPv6 can still if explicity asked */
255#undef IPV4_DEFAULT 258#undef IPV4_DEFAULT
256 259
260/* If you have no atexit() but xatexit(), and want to use xatexit() */
261#undef HAVE_XATEXIT
262
257/* getaddrinfo is broken (if present) */ 263/* getaddrinfo is broken (if present) */
258#undef BROKEN_GETADDRINFO 264#undef BROKEN_GETADDRINFO
259 265
diff --git a/compat.c b/compat.c
index 0e12b77c6..49bc0519a 100644
--- a/compat.c
+++ b/compat.c
@@ -29,8 +29,8 @@ RCSID("$OpenBSD: compat.c,v 1.25 2000/10/14 12:16:56 markus Exp $");
29#include "packet.h" 29#include "packet.h"
30#include "xmalloc.h" 30#include "xmalloc.h"
31#include "compat.h" 31#include "compat.h"
32#ifdef HAVE_LIBRX 32#ifdef HAVE_LIBPCRE
33# include <rxposix.h> 33# include <pcreposix.h>
34#else /* Use native regex libraries */ 34#else /* Use native regex libraries */
35# include <regex.h> 35# include <regex.h>
36#endif /* HAVE_LIBRX */ 36#endif /* HAVE_LIBRX */
diff --git a/configure.in b/configure.in
index c859b66d2..1a57583fa 100644
--- a/configure.in
+++ b/configure.in
@@ -119,6 +119,13 @@ case "$host" in
119 AC_DEFINE(PAM_TTY_KLUDGE) 119 AC_DEFINE(PAM_TTY_KLUDGE)
120 inet6_default_4in6=yes 120 inet6_default_4in6=yes
121 ;; 121 ;;
122mips-sony-bsd|mips-sony-newsos4)
123 AC_DEFINE(HAVE_NEWS4)
124 SONY=1
125 AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT),
126 AC_MSG_ERROR([*** libiberty missing - please install first ***])
127 )
128 ;;
122*-*-netbsd*) 129*-*-netbsd*)
123 need_dash_r=1 130 need_dash_r=1
124 ;; 131 ;;
@@ -257,7 +264,8 @@ AC_ARG_WITH(libs,
257# Checks for libraries. 264# Checks for libraries.
258AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***])) 265AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***]))
259AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil") 266AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil")
260AC_CHECK_LIB(rx, regcomp, AC_DEFINE(HAVE_LIBRX) LIBS="$LIBS -lrx") 267AC_CHECK_LIB(pcre, pcre_info,
268 AC_DEFINE(HAVE_LIBPCRE) LIBS="$LIBS -lpcreposix -lpcre")
261 269
262if test -z "$no_libsocket" ; then 270if test -z "$no_libsocket" ; then
263 AC_CHECK_LIB(nsl, yp_match, , ) 271 AC_CHECK_LIB(nsl, yp_match, , )
@@ -490,6 +498,11 @@ else
490 fi 498 fi
491fi 499fi
492 500
501# Cheap hack to ensure NEWS-OS libraries are arranged right.
502if test ! -z "$SONY" ; then
503 LIBS="$LIBS -liberty";
504fi
505
493# Checks for data types 506# Checks for data types
494AC_CHECK_SIZEOF(char, 1) 507AC_CHECK_SIZEOF(char, 1)
495AC_CHECK_SIZEOF(short int, 2) 508AC_CHECK_SIZEOF(short int, 2)
diff --git a/defines.h b/defines.h
index 323ff29b5..79d98e2e0 100644
--- a/defines.h
+++ b/defines.h
@@ -354,6 +354,10 @@ struct winsize {
354 354
355#if !defined(HAVE_ATEXIT) && defined(HAVE_ON_EXIT) 355#if !defined(HAVE_ATEXIT) && defined(HAVE_ON_EXIT)
356# define atexit(a) on_exit(a) 356# define atexit(a) on_exit(a)
357#else
358# if defined(HAVE_XATEXIT)
359# define atexit(a) xatexit(a)
360# endif /* defined(HAVE_XATEXIT) */
357#endif /* !defined(HAVE_ATEXIT) && defined(HAVE_ON_EXIT) */ 361#endif /* !defined(HAVE_ATEXIT) && defined(HAVE_ON_EXIT) */
358 362
359#if defined(HAVE_VHANGUP) && !defined(BROKEN_VHANGUP) 363#if defined(HAVE_VHANGUP) && !defined(BROKEN_VHANGUP)
diff --git a/includes.h b/includes.h
index 797c5e851..916066326 100644
--- a/includes.h
+++ b/includes.h
@@ -20,6 +20,7 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
20#include "config.h" 20#include "config.h"
21 21
22#include "next-posix.h" 22#include "next-posix.h"
23#include "news4-posix.h"
23 24
24#include <sys/types.h> 25#include <sys/types.h>
25#include <sys/socket.h> 26#include <sys/socket.h>
diff --git a/news4-posix.c b/news4-posix.c
new file mode 100644
index 000000000..b1a289f7a
--- /dev/null
+++ b/news4-posix.c
@@ -0,0 +1,39 @@
1#include "config.h"
2
3#ifdef HAVE_NEWS4
4#include <stdio.h>
5#include <stdlib.h>
6#include <string.h>
7#include <errno.h>
8#include <unistd.h>
9
10#include <sys/types.h>
11#include <sys/stat.h>
12#include <fcntl.h>
13
14#include <sys/fcntl.h>
15#include <sys/ioctl.h>
16#include <sys/time.h>
17#include <sys/file.h>
18#include <errno.h>
19#include <termios.h>
20#include <sys/wait.h>
21
22#include "xmalloc.h"
23#include "ssh.h"
24#include "news4-posix.h"
25
26int
27waitpid(int pid, int *stat_loc, int options)
28{
29 if (pid <= 0) {
30 if (pid != -1) {
31 errno = EINVAL;
32 return -1;
33 }
34 pid = 0; /* wait4() expects pid=0 for indiscriminate wait. */
35 }
36 return wait4(pid, (union wait *)stat_loc, options, NULL);
37}
38
39#endif /* HAVE_NEWS4 */
diff --git a/news4-posix.h b/news4-posix.h
new file mode 100644
index 000000000..874067934
--- /dev/null
+++ b/news4-posix.h
@@ -0,0 +1,35 @@
1/*
2 * Defines and prototypes specific to News4 system
3 */
4
5#ifndef _NEWS4_POSIX_H
6#define _NEWS4_POSIX_H
7
8#ifdef HAVE_NEWS4
9
10#include <sys/wait.h>
11
12typedef long clock_t;
13
14/* FILE */
15#define O_NONBLOCK 00004 /* non-blocking open */
16
17/* WAITPID */
18#undef WIFEXITED
19#undef WIFSTOPPED
20#undef WIFSIGNALED
21
22#define _W_INT(w) (*(int*)&(w)) /* convert union wait to int */
23#define WIFEXITED(w) (!((_W_INT(w)) & 0377))
24#define WIFSTOPPED(w) ((_W_INT(w)) & 0100)
25#define WIFSIGNALED(w) (!WIFEXITED(w) && !WIFSTOPPED(w))
26#define WEXITSTATUS(w) (int)(WIFEXITED(w) ? ((_W_INT(w) >> 8) & 0377) : -1)
27#define WTERMSIG(w) (int)(WIFSIGNALED(w) ? (_W_INT(w) & 0177) : -1)
28#define WCOREFLAG 0x80
29#define WCOREDUMP(w) ((_W_INT(w)) & WCOREFLAG)
30
31int waitpid(int pid,int *stat_loc,int options);
32#define setsid() setpgrp(0, getpid())
33
34#endif /* HAVE_NEWS4 */
35#endif /* _NEWS4_POSIX_H */
diff --git a/pty.c b/pty.c
index cbbe5845e..04004d20f 100644
--- a/pty.c
+++ b/pty.c
@@ -242,6 +242,10 @@ pty_make_controlling_tty(int *ttyfd, const char *ttyname)
242 */ 242 */
243 ioctl(*ttyfd, TIOCSCTTY, NULL); 243 ioctl(*ttyfd, TIOCSCTTY, NULL);
244#endif /* TIOCSCTTY */ 244#endif /* TIOCSCTTY */
245#ifdef HAVE_NEWS4
246 if (setpgrp(0,0) < 0)
247 error("SETPGRP %s",strerror(errno));
248#endif /* HAVE_NEWS4 */
245#ifdef USE_VHANGUP 249#ifdef USE_VHANGUP
246 old = signal(SIGHUP, SIG_IGN); 250 old = signal(SIGHUP, SIG_IGN);
247 vhangup(); 251 vhangup();