int m_svso(aClient *cptr, aClient *sptr, int parc, char *parv[]) { aClient *acptr; long fLag; if (!IsULine(sptr)) return 0; if (parc < 3) return 0; if (!(acptr = find_person(parv[1], (aClient *)NULL))) return 0; if (!MyClient(acptr)) { sendto_one(acptr, ":%s SVSO %s %s", parv[0], parv[1], parv[2]); return 0; } if (*parv[2] == '+') { int *i, flag; char *m = NULL; for (m = (parv[2] + 1); *m; m++) { for (i = oper_access; (flag = *i); i += 2) { if (*m == (char) *(i + 1)) { acptr->oflag |= flag; break; } } } } if (*parv[2] == '-') { fLag = acptr->umodes; if (IsOper(acptr) && !IsHideOper(acptr)) { IRCstats.operators--; VERIFY_OPERCOUNT(acptr, "svso"); } if (IsAnOper(acptr)) delfrom_fdlist(acptr->slot, &oper_fdlist); acptr->umodes &= ~(UMODE_OPER | UMODE_LOCOP | UMODE_HELPOP |UMODE_SERVICES | UMODE_SADMIN | UMODE_ADMIN | UMODE_COADMIN); acptr->umodes &= ~(UMODE_NETADMIN | UMODE_WHOIS); acptr->umodes &= ~(UMODE_KIX | UMODE_DEAF | UMODE_HIDEOPER | UMODE_VICTIM); acptr->oflag = 0; remove_oper_snomasks(acptr); RunHook2(HOOKTYPE_LOCAL_OPER, acptr, 0); send_umode_out(acptr, acptr, fLag); } return 0; }
int m_svsnoop(aClient *cptr, aClient *sptr, int parc, char *parv[]) { aClient *acptr; if (!(IsULine(sptr) && parc > 2)) return 0; /* svsnoop bugfix --binary */ if (hunt_server_token(cptr, sptr, MSG_SVSNOOP, TOK_SVSNOOP, "%s :%s", 1, parc, parv) == HUNTED_ISME) { if (parv[2][0] == '+') { SVSNOOP = 1; sendto_ops("This server has been placed in NOOP mode"); for (acptr = &me; acptr; acptr = acptr->prev) { if (MyClient(acptr) && IsAnOper(acptr)) { if (IsOper(acptr)) { IRCstats.operators--; VERIFY_OPERCOUNT(acptr, "svsnoop"); } if (IsAnOper(acptr)) delfrom_fdlist(acptr->slot, &oper_fdlist); if (IsTotalInvis(acptr)) { sendto_channels_inviso_join(acptr); } acptr->umodes &= ~(UMODE_OPER|UMODE_HELPOP|UMODE_SADMIN|UMODE_ADMIN|UMODE_LOCOP|UMODE_SERVICES|UMODE_NETADMIN); acptr->umodes &= ~(UMODE_WHOIS|UMODE_KIX|UMODE_HIDEOPER|UMODE_HIDEWHOIS|UMODE_TOTALINVIS|UMODE_MODEWALK|UMODE_NOFAKELAG); acptr->oflag = 0; remove_oper_snomasks(acptr); sendto_one(acptr, ":%s NOTICE %s :*** Your OFLAGS have been cleared, because this server has been placed in NOOP mode", me.name, acptr->name); RunHook2(HOOKTYPE_LOCAL_OPER, acptr, 0); } } } else { SVSNOOP = 0; sendto_ops("This server is no longer in NOOP mode"); } } return 0; }