summaryrefslogtreecommitdiff
path: root/openbsd-compat
Commit message (Collapse)AuthorAgeFilesLines
* Also check pid in pselect_notify_setup.Darren Tucker2021-08-201-1/+1
| | | | Spotted by djm@.
* Prefix pselect functions to clarify debug messagesDarren Tucker2021-08-201-14/+14
|
* Fix race in pselect replacement code.Darren Tucker2021-08-201-4/+19
| | | | | | | | | | On the second and subsequent calls to pselect the notify_pipe was not added to the select readset, opening up a race that om G. Christensen discovered on multiprocessor Solaris <=9 systems. Also reinitialize notify_pipe if the pid changes. This will prevent a parent and child from using the same FD, although this is not an issue in the current structure it might be in future.
* openbsd-compat/openbsd-compat.h: put bsd-signal.h before bsd-misc.hTim Rice2021-08-141-1/+1
| | | | to get sigset_t from signal.h needed for the pselect replacement.
* Add includes.h to compat tests.Darren Tucker2021-08-117-3/+13
| | | | | | | On platforms where closefrom returns void (eg glibc>=2.34) the prototype for closefrom in its compat tests would cause compile errors. Remove this and have the tests pull in the compat headers in the same way as the main code. bz#3336.
* lastenv is only used in setenv.Darren Tucker2021-07-271-0/+2
| | | | | Prevents an unused variable warning on platforms that have setenv but not unsetenv.
* Fix ifdefs around get_random_bytes_prngd.Darren Tucker2021-07-021-2/+2
| | | | | get_random_bytes_prngd() is used if either of PRNGD_PORT or PRNGD_SOCKET are defined, so adjust ifdef accordingly.
* wrap get_random_bytes_prngd() in ifdefDamien Miller2021-07-021-0/+2
| | | | avoid unused static function warning
* Try EGD/PRNGD if random device fails.Darren Tucker2021-06-181-3/+9
| | | | | When built --without-openssl, try EGD/PRGGD (if configured) as a last resort before failing.
* Split EGD/PRNGD interface into its own file.Darren Tucker2021-06-183-0/+164
| | | | This will allow us to use it when building --without-openssl.
* Handle GIDs > 2^31 in getgrouplist.Darren Tucker2021-06-171-4/+4
| | | | | | When compiled in 32bit mode, the getgrouplist implementation may fail for GIDs greater than LONG_MAX. Analysis and change from ralf.winkel at tui.com.
* Clear notify_pipe from readset if present.Darren Tucker2021-06-041-1/+3
| | | | Prevents leaking an implementation detail to the caller.
* space->tabs.Darren Tucker2021-06-041-83/+83
|
* Add pselect implementation for platforms without.Darren Tucker2021-06-043-0/+194
| | | | | | | | | | | 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.
* Include login_cap.h for login_getpwclass override.Darren Tucker2021-05-271-0/+1
| | | | | | On minix3, login_getpwclass is __RENAME'ed to __login_getpwclass50 so without this the include overriding login_getpwclass causes a compile error.
* Add OPENBSD ORIGINAL marker.Darren Tucker2021-04-241-0/+2
|
* ifdef out MIN and MAX.Darren Tucker2021-04-081-0/+3
| | | | | | 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.
* polish whitespace for portable filesDamien Miller2021-04-0310-19/+19
|
* Move generic includes outside of ifdef.Darren Tucker2021-03-121-4/+4
| | | | | | 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.
* support OpenSSL 3.x cipher IV API changeDamien Miller2021-02-181-0/+4
| | | | | | | | | 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@
* prefer login_getpwclass() to login_getclass()Damien Miller2021-02-181-0/+4
| | | | | | | | 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@
* Using explicit_memset for the explicit_bzero compatibility layer.David Carlier2021-02-051-1/+9
| | | | Favoriting the native implementation in this case.
* Include stdio.h for FILE in misc.h.Darren Tucker2020-12-221-0/+1
| | | | Fixes build on at least OpenBSD.
* SELinux has deprecated security_context_tDamien Miller2020-11-131-9/+6
| | | | (it was only ever a char* anyway)
* Remove checks for strict POSIX mkdtemp()Damien Miller2020-10-272-3/+3
| | | | | | | 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@
* logging is now macros, remove function pointersDamien Miller2020-10-171-5/+5
|
* use relative rather than system include hereDamien Miller2020-10-031-1/+1
|
* Wrap stdint.h include in ifdef HAVE_STDINT_H.Darren Tucker2020-08-171-0/+2
|
* sync memmem.c with OpenBSDDamien Miller2020-08-101-47/+167
|
* wrap a declaration in the same ifdefs as its useDamien Miller2020-08-041-2/+5
| | | | avoids warnings on NetBSD
* undef TAILQ_CONCAT and friendsDamien Miller2020-08-041-56/+59
| | | | Needed for NetBSD. etc that supply these macros
* sync sys-queue.h with OpenBSD upstreamDamien Miller2020-07-031-147/+113
| | | | needed for TAILQ_CONCAT
* Add OPENBSD ORIGINAL marker to bcrypt_pbkdf.Darren Tucker2020-06-191-0/+2
|
* Extra brackets around sizeof() in bcrypt.Darren Tucker2020-06-191-1/+1
| | | | | | | | 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
* Sync rev 1.49.Darren Tucker2020-04-211-3/+3
| | | | | 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@
* fix inverted test for LibreSSL versionDamien Miller2020-04-061-1/+1
|
* prefer libcrypto chacha20-poly1305 where possibleDamien Miller2020-04-031-0/+6
|
* sync fnmatch.c with upstream to fix another typoDamien Miller2020-03-131-2/+2
|
* another spelling error in commentDamien Miller2020-03-131-1/+1
|
* spelling mistakesDamien Miller2020-03-131-1/+1
| | | | from https://fossies.org/linux/misc/openssh-8.2p1.tar.gz/codespell.html
* Constify aix_krb5_get_principal_name.Darren Tucker2020-02-172-5/+7
| | | | Prevents warning about discarding type qualifiers on AIX.
* Check if TILDE is already defined and undef.Darren Tucker2020-02-171-0/+4
| | | | Prevents redefinition warning on AIX.
* Prevent unused variable warning.Darren Tucker2020-02-171-0/+2
|
* Check if getpeereid is actually declared.Darren Tucker2020-02-171-1/+1
| | | | | 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.
* Fix sha2 MAKE_CLONE no-op definitionMichael Forney2020-02-061-1/+1
| | | | | | | 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.
* Include signal.h to prevent redefintion of _NSIG.Darren Tucker2020-01-261-0/+2
|
* include tunnel device path in error messageDamien Miller2020-01-251-4/+4
|
* Fix a couple of mysig_t leftovers.Darren Tucker2020-01-231-1/+3
|
* Remove mysignal wrapper.Darren Tucker2020-01-232-38/+0
| | | | | We switched the main code to use sigaction(), so the wrapper is no longer used.
* upstream: Replace all calls to signal(2) with a wrapper arounddtucker@openbsd.org2020-01-231-2/+2
| | | | | | | | 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