Commit Graph

735 Commits

Author SHA1 Message Date
Damien Miller
08300c2114 unbreak compilation with --with-ssl-engine
Missing last argument to OPENSSL_init_crypto()
2018-10-17 08:12:02 +11:00
Damien Miller
4e23deefd7 Avoid deprecated OPENSSL_config when using 1.1.x
OpenSSL 1.1.x soft-deprecated OPENSSL_config in favour of
OPENSSL_init_crypto; pointed out by Jakub Jelen
2018-10-16 10:54:37 +11:00
Darren Tucker
797cdd9c84 Don't avoid our *sprintf replacements.
Don't let systems with broken printf(3) avoid our replacements
via asprintf(3)/vasprintf(3) calling libc internally.  From djm@
2018-10-12 16:58:47 +11:00
Damien Miller
fe8e8f349a check for NULL return from shadow_pw()
probably unreachable on this platform; pointed out by
coolbugcheckers AT gmail.com
2018-10-11 11:03:54 +11:00
Damien Miller
d1d301a1dd in pick_salt() avoid dereference of NULL passwords
Apparently some NIS implementations can leave pw->pw_passwd (or the
shadow equivalent) NULL.

bz#2909; based on patch from Todd Eigenschink
2018-10-10 14:57:00 +11:00
Darren Tucker
c2fa53cd64 Remove unused variable in _ssh_compat_fflush. 2018-09-22 14:41:24 +10:00
Damien Miller
48f54b9d12 adapt -portable to OpenSSL 1.1x API
Polyfill missing API with replacement functions extracted from LibreSSL
2018-09-13 12:13:50 +10:00
Darren Tucker
039bf2a817 Initial len for the fmt=NULL case.
Patch from jjelen at redhat via bz#2687.  (OpenSSH never calls
setproctitle with a null format so len is always initialized).
2018-09-07 14:06:57 +10:00
Darren Tucker
ea9c06e11d Include stdlib.h.
Patch from jjelen at redhat via bz#2687.
2018-09-07 14:01:39 +10:00
Tim Rice
bc44ee088a modified: openbsd-compat/port-uw.c
remove obsolete and un-needed include
2018-08-21 08:57:24 -07:00
Corinna Vinschen
b0917945ef cygwin: add missing stdarg.h include
Further header file standarization in Cygwin uncovered a lazy
indirect include in bsd-cygwin_util.c

Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
2018-08-13 13:01:18 -07:00
Damien Miller
e36a5f61b0 Some AIX fixes; report from Michael Felt 2018-08-11 18:08:45 -07:00
Damien Miller
4492e2ec4e correct snprintf truncation check in closefrom()
Truncation cannot happen unless the system has set PATH_MAX to some
nonsensically low value.

bz#2862, patch from Daniel Le
2018-07-27 14:20:09 +10:00
Darren Tucker
61cc0003eb Undef a few new macros in sys-queue.h.
Prevents macro redefinition warnings on OSX.
2018-07-14 16:49:01 +10:00
markus@openbsd.org
5467fbcb09 upstream: remove legacy key emulation layer; ok djm@
OpenBSD-Commit-ID: 2b1f9619259e222bbd4fe9a8d3a0973eafb9dd8d
2018-07-12 13:18:25 +10:00
Darren Tucker
1c688801e9 Include stdlib.h for declaration of free.
Fixes build with -Werror on at least Fedora and probably others.
2018-07-11 12:14:09 +10:00
Damien Miller
120a1ec74e Adapt portable to legacy buffer API removal 2018-07-10 19:39:52 +10:00
Darren Tucker
872517ddbb Defer setting bufsiz in getdelim.
Do not write to bufsiz until we are sure the malloc has succeeded,
in case any callers rely on it (which they shouldn't).  ok djm@
2018-07-06 13:32:02 +10:00
Darren Tucker
6301e6c787 Add implementation of getline.
Add getline for the benefit of platforms that don't have it.  Sourced
from NetBSD (OpenBSD's implementation is a little too chummy with the
internals of FILE).
2018-07-02 21:36:31 +10:00
Damien Miller
32e4e94e15 sync fmt_scaled.c
revision 1.17
date: 2018/05/14 04:39:04;  author: djm;  state: Exp;  lines: +5 -2;
commitid: 53zY8GjViUBnWo8Z;
constrain fractional part to [0-9] (less confusing to static analysis); ok ian@
2018-05-14 14:40:08 +10:00
Darren Tucker
7c15301841 Use includes.h instead of config.h.
This ensures it picks up the definition of DEF_WEAK, the lack of which
can cause compile errors in some cases (eg modern AIX).  From
michael at felt.demon.nl.
2018-04-29 17:54:12 +10:00
Damien Miller
cfb1d9bc76 Fix tunnel forwarding broken in 7.7p1
bz2855, ok dtucker@
2018-04-13 13:38:06 +10:00
Damien Miller
afa6e79b76 prefer to use getrandom() for PRNG seeding
Only applies when built --without-openssl. Thanks Jann Horn for
reminder.
2018-04-13 13:32:23 +10:00
Damien Miller
10479cc2a4 Many typo fixes from Karsten Weiss
Spotted using https://github.com/lucasdemarchi/codespell
2018-04-10 10:19:02 +10:00
Darren Tucker
2c71ca1dd1 Disable native strndup and strnlen on AIX.
On at least some revisions of AIX, strndup returns unterminated strings
under some conditions, apparently because strnlen returns incorrect
values in those cases.  Disable both on AIX and use the replacements
from openbsd-compat.  Fixes problem with ECDSA keys there, ok djm.
2018-03-30 18:23:07 +11:00
Darren Tucker
6b5a17bc14 Include ssh_api.h for struct ssh.
struct ssh is needed by implementations of sys_auth_passwd() that were
converted in commit bba02a50.  Needed to fix build on AIX, I assume for
the other platforms too (although it should be harmless if not needed).
2018-03-26 13:24:41 +11:00
Darren Tucker
bc3f80e4d1 Remove UNICOS code missed during removal.
Fixes compile error on AIX.
2018-03-26 13:24:28 +11:00
Tim Rice
bba02a5094 modified: auth-sia.c
modified:   openbsd-compat/port-aix.c
	modified:   openbsd-compat/port-uw.c

	propogate changes to auth-passwd.c in commit
	7c85685760 to other providers
	of sys_auth_passwd()
2018-03-25 09:17:33 -07:00
Darren Tucker
58fd4c5c01 Check for and work around buggy fflush(NULL).
Some really old platforms (eg SunOS4) segfault on fflush(NULL) so check
for and work around.  With klausz at haus-gisela.de.
2018-03-05 19:28:08 +11:00
Darren Tucker
33561e68e0 Add strndup for platforms that need it.
Some platforms don't have strndup, which includes Solaris 10, NetBSD 3
and FreeBSD 6.
2018-03-03 14:58:34 +11:00
Darren Tucker
e8a17feba9 Flatten and alphabetize object file lists.
This will make maintenance and changes easier.  "no objection" tim@
2018-03-03 14:58:34 +11:00
Darren Tucker
f0b245b043 Check if HAVE_DECL_BZERO correctly. 2018-02-27 08:51:52 +11:00
Darren Tucker
5aea4aa522 typo: missing ; 2018-02-26 14:39:14 +11:00
Darren Tucker
cd3ab57f9b Hook up flock() compat code.
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-26 14:37:06 +11:00
Darren Tucker
b087998d1b Import flock() compat from NetBSD.
From NetBSD's src/trunk/tools/compat/flock.c, no OpenSSH changes yet.
2018-02-26 14:27:02 +11:00
Damien Miller
bda709b8e1 avoid inclusion of deprecated selinux/flask.h
Use string_to_security_class() instead.
2018-02-26 12:17:22 +11:00
Darren Tucker
c7b5a47e3b Invert sense of getpgrp test.
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-26 00:14:42 +11:00
Darren Tucker
b39593a6de Add no-op getsid implmentation. 2018-02-26 00:09:04 +11:00
Darren Tucker
11057564eb bsd-statvfs: include sys/vfs.h, check for f_flags. 2018-02-26 00:09:04 +11:00
Darren Tucker
e9dede06e5 Handle calloc(0,x) where different from malloc.
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-26 00:09:04 +11:00
Darren Tucker
2eb4041493 Add prototype for readv if needed. 2018-02-26 00:09:04 +11:00
Darren Tucker
6c8c9a615b Check for raise and supply if needed. 2018-02-26 00:09:04 +11:00
Darren Tucker
a9004425a0 Check for bzero and supply if needed.
Since explicit_bzero uses it via an indirect it needs to be a function
not just a macro.
2018-02-26 00:09:04 +11:00
Darren Tucker
f6dc2ba3c9 freezero should check for NULL. 2018-02-16 17:33:29 +11:00
Darren Tucker
265d88d4e6 Remove remaining now-obsolete cvs $Ids. 2018-02-15 20:06:19 +11:00
Darren Tucker
ddc0f38148 Remove UNICOS support.
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-15 20:04:02 +11:00
Darren Tucker
fbfa6f980d Move signal compat code into bsd-signal.{c,h} 2018-02-11 21:24:48 +11:00
Darren Tucker
ba460acae4 Include string.h for explicit_bzero. 2017-11-24 16:24:31 +11:00
Darren Tucker
f21455a084 Include includes.h for HAVE_GETPAGESIZE.
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-31 10:09:33 +11:00
Damien Miller
2de5c6b53b fix rdomain compilation errors 2017-10-27 08:42:33 +11:00