]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conf.c
Show a warning on startup if config file is not a full path
[ngircd-alex.git] / src / ngircd / conf.c
index 41b5469a8140f4c5a07d1874dd6d048fcbf6ae3b..627e6d3fbf22557d695478ffe2a507b5fafe2a4d 100644 (file)
@@ -346,7 +346,7 @@ Conf_Test( void )
 
        puts("[LIMITS]");
        printf("  ConnectRetry = %d\n", Conf_ConnectRetry);
-       printf("  MaxConnections = %ld\n", Conf_MaxConnections);
+       printf("  MaxConnections = %d\n", Conf_MaxConnections);
        printf("  MaxConnectionsIP = %d\n", Conf_MaxConnectionsIP);
        printf("  MaxJoins = %d\n", Conf_MaxJoins > 0 ? Conf_MaxJoins : -1);
        printf("  MaxNickLength = %u\n", Conf_MaxNickLength - 1);
@@ -648,7 +648,8 @@ Conf_NickIsService(int ConfServer, const char *Nick)
        assert (ConfServer >= 0);
        assert (ConfServer < MAX_SERVERS);
 
-       return MatchCaseInsensitive(Conf_Server[ConfServer].svs_mask, Nick);
+       return MatchCaseInsensitiveList(Conf_Server[ConfServer].svs_mask,
+                                       Nick, ",");
 }
 
 /**
@@ -1431,7 +1432,7 @@ Handle_LIMITS(int Line, char *Var, char *Arg)
                return;
        }
        if (strcasecmp(Var, "MaxConnections") == 0) {
-               Conf_MaxConnections = atol(Arg);
+               Conf_MaxConnections = atoi(Arg);
                if (!Conf_MaxConnections && strcmp(Arg, "0"))
                        Config_Error_NaN(Line, Var);
                return;
@@ -1910,6 +1911,13 @@ Validate_Config(bool Configtest, bool Rehash)
        bool config_valid = true;
        char *ptr;
 
+       /* Emit a warning when the config file is not a full path name */
+       if (NGIRCd_ConfFile[0] && NGIRCd_ConfFile[0] != '/') {
+               Config_Error(LOG_WARNING,
+                       "Not specifying a full path name to \"%s\" can cause problems when rehashing the server!",
+                       NGIRCd_ConfFile);
+       }
+
        /* Validate configured server name, see RFC 2812 section 2.3.1 */
        ptr = Conf_ServerName;
        do {