Committer : entrope
CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Commit time: 2005-10-01 03:42:23 UTC
Modified files:
ChangeLog ircd/m_who.c
Log message:
Properly match against accounts when searching users.
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.714 ircu2.10/ChangeLog:1.715
--- ircu2.10/ChangeLog:1.714 Fri Sep 30 20:37:43 2005
+++ ircu2.10/ChangeLog Fri Sep 30 20:42:13 2005
@@ -1,5 +1,10 @@
2005-09-30 Michael Poole <[EMAIL PROTECTED]>
+ * ircd/m_who.c (m_who): Handle matchsel & WHO_FIELD_ACC when
+ matching users.
+
+2005-09-30 Michael Poole <[EMAIL PROTECTED]>
+
* include/whocmds.h: File becomes unused and almost empty; remove.
* ircd/whocmds.c: Likewise.
Index: ircu2.10/ircd/m_who.c
diff -u ircu2.10/ircd/m_who.c:1.23 ircu2.10/ircd/m_who.c:1.24
--- ircu2.10/ircd/m_who.c:1.23 Fri Sep 30 20:37:43 2005
+++ ircu2.10/ircd/m_who.c Fri Sep 30 20:42:13 2005
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_who.c,v 1.23 2005/10/01 03:37:43 entrope Exp $
+ * $Id: m_who.c,v 1.24 2005/10/01 03:42:13 entrope Exp $
*/
#include "config.h"
@@ -579,6 +579,8 @@
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 */
@@ -595,8 +597,8 @@
we'll never have to show this acptr in this
query */
if ((bitsel & WHOSELECT_OPER) && !SeeOper(sptr,acptr))
continue;
- if ((mask) &&
- ((!(matchsel & WHO_FIELD_NIC))
+ if ((mask)
+ && ((!(matchsel & WHO_FIELD_NIC))
|| matchexec(cli_name(acptr), mymask, minlen))
&& ((!(matchsel & WHO_FIELD_UID))
|| matchexec(cli_user(acptr)->username, mymask, minlen))
@@ -612,7 +614,10 @@
|| 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;
@@ -631,8 +636,8 @@
continue;
if (!(SEE_USER(sptr, acptr, bitsel)))
continue;
- if ((mask) &&
- ((!(matchsel & WHO_FIELD_NIC))
+ if ((mask)
+ && ((!(matchsel & WHO_FIELD_NIC))
|| matchexec(cli_name(acptr), mymask, minlen))
&& ((!(matchsel & WHO_FIELD_UID))
|| matchexec(cli_user(acptr)->username, mymask, minlen))
@@ -648,7 +653,10 @@
|| 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;
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches