Properly match against accounts when searching users.
authorMichael Poole <mdpoole@troilus.org>
Sat, 1 Oct 2005 03:45:19 +0000 (03:45 +0000)
committerMichael Poole <mdpoole@troilus.org>
Sat, 1 Oct 2005 03:45:19 +0000 (03:45 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1507 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/m_who.c

index 522d89b4695fb84ee3f8e1fc9d74e25bd28caec2..f180550a44a851bbaf723e1e8e76d177a42b6f51 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-09-30  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/m_who.c (m_who): Handle matchsel & WHO_FIELD_ACC when
+       matching users.
+
 2005-09-30  Michael Poole <mdpoole@troilus.org>
 
        * include/patchlevel.h: Update for release.
index 6b277f1bcd41d5c2e06cfd82a5154dc84c88b238..ffc78f716a3aee829734fa0899a6a4ec21d6272d 100644 (file)
@@ -376,6 +376,8 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
         matchsel &= ~WHO_FIELD_UID;
       if ((minlen > HOSTLEN) || !(cset & NTL_IRCHN))
         matchsel &= ~WHO_FIELD_HOS;
+      if ((minlen > ACCOUNTLEN))
+        matchsel &= ~WHO_FIELD_ACC;
     }
 
     /* First of all loop through the clients in common channels */
@@ -409,7 +411,9 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
               || matchexec(cli_info(acptr), mymask, minlen))
               && ((!(matchsel & WHO_FIELD_NIP))
              || (HasHiddenHost(acptr) && !IsAnOper(sptr))
-              || !ipmask_check(&cli_ip(acptr), &imask, ibits)))
+              || !ipmask_check(&cli_ip(acptr), &imask, ibits))
+              && ((!(matchsel & WHO_FIELD_ACC))
+              || matchexec(cli_user(acptr)->account, mymask, minlen)))
             continue;
           if (!SHOW_MORE(sptr, counter))
             break;
@@ -445,7 +449,9 @@ int m_who(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
             || matchexec(cli_info(acptr), mymask, minlen))
             && ((!(matchsel & WHO_FIELD_NIP))
            || (HasHiddenHost(acptr) && !IsAnOper(sptr))
-            || !ipmask_check(&cli_ip(acptr), &imask, ibits)))
+            || !ipmask_check(&cli_ip(acptr), &imask, ibits))
+            && ((!(matchsel & WHO_FIELD_ACC))
+            || matchexec(cli_user(acptr)->account, mymask, minlen)))
           continue;
         if (!SHOW_MORE(sptr, counter))
           break;