summaryrefslogtreecommitdiff
path: root/servconf.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-06-23 21:29:23 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-06-23 21:29:23 +0000
commite135363422c0e48901fa0b4927ef3f1c12614287 (patch)
tree5b2b9280aa9694a36cc629e62b58c1b508b592fe /servconf.c
parent58d3b7224fd49bf4d470f9f3ad6bdfc5dbcc1e0a (diff)
- deraadt@cvs.openbsd.org 2002/06/23 09:46:51
[bufaux.c servconf.c] minor KNF. things the fingers do while you read
Diffstat (limited to 'servconf.c')
-rw-r--r--servconf.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/servconf.c b/servconf.c
index fb6332c31..0d77c7078 100644
--- a/servconf.c
+++ b/servconf.c
@@ -10,7 +10,7 @@
10 */ 10 */
11 11
12#include "includes.h" 12#include "includes.h"
13RCSID("$OpenBSD: servconf.c,v 1.111 2002/06/20 23:05:55 markus Exp $"); 13RCSID("$OpenBSD: servconf.c,v 1.112 2002/06/23 09:46:51 deraadt Exp $");
14 14
15#if defined(KRB4) 15#if defined(KRB4)
16#include <krb.h> 16#include <krb.h>
@@ -423,7 +423,7 @@ add_one_listen_addr(ServerOptions *options, char *addr, u_short port)
423 hints.ai_family = IPv4or6; 423 hints.ai_family = IPv4or6;
424 hints.ai_socktype = SOCK_STREAM; 424 hints.ai_socktype = SOCK_STREAM;
425 hints.ai_flags = (addr == NULL) ? AI_PASSIVE : 0; 425 hints.ai_flags = (addr == NULL) ? AI_PASSIVE : 0;
426 snprintf(strport, sizeof strport, "%d", port); 426 snprintf(strport, sizeof strport, "%u", port);
427 if ((gaierr = getaddrinfo(addr, strport, &hints, &aitop)) != 0) 427 if ((gaierr = getaddrinfo(addr, strport, &hints, &aitop)) != 0)
428 fatal("bad addr or host: %s (%s)", 428 fatal("bad addr or host: %s (%s)",
429 addr ? addr : "<NULL>", 429 addr ? addr : "<NULL>",
@@ -439,9 +439,8 @@ process_server_config_line(ServerOptions *options, char *line,
439 const char *filename, int linenum) 439 const char *filename, int linenum)
440{ 440{
441 char *cp, **charptr, *arg, *p; 441 char *cp, **charptr, *arg, *p;
442 int *intptr, value; 442 int *intptr, value, i, n;
443 ServerOpCodes opcode; 443 ServerOpCodes opcode;
444 int i, n;
445 444
446 cp = line; 445 cp = line;
447 arg = strdelim(&cp); 446 arg = strdelim(&cp);
@@ -765,7 +764,8 @@ parse_flag:
765 if (options->num_allow_users >= MAX_ALLOW_USERS) 764 if (options->num_allow_users >= MAX_ALLOW_USERS)
766 fatal("%s line %d: too many allow users.", 765 fatal("%s line %d: too many allow users.",
767 filename, linenum); 766 filename, linenum);
768 options->allow_users[options->num_allow_users++] = xstrdup(arg); 767 options->allow_users[options->num_allow_users++] =
768 xstrdup(arg);
769 } 769 }
770 break; 770 break;
771 771
@@ -774,7 +774,8 @@ parse_flag:
774 if (options->num_deny_users >= MAX_DENY_USERS) 774 if (options->num_deny_users >= MAX_DENY_USERS)
775 fatal( "%s line %d: too many deny users.", 775 fatal( "%s line %d: too many deny users.",
776 filename, linenum); 776 filename, linenum);
777 options->deny_users[options->num_deny_users++] = xstrdup(arg); 777 options->deny_users[options->num_deny_users++] =
778 xstrdup(arg);
778 } 779 }
779 break; 780 break;
780 781
@@ -783,7 +784,8 @@ parse_flag:
783 if (options->num_allow_groups >= MAX_ALLOW_GROUPS) 784 if (options->num_allow_groups >= MAX_ALLOW_GROUPS)
784 fatal("%s line %d: too many allow groups.", 785 fatal("%s line %d: too many allow groups.",
785 filename, linenum); 786 filename, linenum);
786 options->allow_groups[options->num_allow_groups++] = xstrdup(arg); 787 options->allow_groups[options->num_allow_groups++] =
788 xstrdup(arg);
787 } 789 }
788 break; 790 break;
789 791
@@ -921,10 +923,9 @@ parse_flag:
921void 923void
922read_server_config(ServerOptions *options, const char *filename) 924read_server_config(ServerOptions *options, const char *filename)
923{ 925{
924 FILE *f; 926 int linenum, bad_options = 0;
925 char line[1024]; 927 char line[1024];
926 int linenum; 928 FILE *f;
927 int bad_options = 0;
928 929
929 f = fopen(filename, "r"); 930 f = fopen(filename, "r");
930 if (!f) { 931 if (!f) {