summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Steves <stevesk@pobox.com>2002-04-07 17:08:53 +0000
committerKevin Steves <stevesk@pobox.com>2002-04-07 17:08:53 +0000
commit86b9fe6a77795fd5f086910912e7853fc1518afa (patch)
treeb5ca35a265987fa2aa235ad126175e012a9eb0ef
parentc3c825575cdae3fd42ceb7709525fe8c0ad43f43 (diff)
- (stevesk) HAVE_MMAP and HAVE_SYS_MMAN_H and use them in
monitor_mm.c
-rw-r--r--ChangeLog4
-rw-r--r--configure.ac6
-rw-r--r--monitor_mm.c7
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 @@
3 Future: we may want to test if fd passing works correctly. 3 Future: we may want to test if fd passing works correctly.
4 - (stevesk) [monitor_fdpass.c] fatal() for UsePrivilegeSeparation=yes 4 - (stevesk) [monitor_fdpass.c] fatal() for UsePrivilegeSeparation=yes
5 and no fd passing support. 5 and no fd passing support.
6 - (stevesk) HAVE_MMAP and HAVE_SYS_MMAN_H and use them in
7 monitor_mm.c
6 8
720020406 920020406
8 - (djm) Typo in Suse SPEC file. Fix from Carsten Grohmann 10 - (djm) Typo in Suse SPEC file. Fix from Carsten Grohmann
@@ -8193,4 +8195,4 @@
8193 - Wrote replacements for strlcpy and mkdtemp 8195 - Wrote replacements for strlcpy and mkdtemp
8194 - Released 1.0pre1 8196 - Released 1.0pre1
8195 8197
8196$Id: ChangeLog,v 1.2035 2002/04/07 16:39:12 stevesk Exp $ 8198$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 @@
1# $Id: configure.ac,v 1.36 2002/04/07 16:18:04 stevesk Exp $ 1# $Id: configure.ac,v 1.37 2002/04/07 17:08:54 stevesk Exp $
2 2
3AC_INIT 3AC_INIT
4AC_CONFIG_SRCDIR([ssh.c]) 4AC_CONFIG_SRCDIR([ssh.c])
@@ -317,7 +317,7 @@ AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \
317 netinet/in_systm.h paths.h poll.h pty.h \ 317 netinet/in_systm.h paths.h poll.h pty.h \
318 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \ 318 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
319 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \ 319 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \
320 sys/poll.h sys/select.h sys/stat.h \ 320 sys/mman.h sys/poll.h sys/select.h sys/stat.h \
321 sys/stropts.h sys/sysmacros.h sys/time.h \ 321 sys/stropts.h sys/sysmacros.h sys/time.h \
322 sys/un.h time.h ttyent.h usersec.h \ 322 sys/un.h time.h ttyent.h usersec.h \
323 util.h utime.h utmp.h utmpx.h) 323 util.h utime.h utmp.h utmpx.h)
@@ -534,7 +534,7 @@ AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \
534 getaddrinfo getcwd getgrouplist getnameinfo getopt \ 534 getaddrinfo getcwd getgrouplist getnameinfo getopt \
535 getrlimit getrusage getttyent glob inet_aton inet_ntoa \ 535 getrlimit getrusage getttyent glob inet_aton inet_ntoa \
536 inet_ntop innetgr login_getcapbool md5_crypt memmove \ 536 inet_ntop innetgr login_getcapbool md5_crypt memmove \
537 mkdtemp openpty readpassphrase realpath \ 537 mkdtemp mmap openpty readpassphrase realpath \
538 rresvport_af setdtablesize setegid setenv seteuid \ 538 rresvport_af setdtablesize setegid setenv seteuid \
539 setlogin setproctitle setresgid setreuid setrlimit \ 539 setlogin setproctitle setresgid setreuid setrlimit \
540 setsid setvbuf sigaction sigvec snprintf strerror \ 540 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 @@
26#include "includes.h" 26#include "includes.h"
27RCSID("$OpenBSD: monitor_mm.c,v 1.4 2002/03/25 20:12:10 stevesk Exp $"); 27RCSID("$OpenBSD: monitor_mm.c,v 1.4 2002/03/25 20:12:10 stevesk Exp $");
28 28
29#ifdef HAVE_SYS_MMAN_H
29#include <sys/mman.h> 30#include <sys/mman.h>
31#endif
30 32
31#include "ssh.h" 33#include "ssh.h"
32#include "xmalloc.h" 34#include "xmalloc.h"
@@ -82,10 +84,15 @@ mm_create(struct mm_master *mmalloc, size_t size)
82 */ 84 */
83 mm->mmalloc = mmalloc; 85 mm->mmalloc = mmalloc;
84 86
87#ifdef HAVE_MMAP
85 address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED, 88 address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED,
86 -1, 0); 89 -1, 0);
87 if (address == MAP_FAILED) 90 if (address == MAP_FAILED)
88 fatal("mmap(%lu)", (u_long)size); 91 fatal("mmap(%lu)", (u_long)size);
92#else
93 fatal("%s: UsePrivilegeSeparation=yes not supported",
94 __FUNCTION__);
95#endif
89 96
90 mm->address = address; 97 mm->address = address;
91 mm->size = size; 98 mm->size = size;