]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conf.c
Initialize Conf_ScrubCTCP even when SYSLOG isn't #define'd
[ngircd-alex.git] / src / ngircd / conf.c
index bdbb506fcfcd39e391b6f967078804c10167a65d..6692ecbbdd8b5f8bb21f981fec5981acfb21e3a9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors.
+ * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -16,9 +16,7 @@
  * Configuration management (reading, parsing & validation)
  */
 
-#include "imp.h"
 #include <assert.h>
-#include <ctype.h>
 #include <errno.h>
 #ifdef PROTOTYPES
 #      include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
 #include <strings.h>
+#include <time.h>
 #include <unistd.h>
 #include <pwd.h>
 #include <grp.h>
 #include <sys/types.h>
-#include <unistd.h>
 #include <dirent.h>
 
-#include "array.h"
 #include "ngircd.h"
 #include "conn.h"
 #include "channel.h"
-#include "defines.h"
 #include "log.h"
 #include "match.h"
-#include "tool.h"
 
-#include "exp.h"
 #include "conf.h"
 
 
@@ -370,9 +364,8 @@ Conf_Test( void )
                       ? (const char*) array_start(&Conf_Motd) : "");
        }
        printf("  Network = %s\n", Conf_Network);
-#ifndef PAM
-       printf("  Password = %s\n", Conf_ServerPwd);
-#endif
+       if (!Conf_PAM) 
+               printf("  Password = %s\n", Conf_ServerPwd);
        printf("  PidFile = %s\n", Conf_PidFile);
        printf("  Ports = ");
        ports_puts(&Conf_ListenPorts);
@@ -813,8 +806,8 @@ Set_Defaults(bool InitServers)
        Conf_PAM = false;
 #endif
        Conf_PAMIsOptional = false;
-#ifdef SYSLOG
        Conf_ScrubCTCP = false;
+#ifdef SYSLOG
 #ifdef LOG_LOCAL5
        Conf_SyslogFacility = LOG_LOCAL5;
 #else
@@ -1054,9 +1047,13 @@ Read_Config(bool TestOnly, bool IsStarting)
 }
 
 /**
- * ...
+ * Read in and handle a configuration file.
+ *
+ * @param File Name of the configuration file.
+ * @param fd File descriptor already opened for reading.
  */
-static void Read_Config_File(const char *File, FILE *fd)
+static void
+Read_Config_File(const char *File, FILE *fd)
 {
        char section[LINE_LEN], str[LINE_LEN], *var, *arg, *ptr;
        int i, line = 0;
@@ -2259,7 +2256,7 @@ Validate_Config(bool Configtest, bool Rehash)
        }
 
 #ifdef PAM
-       if (Conf_ServerPwd[0])
+       if (Conf_PAM && Conf_ServerPwd[0])
                Config_Error(LOG_ERR,
                             "This server uses PAM, \"Password\" in [Global] section will be ignored!");
 #endif