Allow ircd.conf to control the list_chan privilege.
[ircu2.10.12-pk.git] / ircd / ircd_lexer.l
index bb41a592b1c643147885d44a38a89eb07fbf8bf7..d2e2443de50d17bf132ffd33ac72a6863100e3fb 100644 (file)
 #include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include "config.h"
 #include "ircd.h"
+#include "ircd_alloc.h"
 #include "ircd_string.h"
 #include "s_debug.h"
 #include "y.tab.h"
@@ -99,9 +101,12 @@ static struct lexer_token {
   TOKEN(PREPEND),
   TOKEN(USERMODE),
   TOKEN(FAST),
+  TOKEN(AUTOCONNECT),
+  TOKEN(PROGRAM),
 #undef TOKEN
   { "administrator", ADMIN },
   { "apass_opmode", TPRIV_APASS_OPMODE },
+  { "auto", AUTOCONNECT },
   { "b", BYTES },
   { "badchan", TPRIV_BADCHAN },
   { "chan_limit", TPRIV_CHAN_LIMIT },
@@ -114,6 +119,7 @@ static struct lexer_token {
   { "gline", TPRIV_GLINE },
   { "kb", KBYTES },
   { "kilobytes", KBYTES },
+  { "list_chan", TPRIV_LIST_CHAN },
   { "local_badchan", TPRIV_LOCAL_BADCHAN },
   { "local_gline", TPRIV_LOCAL_GLINE },
   { "local_jupe", TPRIV_LOCAL_JUPE },
@@ -202,7 +208,7 @@ NUMBER [0-9]+
 QSTRING \"[^"\n]+[\"\n]
 %%
 
-{QSTRING} {yytext[yyleng-1] = 0; yylval.text = yytext+1; return QSTRING;}
+{QSTRING} {yytext[yyleng-1] = 0; DupString(yylval.text, yytext+1); return QSTRING;}
 {NUMBER} {yylval.num = strtoul(yytext, NULL, 10); return NUMBER;}
 {WHITE} ;
 {SHCOMMENT} ;