]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conf.c
Support individual channel keys for pre-defined channels.
[ngircd-alex.git] / src / ngircd / conf.c
index fc12cd9ba826ed19903120433464b6d148a59f3d..4a8b6283a4f8136d27a4e23f0cc1629a7e7e3f85 100644 (file)
@@ -313,7 +313,8 @@ Conf_Test( void )
                printf("  Modes = %s\n", predef_chan->modes);
                printf("  Key = %s\n", predef_chan->key);
                printf("  MaxUsers = %lu\n", predef_chan->maxusers);
-               printf("  Topic = %s\n\n", predef_chan->topic);
+               printf("  Topic = %s\n", predef_chan->topic);
+               printf("  KeyFile = %s\n\n", predef_chan->keyfile);
        }
 
        return (config_valid ? 0 : 1);
@@ -1232,6 +1233,13 @@ Handle_CHANNEL(int Line, char *Var, char *Arg)
                        Config_Error_NaN(Line, Var);
                return;
        }
+       if (strcasecmp(Var, "KeyFile") == 0) {
+               /* channel keys */
+               len = strlcpy(chan->keyfile, Arg, sizeof(chan->keyfile));
+               if (len >= sizeof(chan->keyfile))
+                       Config_Error_TooLong(Line, Var);
+               return;
+       }
 
        Config_Error( LOG_ERR, "%s, line %d (section \"Channel\"): Unknown variable \"%s\"!",
                                                                NGIRCd_ConfFile, Line, Var );