diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | acconfig.h | 5 | ||||
-rw-r--r-- | configure.ac | 26 | ||||
-rw-r--r-- | monitor_mm.c | 6 | ||||
-rw-r--r-- | servconf.c | 2 |
5 files changed, 35 insertions, 8 deletions
@@ -4,6 +4,8 @@ | |||
4 | - (djm) Create privsep directory and warn if privsep user is missing | 4 | - (djm) Create privsep directory and warn if privsep user is missing |
5 | during make install | 5 | during make install |
6 | - (bal) Started list of PrivSep issues in TODO | 6 | - (bal) Started list of PrivSep issues in TODO |
7 | - (bal) if mmap() is substandard, don't allow compression on server side. | ||
8 | Post 'event' we will add more options. | ||
7 | 9 | ||
8 | 20020624 | 10 | 20020624 |
9 | - OpenBSD CVS Sync | 11 | - OpenBSD CVS Sync |
@@ -1089,4 +1091,4 @@ | |||
1089 | - (stevesk) entropy.c: typo in debug message | 1091 | - (stevesk) entropy.c: typo in debug message |
1090 | - (djm) ssh-keygen -i needs seeded RNG; report from markus@ | 1092 | - (djm) ssh-keygen -i needs seeded RNG; report from markus@ |
1091 | 1093 | ||
1092 | $Id: ChangeLog,v 1.2268 2002/06/25 02:28:22 mouring Exp $ | 1094 | $Id: ChangeLog,v 1.2269 2002/06/25 03:22:03 mouring Exp $ |
diff --git a/acconfig.h b/acconfig.h index 682e2754c..0bf305bb8 100644 --- a/acconfig.h +++ b/acconfig.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: acconfig.h,v 1.139 2002/06/24 16:26:49 stevesk Exp $ */ | 1 | /* $Id: acconfig.h,v 1.140 2002/06/25 03:22:04 mouring Exp $ */ |
2 | 2 | ||
3 | #ifndef _CONFIG_H | 3 | #ifndef _CONFIG_H |
4 | #define _CONFIG_H | 4 | #define _CONFIG_H |
@@ -355,6 +355,9 @@ | |||
355 | /* Path that unprivileged child will chroot() to in privep mode */ | 355 | /* Path that unprivileged child will chroot() to in privep mode */ |
356 | #undef PRIVSEP_PATH | 356 | #undef PRIVSEP_PATH |
357 | 357 | ||
358 | /* Define if you have the `mmap' function that supports MAP_ANON|SHARED */ | ||
359 | #undef HAVE_MMAP_ANON_SHARED | ||
360 | |||
358 | @BOTTOM@ | 361 | @BOTTOM@ |
359 | 362 | ||
360 | /* ******************* Shouldn't need to edit below this line ************** */ | 363 | /* ******************* Shouldn't need to edit below this line ************** */ |
diff --git a/configure.ac b/configure.ac index d29091e9e..a99860334 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1,4 +1,4 @@ | |||
1 | # $Id: configure.ac,v 1.70 2002/06/25 00:24:48 djm Exp $ | 1 | # $Id: configure.ac,v 1.71 2002/06/25 03:22:04 mouring Exp $ |
2 | 2 | ||
3 | AC_INIT | 3 | AC_INIT |
4 | AC_CONFIG_SRCDIR([ssh.c]) | 4 | AC_CONFIG_SRCDIR([ssh.c]) |
@@ -574,6 +574,30 @@ AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \ | |||
574 | socketpair strerror strlcat strlcpy strmode strsep sysconf tcgetpgrp \ | 574 | socketpair strerror strlcat strlcpy strmode strsep sysconf tcgetpgrp \ |
575 | truncate utimes vhangup vsnprintf waitpid __b64_ntop _getpty) | 575 | truncate utimes vhangup vsnprintf waitpid __b64_ntop _getpty) |
576 | 576 | ||
577 | if test $ac_cv_func_mmap = yes ; then | ||
578 | AC_MSG_CHECKING([for mmap anon shared]) | ||
579 | AC_TRY_RUN( | ||
580 | [ | ||
581 | #include <stdio.h> | ||
582 | #include <sys/mman.h> | ||
583 | #if !defined(MAP_ANON) && defined(MAP_ANONYMOUS) | ||
584 | #define MAP_ANON MAP_ANONYMOUS | ||
585 | #endif | ||
586 | main() { char *p; | ||
587 | p = (char *) mmap(NULL, 10, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED, -1, 0); | ||
588 | if (p == (char *)-1) | ||
589 | exit(1); | ||
590 | exit(0); | ||
591 | } | ||
592 | ], | ||
593 | [ | ||
594 | AC_MSG_RESULT(yes) | ||
595 | AC_DEFINE(HAVE_MMAP_ANON_SHARED) | ||
596 | ], | ||
597 | [ AC_MSG_RESULT(no) ] | ||
598 | ) | ||
599 | fi | ||
600 | |||
577 | dnl IRIX and Solaris 2.5.1 have dirname() in libgen | 601 | dnl IRIX and Solaris 2.5.1 have dirname() in libgen |
578 | AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[ | 602 | AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[ |
579 | AC_CHECK_LIB(gen, dirname,[ | 603 | AC_CHECK_LIB(gen, dirname,[ |
diff --git a/monitor_mm.c b/monitor_mm.c index 0076c4210..c7662d807 100644 --- a/monitor_mm.c +++ b/monitor_mm.c | |||
@@ -84,13 +84,11 @@ mm_create(struct mm_master *mmalloc, size_t size) | |||
84 | */ | 84 | */ |
85 | mm->mmalloc = mmalloc; | 85 | mm->mmalloc = mmalloc; |
86 | 86 | ||
87 | #if defined(HAVE_MMAP) && defined(MAP_ANON) | 87 | #ifdef HAVE_MMAP_ANON_SHARED |
88 | 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, |
89 | -1, 0); | 89 | -1, 0); |
90 | if (address == MAP_FAILED) | ||
91 | fatal("mmap(%lu): %s", (u_long)size, strerror(errno)); | ||
92 | #else | 90 | #else |
93 | fatal("%s: UsePrivilegeSeparation=yes not supported", | 91 | fatal("%s: UsePrivilegeSeparation=yes and Compression=yes not supported", |
94 | __func__); | 92 | __func__); |
95 | #endif | 93 | #endif |
96 | 94 | ||
diff --git a/servconf.c b/servconf.c index 0d77c7078..f311ae48d 100644 --- a/servconf.c +++ b/servconf.c | |||
@@ -257,7 +257,7 @@ fill_default_server_options(ServerOptions *options) | |||
257 | if (use_privsep == -1) | 257 | if (use_privsep == -1) |
258 | use_privsep = 1; | 258 | use_privsep = 1; |
259 | 259 | ||
260 | #if !defined(HAVE_MMAP) || !defined(MAP_ANON) | 260 | #if !defined(HAVE_MMAP_ANON_SHARED) |
261 | if (use_privsep && options->compression == 1) { | 261 | if (use_privsep && options->compression == 1) { |
262 | error("This platform does not support both privilege " | 262 | error("This platform does not support both privilege " |
263 | "separation and compression"); | 263 | "separation and compression"); |