X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/13ae2f4b6904ebf7b8160902f9ffeb80f7585ed2..8097430a810ac1535fe5304f74991b16ff58b064:/modules/m_scan.c diff --git a/modules/m_scan.c b/modules/m_scan.c index 23a64b3..ccc1d02 100644 --- a/modules/m_scan.c +++ b/modules/m_scan.c @@ -79,7 +79,6 @@ static const char *spoofed_sockhost = "0"; /* * m_scan - * parv[0] = sender prefix * parv[1] = options [or target] * parv[2] = [target] */ @@ -115,7 +114,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 +134,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 +175,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)) {