summaryrefslogtreecommitdiff
path: root/openbsd-compat
AgeCommit message (Collapse)Author
2018-03-05Check for and work around buggy fflush(NULL).Darren Tucker
Some really old platforms (eg SunOS4) segfault on fflush(NULL) so check for and work around. With klausz at haus-gisela.de.
2018-03-03Add strndup for platforms that need it.Darren Tucker
Some platforms don't have strndup, which includes Solaris 10, NetBSD 3 and FreeBSD 6.
2018-03-03Flatten and alphabetize object file lists.Darren Tucker
This will make maintenance and changes easier. "no objection" tim@
2018-02-27Check if HAVE_DECL_BZERO correctly.Darren Tucker
2018-02-26typo: missing ;Darren Tucker
2018-02-26Hook up flock() compat code.Darren Tucker
Also a couple of minor changes: fail if we can't lock instead of silently succeeding, and apply a couple of minor style fixes.
2018-02-26Import flock() compat from NetBSD.Darren Tucker
From NetBSD's src/trunk/tools/compat/flock.c, no OpenSSH changes yet.
2018-02-26avoid inclusion of deprecated selinux/flask.hDamien Miller
Use string_to_security_class() instead.
2018-02-26Invert sense of getpgrp test.Darren Tucker
AC_FUNC_GETPGRP tests if getpgrp(0) works, which it does if it's not declared. Instead, test if the zero-arg version we want to use works.
2018-02-26Add no-op getsid implmentation.Darren Tucker
2018-02-26bsd-statvfs: include sys/vfs.h, check for f_flags.Darren Tucker
2018-02-26Handle calloc(0,x) where different from malloc.Darren Tucker
Configure assumes that if malloc(0) returns null then calloc(0,n) also does. On some old platforms (SunOS4) malloc behaves as expected (as determined by AC_FUNC_MALLOC) but calloc doesn't. Test for this at configure time and activate the replacement function if found, plus handle this case in rpl_calloc.
2018-02-26Add prototype for readv if needed.Darren Tucker
2018-02-26Check for raise and supply if needed.Darren Tucker
2018-02-26Check for bzero and supply if needed.Darren Tucker
Since explicit_bzero uses it via an indirect it needs to be a function not just a macro.
2018-02-16freezero should check for NULL.Darren Tucker
2018-02-15Remove remaining now-obsolete cvs $Ids.Darren Tucker
2018-02-15Remove UNICOS support.Darren Tucker
The code required to support it is quite invasive to the mainline code that is synced with upstream and is an ongoing maintenance burden. Both the hardware and software are literal museum pieces these days and we could not find anyone still running OpenSSH on one.
2018-02-11Move signal compat code into bsd-signal.{c,h}Darren Tucker
2017-11-24Include string.h for explicit_bzero.Darren Tucker
2017-10-31Include includes.h for HAVE_GETPAGESIZE.Darren Tucker
The configure script checks for getpagesize() and sets HAVE_GETPAGESIZE in config.h, but bsd-getpagesize.c forgot to include includes.h (which indirectly includes config.h) so the checks always fails, causing linker issues when linking statically on systems with getpagesize(). Patch from Peter Korsgaard <peter at korsgaard.com>
2017-10-27fix rdomain compilation errorsDamien Miller
2017-10-25basic valid_rdomain() implementation for LinuxDamien Miller
2017-10-25implement get/set_rdomain() for LinuxDamien Miller
Not enabled, pending implementation of valid_rdomain() and autoconf glue
2017-10-25stubs for rdomain replacement functionsDamien Miller
2017-10-25rename port-tun.[ch] => port-net.[ch]Damien Miller
Ahead of adding rdomain support
2017-10-23upstream commitdjm@openbsd.org
Expose devices allocated for tun/tap forwarding. At the client, the device may be obtained from a new %T expansion for LocalCommand. At the server, the allocated devices will be listed in a SSH_TUNNEL variable exposed to the environment of any user sessions started after the tunnel forwarding was established. ok markus Upstream-ID: e61e53f8ae80566e9ddc0d67a5df5bdf2f3c9f9e
2017-09-27Check for and handle calloc(p, 0) = NULL.Darren Tucker
On some platforms (AIX, maybe others) allocating zero bytes of memory via the various *alloc functions returns NULL, which is permitted by the standards. Autoconf has some macros for detecting this (with the exception of calloc for some reason) so use these and if necessary activate shims for them. ok djm@
2017-09-25Add minimal strsignal for platforms without it.Darren Tucker
2017-09-19add freezero(3) replacementDamien Miller
ok dtucker@
2017-09-12adapt portable to channels API changesDamien Miller
2017-08-27Add missing includes for bsd-err.c.Darren Tucker
Patch from cjwatson at debian.org via bz#2767.
2017-07-28fix problems in tunnel forwarding portability codeDamien Miller
This fixes a few problems in the tun forwarding code, mostly to do with host/network byte order confusion. Based on a report and patch by stepe AT centaurus.uberspace.de; bz#2735; ok dtucker@
2017-07-14make explicit_bzero/memset safe for sz=0Damien Miller
2017-06-09Wrap stdint.h include in #ifdef.Darren Tucker
2017-06-01avoid compiler warningDamien Miller
2017-06-01add recallocarray replacement and dependencyDamien Miller
recallocarray() needs getpagesize() so add a tiny replacement for that.
2017-03-29Import fmt_scaled.c rev 1.16 from OpenBSD.Darren Tucker
Fix overly-conservative overflow checks on mulitplications and add checks on additions. This allows scan_scaled to work up to +/-LLONG_MAX (LLONG_MIN will still be flagged as a range error). ok millert@
2017-03-29Import fmt_scaled.c rev 1.15 from OpenBSD.Darren Tucker
Collapse underflow and overflow checks into a single block. ok djm@ millert@
2017-03-29Import fmt_scaled.c rev 1.14 from OpenBSD.Darren Tucker
Catch integer underflow in scan_scaled reported by Nicolas Iooss. ok deraadt@ djm@
2017-03-20Add llabs() implementation.Darren Tucker
2017-03-12sync fmt_scaled.c with OpenBSDDamien Miller
revision 1.13 date: 2017/03/11 23:37:23; author: djm; state: Exp; lines: +14 -1; commitid: jnFKyHkB3CEiEZ2R; fix signed integer overflow in scan_scaled. Found by Nicolas Iooss using AFL against ssh_config. ok deraadt@ millert@ ---------------------------- revision 1.12 date: 2013/11/29 19:00:51; author: deraadt; state: Exp; lines: +6 -5; fairly simple unsigned char casts for ctype ok krw ---------------------------- revision 1.11 date: 2012/11/12 14:07:20; author: halex; state: Exp; lines: +4 -2; make scan_scaled set errno to EINVAL rather than ERANGE if it encounters an invalid multiplier, like the man page says it should "looks sensible" deraadt@, ok ian@ ---------------------------- revision 1.10 date: 2009/06/20 15:00:04; author: martynas; state: Exp; lines: +4 -4; use llabs instead of the home-grown version; and some comment changes ok ian@, millert@ ----------------------------
2016-12-13Remove commented-out includes.Darren Tucker
These commented-out includes have "Still needed?" comments. Since they've been commented out for ~13 years I assert that they're not.
2016-12-13Add prototype for strcasestr in compat library.Darren Tucker
2016-12-13Add strcasestr to compat library.Darren Tucker
Fixes build on (at least) Solaris 10.
2016-10-28Move OPENSSL_NO_RIPEMD160 to compat.Darren Tucker
Move OPENSSL_NO_RIPEMD160 to compat and add ifdefs to mac.c around the ripemd160 MACs.
2016-10-26Use !=NULL instead of >0 for getdefaultproj.Darren Tucker
getdefaultproj() returns a pointer so test it for NULL inequality instead of >0. Fixes compiler warning and is more correct. Patch from David Binderman.
2016-10-19Import readpassphrase.c rev 1.26.Darren Tucker
Author: miller@openbsd.org: Avoid generate SIGTTOU when restoring the terminal mode. If we get SIGTTOU it means the process is not in the foreground process group which, in most cases, means that the shell has taken control of the tty. Requiring the user the fg the process in this case doesn't make sense and can result in both SIGTSTP and SIGTTOU being sent which can lead to the process being suspended again immediately after being brought into the foreground.
2016-10-19Import readpassphrase.c rev 1.25.Darren Tucker
Wrap <readpassphrase.h> so internal calls go direct and readpassphrase is weak. (DEF_WEAK is a no-op in portable.)
2016-10-15Move DEF_WEAK into defines.h.Darren Tucker
As well pull in more recent changes from OpenBSD these will start to arrive so put it where the definition is shared.