]> jfr.im git - irc/evilnet/x3.git/commitdiff
backing out alert kill fix. Turns out I was wrong about there being a problem
authorrubin <redacted>
Fri, 30 Jan 2009 09:30:00 +0000 (09:30 +0000)
committerrubin <redacted>
Fri, 30 Jan 2009 09:30:00 +0000 (09:30 +0000)
ChangeLog
src/dict-splay.c
src/dict.h
src/hash.c
src/mod-track.c
src/opserv.c

index fa85b5c388cb087248eb7c0e8725a14e5eb8182e..ee3eca4b8c2e2e2fde5c5dd530a0590f09d2aa53 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,21 +7,6 @@ X3 ChangeLog
 
        * src/proto-p10.c: Bug fix for SF Bug #2547157 (topic ident bug).
 
-2009-01-29  Alex Schumann  <rubin@afternet.org>
-
-       * src/hash.c: Added a function to check if a user pointer
-       points to a user that actually exists.
-
-       * src/dict-splay.c: added a dict function to check if data exists
-       in a dict list.
-
-       * src/opserv.c: added safety checks on nick and auth callbacks to
-       ensure the user still exists (and wasn't removed by a previous
-       callback)
-
-       * src/mod-track.c: added safety checks on nick and auth callbacks
-       to ensure the user still exists
-
 2009-01-27  Alex Schumann  <rubin@afternet.org>
 
        * src/modpython.py: Comment out debug printing
index 5f37b1d205e98f8e33e8cdc0154d6d4b92427ec0..2532c2d3f3bb7a8843f6cdaff730abc05f373a3a 100644 (file)
@@ -67,22 +67,6 @@ dict_foreach(dict_t dict, dict_iterator_f it_f, void *extra)
     return NULL;
 }
 
-/* We seem to find ourselves in a situation where callbacks sometimes contain
- * data pointers to users who have been killed and deleted by previously hooked
- * callbacks. This function provides a way to check for that before using
- * what will be unallocated memory pointed to by an old pointer. */
-unsigned int
-dict_validptr(dict_t dict, void *data)
-{
-    dict_iterator_t it;
-    for (it=dict_first(dict); it; it=iter_next(it)) {
-        if(iter_data(it) == data)
-            return true;
-    }
-    return false;
-}
-
-
 /*
  *   This function finds a node and pulls it to the top of the tree.
  *   This helps balance the tree and auto-cache things you search for.
index 44baf77b4e09e78e6a2dd1fd9b394599be72b71b..1255ee5f872231b1e3b21b219fd85df3861be449 100644 (file)
@@ -55,7 +55,6 @@ void dict_insert(dict_t dict, const char *key, void *data);
 void dict_set_free_keys(dict_t dict, free_f free_keys);
 void dict_set_free_data(dict_t dict, free_f free_data);
 unsigned int dict_size(dict_t dict);
-unsigned int dict_validptr(dict_t dict, void *data);
 /* if present!=NULL, then *present=1 iff node was found (if node is
  * not found, return value is NULL, which may be a valid datum) */
 void* dict_find(dict_t dict, const char *key, int *present);
index f493436a5a5ca7ee81108bbbfd740f2c45451cfd..c45e5a387ae4be1e242843d0d0ad6e15e00e0266 100644 (file)
@@ -231,15 +231,6 @@ SVSNickChange(struct userNode* user, const char *new_nick)
     free(old_nick);
 }
 
-/* go through all clients and look for one with this userNode pointer.
- * if we can find it, return true. Otherwise, the user got killed or 
- * something and the pointer is not valid anymore */
-unsigned int
-IsUserP(struct userNode *user)
-{
-    return dict_validptr(clients, user);
-}
-
 struct userNode *
 GetUserH(const char *nick)
 {
index 3c7e7f36472e971555a39b5924381753e8bcac95..6f193c447a495744ee1d1ad387a2c8ed71553f5d 100644 (file)
@@ -193,8 +193,6 @@ static void
 track_nick_change(struct userNode *user, const char *old_nick) {
     if (!track_cfg.enabled) return;
 
-    if(!IsUserP(user))
-        return 0;
     if(check_track_user(old_nick)) {
         del_track_user(old_nick);
         add_track_user(user);
@@ -248,8 +246,6 @@ track_kick(struct userNode *kicker, struct userNode *victim, struct chanNode *ch
 static int
 track_new_user(struct userNode *user) {
 
-    if(!IsUserP(user))
-        return 0;
     if (!track_cfg.enabled) return 0;
     if (user->uplink->burst && !track_cfg.show_bursts) return 0;
     if (check_track_new(track_cfg) && check_track_user(user->nick))
@@ -277,8 +273,6 @@ track_del_user(struct userNode *user, struct userNode *killer, const char *why)
 
 static void
 track_auth(struct userNode *user, UNUSED_ARG(struct handle_info *old_handle)) {
-    if(!IsUserP(user))
-        return;
     if (!track_cfg.enabled) return;
     if (user->uplink->burst && !track_cfg.show_bursts) return;
     if (user->handle_info && (check_track_auth(track_cfg) && check_track_user(user->nick))) {
index a15e66e082bc2984ed7f89f2b4959794c20089ee..7954da3028087eddbc4f34dde2f7271632e3f46e 100644 (file)
@@ -2666,9 +2666,6 @@ opserv_new_user_check(struct userNode *user)
     struct gag_entry *gag;
     char addr[IRC_NTOP_MAX_SIZE];
 
-    if(!IsUserP(user))
-        return 0; /* bail if this user ptr doesnt still exist in users */
-
     /* Check to see if we should ignore them entirely. */
     if (IsLocal(user) || IsService(user))
         return 0;
@@ -6567,8 +6564,6 @@ alert_check_user(const char *key, void *data, void *extra)
 static void
 opserv_alert_check_account(struct userNode *user, UNUSED_ARG(struct handle_info *old_handle))
 {
-    if(!IsUserP(user))
-        return; /* bail if this user ptr doesnt still exist in users */
     dict_foreach(opserv_account_based_alerts, alert_check_user, user);
 }
 
@@ -6577,10 +6572,8 @@ opserv_alert_check_nick(struct userNode *user, UNUSED_ARG(const char *old_nick))
 {
     struct gag_entry *gag;
 
-    if(!IsUserP(user))
-        return; /* bail if this user ptr doesnt still exist in users */
+    dict_foreach(opserv_nick_based_alerts, alert_check_user, user); 
 
-    dict_foreach(opserv_nick_based_alerts, alert_check_user, user);
     /* Gag them if appropriate (and only if). */
     user->modes &= ~FLAGS_GAGGED;
     for (gag = gagList; gag; gag = gag->next) {
@@ -6596,9 +6589,6 @@ opserv_staff_alert(struct userNode *user, UNUSED_ARG(struct handle_info *old_han
 {
     const char *type;
 
-    if(!IsUserP(user))
-        return; /* bail if this user ptr doesnt still exist in users */
-
     if (!opserv_conf.staff_auth_channel
         || user->uplink->burst
         || !user->handle_info)