Skip to content

Commit

Permalink
Remove portability support for mmap
Browse files Browse the repository at this point in the history
We no longer need to wrap/replace mmap for portability now that
pre-auth compression has been removed from OpenSSH.
  • Loading branch information
djmdjm committed Sep 28, 2016
1 parent 0082fba commit 1cfd5c0
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 101 deletions.
7 changes: 0 additions & 7 deletions README.privsep
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ More information is available at:
Privilege separation is now enabled by default; see the
UsePrivilegeSeparation option in sshd_config(5).

On systems which lack mmap or anonymous (MAP_ANON) memory mapping,
compression must be disabled in order for privilege separation to
function.

When privsep is enabled, during the pre-authentication phase sshd will
chroot(2) to "/var/empty" and change its privileges to the "sshd" user
and its primary group. sshd is a pseudo-account that should not be
Expand All @@ -35,9 +31,6 @@ privsep user and chroot directory:
--with-privsep-path=xxx Path for privilege separation chroot
--with-privsep-user=user Specify non-privileged user for privilege separation

Privsep requires operating system support for file descriptor passing.
Compression will be disabled on systems without a working mmap MAP_ANON.

PAM-enabled OpenSSH is known to function with privsep on AIX, FreeBSD,
HP-UX (including Trusted Mode), Linux, NetBSD and Solaris.

Expand Down
4 changes: 0 additions & 4 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ Packaging:
([email protected])

PrivSep Issues:
- mmap() issues.
+ /dev/zero solution (Solaris)
+ No/broken MAP_ANON (Irix)
+ broken /dev/zero parse (Linux)
- PAM
+ See above PAM notes
- AIX
Expand Down
2 changes: 0 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,6 @@ mips-sony-bsd|mips-sony-newsos4)

*-*-ultrix*)
AC_DEFINE([BROKEN_GETGROUPS], [1], [getgroups(0,NULL) will return -1])
AC_DEFINE([BROKEN_MMAP], [1], [Ultrix mmap can't map files])
AC_DEFINE([NEED_SETPGRP])
AC_DEFINE([HAVE_SYS_SYSLOG_H], [1], [Force use of sys/syslog.h on Ultrix])
;;
Expand Down Expand Up @@ -1708,7 +1707,6 @@ AC_CHECK_FUNCS([ \
memmove \
memset_s \
mkdtemp \
mmap \
ngetaddrinfo \
nsleep \
ogetaddrinfo \
Expand Down
2 changes: 1 addition & 1 deletion openbsd-compat/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ LDFLAGS=-L. @LDFLAGS@

OPENBSD=base64.o basename.o bcrypt_pbkdf.o bindresvport.o blowfish.o daemon.o dirname.o fmt_scaled.o getcwd.o getgrouplist.o getopt_long.o getrrsetbyname.o glob.o inet_aton.o inet_ntoa.o inet_ntop.o mktemp.o pwcache.o readpassphrase.o reallocarray.o realpath.o rresvport.o setenv.o setproctitle.o sha1.o sha2.o rmd160.o md5.o sigact.o strlcat.o strlcpy.o strmode.o strnlen.o strptime.o strsep.o strtonum.o strtoll.o strtoul.o strtoull.o timingsafe_bcmp.o vis.o blowfish.o bcrypt_pbkdf.o explicit_bzero.o

COMPAT=arc4random.o bsd-asprintf.o bsd-closefrom.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o getrrsetbyname-ldns.o bsd-err.o bsd-misc.o bsd-nextstep.o bsd-openpty.o bsd-poll.o bsd-setres_id.o bsd-snprintf.o bsd-statvfs.o bsd-waitpid.o fake-rfc2553.o openssl-compat.o xmmap.o xcrypt.o kludge-fd_set.o
COMPAT=arc4random.o bsd-asprintf.o bsd-closefrom.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o getrrsetbyname-ldns.o bsd-err.o bsd-misc.o bsd-nextstep.o bsd-openpty.o bsd-poll.o bsd-setres_id.o bsd-snprintf.o bsd-statvfs.o bsd-waitpid.o fake-rfc2553.o openssl-compat.o xcrypt.o kludge-fd_set.o

PORTS=port-aix.o port-irix.o port-linux.o port-solaris.o port-tun.o port-uw.o

Expand Down
1 change: 0 additions & 1 deletion openbsd-compat/openbsd-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ int bcrypt_pbkdf(const char *, size_t, const u_int8_t *, size_t,
void explicit_bzero(void *p, size_t n);
#endif

void *xmmap(size_t size);
char *xcrypt(const char *password, const char *salt);
char *shadow_pw(struct passwd *pw);

Expand Down
86 changes: 0 additions & 86 deletions openbsd-compat/xmmap.c

This file was deleted.

0 comments on commit 1cfd5c0

Please sign in to comment.