Explorar el Código

* Ported [2482] to 1.2.9 (unsetting auth-prefix disables auth cmds)

svn: 2716
Bryan Drewery hace 20 años
padre
commit
683a8ca6b9
Se han modificado 3 ficheros con 7 adiciones y 3 borrados
  1. 1 0
      doc/UPDATES
  2. 1 1
      src/mod/irc.mod/chan.c
  3. 5 2
      src/mod/server.mod/servmsg.c

+ 1 - 0
doc/UPDATES

@@ -60,6 +60,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fixed bot going floodless when it wasn't granted it.
 * Fixed bots requesting op in chans they don't have access to. (fixes #196)
 * Fixed a startup segfault. (fixes #195)
+* Unsetting auth-prefix disables authing/cmds.
 
 1.2.8
 * Fixed [bot]* cmds depending on case of botnicks.

+ 1 - 1
src/mod/irc.mod/chan.c

@@ -3027,7 +3027,7 @@ static int gotmsg(char *from, char *msg)
       if (botmatch && strcmp(fword, "*"))	
         fword = newsplit(&my_msg);	/* now this will be the command */
       /* is it a cmd? */
-      if (fword && fword[0] && fword[1] && ((botmatch && fword[0] != auth_prefix[0]) || (fword[0] == auth_prefix[0]))) {
+      if (auth_prefix[0] && fword && fword[0] && fword[1] && ((botmatch && fword[0] != auth_prefix[0]) || (fword[0] == auth_prefix[0]))) {
         Auth *auth = Auth::Find(uhost);
 
         if (auth && auth->Authed()) {

+ 5 - 2
src/mod/server.mod/servmsg.c

@@ -571,7 +571,10 @@ static int gotmsg(char *from, char *msg)
       }
     } else {
       char *my_code = NULL;
-      Auth *auth = Auth::Find(uhost);
+      Auth *auth = NULL;
+     
+      if (auth_prefix[0])
+        Auth::Find(uhost);
 
       if (!auth)
         detect_flood(nick, uhost, from, FLOOD_PRIVMSG);
@@ -579,7 +582,7 @@ static int gotmsg(char *from, char *msg)
       rmspace(msg);
       /* is it a cmd? */
 
-      if (my_code && my_code[0] && my_code[1] && auth && auth->Authed() && my_code[0] == auth_prefix[0]) {
+      if (auth_prefix[0] && my_code && my_code[0] && my_code[1] && auth && auth->Authed() && my_code[0] == auth_prefix[0]) {
         my_code++;		//eliminate the prefix
         auth->atime = now;