=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/servconf.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- src/usr.bin/ssh/servconf.c 1999/11/11 22:58:38 1.21 +++ src/usr.bin/ssh/servconf.c 1999/11/11 23:26:53 1.22 @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$Id: servconf.c,v 1.21 1999/11/11 22:58:38 markus Exp $"); +RCSID("$Id: servconf.c,v 1.22 1999/11/11 23:26:53 markus Exp $"); #include "ssh.h" #include "servconf.h" @@ -144,6 +144,7 @@ /* Keyword tokens. */ typedef enum { + sBadOption, /* == unknown option */ sPort, sHostKeyFile, sServerKeyBits, sLoginGraceTime, sKeyRegenerationTime, sPermitRootLogin, sLogFacility, sLogLevel, sRhostsAuthentication, sRhostsRSAAuthentication, sRSAAuthentication, @@ -260,9 +261,9 @@ if (strcmp(cp, keywords[i].name) == 0) return keywords[i].opcode; - fprintf(stderr, "%s line %d: Bad configuration option: %s\n", + fprintf(stderr, "%s: line %d: Bad configuration option: %s\n", filename, linenum, cp); - exit(1); + return sBadOption; } /* Reads the server configuration file. */ @@ -273,6 +274,7 @@ char line[1024]; char *cp, **charptr; int linenum, *intptr, i, value; + int bad_options = 0; ServerOpCodes opcode; f = fopen(filename, "r"); @@ -300,6 +302,9 @@ opcode = parse_token(cp, filename, linenum); switch (opcode) { + case sBadOption: + bad_options++; + continue; case sPort: intptr = &options->port; parse_int: @@ -596,4 +601,9 @@ } } fclose(f); + if (bad_options > 0) { + fprintf(stderr, "%s: terminating, %d bad configuration options\n", + filename, bad_options); + exit(1); + } }