Jelajahi Sumber

* Fixed msg_invite spamming password
* pass_set shares for all users now (was !bots)
* Fixed a potential problem in share.mod
* cmd_pls_host is now o|o


svn: 925

Bryan Drewery 22 tahun lalu
induk
melakukan
5ef82004f5

+ 2 - 0
doc/UPDATES

@@ -8,6 +8,8 @@ This is a summary of ChangeLog basically.
 4.Several user cmds on BOTS were not being shared.
 5.Fixed a fatal bug in +take.
 6.Removed garblestrings dependancy on binary checksum checking.
+7.Cmd_pls_host now is available to o|o. Users can add hosts to themselves now.
+8.Fixed msg_invite spamming the password for non-users.
 
 1.1.5
 

+ 1 - 1
src/cmds.c

@@ -4097,7 +4097,7 @@ static void cmd_quit(struct userrec *u, int idx, char *text)
  */
 cmd_t C_dcc[] =
 {
-  {"+host",		"j",	(Function) cmd_pls_host,	NULL},
+  {"+host",		"o|o",	(Function) cmd_pls_host,	NULL},
   {"+ignore",		"m",	(Function) cmd_pls_ignore,	NULL},
   {"+user",		"m",	(Function) cmd_pls_user,	NULL},
 #ifdef HUB

+ 2 - 1
src/mod/irc.mod/msgcmds.c

@@ -157,6 +157,7 @@ static int msg_invite(char *nick, char *host, struct userrec *u, char *par)
 
   if (match_my_nick(nick))
     return BIND_RET_BREAK;
+
   pass = newsplit(&par);
   if (u_pass_match(u, pass) && !u_pass_match(u, "-")) {
     if (par[0] == '*') {
@@ -430,7 +431,7 @@ static cmd_t C_msg[] =
   {"word",		"",	(Function) msg_word,		NULL},
 #ifdef S_MSGCMDS
   {"ident",   		"",	(Function) msg_ident,		NULL},
-  {"invite",		"o|o",	(Function) msg_invite,		NULL},
+  {"invite",		"",	(Function) msg_invite,		NULL},
   {"op",		"",	(Function) msg_op,		NULL},
   {"pass",		"",	(Function) msg_pass,		NULL},
 #endif /* S_MSGCMDS */

+ 3 - 3
src/mod/server.mod/server.c

@@ -1519,10 +1519,10 @@ void server_init()
   BT_msgc = bind_table_add("msgc", 5, "ssUss", MATCH_FLAGS, 0); 
 #endif /* S_AUTHCMDS */
   BT_msg = bind_table_add("msg", 4, "ssUs", MATCH_FLAGS, 0);
-  BT_raw = bind_table_add("raw", 2, "ss", MATCH_MASK, BIND_STACKABLE);
+  BT_raw = bind_table_add("raw", 2, "ss", 0, BIND_STACKABLE);
 
-  BT_ctcr = bind_table_add("ctcr", 6, "ssUsss", MATCH_MASK | MATCH_FLAGS, BIND_STACKABLE);
-  BT_ctcp = bind_table_add("ctcp", 6, "ssUsss", MATCH_MASK | MATCH_FLAGS, BIND_STACKABLE);
+  BT_ctcr = bind_table_add("ctcr", 6, "ssUsss", 0, BIND_STACKABLE);
+  BT_ctcp = bind_table_add("ctcp", 6, "ssUsss", 0, BIND_STACKABLE);
 
   add_builtins("raw", my_raw_binds);
   add_builtins("dcc", C_dcc_serv);

+ 11 - 13
src/mod/server.mod/servmsg.c

@@ -102,16 +102,18 @@ static int gotfake433(char *from)
  * msg: proc-name <nick> <user@host> <handle> <args...>
  */
 
-static int check_bind_msg(char *cmd, char *nick, char *uhost, struct userrec *u, char *args)
+static void check_bind_msg(char *cmd, char *nick, char *uhost, struct userrec *u, char *args)
 {
   struct flag_record fr = {FR_GLOBAL | FR_CHAN | FR_ANYWH, 0, 0, 0};
   int x;
 
   get_user_flagrec(u, &fr, NULL);
   x = check_bind(BT_msg, cmd, &fr, nick, uhost, u, args);
-  if (x & BIND_RET_LOG) putlog(LOG_CMDS, "*", "(%s!%s) !%s! %s %s", nick, uhost, u ? u->handle : "*" , args);
-  if (x) return(1);
-  else return(0);
+
+  if (x & BIND_RET_LOG) 
+    putlog(LOG_CMDS, "*", "(%s!%s) !%s! %s %s", nick, uhost, u ? u->handle : "*" , args);
+  else if (x == 0)
+    putlog(LOG_MSGS, "*", "[%s!%s] %s %s", nick, uhost, cmd, args);
 }
 
 #ifdef S_AUTHCMDS
@@ -123,7 +125,7 @@ static int check_bind_msgc(char *cmd, char *nick, char *from, struct userrec *u,
   x = check_bind(BT_msgc, cmd, &fr, nick, from, u, args, NULL);
 
   if (x & BIND_RET_LOG)
-    putlog(LOG_CMDS, "*", " in check_bind_msgc(%s!%s) !%s! %s%s %s", nick, from, u ? u->handle : "*", cmdprefix, cmd, args);
+    putlog(LOG_CMDS, "*", "(%s!%s) !%s! %s%s %s", nick, from, u ? u->handle : "*", cmdprefix, cmd, args);
 
   if (x & BIND_RET_BREAK) return(1);
   return(0);
@@ -498,7 +500,7 @@ static int gotmsg(char *from, char *msg)
       /* is it a cmd? */
 
       if (i > -1 && auth[i].authed && my_code[0] == cmdprefix[0] && my_code[1]) {
-        my_code++;        
+        my_code++;
         my_u = auth[i].user;
 
         if (check_bind_msgc(my_code, nick, uhost, my_u, msg))
@@ -508,13 +510,12 @@ static int gotmsg(char *from, char *msg)
       } else if ((my_code[0] != cmdprefix[0] || !my_code[1] || i == -1 || !(auth[i].authed))) {
 #endif /* S_AUTHCMDS */
         if (!ignoring) {
-          int doit = 1, result = 0;
+          int doit = 1;
 #ifdef S_MSGCMDS
           if (!egg_strcasecmp(my_code, "op") || !egg_strcasecmp(my_code, "pass") || !egg_strcasecmp(my_code, "invite") 
               || !egg_strcasecmp(my_code, "ident")
                || !egg_strcasecmp(my_code, msgop) || !egg_strcasecmp(my_code, msgpass) 
                || !egg_strcasecmp(my_code, msginvite) || !egg_strcasecmp(my_code, msgident)) {
-/*           || !strcmp(my_code, msgop) || !strcmp(my_code, msgpass) || !strcmp(my_code, msgop)) { */
             char buf2[10] = "";
 
             doit = 0;
@@ -527,14 +528,11 @@ static int gotmsg(char *from, char *msg)
             else if (!egg_strcasecmp(my_code, msgident))
               sprintf(buf2, "ident");
             if (buf[0])
-              result = check_bind_msg(buf2, nick, uhost, my_u, msg);
+              check_bind_msg(buf2, nick, uhost, my_u, msg);
           }
 #endif /* S_MSGCMDS */
           if (doit)
-            result = check_bind_msg(my_code, nick, uhost, my_u, msg);
-            
-	  if (!result)
-	    putlog(LOG_MSGS, "*", "[%s] %s %s", from, my_code, msg);
+            check_bind_msg(my_code, nick, uhost, my_u, msg);
         }
 #ifdef S_AUTHCMDS
       }

+ 1 - 1
src/mod/share.mod/share.c

@@ -1481,12 +1481,12 @@ finish_share(int idx)
   unlink(dcc[idx].u.xfer->filename);    //I mean really, shit fills up the quota fast.
 
   loading = 0;
-  putlog(LOG_BOTS, "*", "%s.", USERF_XFERDONE);
 
   clear_chanlist();             /* Remove all user references from the
                                  * channel lists.                       */
   userlist = u;                 /* Set new user list.                   */
   lastuser = NULL;              /* Reset last accessed user ptr.        */
+  putlog(LOG_BOTS, "*", "%s.", USERF_XFERDONE);
 
   /*
    * Migrate:

+ 1 - 0
src/tclhash.c

@@ -428,6 +428,7 @@ static int bind_vcheck_hits (bind_table_t *table, const char *match, struct flag
 		}
 		else {
 			if (table->match_type & MATCH_CASE) cmp = strcmp(entry->mask, match);
+			/* MATCH_EXACT */
 			else cmp = strcasecmp(entry->mask, match);
 		}
 		if (cmp) continue; /* Doesn't match. */

+ 1 - 1
src/userent.c

@@ -544,7 +544,7 @@ int pass_set(struct userrec *u, struct user_entry *e, void *buf)
       encrypt_pass(pass, new);
     e->u.extra = strdup(new);
   }
-  if (!noshare && !(u->flags & USER_BOT))
+  if (!noshare)
     shareout(NULL, "c PASS %s %s\n", u->handle, pass ? pass : "");
   return 1;
 }