From 86b9fe6a77795fd5f086910912e7853fc1518afa Mon Sep 17 00:00:00 2001 From: Kevin Steves Date: Sun, 7 Apr 2002 17:08:53 +0000 Subject: - (stevesk) HAVE_MMAP and HAVE_SYS_MMAN_H and use them in monitor_mm.c --- ChangeLog | 4 +++- configure.ac | 6 +++--- monitor_mm.c | 7 +++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7f083a359..3bbd4aeaf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ Future: we may want to test if fd passing works correctly. - (stevesk) [monitor_fdpass.c] fatal() for UsePrivilegeSeparation=yes and no fd passing support. + - (stevesk) HAVE_MMAP and HAVE_SYS_MMAN_H and use them in + monitor_mm.c 20020406 - (djm) Typo in Suse SPEC file. Fix from Carsten Grohmann @@ -8193,4 +8195,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.2035 2002/04/07 16:39:12 stevesk Exp $ +$Id: ChangeLog,v 1.2036 2002/04/07 17:08:53 stevesk Exp $ diff --git a/configure.ac b/configure.ac index 0afab0755..875bc771f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.36 2002/04/07 16:18:04 stevesk Exp $ +# $Id: configure.ac,v 1.37 2002/04/07 17:08:54 stevesk Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -317,7 +317,7 @@ AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \ netinet/in_systm.h paths.h poll.h pty.h \ rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \ strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \ - sys/poll.h sys/select.h sys/stat.h \ + sys/mman.h sys/poll.h sys/select.h sys/stat.h \ sys/stropts.h sys/sysmacros.h sys/time.h \ sys/un.h time.h ttyent.h usersec.h \ util.h utime.h utmp.h utmpx.h) @@ -534,7 +534,7 @@ AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \ getaddrinfo getcwd getgrouplist getnameinfo getopt \ getrlimit getrusage getttyent glob inet_aton inet_ntoa \ inet_ntop innetgr login_getcapbool md5_crypt memmove \ - mkdtemp openpty readpassphrase realpath \ + mkdtemp mmap openpty readpassphrase realpath \ rresvport_af setdtablesize setegid setenv seteuid \ setlogin setproctitle setresgid setreuid setrlimit \ setsid setvbuf sigaction sigvec snprintf strerror \ diff --git a/monitor_mm.c b/monitor_mm.c index b383193cd..b9ea978a6 100644 --- a/monitor_mm.c +++ b/monitor_mm.c @@ -26,7 +26,9 @@ #include "includes.h" RCSID("$OpenBSD: monitor_mm.c,v 1.4 2002/03/25 20:12:10 stevesk Exp $"); +#ifdef HAVE_SYS_MMAN_H #include +#endif #include "ssh.h" #include "xmalloc.h" @@ -82,10 +84,15 @@ mm_create(struct mm_master *mmalloc, size_t size) */ mm->mmalloc = mmalloc; +#ifdef HAVE_MMAP address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED, -1, 0); if (address == MAP_FAILED) fatal("mmap(%lu)", (u_long)size); +#else + fatal("%s: UsePrivilegeSeparation=yes not supported", + __FUNCTION__); +#endif mm->address = address; mm->size = size; -- cgit v1.2.3