summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-09-12 18:32:20 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-09-12 18:32:20 +0000
commitedc0cf26d11d708320ade92e066d4f3e84e20112 (patch)
tree88abb6fc3997b9b090bebd2e1f04676086e8b24e
parent7d199962015ad042208beb54cf4a8fb72053f468 (diff)
- stevesk@cvs.openbsd.org 2001/09/03 20:58:33
[readconf.c readconf.h ssh.c] fatal() for nonexistent -Fssh_config. ok markus@
-rw-r--r--ChangeLog9
-rw-r--r--readconf.c9
-rw-r--r--readconf.h4
-rw-r--r--ssh.c10
4 files changed, 19 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 8b9aa4dc..dcf3ed76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -75,8 +75,11 @@
do not pass pointers to longjmp; fix from wayne@blorf.net
- markus@cvs.openbsd.org 2001/08/31 11:46:39
[sshconnect2.c]
- disable kbd-interactive if we don't get
- SSH2_MSG_USERAUTH_INFO_REQUEST messages
+ disable kbd-interactive if we don't get SSH2_MSG_USERAUTH_INFO_REQUEST
+ messages
+ - stevesk@cvs.openbsd.org 2001/09/03 20:58:33
+ [readconf.c readconf.h ssh.c]
+ fatal() for nonexistent -Fssh_config. ok markus@
20010815
- (bal) Fixed stray code in readconf.c that went in by mistake.
@@ -6400,4 +6403,4 @@
- Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1
-$Id: ChangeLog,v 1.1507 2001/09/12 18:29:00 mouring Exp $
+$Id: ChangeLog,v 1.1508 2001/09/12 18:32:20 mouring Exp $
diff --git a/readconf.c b/readconf.c
index 04895be6..6a426ae0 100644
--- a/readconf.c
+++ b/readconf.c
@@ -12,7 +12,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: readconf.c,v 1.88 2001/08/30 16:04:35 stevesk Exp $");
+RCSID("$OpenBSD: readconf.c,v 1.89 2001/09/03 20:58:33 stevesk Exp $");
#include "ssh.h"
#include "xmalloc.h"
@@ -670,10 +670,10 @@ parse_int:
/*
* Reads the config file and modifies the options accordingly. Options
* should already be initialized before this call. This never returns if
- * there is an error. If the file does not exist, this returns immediately.
+ * there is an error. If the file does not exist, this returns 0.
*/
-void
+int
read_config_file(const char *filename, const char *host, Options *options)
{
FILE *f;
@@ -684,7 +684,7 @@ read_config_file(const char *filename, const char *host, Options *options)
/* Open the file. */
f = fopen(filename, "r");
if (!f)
- return;
+ return 0;
debug("Reading configuration data %.200s", filename);
@@ -704,6 +704,7 @@ read_config_file(const char *filename, const char *host, Options *options)
if (bad_options > 0)
fatal("%s: terminating, %d bad configuration options",
filename, bad_options);
+ return 1;
}
/*
diff --git a/readconf.h b/readconf.h
index 802fd190..faeef1db 100644
--- a/readconf.h
+++ b/readconf.h
@@ -11,7 +11,7 @@
* called by a name other than "ssh" or "Secure Shell".
*/
-/* RCSID("$OpenBSD: readconf.h,v 1.37 2001/08/01 22:03:33 markus Exp $"); */
+/* RCSID("$OpenBSD: readconf.h,v 1.38 2001/09/03 20:58:33 stevesk Exp $"); */
#ifndef READCONF_H
#define READCONF_H
@@ -105,7 +105,7 @@ typedef struct {
void initialize_options(Options *);
void fill_default_options(Options *);
-void read_config_file(const char *, const char *, Options *);
+int read_config_file(const char *, const char *, Options *);
int
process_config_line(Options *, const char *, char *, const char *, int, int *);
diff --git a/ssh.c b/ssh.c
index d500e849..9ccd9d8f 100644
--- a/ssh.c
+++ b/ssh.c
@@ -39,7 +39,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: ssh.c,v 1.141 2001/08/29 23:27:23 stevesk Exp $");
+RCSID("$OpenBSD: ssh.c,v 1.142 2001/09/03 20:58:33 stevesk Exp $");
#include <openssl/evp.h>
#include <openssl/err.h>
@@ -622,14 +622,16 @@ again:
* file if the user specifies a config file on the command line.
*/
if (config != NULL) {
- read_config_file(config, host, &options);
+ if (!read_config_file(config, host, &options))
+ fatal("Can't open user config file %.100s: "
+ "%.100s", config, strerror(errno));
} else {
snprintf(buf, sizeof buf, "%.100s/%.100s", pw->pw_dir,
_PATH_SSH_USER_CONFFILE);
/* Read systemwide configuration file. */
- read_config_file(_PATH_HOST_CONFIG_FILE, host, &options);
- read_config_file(buf, host, &options);
+ (void)read_config_file(_PATH_HOST_CONFIG_FILE, host, &options);
+ (void)read_config_file(buf, host, &options);
}
/* Fill configuration defaults. */