Commit Graph

852 Commits

Author SHA1 Message Date
Darren Tucker c867706507 Add pselect implementation for platforms without.
This is basically the existing notify_pipe kludge from serverloop.c
moved behind a pselect interface.  It works by installing a signal
handler that writes to a pipe that the select is watching, then calls
the original handler.

The select call in serverloop will become pselect soon, at which point the
kludge will be removed from thereand will only exist in the compat layer.
Original code by markus, help from djm.
2021-06-04 18:39:48 +10:00
Darren Tucker eb68e669bc Include login_cap.h for login_getpwclass override.
On minix3, login_getpwclass is __RENAME'ed to __login_getpwclass50 so
without this the include overriding login_getpwclass causes a compile
error.
2021-05-27 21:14:15 +10:00
Darren Tucker a6b4ec94e5 Add OPENBSD ORIGINAL marker. 2021-04-24 17:52:24 +10:00
Darren Tucker 80032102d0 ifdef out MIN and MAX.
In -portable, defines.h ensures that these are defined, so redefining
potentially causes a warning.  We don't just delete it to make any
future code syncs a little but easier.  bz#3293.
2021-04-08 13:25:57 +10:00
Damien Miller 57ed647ee0 polish whitespace for portable files 2021-04-03 17:47:37 +11:00
Darren Tucker 1cd67ee15c Move generic includes outside of ifdef.
This ensures that the macros in log.h are defined in the case where
either of --with-solaris-projects or --with-solaris-privs are used
without --with-solaris-contracts.  bz#3278.
2021-03-12 13:16:10 +11:00
Damien Miller 324449a68d support OpenSSL 3.x cipher IV API change
OpenSSL renamed the "get current CIPHER_CTX" IV operation in 3.x.
This uses the new name if available.

https://github.com/openssl/openssl/issues/13411

bz#3238 ok dtucker@
2021-02-18 12:06:25 +11:00
Damien Miller 845fe9811c prefer login_getpwclass() to login_getclass()
FreeBSD has login_getpwclass() that does some special magic for
UID=0. Prefer this to login_getclass() as its easier to emulate
the former with the latter.

Based on FreeBSD PR 37416 via Ed Maste; ok dtucker@
2021-02-18 11:27:09 +11:00
David Carlier 1cb6ce98d6 Using explicit_memset for the explicit_bzero compatibility layer.
Favoriting the native implementation in this case.
2021-02-05 17:07:03 +11:00
Darren Tucker 0f2e21c9dc Include stdio.h for FILE in misc.h.
Fixes build on at least OpenBSD.
2020-12-22 18:56:54 +11:00
Damien Miller e51dc7fab6 SELinux has deprecated security_context_t
(it was only ever a char* anyway)
2020-11-13 13:46:28 +11:00
Damien Miller 33267feaff Remove checks for strict POSIX mkdtemp()
We needed a mkdtemp() that accepted template paths that did not
end in XXXXXX a long time ago for KRB4, but that code is long
deprecated. We no longer need to replace mkdtemp() for strictly
following POSIX. ok dtucker@
2020-10-27 16:50:38 +11:00
Damien Miller f9ea651520 logging is now macros, remove function pointers 2020-10-17 11:51:20 +11:00
Damien Miller 86cc8ce002 use relative rather than system include here 2020-10-03 13:39:17 +10:00
Darren Tucker 05c215de8d Wrap stdint.h include in ifdef HAVE_STDINT_H. 2020-08-17 21:34:32 +10:00
Damien Miller eaf2765efe sync memmem.c with OpenBSD 2020-08-10 13:24:20 +10:00
Damien Miller 32c63e75a7 wrap a declaration in the same ifdefs as its use
avoids warnings on NetBSD
2020-08-04 14:59:21 +10:00
Damien Miller c9e3be9f4b undef TAILQ_CONCAT and friends
Needed for NetBSD. etc that supply these macros
2020-08-04 14:58:46 +10:00
Damien Miller adfdbf1211 sync sys-queue.h with OpenBSD upstream
needed for TAILQ_CONCAT
2020-07-03 15:15:15 +10:00
Darren Tucker b4556c8ad7 Add OPENBSD ORIGINAL marker to bcrypt_pbkdf. 2020-06-19 19:22:00 +10:00
Darren Tucker 1babb8bb14 Extra brackets around sizeof() in bcrypt.
Prevents following warning from clang 10:
bcrypt_pbkdf.c:94:40: error: expression does not compute the number of
  elements in this array; element type is ´uint32_tÂ[...]
  place parentheses around the ´sizeof(uint64_t)´ expression to
  silence this warning
2020-06-19 19:10:47 +10:00
Darren Tucker 8854724cce Sync rev 1.49.
Prevent infinite for loop since i went from ssize_t to size_t.  Patch from
eagleoflqj via OpenSSH github PR#178, ok djm@, feedback & ok millert@
2020-04-21 18:28:19 +10:00
Damien Miller 931c50c588 fix inverted test for LibreSSL version 2020-04-06 10:04:56 +10:00
Damien Miller abe2b245b3 prefer libcrypto chacha20-poly1305 where possible 2020-04-03 17:26:29 +11:00
Damien Miller 955c4cf4c6 sync fnmatch.c with upstream to fix another typo 2020-03-13 14:30:16 +11:00
Damien Miller 397f217e86 another spelling error in comment 2020-03-13 14:24:23 +11:00
Damien Miller def31bc542 spelling mistakes
from https://fossies.org/linux/misc/openssh-8.2p1.tar.gz/codespell.html
2020-03-13 14:23:07 +11:00
Darren Tucker 31c9348c5e Constify aix_krb5_get_principal_name.
Prevents warning about discarding type qualifiers on AIX.
2020-02-17 22:53:24 +11:00
Darren Tucker 290c994336 Check if TILDE is already defined and undef.
Prevents redefinition warning on AIX.
2020-02-17 22:51:36 +11:00
Darren Tucker 41a2e64ae4 Prevent unused variable warning. 2020-02-17 22:51:00 +11:00
Darren Tucker d4860ec4ef Check if getpeereid is actually declared.
Check in sys/socket.h (AIX) and unistd.h (FreeBSD, DragonFLy and OS X).
Prevents undeclared function warning on at least some versions of AIX.
2020-02-17 22:48:50 +11:00
Michael Forney 9716e8c495 Fix sha2 MAKE_CLONE no-op definition
The point of the dummy declaration is so that MAKE_CLONE(...) can have
a trailing semicolon without introducing an empty declaration. So,
the macro replacement text should *not* have a trailing semicolon,
just like DEF_WEAK.
2020-02-06 11:53:38 +11:00
Darren Tucker 0373f9eba2 Include signal.h to prevent redefintion of _NSIG. 2020-01-26 14:09:17 +11:00
Damien Miller e1e97cae19 include tunnel device path in error message 2020-01-25 16:30:22 +11:00
Darren Tucker 945bf52c3c Fix a couple of mysig_t leftovers. 2020-01-23 21:06:45 +11:00
Darren Tucker 84226b447d Remove mysignal wrapper.
We switched the main code to use sigaction(), so the wrapper is no
longer used.
2020-01-23 18:55:24 +11:00
dtucker@openbsd.org 3bf2a6ac79 upstream: Replace all calls to signal(2) with a wrapper around
sigaction(2). This wrapper blocks all other signals during the handler
preventing races between handlers, and sets SA_RESTART which should reduce
the potential for short read/write operations.

OpenBSD-Commit-ID: 5e047663fd77a40d7b07bdabe68529df51fd2519
2020-01-23 18:51:25 +11:00
Darren Tucker e0cedcad51 Improve search for 'struct timespec'.
Make struct timespec test consistent with existing timeval test.
Include time.h for timespec in compat header where required.
2020-01-14 14:28:01 +11:00
Darren Tucker 26b2675b0c Remove configure test & compat code for ripemd160.
RIPEMD160 support was removed upstream in 2017, however we still had
a configure test and compat code for it, so clean those up now.
2020-01-14 12:05:00 +11:00
Darren Tucker afffd31036 Check if memmem is declared in system headers.
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-12-11 13:22:06 +11:00
Damien Miller 443848155f compile sk-dummy.so with no-PIE version of LDFLAGS
This lets it pick up the -L path to libcrypto for example.
2019-11-29 15:10:21 +11:00
Damien Miller b218055e59 (yet) another x-platform fix for sk-dummy.so
Check for -fPIC support from compiler

Compile libopenbsd-compat -fPIC

Don't mix -fPIE and -fPIC when compiling
2019-11-29 12:32:23 +11:00
Damien Miller fbcb9a7fa5 upstream commit
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-15 16:06:30 +11:00
Damien Miller 2cfb11abac upstream commit
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-15 16:05:07 +11:00
Damien Miller 228dd595c7 upstream commit
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-15 16:04:28 +11:00
Damien Miller a16f748690 upstream commit
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-15 16:02:43 +11:00
Damien Miller fd37cdeafe upstream commit
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-15 16:02:27 +11:00
Damien Miller fd62769c38 upstream commit
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-15 16:01:20 +11:00
Damien Miller 2b6cba7ee2 upstream commit
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-15 16:00:07 +11:00
Damien Miller 19f8ec428d upstream commit
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-15 15:08:28 +11:00