summaryrefslogtreecommitdiffstats
path: root/sshd.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-11-17 17:29:08 +1100
committerDamien Miller <djm@mindrot.org>1999-11-17 17:29:08 +1100
commit10f6f6ba9ee14d306f8780edee8a10640c1643e0 (patch)
tree859600c705d582b147162d73746cb2f39b59ed58 /sshd.c
parentd743bba481056ba3d1c229c18fd42c6bdc3f8d74 (diff)
- Merged OpenBSD CVS changes
- [ChangeLog.Ylonen] noone needs this anymore - [authfd.c] close-on-exec for auth-socket, ok deraadt - [hostfile.c] in known_hosts key lookup the entry for the bits does not need to match, all the information is contained in n and e. This solves the problem with buggy servers announcing the wrong modulus length. markus and me. - [serverloop.c] bugfix: check for space if child has terminated, from: iedowse@maths.tcd.ie - [ssh-add.1 ssh-add.c ssh-keygen.1 ssh-keygen.c sshconnect.c] [fingerprint.c fingerprint.h] rsa key fingerprints, idea from Bjoern Groenvall <bg@sics.se> - [ssh-agent.1] typo - [ssh.1] add OpenSSH information to AUTHOR section. okay markus@ - [sshd.c] force logging to stderr while loading private key file (lost while converting to new log-levels)
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/sshd.c b/sshd.c
index a0825284..a40324cb 100644
--- a/sshd.c
+++ b/sshd.c
@@ -18,7 +18,7 @@ agent connections.
*/
#include "includes.h"
-RCSID("$Id: sshd.c,v 1.21 1999/11/16 02:37:17 damien Exp $");
+RCSID("$Id: sshd.c,v 1.22 1999/11/17 06:29:08 damien Exp $");
#include "xmalloc.h"
#include "rsa.h"
@@ -486,35 +486,29 @@ main(int ac, char **av)
exit(1);
}
- /* Initialize the log (it is reinitialized below in case we forked). */
-
- if (debug_flag && !inetd_flag)
- log_stderr = 1;
-
- log_init(av0, options.log_level, options.log_facility, log_stderr);
+ /* Force logging to stderr while loading the private host key
+ unless started from inetd */
+ log_init(av0, options.log_level, options.log_facility, !inetd_flag);
debug("sshd version %.100s", SSH_VERSION);
sensitive_data.host_key = RSA_new();
+ errno = 0;
/* Load the host key. It must have empty passphrase. */
if (!load_private_key(options.host_key_file, "",
sensitive_data.host_key, &comment))
{
- if (debug_flag)
- fprintf(stderr, "Could not load host key: %s: %s\n",
- options.host_key_file, strerror(errno));
- else
- {
- int err = errno;
- /* force logging */
- log_init(av0, SYSLOG_LEVEL_DEBUG, options.log_facility, log_stderr);
- error("Could not load host key: %.200s: %.100s",
- options.host_key_file, strerror(err));
- }
+ error("Could not load host key: %.200s: %.100s",
+ options.host_key_file, strerror(errno));
exit(1);
}
xfree(comment);
+ /* Initialize the log (it is reinitialized below in case we forked). */
+ if (debug_flag && !inetd_flag)
+ log_stderr = 1;
+ log_init(av0, options.log_level, options.log_facility, log_stderr);
+
/* If not in debugging mode, and not started from inetd, disconnect from
the controlling terminal, and fork. The original process exits. */
if (!debug_flag && !inetd_flag)