[READ-ONLY] Mirror of https://github.com/VibeDevelopers/Comet.
0

Configure Feed

Select the types of activity you want to include in your feed.

Remove some legacy cruft

- The hurt extension doesn't work well and is now supplanted by
m_quarantine
- ip_cloaking_old has been broken (causes segfaults) for years now,
remove it
- ip_cloaking_3.0 has hardcoded keys that require .c file edits to be
secure. Anyone using it will probably maintain their fork of this file
anyway, but it's not good for new people to use. Remove that too
- Remove LOCOPS and umode +l entirely; they serve no useful purpose on
unified networks. This also removes the no_locops extension since it
is now useless

authored by

Ryan Schmidt and committed by
Aaron Jones
(May 13, 2026, 3:55 AM UTC) 8cbf75cc 913d2e34

+12 -1240
+3 -4
doc/ircd.conf.example
··· 26 26 #loadmodule "extensions/m_extendchans"; 27 27 #loadmodule "extensions/m_findforwards"; 28 28 #loadmodule "extensions/m_identify"; 29 - #loadmodule "extensions/m_locops"; 30 29 #loadmodule "extensions/no_oper_invis"; 31 30 #loadmodule "extensions/sno_farconnect"; 32 31 #loadmodule "extensions/sno_globalnickchange"; ··· 273 272 * If this is specified an oper will not be given oper_umodes 274 273 * These are described above oper_only_umodes in general {}; 275 274 */ 276 - #umodes = locops, servnotice, operwall, wallop; 275 + #umodes = servnotice, operwall, wallop; 277 276 278 277 /* fingerprint: if specified, the oper's client certificate 279 278 * fingerprint will be checked against the specified fingerprint ··· 612 611 client_flood_max_lines = 20; 613 612 post_registration_delay = 0 seconds; 614 613 use_whois_actually = no; 615 - oper_only_umodes = operwall, locops, servnotice; 616 - oper_umodes = locops, servnotice, operwall, wallop; 614 + oper_only_umodes = operwall, servnotice; 615 + oper_umodes = servnotice, operwall, wallop; 617 616 oper_snomask = "+s"; 618 617 burst_away = yes; 619 618 nick_delay = 0 seconds; # 15 minutes if you want to enable this
+1 -11
doc/oper-guide/config.rst
··· 697 697 unresv (R) 698 698 ``RESV`` removals 699 699 700 - locops (L) 701 - ``LOCOPS`` messages (sharing this with \* makes ``LOCOPS`` rather similar to 702 - ``OPERWALL`` which is not useful) 703 - 704 700 all 705 701 All of the above 706 702 ··· 765 761 ``RESV`` removals 766 762 767 763 all 768 - All of the above; this does not include locops, rehash, dline, 764 + All of the above; this does not include rehash, dline, 769 765 tdline or undline. 770 - 771 - locops (L) 772 - ``LOCOPS`` messages (accepting this from \* makes ``LOCOPS`` rather similar 773 - to ``OPERWALL`` which is not useful); unlike the other flags, this can 774 - only be accepted from \*@\* although it can be restricted based on 775 - source server. 776 766 777 767 rehash (H) 778 768 ``REHASH`` commands; all options can be used
-9
doc/oper-guide/umodes.rst
··· 50 50 51 51 Invisible users do not show up in ``WHO`` and ``NAMES`` unless you can see them. 52 52 53 - ``+l``, receive locops 54 - ---------------------- 55 - 56 - ``LOCOPS`` is a version of ``OPERWALL`` that is sent to opers on a single server 57 - only. With cluster{} and shared{} blocks they can optionally be 58 - propagated further. 59 - 60 - Unlike ``OPERWALL``, any oper can send and receive ``LOCOPS``. 61 - 62 53 ``+o``, operator 63 54 ---------------- 64 55
+3 -14
doc/reference.conf
··· 85 85 * Dynamically extend channel limits -- m_extendchans 86 86 * Find channel forwards -- m_findforwards 87 87 * /identify support -- m_identify 88 - * /locops support -- m_locops 89 88 * /ojoin support (alternative to override) -- m_ojoin 90 89 * /okick support (alternative to override) -- m_okick 91 90 * /omode support (alternative to override) -- m_omode ··· 96 95 * Shed users from the server -- m_shedding 97 96 * WebIRC support -- m_webirc 98 97 * Prevent opers from killing services -- no_kill_services 99 - * Disables local opers entirely -- no_locops 100 98 * Opers cannot be invisible (umode +i) -- no_oper_invis 101 99 * Oper override -- override 102 100 * Opers using override cannot be /kicked -- override_kick_immunity ··· 150 148 #loadmodule "extensions/m_extendchans"; 151 149 #loadmodule "extensions/m_findforwards"; 152 150 #loadmodule "extensions/m_identify"; 153 - #loadmodule "extensions/m_locops"; 154 151 #loadmodule "extensions/m_ojoin"; 155 152 #loadmodule "extensions/m_okick"; 156 153 #loadmodule "extensions/m_omode"; ··· 161 158 #loadmodule "extensions/m_shedding"; 162 159 #loadmodule "extensions/m_webirc"; 163 160 #loadmodule "extensions/no_kill_services"; 164 - #loadmodule "extensions/no_locops"; 165 161 #loadmodule "extensions/no_oper_invis"; 166 162 #loadmodule "extensions/override"; 167 163 #loadmodule "extensions/override_kick_immunity"; ··· 599 595 * If this is specified an oper will not be given oper_umodes 600 596 * These are described above oper_only_umodes in general {}; 601 597 */ 602 - #umodes = locops, servnotice, operwall, wallop; 598 + #umodes = servnotice, operwall, wallop; 603 599 604 600 /* snomask: specific server notice mask on oper up. 605 601 * If this is specified an oper will not be given oper_snomask. ··· 708 704 * kline - share perm klines 709 705 * tkline - share temp klines 710 706 * unkline - share unklines 711 - * locops - share locops 712 707 * xline - share perm xlines 713 708 * txline - share temp xlines 714 709 * unxline - share unxlines ··· 721 716 /* share klines/unklines/xlines with *.lan */ 722 717 name = "*.lan"; 723 718 flags = kline, unkline, xline; 724 - 725 - /* share locops with irc.ircd-ratbox.org and ircd.ircd-ratbox.org */ 726 - name = "irc.ircd-ratbox.org"; 727 - name = "ircd.ircd-ratbox.org"; 728 - flags = locops; 729 719 }; 730 720 731 721 /* service{}: privileged servers (services). These servers have extra ··· 1422 1412 * +D - deaf - Don't see channel messages 1423 1413 * +i - invisible - Not shown in NAMES or WHO unless you share a 1424 1414 * a channel 1425 - * +l - locops - See LOCOPS messages 1426 1415 * +Q - noforward - Unaffected by channel forwarding 1427 1416 * +s - servnotice - See server notices 1428 1417 * +w - wallop - See oper and server generated WALLOPS ··· 1430 1419 */ 1431 1420 1432 1421 /* oper only umodes: usermodes only opers may set */ 1433 - oper_only_umodes = operwall, locops, servnotice; 1422 + oper_only_umodes = operwall, servnotice; 1434 1423 1435 1424 /* oper umodes: default usermodes opers get when they /oper */ 1436 - oper_umodes = locops, servnotice, operwall, wallop; 1425 + oper_umodes = servnotice, operwall, wallop; 1437 1426 1438 1427 /* oper snomask: default snomask opers get when they /oper, 1439 1428 * provided they have umode +s set */
+1 -1
doc/technical/capab.txt
··· 23 23 SERVICES - supports ratbox's services extensions 24 24 SAVE - supports SAVE extension (friendlier alternative to KILL on nick collide) 25 25 RSFNC - supports RSFNC extension (forcenick) 26 - CLUSTER - supports remote XLINE, UNXLINE, RESV, UNRESV and LOCOPS 26 + CLUSTER - supports remote XLINE, UNXLINE, RESV, and UNRESV 27 27 EUID - supports EUID, non-ENCAP CHGHOST and NICKDELAY 28 28 ZIP - supports ziplinks 29 29 ENC - supports encryption (cryptlinks)
-5
extensions/Makefile.am
··· 34 34 force_user_invis.la \ 35 35 helpops.la \ 36 36 hide_uncommon_channels.la \ 37 - hurt.la \ 38 37 identify_msg.la \ 39 38 invex_regonly.la \ 40 39 invite_notify.la \ 41 40 ip_cloaking.la \ 42 - ip_cloaking_old.la \ 43 - ip_cloaking_3.0.la \ 44 41 ip_cloaking_4.0.la \ 45 42 m_adminwall.la \ 46 43 m_echotags.la \ 47 44 m_extendchans.la \ 48 45 m_findforwards.la \ 49 46 m_identify.la \ 50 - m_locops.la \ 51 47 m_mkpasswd.la \ 52 48 m_ojoin.la \ 53 49 m_okick.la \ ··· 59 55 m_shedding.la \ 60 56 m_webirc.la \ 61 57 no_kill_services.la \ 62 - no_locops.la \ 63 58 no_oper_invis.la \ 64 59 override.la \ 65 60 override_kick_immunity.la \
-636
extensions/hurt.c
··· 1 - /* 2 - * Solanum: a slightly advanced ircd 3 - * 4 - * Copyright (C) 2006 charybdis development team 5 - * All rights reserved 6 - */ 7 - #include "stdinc.h" 8 - #include "modules.h" 9 - #include "hook.h" 10 - #include "client.h" 11 - #include "ircd.h" 12 - #include "send.h" 13 - #include "numeric.h" 14 - #include "hostmask.h" 15 - #include "s_conf.h" 16 - #include "s_newconf.h" 17 - #include "hash.h" 18 - #include "messages.h" 19 - #include "s_assert.h" 20 - 21 - /* {{{ Structures */ 22 - #define HURT_CUTOFF (10) /* protocol messages. */ 23 - #define HURT_DEFAULT_EXPIRE (7 * 24 * 60) /* minutes. */ 24 - #define HURT_EXIT_REASON "Hurt: Failed to identify to services" 25 - 26 - enum { 27 - HEAL_NICK = 0, 28 - HEAL_IP 29 - }; 30 - 31 - typedef struct _hurt_state { 32 - time_t start_time; 33 - uint32_t n_hurts; 34 - rb_dlink_list hurt_clients; 35 - uint16_t cutoff; 36 - time_t default_expire; 37 - const char *exit_reason; 38 - } hurt_state_t; 39 - 40 - typedef struct _hurt { 41 - char *ip; 42 - struct sockaddr *saddr; 43 - int saddr_bits; 44 - char *reason; 45 - time_t expire; 46 - } hurt_t; 47 - /* }}} */ 48 - 49 - /* {{{ Prototypes */ 50 - static void mo_hurt(struct MsgBuf *msgbuf_p, struct Client *, struct Client *, int, const char **); 51 - static void me_hurt(struct MsgBuf *msgbuf_p, struct Client *, struct Client *, int, const char **); 52 - static void mo_heal(struct MsgBuf *msgbuf_p, struct Client *, struct Client *, int, const char **); 53 - static void me_heal(struct MsgBuf *msgbuf_p, struct Client *, struct Client *, int, const char **); 54 - 55 - static int modinit(void); 56 - static void modfini(void); 57 - 58 - static void client_exit_hook(void *); 59 - static void new_local_user_hook(void *); 60 - static void doing_stats_hook(void *); 61 - 62 - static void hurt_check_event(void *); 63 - static void hurt_expire_event(void *); 64 - 65 - static hurt_t *hurt_new(time_t, const char *, const char *); 66 - static void hurt_add(hurt_t *); 67 - static void hurt_propagate(struct Client *, struct Client *, hurt_t *); 68 - static hurt_t *hurt_find(const char *ip); 69 - static hurt_t *hurt_find_exact(const char *ip); 70 - static void hurt_remove(const char *ip); 71 - static void hurt_destroy(void *hurt); 72 - 73 - static void heal_nick(struct Client *, struct Client *); 74 - 75 - /* }}} */ 76 - 77 - /* {{{ State containers */ 78 - 79 - rb_dlink_list hurt_confs = { NULL, NULL, 0 }; 80 - 81 - /* }}} */ 82 - 83 - /* {{{ Messages */ 84 - struct Message hurt_msgtab = { 85 - "HURT", 0, 0, 0, 0, { 86 - mg_ignore, mg_ignore, mg_ignore, 87 - mg_ignore, {me_hurt, 0}, {mo_hurt, 3} 88 - } 89 - }; 90 - 91 - struct Message heal_msgtab = { 92 - "HEAL", 0, 0, 0, 0, { 93 - mg_ignore, mg_ignore, mg_ignore, 94 - mg_ignore, {me_heal, 0}, {mo_heal, 2} 95 - } 96 - }; 97 - /* }}} */ 98 - 99 - /* {{{ Misc module stuff */ 100 - mapi_hfn_list_av1 hurt_hfnlist[] = { 101 - {"client_exit", client_exit_hook}, 102 - {"new_local_user", new_local_user_hook}, 103 - {"doing_stats", doing_stats_hook}, 104 - {NULL, NULL}, 105 - }; 106 - 107 - mapi_clist_av1 hurt_clist[] = { &hurt_msgtab, &heal_msgtab, NULL }; 108 - 109 - static const char hurt_desc[] = 110 - "Prevents \"hurt\" users from messaging anyone but operators or " 111 - "services until they identify or are \"healed\""; 112 - 113 - DECLARE_MODULE_AV2( 114 - hurt, 115 - modinit, 116 - modfini, 117 - hurt_clist, 118 - NULL, 119 - hurt_hfnlist, 120 - NULL, 121 - NULL, 122 - hurt_desc 123 - ); 124 - /* }}} */ 125 - 126 - hurt_state_t hurt_state = { 127 - .cutoff = HURT_CUTOFF, 128 - .default_expire = HURT_DEFAULT_EXPIRE, 129 - .exit_reason = HURT_EXIT_REASON, 130 - }; 131 - 132 - /* 133 - * Module constructor/destructor. 134 - */ 135 - 136 - /* {{{ static int modinit() */ 137 - 138 - struct ev_entry *hurt_expire_ev = NULL; 139 - struct ev_entry *hurt_check_ev = NULL; 140 - 141 - static int 142 - modinit(void) 143 - { 144 - /* set-up hurt_state. */ 145 - hurt_state.start_time = rb_current_time(); 146 - 147 - /* add our event handlers. */ 148 - hurt_expire_ev = rb_event_add("hurt_expire", hurt_expire_event, NULL, 60); 149 - hurt_check_ev = rb_event_add("hurt_check", hurt_check_event, NULL, 5); 150 - 151 - return 0; 152 - } 153 - /* }}} */ 154 - 155 - /* {{{ static void modfini() */ 156 - static void 157 - modfini(void) 158 - { 159 - rb_dlink_node *ptr, *next_ptr; 160 - 161 - /* and delete our events. */ 162 - rb_event_delete(hurt_expire_ev); 163 - rb_event_delete(hurt_check_ev); 164 - 165 - RB_DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_state.hurt_clients.head) 166 - { 167 - rb_dlinkDestroy(ptr, &hurt_state.hurt_clients); 168 - } 169 - } 170 - /* }}} */ 171 - 172 - /* 173 - * Message handlers. 174 - */ 175 - 176 - /* {{{ static void mo_hurt() 177 - * 178 - * HURT [<expire>] <ip> <reason> 179 - * 180 - * parv[1] - expire or ip 181 - * parv[2] - ip or reason 182 - * parv[3] - reason or NULL 183 - */ 184 - static void 185 - mo_hurt(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, 186 - int parc, const char **parv) 187 - { 188 - const char *ip, *expire, *reason; 189 - int expire_time; 190 - hurt_t *hurt; 191 - struct Client *target_p; 192 - 193 - if (!IsOperK(source_p)) { 194 - sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, 195 - source_p->name, "kline"); 196 - return; 197 - } 198 - 199 - if (parc == 3) 200 - expire = NULL, ip = parv[1], reason = parv[2]; 201 - else 202 - expire = parv[1], ip = parv[2], reason = parv[3]; 203 - 204 - if (!expire) 205 - expire_time = HURT_DEFAULT_EXPIRE; 206 - if (expire && (expire_time = valid_temp_time(expire)) < 1) { 207 - sendto_one_notice(source_p, ":Permanent HURTs are not supported"); 208 - return; 209 - } 210 - if (EmptyString(reason)) { 211 - sendto_one_notice(source_p, ":Empty HURT reasons are bad for business"); 212 - return; 213 - } 214 - 215 - /* Is this a client? */ 216 - if (strchr(ip, '.') == NULL && strchr(ip, ':') == NULL) 217 - { 218 - target_p = find_named_person(ip); 219 - if (target_p == NULL) 220 - { 221 - sendto_one_numeric(source_p, ERR_NOSUCHNICK, 222 - form_str(ERR_NOSUCHNICK), ip); 223 - return; 224 - } 225 - ip = target_p->orighost; 226 - } 227 - else 228 - { 229 - if (!strncmp(ip, "*@", 2)) 230 - ip += 2; 231 - if (strchr(ip, '!') || strchr(ip, '@')) 232 - { 233 - sendto_one_notice(source_p, ":Invalid HURT mask [%s]", 234 - ip); 235 - return; 236 - } 237 - } 238 - 239 - if (hurt_find(ip) != NULL) { 240 - sendto_one(source_p, ":[%s] already HURT", ip); 241 - return; 242 - } 243 - 244 - /* 245 - * okay, we've got this far, now it's time to add the the HURT locally 246 - * and propagate it to other servers on the network. 247 - */ 248 - sendto_realops_snomask(SNO_GENERAL, L_ALL, 249 - "%s added HURT on [%s] for %ld minutes with reason [%s]", 250 - get_oper_name(source_p), ip, (long) expire_time / 60, reason); 251 - 252 - hurt = hurt_new(expire_time, ip, reason); 253 - hurt_add(hurt); 254 - hurt_propagate(NULL, source_p, hurt); 255 - } 256 - /* }}} */ 257 - 258 - /* {{{ static void me_hurt() 259 - * 260 - * [ENCAP mask] HURT <target> <expire> <ip> <reason> 261 - * 262 - * parv[1] - expire 263 - * parv[2] - ip 264 - * parv[3] - reason 265 - */ 266 - static void 267 - me_hurt(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, 268 - int parc, const char **parv) 269 - { 270 - time_t expire_time; 271 - hurt_t *hurt; 272 - 273 - /* 274 - * right... if we don't get enough arguments, or if we get any invalid 275 - * arguments, just ignore this request - shit happens, and it's not worth 276 - * dropping a server over. 277 - */ 278 - if (parc < 4 || !IsPerson(source_p)) 279 - return; 280 - if ((expire_time = atoi(parv[1])) < 1) 281 - return; 282 - if (hurt_find(parv[2]) != NULL) 283 - return; 284 - if (EmptyString(parv[3])) 285 - return; 286 - 287 - sendto_realops_snomask(SNO_GENERAL, L_ALL, 288 - "%s added HURT on [%s] for %ld minutes with reason [%s]", 289 - get_oper_name(source_p), parv[2], (long) expire_time / 60, parv[3]); 290 - hurt = hurt_new(expire_time, parv[2], parv[3]); 291 - hurt_add(hurt); 292 - } 293 - /* }}} */ 294 - 295 - /* {{{ static void mo_heal() 296 - * 297 - * HURT <nick>|<ip> 298 - * 299 - * parv[1] - nick or ip 300 - */ 301 - static void 302 - mo_heal(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, 303 - int parc, const char **parv) 304 - { 305 - struct Client *target_p; 306 - 307 - if (!IsOperUnkline(source_p)) 308 - { 309 - sendto_one(source_p, form_str(ERR_NOPRIVS), 310 - me.name, source_p->name, "unkline"); 311 - return; 312 - } 313 - 314 - if (clean_nick(parv[1], 0)) 315 - { 316 - target_p = find_named_person(parv[1]); 317 - if (target_p == NULL) 318 - { 319 - sendto_one_numeric(source_p, ERR_NOSUCHNICK, 320 - form_str(ERR_NOSUCHNICK), parv[1]); 321 - return; 322 - } 323 - if (MyConnect(target_p)) 324 - heal_nick(source_p, target_p); 325 - else 326 - sendto_one(target_p, ":%s ENCAP %s HEAL %s", 327 - get_id(source_p, target_p), 328 - target_p->servptr->name, 329 - get_id(target_p, target_p)); 330 - } 331 - else if (strchr(parv[1], '.')) 332 - { 333 - if (hurt_find_exact(parv[1]) == NULL) 334 - { 335 - sendto_one_notice(source_p, ":Mask [%s] is not HURT", parv[1]); 336 - return; 337 - } 338 - hurt_remove(parv[1]); 339 - sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s removed HURT on %s", 340 - get_oper_name(source_p), parv[1]); 341 - sendto_server(NULL, NULL, NOCAPS, NOCAPS, ":%s ENCAP * HEAL %s", 342 - source_p->name, parv[1]); 343 - } 344 - else 345 - { 346 - sendto_one(source_p, ":[%s] is not a valid IP address/nick", parv[1]); 347 - return; 348 - } 349 - } 350 - /* }}} */ 351 - 352 - static void 353 - me_heal(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, 354 - int parc, const char **parv) 355 - { 356 - struct Client *target_p; 357 - 358 - /* as noted in me_hurt(), if we don't get sufficient arguments... 359 - * *poof*, it's dropped... 360 - */ 361 - if (parc < 2) 362 - return; 363 - 364 - if (clean_nick(parv[1], 0)) 365 - { 366 - target_p = find_person(parv[1]); 367 - if (target_p != NULL && MyConnect(target_p)) 368 - heal_nick(source_p, target_p); 369 - } 370 - else if (strchr(parv[1], '.')) /* host or mask to remove ban for */ 371 - { 372 - if (hurt_find_exact(parv[1]) == NULL) 373 - return; 374 - 375 - hurt_remove(parv[1]); 376 - sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s removed HURT on %s", 377 - get_oper_name(source_p), parv[1]); 378 - } 379 - } 380 - 381 - /* 382 - * Event handlers. 383 - */ 384 - 385 - /* {{{ static void hurt_check_event() */ 386 - static void 387 - hurt_check_event(void *arg) 388 - { 389 - rb_dlink_node *ptr, *next_ptr; 390 - struct Client *client_p; 391 - 392 - RB_DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_state.hurt_clients.head) { 393 - client_p = ptr->data; 394 - if (!EmptyString(client_p->user->suser)) 395 - { 396 - rb_dlinkDestroy(ptr, &hurt_state.hurt_clients); 397 - sendto_one_notice(client_p, ":HURT restriction removed for this session"); 398 - client_p->localClient->target_last = rb_current_time(); /* don't ask --nenolod */ 399 - } 400 - else if (client_p->localClient->receiveM > hurt_state.cutoff) 401 - exit_client(NULL, client_p, &me, hurt_state.exit_reason); 402 - } 403 - } 404 - /* }}} */ 405 - 406 - /* {{{ static void hurt_expire_event() */ 407 - static void 408 - hurt_expire_event(void *unused) 409 - { 410 - rb_dlink_node *ptr, *next_ptr; 411 - hurt_t *hurt; 412 - 413 - RB_DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_confs.head) 414 - { 415 - hurt = (hurt_t *) ptr->data; 416 - 417 - if (hurt->expire <= rb_current_time()) 418 - { 419 - rb_dlinkFindDestroy(hurt, &hurt_confs); 420 - hurt_destroy(hurt); 421 - } 422 - } 423 - } 424 - /* }}} */ 425 - 426 - /* 427 - * Hook functions. 428 - */ 429 - 430 - /* {{{ static void client_exit_hook() */ 431 - static void 432 - client_exit_hook(void *data_) 433 - { 434 - hook_data_client_exit *data = data_; 435 - s_assert(data != NULL); 436 - s_assert(data->target != NULL); 437 - 438 - rb_dlinkFindDestroy(data->target, &hurt_state.hurt_clients); 439 - } 440 - /* }}} */ 441 - 442 - /* {{{ static void new_local_user_hook() */ 443 - static void 444 - new_local_user_hook(void *data) 445 - { 446 - struct Client *source_p = data; 447 - if (IsAnyDead(source_p) || !EmptyString(source_p->user->suser) || 448 - IsExemptKline(source_p)) 449 - return; 450 - 451 - if (hurt_find(source_p->sockhost) || hurt_find(source_p->orighost)) 452 - { 453 - source_p->localClient->target_last = rb_current_time() + 600; /* don't ask --nenolod */ 454 - SetTGChange(source_p); 455 - rb_dlinkAddAlloc(source_p, &hurt_state.hurt_clients); 456 - sendto_one_notice(source_p, ":You are hurt. Please identify to services immediately, or use /stats p for assistance."); 457 - } 458 - } 459 - /* }}} */ 460 - 461 - /* {{{ static void doing_stats_hook() */ 462 - static void 463 - doing_stats_hook(void *data) 464 - { 465 - hook_data_int *hdata = data; 466 - rb_dlink_node *ptr; 467 - hurt_t *hurt; 468 - struct Client *source_p; 469 - 470 - s_assert(hdata); 471 - s_assert(hdata->client); 472 - 473 - source_p = hdata->client; 474 - if(hdata->arg2 != (int) 's') 475 - return; 476 - if((ConfigFileEntry.stats_k_oper_only == 2) && !IsOperGeneral(source_p)) 477 - return; 478 - if ((ConfigFileEntry.stats_k_oper_only == 1) && !IsOperGeneral(source_p)) 479 - { 480 - hurt = hurt_find(source_p->sockhost); 481 - if (hurt != NULL) 482 - { 483 - sendto_one_numeric(source_p, RPL_STATSKLINE, 484 - form_str(RPL_STATSKLINE), 's', 485 - "*", hurt->ip, hurt->reason, "", ""); 486 - return; 487 - } 488 - 489 - hurt = hurt_find(source_p->orighost); 490 - if (hurt != NULL) 491 - { 492 - sendto_one_numeric(source_p, RPL_STATSKLINE, 493 - form_str(RPL_STATSKLINE), 's', 494 - "*", hurt->ip, hurt->reason, "", ""); 495 - } 496 - return; 497 - } 498 - 499 - RB_DLINK_FOREACH(ptr, hurt_confs.head) 500 - { 501 - hurt = (hurt_t *) ptr->data; 502 - sendto_one_numeric(source_p, RPL_STATSKLINE, 503 - form_str(RPL_STATSKLINE), 's', 504 - "*", hurt->ip, hurt->reason, "", ""); 505 - } 506 - } 507 - /* }}} */ 508 - 509 - /* {{{ static void hurt_propagate() 510 - * 511 - * client_p - specific server to propagate HURT to, or NULL to propagate to all 512 - * servers. 513 - * source_p - source (oper who added the HURT) 514 - * hurt - HURT to be propagated 515 - */ 516 - static void 517 - hurt_propagate(struct Client *client_p, struct Client *source_p, hurt_t *hurt) 518 - { 519 - if (client_p) 520 - sendto_one(client_p, 521 - ":%s ENCAP %s HURT %ld %s :%s", 522 - source_p->name, client_p->name, 523 - (long)(hurt->expire - rb_current_time()), 524 - hurt->ip, hurt->reason); 525 - else 526 - sendto_server(&me, NULL, NOCAPS, NOCAPS, 527 - ":%s ENCAP * HURT %ld %s :%s", 528 - source_p->name, 529 - (long)(hurt->expire - rb_current_time()), 530 - hurt->ip, hurt->reason); 531 - } 532 - /* }}} */ 533 - 534 - /* {{{ static hurt_t *hurt_new() */ 535 - static hurt_t * 536 - hurt_new(time_t expire, const char *ip, const char *reason) 537 - { 538 - hurt_t *hurt; 539 - 540 - hurt = rb_malloc(sizeof(hurt_t)); 541 - 542 - hurt->ip = rb_strdup(ip); 543 - hurt->reason = rb_strdup(reason); 544 - hurt->expire = rb_current_time() + expire; 545 - 546 - return hurt; 547 - } 548 - /* }}} */ 549 - 550 - /* {{{ static void hurt_destroy() */ 551 - static void 552 - hurt_destroy(void *hurt) 553 - { 554 - hurt_t *h; 555 - 556 - if (!hurt) 557 - return; 558 - 559 - h = (hurt_t *) hurt; 560 - rb_free(h->ip); 561 - rb_free(h->reason); 562 - rb_free(h); 563 - } 564 - /* }}} */ 565 - 566 - static void 567 - hurt_add(hurt_t *hurt) 568 - { 569 - rb_dlinkAddAlloc(hurt, &hurt_confs); 570 - } 571 - 572 - static hurt_t * 573 - hurt_find_exact(const char *ip) 574 - { 575 - rb_dlink_node *ptr; 576 - hurt_t *hurt; 577 - 578 - RB_DLINK_FOREACH(ptr, hurt_confs.head) 579 - { 580 - hurt = (hurt_t *) ptr->data; 581 - 582 - if (!rb_strcasecmp(ip, hurt->ip)) 583 - return hurt; 584 - } 585 - 586 - return NULL; 587 - } 588 - 589 - static hurt_t * 590 - hurt_find(const char *ip) 591 - { 592 - rb_dlink_node *ptr; 593 - hurt_t *hurt; 594 - 595 - RB_DLINK_FOREACH(ptr, hurt_confs.head) 596 - { 597 - hurt = (hurt_t *) ptr->data; 598 - 599 - if (match(hurt->ip, ip)) 600 - return hurt; 601 - } 602 - 603 - return NULL; 604 - } 605 - 606 - static void 607 - hurt_remove(const char *ip) 608 - { 609 - hurt_t *hurt = hurt_find_exact(ip); 610 - 611 - rb_dlinkFindDestroy(hurt, &hurt_confs); 612 - hurt_destroy(hurt); 613 - } 614 - 615 - /* {{{ static void heal_nick() */ 616 - static void 617 - heal_nick(struct Client *source_p, struct Client *target_p) 618 - { 619 - if (rb_dlinkFindDestroy(target_p, &hurt_state.hurt_clients)) 620 - { 621 - sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s used HEAL on %s", 622 - get_oper_name(source_p), get_client_name(target_p, HIDE_IP)); 623 - sendto_one_notice(target_p, ":HURT restriction temporarily removed by operator"); 624 - sendto_one_notice(source_p, ":HURT restriction on %s temporarily removed", target_p->name); 625 - target_p->localClient->target_last = rb_current_time(); /* don't ask --nenolod */ 626 - } 627 - else 628 - { 629 - sendto_one_notice(source_p, ":%s was not hurt", target_p->name); 630 - } 631 - } 632 - /* }}} */ 633 - 634 - /* 635 - * vim: ts=8 sw=8 noet fdm=marker tw=80 636 - */
-232
extensions/ip_cloaking_3.0.c
··· 1 - 2 - #include "stdinc.h" 3 - #include "modules.h" 4 - #include "hook.h" 5 - #include "client.h" 6 - #include "ircd.h" 7 - #include "send.h" 8 - #include "s_conf.h" 9 - #include "s_user.h" 10 - #include "s_serv.h" 11 - #include "numeric.h" 12 - 13 - static const char ip_cloaking_desc[] = "The old IP cloaking mechanism version 3.0"; 14 - 15 - /* if you're modifying this module, you'll probably want to change this */ 16 - #define KEY 0x13748cfa 17 - 18 - static int 19 - _modinit(void) 20 - { 21 - /* add the usermode to the available slot */ 22 - user_modes['h'] = find_umode_slot(); 23 - construct_umodebuf(); 24 - 25 - return 0; 26 - } 27 - 28 - static void 29 - _moddeinit(void) 30 - { 31 - /* disable the umode and remove it from the available list */ 32 - user_modes['h'] = 0; 33 - construct_umodebuf(); 34 - } 35 - 36 - static void check_umode_change(void *data); 37 - static void check_new_user(void *data); 38 - mapi_hfn_list_av1 ip_cloaking_hfnlist[] = { 39 - { "umode_changed", check_umode_change }, 40 - { "new_local_user", check_new_user }, 41 - { NULL, NULL } 42 - }; 43 - 44 - DECLARE_MODULE_AV2(ip_cloaking, _modinit, _moddeinit, NULL, NULL, 45 - ip_cloaking_hfnlist, NULL, NULL, ip_cloaking_desc); 46 - 47 - static void 48 - distribute_hostchange(struct Client *client_p, char *newhost) 49 - { 50 - if (newhost != client_p->orighost) 51 - sendto_one_numeric(client_p, RPL_HOSTHIDDEN, "%s :is now your hidden host", 52 - newhost); 53 - else 54 - sendto_one_numeric(client_p, RPL_HOSTHIDDEN, "%s :hostname reset", 55 - newhost); 56 - 57 - sendto_server(NULL, NULL, 58 - CAP_EUID | CAP_TS6, NOCAPS, ":%s CHGHOST %s :%s", 59 - use_id(&me), use_id(client_p), newhost); 60 - sendto_server(NULL, NULL, 61 - CAP_TS6, CAP_EUID, ":%s ENCAP * CHGHOST %s :%s", 62 - use_id(&me), use_id(client_p), newhost); 63 - 64 - change_nick_user_host(client_p, client_p->name, client_p->username, newhost, 0, "Changing host"); 65 - 66 - if (newhost != client_p->orighost) 67 - SetDynSpoof(client_p); 68 - else 69 - ClearDynSpoof(client_p); 70 - } 71 - 72 - #define Nval 0x8c3a48ac 73 - #define HOSTLEN 63 74 - #define INITDATA "98fwqefnoiqefv03f423t34gbv3vb89tg432t3b8" /* change this */ 75 - 76 - static inline unsigned int 77 - get_string_entropy(const char *inbuf) 78 - { 79 - unsigned int accum = 1; 80 - 81 - while(*inbuf != '\0') 82 - accum += *inbuf++; 83 - 84 - return accum; 85 - } 86 - 87 - /* calls get_string_entropy() and toasts it against INITDATA */ 88 - static inline unsigned int 89 - get_string_weighted_entropy(const char *inbuf) 90 - { 91 - static int base_entropy = 0; 92 - unsigned int accum = get_string_entropy(inbuf); 93 - 94 - /* initialize the algorithm if it is not yet ready */ 95 - if (base_entropy == 0) 96 - base_entropy = get_string_entropy(INITDATA); 97 - 98 - return (Nval * accum) ^ base_entropy; 99 - } 100 - 101 - static void 102 - do_host_cloak_ip(const char *inbuf, char *outbuf) 103 - { 104 - char *tptr; 105 - unsigned int accum = get_string_weighted_entropy(inbuf); 106 - char buf[HOSTLEN + 1] = { 0 }; 107 - int ipv6 = 0; 108 - 109 - strncpy(buf, inbuf, HOSTLEN); 110 - tptr = strrchr(buf, '.'); 111 - 112 - if (tptr == NULL) 113 - { 114 - tptr = strrchr(buf, ':'); 115 - ipv6 = 1; 116 - } 117 - 118 - if (tptr == NULL) 119 - { 120 - strncpy(outbuf, inbuf, HOSTLEN); 121 - return; 122 - } 123 - 124 - *tptr++ = '\0'; 125 - 126 - if(ipv6) 127 - { 128 - snprintf(outbuf, HOSTLEN, "%.60s:%x", buf, accum); 129 - } 130 - else 131 - { 132 - snprintf(outbuf, HOSTLEN, "%.60s.%x", buf, accum); 133 - } 134 - } 135 - 136 - static void 137 - do_host_cloak_host(const char *inbuf, char *outbuf) 138 - { 139 - char b26_alphabet[] = "abcdefghijklmnopqrstuvwxyz"; 140 - char *tptr; 141 - unsigned int accum = get_string_weighted_entropy(inbuf); 142 - 143 - strncpy(outbuf, inbuf, HOSTLEN); 144 - 145 - /* pass 1: scramble first section of hostname using base26 146 - * alphabet toasted against the weighted entropy of the string. 147 - * 148 - * numbers are not changed at this time, only letters. 149 - */ 150 - for (tptr = outbuf; *tptr != '\0'; tptr++) 151 - { 152 - if (*tptr == '.') 153 - break; 154 - 155 - if (isdigit((unsigned char)*tptr) || *tptr == '-') 156 - continue; 157 - 158 - *tptr = b26_alphabet[(*tptr * accum) % 26]; 159 - } 160 - 161 - /* pass 2: scramble each number in the address */ 162 - for (tptr = outbuf; *tptr != '\0'; tptr++) 163 - { 164 - if (isdigit((unsigned char)*tptr)) 165 - { 166 - *tptr = 48 + ((*tptr * accum) % 10); 167 - } 168 - } 169 - } 170 - 171 - static void 172 - check_umode_change(void *vdata) 173 - { 174 - hook_data_umode_changed *data = (hook_data_umode_changed *)vdata; 175 - struct Client *source_p = data->client; 176 - 177 - if (!MyClient(source_p)) 178 - return; 179 - 180 - /* didn't change +h umode, we don't need to do anything */ 181 - if (!((data->oldumodes ^ source_p->umodes) & user_modes['h'])) 182 - return; 183 - 184 - if (source_p->umodes & user_modes['h']) 185 - { 186 - if (IsIPSpoof(source_p) || source_p->localClient->mangledhost == NULL || (IsDynSpoof(source_p) && strcmp(source_p->host, source_p->localClient->mangledhost))) 187 - { 188 - source_p->umodes &= ~user_modes['h']; 189 - return; 190 - } 191 - if (strcmp(source_p->host, source_p->localClient->mangledhost)) 192 - { 193 - distribute_hostchange(source_p, source_p->localClient->mangledhost); 194 - } 195 - else /* not really nice, but we need to send this numeric here */ 196 - sendto_one_numeric(source_p, RPL_HOSTHIDDEN, "%s :is now your hidden host", 197 - source_p->host); 198 - } 199 - else if (!(source_p->umodes & user_modes['h'])) 200 - { 201 - if (source_p->localClient->mangledhost != NULL && 202 - !strcmp(source_p->host, source_p->localClient->mangledhost)) 203 - { 204 - distribute_hostchange(source_p, source_p->orighost); 205 - } 206 - } 207 - } 208 - 209 - static void 210 - check_new_user(void *vdata) 211 - { 212 - struct Client *source_p = (void *)vdata; 213 - 214 - if (IsIPSpoof(source_p)) 215 - { 216 - source_p->umodes &= ~user_modes['h']; 217 - return; 218 - } 219 - source_p->localClient->mangledhost = rb_malloc(HOSTLEN + 1); 220 - if (!irccmp(source_p->orighost, source_p->sockhost)) 221 - do_host_cloak_ip(source_p->orighost, source_p->localClient->mangledhost); 222 - else 223 - do_host_cloak_host(source_p->orighost, source_p->localClient->mangledhost); 224 - if (IsDynSpoof(source_p)) 225 - source_p->umodes &= ~user_modes['h']; 226 - if (source_p->umodes & user_modes['h']) 227 - { 228 - rb_strlcpy(source_p->host, source_p->localClient->mangledhost, sizeof(source_p->host)); 229 - if (irccmp(source_p->host, source_p->orighost)) 230 - SetDynSpoof(source_p); 231 - } 232 - }
-174
extensions/ip_cloaking_old.c
··· 1 - 2 - #include "stdinc.h" 3 - #include "modules.h" 4 - #include "hook.h" 5 - #include "client.h" 6 - #include "ircd.h" 7 - #include "send.h" 8 - #include "s_conf.h" 9 - #include "s_user.h" 10 - #include "s_serv.h" 11 - #include "numeric.h" 12 - 13 - static const char ip_cloaking_desc[] = "Very old IP cloaking mechanism"; 14 - 15 - /* if you're modifying this module, you'll probably want to change this */ 16 - #define KEY 0x13748cfa 17 - 18 - static int 19 - _modinit(void) 20 - { 21 - /* add the usermode to the available slot */ 22 - user_modes['h'] = find_umode_slot(); 23 - construct_umodebuf(); 24 - 25 - return 0; 26 - } 27 - 28 - static void 29 - _moddeinit(void) 30 - { 31 - /* disable the umode and remove it from the available list */ 32 - user_modes['h'] = 0; 33 - construct_umodebuf(); 34 - } 35 - 36 - static void check_umode_change(void *data); 37 - static void check_new_user(void *data); 38 - mapi_hfn_list_av1 ip_cloaking_hfnlist[] = { 39 - { "umode_changed", check_umode_change }, 40 - { "new_local_user", check_new_user }, 41 - { NULL, NULL } 42 - }; 43 - 44 - DECLARE_MODULE_AV2(ip_cloaking, _modinit, _moddeinit, NULL, NULL, 45 - ip_cloaking_hfnlist, NULL, NULL, ip_cloaking_desc); 46 - 47 - static void 48 - distribute_hostchange(struct Client *client_p, char *newhost) 49 - { 50 - if (newhost != client_p->orighost) 51 - sendto_one_numeric(client_p, RPL_HOSTHIDDEN, "%s :is now your hidden host", 52 - newhost); 53 - else 54 - sendto_one_numeric(client_p, RPL_HOSTHIDDEN, "%s :hostname reset", 55 - newhost); 56 - 57 - sendto_server(NULL, NULL, 58 - CAP_EUID | CAP_TS6, NOCAPS, ":%s CHGHOST %s :%s", 59 - use_id(&me), use_id(client_p), newhost); 60 - sendto_server(NULL, NULL, 61 - CAP_TS6, CAP_EUID, ":%s ENCAP * CHGHOST %s :%s", 62 - use_id(&me), use_id(client_p), newhost); 63 - 64 - change_nick_user_host(client_p, client_p->name, client_p->username, newhost, 0, "Changing host"); 65 - 66 - if (newhost != client_p->orighost) 67 - SetDynSpoof(client_p); 68 - else 69 - ClearDynSpoof(client_p); 70 - } 71 - 72 - static void 73 - do_host_cloak(const char *inbuf, char *outbuf, int ipmask) 74 - { 75 - unsigned int cyc; 76 - unsigned int hosthash = 1, hosthash2 = 1; 77 - unsigned int maxcycle = strlen(inbuf); 78 - int len1; 79 - const char *rest, *next; 80 - 81 - for (cyc = 0; cyc < maxcycle - 2; cyc += 2) 82 - hosthash *= (unsigned int) inbuf[cyc]; 83 - 84 - /* safety: decrement ourselves two steps back */ 85 - for (cyc = maxcycle - 1; cyc >= 1; cyc -= 2) 86 - hosthash2 *= (unsigned int) inbuf[cyc]; 87 - 88 - /* lets do some bitshifting -- this pretty much destroys the IP 89 - * sequence, while still providing a checksum. exactly what 90 - * we're shooting for. --nenolod 91 - */ 92 - hosthash += (hosthash2 / KEY); 93 - hosthash2 += (hosthash / KEY); 94 - 95 - if (ipmask == 0) 96 - { 97 - snprintf(outbuf, HOSTLEN, "%s-%X%X", 98 - ServerInfo.network_name, hosthash2, hosthash); 99 - len1 = strlen(outbuf); 100 - rest = strchr(inbuf, '.'); 101 - if (rest == NULL) 102 - rest = "."; 103 - /* try to avoid truncation -- jilles */ 104 - while (len1 + strlen(rest) >= HOSTLEN && (next = strchr(rest + 1, '.')) != NULL) 105 - rest = next; 106 - rb_strlcat(outbuf, rest, HOSTLEN); 107 - } 108 - else 109 - snprintf(outbuf, HOSTLEN, "%X%X.%s", 110 - hosthash2, hosthash, ServerInfo.network_name); 111 - } 112 - 113 - static void 114 - check_umode_change(void *vdata) 115 - { 116 - hook_data_umode_changed *data = (hook_data_umode_changed *)vdata; 117 - struct Client *source_p = data->client; 118 - 119 - if (!MyClient(source_p)) 120 - return; 121 - 122 - /* didn't change +h umode, we don't need to do anything */ 123 - if (!((data->oldumodes ^ source_p->umodes) & user_modes['h'])) 124 - return; 125 - 126 - if (source_p->umodes & user_modes['h']) 127 - { 128 - if (IsIPSpoof(source_p) || source_p->localClient->mangledhost == NULL || (IsDynSpoof(source_p) && strcmp(source_p->host, source_p->localClient->mangledhost))) 129 - { 130 - source_p->umodes &= ~user_modes['h']; 131 - return; 132 - } 133 - if (strcmp(source_p->host, source_p->localClient->mangledhost)) 134 - { 135 - distribute_hostchange(source_p, source_p->localClient->mangledhost); 136 - } 137 - else /* not really nice, but we need to send this numeric here */ 138 - sendto_one_numeric(source_p, RPL_HOSTHIDDEN, "%s :is now your hidden host", 139 - source_p->host); 140 - } 141 - else if (!(source_p->umodes & user_modes['h'])) 142 - { 143 - if (source_p->localClient->mangledhost != NULL && 144 - !strcmp(source_p->host, source_p->localClient->mangledhost)) 145 - { 146 - distribute_hostchange(source_p, source_p->orighost); 147 - } 148 - } 149 - } 150 - 151 - static void 152 - check_new_user(void *vdata) 153 - { 154 - struct Client *source_p = (void *)vdata; 155 - 156 - if (IsIPSpoof(source_p)) 157 - { 158 - source_p->umodes &= ~user_modes['h']; 159 - return; 160 - } 161 - source_p->localClient->mangledhost = rb_malloc(HOSTLEN + 1); 162 - if (!irccmp(source_p->orighost, source_p->sockhost)) 163 - do_host_cloak(source_p->orighost, source_p->localClient->mangledhost, 1); 164 - else 165 - do_host_cloak(source_p->orighost, source_p->localClient->mangledhost, 0); 166 - if (IsDynSpoof(source_p)) 167 - source_p->umodes &= ~user_modes['h']; 168 - if (source_p->umodes & user_modes['h']) 169 - { 170 - rb_strlcpy(source_p->host, source_p->localClient->mangledhost, sizeof(source_p->host)); 171 - if (irccmp(source_p->host, source_p->orighost)) 172 - SetDynSpoof(source_p); 173 - } 174 - }
-95
extensions/m_locops.c
··· 1 - /* 2 - * ircd-ratbox: A slightly useful ircd. 3 - * m_locops.c: Sends a message to all operators on the local server. 4 - * 5 - * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center 6 - * Copyright (C) 1996-2002 Hybrid Development Team 7 - * Copyright (C) 2002-2005 ircd-ratbox development team 8 - * 9 - * This program is free software; you can redistribute it and/or modify 10 - * it under the terms of the GNU General Public License as published by 11 - * the Free Software Foundation; either version 2 of the License, or 12 - * (at your option) any later version. 13 - * 14 - * This program is distributed in the hope that it will be useful, 15 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 - * GNU General Public License for more details. 18 - * 19 - * You should have received a copy of the GNU General Public License 20 - * along with this program; if not, write to the Free Software 21 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 22 - * USA 23 - */ 24 - 25 - #include "stdinc.h" 26 - #include "client.h" 27 - #include "ircd.h" 28 - #include "match.h" 29 - #include "numeric.h" 30 - #include "send.h" 31 - #include "s_user.h" 32 - #include "s_conf.h" 33 - #include "s_newconf.h" 34 - #include "hash.h" 35 - #include "msg.h" 36 - #include "parse.h" 37 - #include "modules.h" 38 - #include "s_serv.h" 39 - 40 - static const char locops_desc[] = 41 - "Provides the LOCOPS command to send a message to all local operators"; 42 - 43 - static void m_locops(struct MsgBuf *, struct Client *, struct Client *, int, const char **); 44 - static void ms_locops(struct MsgBuf *, struct Client *, struct Client *, int, const char **); 45 - static void me_locops(struct MsgBuf *, struct Client *, struct Client *, int, const char **); 46 - 47 - struct Message locops_msgtab = { 48 - "LOCOPS", 0, 0, 0, 0, 49 - {mg_unreg, mg_not_oper, {ms_locops, 3}, mg_ignore, {me_locops, 2}, {m_locops, 2}} 50 - }; 51 - 52 - mapi_clist_av1 locops_clist[] = { &locops_msgtab, NULL }; 53 - 54 - DECLARE_MODULE_AV2(locops, NULL, NULL, locops_clist, NULL, NULL, NULL, NULL, locops_desc); 55 - 56 - /* 57 - * m_locops - LOCOPS message handler 58 - * (write to *all* local opers currently online) 59 - * parv[1] = message text 60 - */ 61 - static void 62 - m_locops(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) 63 - { 64 - sendto_wallops_flags(UMODE_LOCOPS, source_p, "LOCOPS - %s", parv[1]); 65 - 66 - if(rb_dlink_list_length(&cluster_conf_list) > 0) 67 - cluster_generic(source_p, "LOCOPS", SHARED_LOCOPS, CAP_CLUSTER, 68 - ":%s", parv[1]); 69 - } 70 - 71 - static void 72 - ms_locops(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) 73 - { 74 - /* source_p parv[1] parv[2] 75 - * oper target serv message 76 - */ 77 - propagate_generic(source_p, "LOCOPS", parv[1], CAP_CLUSTER, 78 - ":%s", parv[2]); 79 - 80 - if(!match(parv[1], me.name)) 81 - return; 82 - 83 - sendto_wallops_flags(UMODE_LOCOPS, source_p, "SLOCOPS - %s", parv[2]); 84 - } 85 - 86 - static void 87 - me_locops(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, 88 - int parc, const char *parv[]) 89 - { 90 - if(!IsPerson(source_p)) 91 - return; 92 - 93 - sendto_wallops_flags(UMODE_LOCOPS, source_p, "SLOCOPS - %s", parv[1]); 94 - } 95 -
-5
extensions/meson.build
··· 27 27 'force_user_invis', 28 28 'helpops', 29 29 'hide_uncommon_channels', 30 - 'hurt', 31 30 'identify_msg', 32 31 'invex_regonly', 33 32 'invite_notify', 34 33 'ip_cloaking', 35 - 'ip_cloaking_old', 36 - 'ip_cloaking_3.0', 37 34 'ip_cloaking_4.0', 38 35 'm_adminwall', 39 36 'm_echotags', 40 37 'm_extendchans', 41 38 'm_findforwards', 42 39 'm_identify', 43 - 'm_locops', 44 40 'm_mkpasswd', 45 41 'm_ojoin', 46 42 'm_okick', ··· 52 48 'm_shedding', 53 49 'm_webirc', 54 50 'no_kill_services', 55 - 'no_locops', 56 51 'no_oper_invis', 57 52 'override', 58 53 'override_kick_immunity',
-36
extensions/no_locops.c
··· 1 - /* 2 - * Disable LOCOPS (by disallowing any local user setting +l). 3 - * -- jilles 4 - */ 5 - 6 - #include "stdinc.h" 7 - #include "modules.h" 8 - #include "client.h" 9 - #include "hook.h" 10 - #include "ircd.h" 11 - #include "send.h" 12 - #include "s_conf.h" 13 - #include "s_newconf.h" 14 - 15 - static const char no_locops_desc[] = "Disables local operators"; 16 - 17 - static void h_nl_umode_changed(void *); 18 - 19 - mapi_hfn_list_av1 nl_hfnlist[] = { 20 - { "umode_changed", h_nl_umode_changed }, 21 - { NULL, NULL } 22 - }; 23 - 24 - DECLARE_MODULE_AV2(no_locops, NULL, NULL, NULL, NULL, nl_hfnlist, NULL, NULL, no_locops_desc); 25 - 26 - static void 27 - h_nl_umode_changed(void *data) 28 - { 29 - hook_data_umode_changed *hdata = data; 30 - struct Client *source_p = hdata->client; 31 - 32 - if (MyClient(source_p) && source_p->umodes & UMODE_LOCOPS) 33 - { 34 - source_p->umodes &= ~UMODE_LOCOPS; 35 - } 36 - }
-4
help/opers/locops
··· 1 - LOCOPS :<message> 2 - 3 - Sends a LOCOPS message of <message> to all 4 - opers on local server who are umode +l
-1
help/opers/umode
··· 11 11 inviting you to channels. 12 12 ?* +h - Show on /STATS p and marked as available for help in whois. 13 13 +i - Designates this client 'invisible'. 14 - * +l - Can see oper locops (local wallops). 15 14 +o - Designates this client is an IRC Operator. 16 15 Use the /oper command to attain this. 17 16 ? +q - Prevents you from joining channels or sending private messages
+1 -4
include/client.h
··· 449 449 #define UMODE_WALLOP 0x0002 /* send wallops to them */ 450 450 #define UMODE_OPERWALL 0x0004 /* Operwalls */ 451 451 #define UMODE_INVISIBLE 0x0008 /* makes user invisible */ 452 - #define UMODE_LOCOPS 0x0020 /* show locops */ 453 452 #define UMODE_SERVICE 0x0040 454 453 #define UMODE_DEAF 0x0080 455 454 #define UMODE_NOFORWARD 0x0100 /* don't forward */ ··· 459 458 #define UMODE_ADMIN 0x2000 /* Admin on server */ 460 459 #define UMODE_SECURE 0x4000 /* has a secure connection */ 461 460 462 - #define DEFAULT_OPER_UMODES (UMODE_SERVNOTICE | UMODE_OPERWALL | \ 463 - UMODE_WALLOP | UMODE_LOCOPS) 461 + #define DEFAULT_OPER_UMODES (UMODE_SERVNOTICE | UMODE_OPERWALL | UMODE_WALLOP) 464 462 #define DEFAULT_OPER_SNOMASK SNO_GENERAL 465 463 466 464 /* ··· 533 531 #define ClearInvisible(x) ((x)->umodes &= ~UMODE_INVISIBLE) 534 532 #define IsSecureClient(x) ((x)->umodes & UMODE_SECURE) 535 533 #define SendWallops(x) ((x)->umodes & UMODE_WALLOP) 536 - #define SendLocops(x) ((x)->umodes & UMODE_LOCOPS) 537 534 #define SendServNotice(x) ((x)->umodes & UMODE_SERVNOTICE) 538 535 #define SendOperwall(x) ((x)->umodes & UMODE_OPERWALL) 539 536 #define IsService(x) ((x)->umodes & UMODE_SERVICE)
+1 -2
include/s_newconf.h
··· 84 84 #define SHARED_TKLINE 0x00001 85 85 #define SHARED_PKLINE 0x00002 86 86 #define SHARED_UNKLINE 0x00004 87 - #define SHARED_LOCOPS 0x00008 88 87 #define SHARED_TXLINE 0x00010 89 88 #define SHARED_PXLINE 0x00020 90 89 #define SHARED_UNXLINE 0x00040 ··· 102 101 #define SHARED_ALL (SHARED_TKLINE | SHARED_PKLINE | SHARED_UNKLINE |\ 103 102 SHARED_PXLINE | SHARED_TXLINE | SHARED_UNXLINE |\ 104 103 SHARED_TRESV | SHARED_PRESV | SHARED_UNRESV | SHARED_GRANT) 105 - #define CLUSTER_ALL (SHARED_ALL | SHARED_LOCOPS) 104 + #define CLUSTER_ALL SHARED_ALL 106 105 107 106 struct oper_conf 108 107 {
-2
ircd/newconf.c
··· 322 322 static struct mode_table umode_table[] = { 323 323 {"deaf", UMODE_DEAF }, 324 324 {"invisible", UMODE_INVISIBLE }, 325 - {"locops", UMODE_LOCOPS }, 326 325 {"noforward", UMODE_NOFORWARD }, 327 326 {"servnotice", UMODE_SERVNOTICE}, 328 327 {"wallop", UMODE_WALLOP }, ··· 373 372 { "kline", SHARED_PKLINE }, 374 373 { "tkline", SHARED_TKLINE }, 375 374 { "unkline", SHARED_UNKLINE }, 376 - { "locops", SHARED_LOCOPS }, 377 375 { "xline", SHARED_PXLINE }, 378 376 { "txline", SHARED_TXLINE }, 379 377 { "unxline", SHARED_UNXLINE },
+1 -2
ircd/s_conf.c
··· 780 780 ConfigFileEntry.tls_ciphers_oper_only = false; 781 781 ConfigFileEntry.oper_secure_only = false; 782 782 783 - ConfigFileEntry.oper_umodes = UMODE_LOCOPS | UMODE_SERVNOTICE | 784 - UMODE_OPERWALL | UMODE_WALLOP; 783 + ConfigFileEntry.oper_umodes = DEFAULT_OPER_UMODES; 785 784 ConfigFileEntry.oper_only_umodes = UMODE_SERVNOTICE; 786 785 ConfigFileEntry.oper_snomask = SNO_GENERAL; 787 786
+1 -1
ircd/s_user.c
··· 102 102 UMODE_INVISIBLE, /* i */ 103 103 0, /* j */ 104 104 0, /* k */ 105 - UMODE_LOCOPS, /* l */ 105 + 0, /* l */ 106 106 0, /* m */ 107 107 0, /* n */ 108 108 UMODE_OPER, /* o */
-2
modules/m_wallops.c
··· 107 107 if (IsPerson(source_p)) 108 108 { 109 109 if (!strncmp(parv[1], "OPERWALL - ", 11) || 110 - !strncmp(parv[1], "LOCOPS - ", 9) || 111 - !strncmp(parv[1], "SLOCOPS - ", 10) || 112 110 !strncmp(parv[1], "ADMINWALL - ", 12)) 113 111 prefix = "WALLOPS - "; 114 112 }