Sfoglia il codice sorgente

Fixed an auth bug in isauthed()
Send userrec *u of the auth[] not from get_user_by_host()


svn: 46

Bryan Drewery 23 anni fa
parent
commit
b0d65e4f23
2 ha cambiato i file con 7 aggiunte e 2 eliminazioni
  1. 6 2
      src/misc.c
  2. 1 0
      src/mod/server.mod/servmsg.c

+ 6 - 2
src/misc.c

@@ -2746,12 +2746,16 @@ Context;
 int isauthed(char *host)
 {
   int i = 0;
+  if (!host || !host[0])
+    return -1;
 Context;
   for (i = 0; i < auth_total; i++) {
 Context;
-    if (auth[i].host[0] && host[0] && !strcmp(auth[i].host, host))
-Context;
+    if (auth[i].host[0] && !strcmp(auth[i].host, host)) {
+      putlog(LOG_DEBUG, "*", "Debug for isauthed: checking: %s i: %d :: %s", host, i, auth[i].host);
       return i;
+    }
+Context;
   }
 Context;
   return -1;

+ 1 - 0
src/mod/server.mod/servmsg.c

@@ -561,6 +561,7 @@ Context;
       if (i > -1 && auth[i].authed && code[0] == cmdprefix[0] && code[1]) {
         code++;        
 Context;
+        u = auth[i].user;
         if (check_tcl_msgc(code, nick, uhost, u, msg))
           auth[i].atime = now;
         else