summaryrefslogtreecommitdiff
path: root/openbsd-compat
AgeCommit message (Collapse)Author
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.
2016-10-13Import rev 1.24 from OpenBSD.Darren Tucker
revision 1.24 date: 2013/11/24 23:51:29; author: deraadt; state: Exp; lines: +4 -4; most obvious unsigned char casts for ctype ok jca krw ingo
2016-10-13Import rev 1.23 from OpenBSD. Fixes bz#2619.Darren Tucker
revision 1.23 date: 2010/05/14 13:30:34; author: millert; state: Exp; lines: +41 -39; Defer installing signal handlers until echo is disabled so that we get suspended normally when not the foreground process. Fix potential infinite loop when restoring terminal settings if process is in the background when restore occurs. OK miod@
2016-10-13If we don't have TCSASOFT, define it to zero.Darren Tucker
This makes it a no-op when we use it below, which allows us to re-sync those lines with the upstream and make future updates easier.
2016-09-29Remove portability support for mmapDamien Miller
We no longer need to wrap/replace mmap for portability now that pre-auth compression has been removed from OpenSSH.
2016-08-17Remove obsolete CVS $Id from source files.Darren Tucker
Since -portable switched to git the CVS $Id tags are no longer being updated and are becoming increasingly misleading. Remove them.
2016-08-16fix false positives when compiled with msanDamien Miller
Our explicit_bzero successfully confused clang -fsanitize-memory in to thinking that memset is never called to initialise memory. Ensure that it is called in a way that the compiler recognises.
2016-08-02Replace spaces with tabs.Darren Tucker
Mechanically replace spaces with tabs in compat files not synced with OpenBSD.
2016-08-02Strip trailing whitespace.Darren Tucker
Mechanically strip trailing whitespace on files not synced with OpenBSD (or in the case of bsd-snprint.c, rsync).
2016-08-02Repair $OpenBSD markers.Darren Tucker
2016-08-02Repair $OpenBSD marker.Darren Tucker