[srvx-commits] CVS: services/src opserv.c,1.338,1.339 opserv.help,1.65,1.66
Brought to you by:
entrope
From: Adrian D. <sai...@us...> - 2003-09-30 17:47:14
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv17866/src Modified Files: opserv.c opserv.help Log Message: Add new trace criterion info_space Index: opserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.c,v retrieving revision 1.338 retrieving revision 1.339 diff -C2 -r1.338 -r1.339 *** opserv.c 9 Sep 2003 16:38:13 -0000 1.338 --- opserv.c 30 Sep 2003 17:47:08 -0000 1.339 *************** *** 326,330 **** unsigned int match_opers : 1, option_log : 1; unsigned int chan_req_modes : 2, chan_no_modes : 2; ! int authed : 2; time_t min_ts, max_ts; } *discrim_t; --- 326,330 ---- unsigned int match_opers : 1, option_log : 1; unsigned int chan_req_modes : 2, chan_no_modes : 2; ! int authed : 2, info_space : 2; time_t min_ts, max_ts; } *discrim_t; *************** *** 2308,2311 **** --- 2308,2312 ---- discrim->max_channels = INT_MAX; discrim->authed = -1; + discrim->info_space = -1; dupmask = strdup(hostmask); if (split_ircmask(dupmask, &discrim->mask_nick, &discrim->mask_ident, &discrim->mask_host)) { *************** *** 2781,2784 **** --- 2782,2786 ---- discrim->max_channels = INT_MAX; discrim->authed = -1; + discrim->info_space = -1; for (i=0; i<argc; i++) { *************** *** 2838,2841 **** --- 2840,2855 ---- goto fail; } + } else if (irccasecmp(argv[i], "info_space") == 0) { + /* XXX: A hack because you can't check explicitly for a space through + * any other means */ + i++; + if (true_string(argv[i])) { + discrim->info_space = 1; + } else if (false_string(argv[i])) { + discrim->info_space = 0; + } else { + opserv_notice(user, MSG_INVALID_BINARY, argv[i]); + goto fail; + } } else if (irccasecmp(argv[i], "duration") == 0) { discrim->duration = ParseInterval(argv[++i]); *************** *** 2926,2933 **** } else if (irccasecmp(argv[i], "clones") == 0) { discrim->min_clones = strtoul(argv[++i], NULL, 0); ! } else { ! opserv_notice(user, MSG_INVALID_CRITERIA, argv[i]); ! goto fail; ! } } --- 2940,2947 ---- } else if (irccasecmp(argv[i], "clones") == 0) { discrim->min_clones = strtoul(argv[++i], NULL, 0); ! } else { ! opserv_notice(user, MSG_INVALID_CRITERIA, argv[i]); ! goto fail; ! } } *************** *** 2961,2964 **** --- 2975,2980 ---- || (discrim->authed == 0 && user->handle_info) || (discrim->authed == 1 && !user->handle_info) + || (discrim->info_space == 0 && user->info[0] == ' ') + || (discrim->info_space == 1 && user->info[0] != ' ') || (discrim->mask_nick && !match_ircglob(user->nick, discrim->mask_nick)) || (discrim->mask_ident && !match_ircglob(user->ident, discrim->mask_ident)) Index: opserv.help =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.help,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -r1.65 -r1.66 *** opserv.help 3 Aug 2003 03:01:24 -0000 1.65 --- opserv.help 30 Sep 2003 17:47:09 -0000 1.66 *************** *** 83,86 **** --- 83,87 ---- "$bDURATION$b duration How long to apply a G-line or gag.", "$bCLONES$b min Ignore clients from hosts with fewer than this many connections.", + "$bINFO_SPACE$b yes/no Clients match only if their info starts with a space (' ') character.", "$bABUSE OPERS$b Force adverse actions to affect opers as well.", "$bLOG$b Record matching users in $O's log file (in addition to acting).", |