summaryrefslogtreecommitdiff
path: root/openbsd-compat
AgeCommit message (Collapse)Author
2019-12-11Check if memmem is declared in system headers.Darren Tucker
If the system (or one of the dependencies) implements memmem but does not define the header, we would not declare it either resulting in compiler warnings. Check for declaration explicitly. bz#3102.
2019-11-29compile sk-dummy.so with no-PIE version of LDFLAGSDamien Miller
This lets it pick up the -L path to libcrypto for example.
2019-11-29(yet) another x-platform fix for sk-dummy.soDamien Miller
Check for -fPIC support from compiler Compile libopenbsd-compat -fPIC Don't mix -fPIE and -fPIC when compiling
2019-11-15upstream commitDamien Miller
revision 1.48 date: 2019/02/04 16:45:40; author: millert; state: Exp; lines: +16 -17; commitid: cpNtVC7erojNyctw; Make gl_pathc, gl_matchc and gl_offs size_t in glob_t to match POSIX. This requires a libc major version bump. OK deraadt@
2019-11-15upstream commitDamien Miller
revision 1.47 date: 2017/05/08 14:53:27; author: millert; state: Exp; lines: +34 -21; commitid: sYfxfyUHAfarP8sE; Fix exponential CPU use with repeated '*' operators by changing '*' handling to be interative instead of recursive. Fix by Yves Orton, ported to OpenBSD glob.c by Ray Lai. OK tb@
2019-11-15upstream commitDamien Miller
revision 1.46 date: 2015/12/28 22:08:18; author: mmcc; state: Exp; lines: +5 -9; commitid: 0uXuF2O13NH9q2e1; Remove NULL-checks before free() and a few related dead assignments. ok and valuable input from millert@
2019-11-15upstream commitDamien Miller
revision 1.44 date: 2015/09/14 16:09:13; author: tedu; state: Exp; lines: +3 -5; commitid: iWfSX2BIn0sLw62l; remove null check before free. from Michael McConville ok semarie
2019-11-15upstream commitDamien Miller
revision 1.43 date: 2015/06/13 16:57:04; author: deraadt; state: Exp; lines: +4 -4; commitid: zOUKuqWBdOPOz1SZ; in glob() initialize the glob_t before the first failure check. from j@pureftpd.org ok millert stsp
2019-11-15upstream commitDamien Miller
revision 1.42 date: 2015/02/05 12:59:57; author: millert; state: Exp; lines: +2 -1; commitid: DTQbfd4poqBW8iSJ; Include stdint.h, not limits.h to get SIZE_MAX. OK guenther@
2019-11-15upstream commitDamien Miller
revision 1.41 date: 2014/10/08 05:35:27; author: deraadt; state: Exp; lines: +3 -3; commitid: JwTGarRLHQKDgPh2; obvious realloc -> reallocarray conversion
2019-11-15upstream commitDamien Miller
revision 1.40 date: 2013/09/30 12:02:34; author: millert; state: Exp; lines: +14 -15; Use PATH_MAX, NAME_MAX and LOGIN_NAME_MAX not MAXPATHNAMELEN, MAXNAMLEN or MAXLOGNAME where possible. OK deraadt@
2019-11-15upstream commitDamien Miller
revision 1.39 date: 2012/01/20 07:09:42; author: tedu; state: Exp; lines: +4 -4; the glob stat limit is way too low. bump to 2048. while here, failed stats should count against the limit too. ok deraadt sthen stsp
2019-11-13Put headers inside ifdef _AIX.Darren Tucker
Prevents compile errors due to missing definitions (eg va_list) on non-AIX platforms.
2019-11-02Define __BSD_VISIBLE in fnmatch.h.Darren Tucker
.. since we use symbols defined only when it is when using the compat fnmatch.
2019-11-01Hook up fnmatch for platforms that don't have it.Darren Tucker
2019-11-01Add missing bracket in realpath macro.Darren Tucker
2019-11-01Import fnmatch.c from OpenBSD.Darren Tucker
2019-11-01Use sftp_realpath if no native realpath.Darren Tucker
2019-11-01Add prototype for localtime_r if needed.Darren Tucker
2019-10-29Add implementation of localtime_r.Darren Tucker
2019-10-28Fix ifdefs to not mask needed bits.Darren Tucker
2019-10-28Make sure we have struct statfs before using.Darren Tucker
2019-10-28Move utimensat definition into timespec section.Darren Tucker
Since utimensat uses struct timespec, move it to the section where we define struct timespec when needed.
2019-10-11Re-add SA_RESTART to mysignal.Darren Tucker
This makes mysignal implement reliable BSD semantics according to Stevens' APUE. This was first attempted in 2001 but was reverted due to problems with HP-UX 10.20 and select() and possibly grantpt(). Modern systems should be fine with it, but if any current platforms have a problem with it now we can disable it just for those. ok djm@
2019-10-10Fix ifdef typo for declaration of memmem.Darren Tucker
Fixes build on IRIX. bz#3081.
2019-10-09Make MAKE_CLONE no-op macro more correct.Darren Tucker
Similar to the previous change to DEF_WEAK, some compilers don't like the empty statement, so convert into a no-op function prototype.
2019-10-08avoid "return (value)" in void-declared functionDamien Miller
spotted by Tim Rice; ok dtucker
2019-09-30Include stdio.h for snprintf.Darren Tucker
Patch from vapier@gentoo.org.
2019-09-02fixed test in OSX closefrom() replacementDamien Miller
from likan_999.student AT sina.com
2019-09-02retain Solaris PRIV_FILE_LINK_ANY in sftp-serverDamien Miller
Dropping this privilege removes the ability to create hard links to files owned by other users. This is required for the legacy sftp rename operation. bz#3036; approach ok Alex Wilson (the original author of the Solaris sandbox/pledge replacement code)
2019-08-30proc_pidinfo()-based closefrom() for OS XDamien Miller
Refactor closefrom() to use a single brute-force close() loop fallback. Based on patch from likan_999.student@sina.com in bz#3049. ok dtucker@
2019-08-24Fix pasto in fallback code.Darren Tucker
There is no parameter called "pathname", it should simply be "path". bz#3059, patch from samuel at cendio.se.
2019-08-05Fix mem leak in unit test.Darren Tucker
Patch from jitendra.sharma at intel.com.
2019-07-23upstream rev 1.28: fix comment typo.Darren Tucker
2019-07-23Remove sys/cdefs.h include.Darren Tucker
It's not needed on -portable (that's handled by includes.h) and not all platforms have it.
2019-07-23Re-apply portability changes to current sha2.{c,h}.Darren Tucker
Rather than attempt to apply 14 years' worth of changes to OpenBSD's sha2 I imported the current versions directly then re-applied the portability changes. This also allowed re-syncing digest-libc.c against upstream.
2019-07-23Import current sha2.c and sha2.h from OpenBSD.Darren Tucker
These are not changed from their original state, the next commit will re-apply the portable changes.
2019-07-19fix SIGWINCH delivery of Solaris for mux sessionsDamien Miller
Remove PRIV_PROC_SESSION which was limiting ability to send SIGWINCH signals to other sessions. bz#3030; report and fix from Darren Moffat
2019-07-19Fix format string integer type in error message.Darren Tucker
2019-07-16Hook memmem compat code into build.Darren Tucker
This fixes builds on platforms that don't have it (at least old DragonFly, probably others).
2019-07-16Import memmem.c from OpenBSD.Darren Tucker
2019-07-08Move log.h include inside ifdefs.Darren Tucker
Fixes build on some other platforms that don't have va_list immediately available (eg NetBSD).
2019-07-08Include log.h for debug() and friends.Darren Tucker
Should fix some compiler warnings on IRIX (bz#3032).
2019-07-08remove realpath() compat replacementDamien Miller
We shipped a BSD implementation of realpath() because sftp-server depended on its behaviour. OpenBSD is now moving to a more strictly POSIX-compliant realpath(2), so sftp-server now unconditionally requires its own BSD-style realpath implementation. As such, there is no need to carry another independant implementation in openbsd-compat. ok dtucker@
2019-07-06Add prototype for strnlen to prevent warnings.Darren Tucker
2019-07-06Cast *ID types to unsigned long when printing.Darren Tucker
UID and GID types vary by platform so cast to u_long and use %lu when printing them to prevent warnings.
2019-07-06Add prototype for compat strndup.(bz#3032).Darren Tucker
2019-06-16Include stdio.h for vsnprintf.Darren Tucker
Patch from mforney at mforney.org.
2019-06-14upstream rev 1.27: fix integer overflow.Darren Tucker
Cast bitcount to u_in64_t before bit shifting to prevent integer overflow on 32bit platforms which cause incorrect results when adding a block >=512M in size. sha1 patch from ante84 at gmail.com via openssh github, sha2 with djm@, ok tedu@
2019-06-14upstream rev 1.25: add DEF_WEAK.Darren Tucker
Wrap blowfish, sha*, md5, and rmd160 so that internal calls go direct ok deraadt@