X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/f06c147c70cf72b40e4ec0ec3b5aca86662beb80..fc579e36e7201b9fcedf1f44f6d8746aa7fe1918:/modules/m_scan.c diff --git a/modules/m_scan.c b/modules/m_scan.c index 23a64b3..28154d8 100644 --- a/modules/m_scan.c +++ b/modules/m_scan.c @@ -28,7 +28,6 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: m_scan.c 1853 2006-08-24 18:30:52Z jilles $ */ #include "stdinc.h" @@ -79,7 +78,6 @@ static const char *spoofed_sockhost = "0"; /* * m_scan - * parv[0] = sender prefix * parv[1] = options [or target] * parv[2] = [target] */ @@ -115,7 +113,7 @@ scan_umodes(struct Client *client_p, struct Client *source_p, int parc, int what = MODE_ADD; int mode; int list_users = YES; - int list_max = 0; + int list_max = 500; int list_count = 0, count = 0; const char *mask = NULL; const char *c; @@ -135,6 +133,12 @@ scan_umodes(struct Client *client_p, struct Client *source_p, int parc, return -1; } + if (parv[2][0] != '+' && parv[2][0] != '-') + { + sendto_one_notice(source_p, ":SCAN UMODES: umodes parameter must start with '+' or '-'"); + return -1; + } + for (c = parv[2]; *c; c++) { switch(*c) @@ -170,9 +174,19 @@ scan_umodes(struct Client *client_p, struct Client *source_p, int parc, list_max = atoi(parv[++i]); else if (!irccmp(parv[i], "mask")) mask = parv[++i]; + else + { + sendto_one_notice(source_p, ":SCAN UMODES: invalid parameters"); + return -1; + } + } + else + { + sendto_one_notice(source_p, ":SCAN UMODES: invalid parameters"); + return -1; } } - if (target_list == &global_client_list && (list_users || mask)) + if (target_list == &global_client_list && list_users) { if (IsOperSpy(source_p)) {