#include "services.h"#include "pseudo.h"
Go to the source code of this file.
Defines | |
| #define | SAFE(x) |
| #define | SAFE(x) |
| #define | SAFE(x) |
Functions | |
| static int | compare_adminlist_entries (SList *slist, void *item1, void *item2) |
| static int | compare_operlist_entries (SList *slist, void *item1, void *item2) |
| static void | free_adminlist_entry (SList *slist, void *item) |
| static void | free_operlist_entry (SList *slist, void *item) |
| static int | is_akill_entry_equal (SList *slist, void *item1, void *item2) |
| static void | free_akill_entry (SList *slist, void *item) |
| static int | is_sgline_entry_equal (SList *slist, void *item1, void *item2) |
| static void | free_sgline_entry (SList *slist, void *item) |
| static int | is_sqline_entry_equal (SList *slist, void *item1, void *item2) |
| static void | free_sqline_entry (SList *slist, void *item) |
| static int | is_szline_entry_equal (SList *slist, void *item1, void *item2) |
| static void | free_szline_entry (SList *slist, void *item) |
| char * | defconReverseModes (const char *modes) |
| void | moduleAddOperServCmds (void) |
| void | os_init (void) |
| void | operserv (User *u, char *buf) |
| static void | load_old_akill (void) |
| void | load_os_dbase (void) |
| void | save_os_dbase (void) |
| void | save_os_rdb_dbase (void) |
| void | os_remove_nick (NickCore *nc) |
| int | is_services_root (User *u) |
| int | is_services_admin (User *u) |
| int | is_services_oper (User *u) |
| int | nick_is_services_root (NickCore *nc) |
| int | nick_is_services_admin (NickCore *nc) |
| int | nick_is_services_oper (NickCore *nc) |
| Server * | server_global (Server *s, char *msg) |
| void | oper_global (char *nick, char *fmt,...) |
| int | add_akill (User *u, char *mask, const char *by, const time_t expires, const char *reason) |
| int | check_akill (char *nick, const char *username, const char *host, const char *vhost, const char *ip) |
| void | expire_akills (void) |
| int | add_sgline (User *u, char *mask, const char *by, const time_t expires, const char *reason) |
| int | check_sgline (char *nick, const char *realname) |
| void | expire_sglines (void) |
| int | add_sqline (User *u, char *mask, const char *by, const time_t expires, const char *reason) |
| int | check_sqline (char *nick, int nick_change) |
| int | check_chan_sqline (const char *chan) |
| void | expire_sqlines (void) |
| int | add_szline (User *u, char *mask, const char *by, const time_t expires, const char *reason) |
| int | check_szline (char *nick, char *ip) |
| void | expire_szlines (void) |
| int | checkDefCon (int level) |
| void | resetDefCon (int level) |
| void | runDefCon (void) |
| int | defconParseModeString (const char *str) |
Variables | |
| SList | servadmins |
| SList | servopers |
| SList | akills |
| SList | sglines |
| SList | sqlines |
| SList | szlines |
| time_t | DefContimer |
| int | DefConModesSet = 0 |
| uint32 | DefConModesOn |
| uint32 | DefConModesOff |
| ChannelInfo | DefConModesCI |
| SListOpts | akopts = { 0, NULL, &is_akill_entry_equal, &free_akill_entry } |
| SListOpts | saopts |
| SListOpts | sgopts = { 0, NULL, &is_sgline_entry_equal, &free_sgline_entry } |
| SListOpts | soopts |
| SListOpts | sqopts |
| SListOpts | szopts = { 0, NULL, &is_szline_entry_equal, &free_szline_entry } |
| #define SAFE | ( | x | ) |
Value:
do { \ if ((x) < 0) { \ restore_db(f); \ log_perror("Write error on %s", OperDBName); \ if (time(NULL) - lastwarn > WarningTimeout) { \ anope_cmd_global(NULL, "Write error on %s: %s", OperDBName, \ strerror(errno)); \ lastwarn = time(NULL); \ } \ return; \ } \ } while (0)
Definition at line 421 of file operserv.c.
| #define SAFE | ( | x | ) |
Value:
do { \ if ((x) < 0) { \ if (!forceload) \ fatal("Read error on %s", OperDBName); \ failed = 1; \ break; \ } \ } while (0)
Definition at line 421 of file operserv.c.
| #define SAFE | ( | x | ) |
Value:
do { \ if ((x) < 0) { \ if (!forceload) \ fatal("Read error on %s", AutokillDBName); \ break; \ } \ } while (0)
Definition at line 421 of file operserv.c.
| int add_akill | ( | User * | u, | |
| char * | mask, | |||
| const char * | by, | |||
| const time_t | expires, | |||
| const char * | reason | |||
| ) |
Definition at line 723 of file operserv.c.
References AkillOnAdd, anope_cmd_akill(), BUFSIZE, akill_::by, slist_::count, akill_::expires, akill_::host, slist_::limit, slist_::list, match_wild_nocase(), notice_lang(), akill_::reason, s_OperServ, scalloc(), akill_::seton, slist_add(), slist_delete(), slist_full(), snprintf(), sstrdup(), stricmp(), and akill_::user.
Referenced by add_session(), do_akill(), do_chankill(), and do_nick().
| int add_sgline | ( | User * | u, | |
| char * | mask, | |||
| const char * | by, | |||
| const time_t | expires, | |||
| const char * | reason | |||
| ) |
Definition at line 956 of file operserv.c.
References anope_cmd_sgline(), BUFSIZE, sxline_::by, slist_::count, sxline_::expires, firstuser(), ircd, is_oper(), kill_user(), KillonSGline, slist_::limit, slist_::list, sxline_::mask, match_wild_nocase(), nextuser(), user_::nick, notice_lang(), user_::realname, sxline_::reason, s_OperServ, scalloc(), ServerName, sxline_::seton, ircdvars_::sglineenforce, slist_add(), slist_delete(), slist_full(), snprintf(), sstrdup(), and stricmp().
Referenced by do_sgline().
| int add_sqline | ( | User * | u, | |
| char * | mask, | |||
| const char * | by, | |||
| const time_t | expires, | |||
| const char * | reason | |||
| ) |
Definition at line 1139 of file operserv.c.
References BUFSIZE, sxline_::by, slist_::count, sxline_::expires, firstuser(), is_oper(), kill_user(), KillonSQline, slist_::limit, slist_::list, sxline_::mask, match_wild_nocase(), nextuser(), user_::nick, notice_lang(), sxline_::reason, s_OperServ, scalloc(), ServerName, sxline_::seton, slist_add(), slist_delete(), slist_full(), snprintf(), sqline(), sstrdup(), and stricmp().
Referenced by do_sqline().
| int add_szline | ( | User * | u, | |
| char * | mask, | |||
| const char * | by, | |||
| const time_t | expires, | |||
| const char * | reason | |||
| ) |
Definition at line 1360 of file operserv.c.
References anope_cmd_szline(), sxline_::by, slist_::count, sxline_::expires, slist_::limit, slist_::list, sxline_::mask, match_wild_nocase(), notice_lang(), sxline_::reason, s_OperServ, scalloc(), sxline_::seton, slist_add(), slist_delete(), slist_full(), sstrdup(), and stricmp().
Referenced by do_szline().
| int check_akill | ( | char * | nick, | |
| const char * | username, | |||
| const char * | host, | |||
| const char * | vhost, | |||
| const char * | ip | |||
| ) |
If DefCon is set to NO new users - kill the user ;).
Definition at line 840 of file operserv.c.
References anope_cmd_akill(), akill_::by, checkDefCon(), slist_::count, DEFCON_NO_NEW_CLIENTS, DefConAkillReason, akill_::expires, akill_::host, ircd, kill_user(), slist_::list, match_wild_nocase(), ircdvars_::nickip, akill_::reason, s_OperServ, akill_::seton, akill_::user, and ircdvars_::vhost.
Referenced by do_chankill(), and do_nick().
| int check_chan_sqline | ( | const char * | chan | ) |
Definition at line 1276 of file operserv.c.
References slist_::count, slist_::list, sxline_::mask, match_wild_nocase(), sxline_::reason, and sqline().
Referenced by do_sjoin().
| int check_sgline | ( | char * | nick, | |
| const char * | realname | |||
| ) |
Definition at line 1057 of file operserv.c.
References anope_cmd_sgline(), anope_cmd_svskill(), slist_::count, slist_::list, sxline_::mask, match_wild_nocase(), sxline_::reason, and ServerName.
Referenced by do_nick().
| int check_sqline | ( | char * | nick, | |
| int | nick_change | |||
| ) |
Definition at line 1245 of file operserv.c.
References ircdvars_::chansqline, slist_::count, ircd, kill_user(), slist_::list, sxline_::mask, match_wild_nocase(), sxline_::reason, s_OperServ, snprintf(), and sqline().
Referenced by do_nick().
| int check_szline | ( | char * | nick, | |
| char * | ip | |||
| ) |
Definition at line 1441 of file operserv.c.
References anope_cmd_szline(), sxline_::by, slist_::count, slist_::list, sxline_::mask, match_wild_nocase(), and sxline_::reason.
Referenced by do_nick().
| int checkDefCon | ( | int | level | ) |
Returns 1 if the passed level is part of the CURRENT defcon, else 0 is returned
Definition at line 1585 of file operserv.c.
References DefCon, and DefConLevel.
Referenced by add_session(), check_akill(), defcon_sendlvls(), do_nick(), do_register(), do_run_cmd(), do_sendall(), do_set_mlock(), do_staff(), memo_send(), req_send_memos(), rsend_notify(), and runDefCon().
| static int compare_adminlist_entries | ( | SList * | slist, | |
| void * | item1, | |||
| void * | item2 | |||
| ) | [static] |
| static int compare_operlist_entries | ( | SList * | slist, | |
| void * | item1, | |||
| void * | item2 | |||
| ) | [static] |
| int defconParseModeString | ( | const char * | str | ) |
Definition at line 1680 of file operserv.c.
References alog(), anope_get_invite_mode(), anope_get_limit_mode(), CBM_NO_MLOCK, cbmodes, ircdvars_::chan_lmode, cbmode_::cssetvalue, DefConModesOff, DefConModesOn, cbmode_::flag, cbmode_::flags, ircd, ircdvars_::knock_needs_i, ircdvars_::Lmode, chaninfo_::mlock_flood, chaninfo_::mlock_key, chaninfo_::mlock_limit, chaninfo_::mlock_redirect, ircdvars_::noknock, and sstrdup().
Referenced by init_secondary().
| char * defconReverseModes | ( | const char * | modes | ) |
Reverse the mode string, used for remove DEFCON chan modes.
Definition at line 1653 of file operserv.c.
Referenced by runDefCon().
| void expire_akills | ( | void | ) |
Definition at line 895 of file operserv.c.
References anope_cmd_global(), slist_::count, akill_::expires, akill_::host, slist_::list, s_OperServ, slist_delete(), akill_::user, and WallAkillExpire.
Referenced by expire_all().
| void expire_sglines | ( | void | ) |
Definition at line 1083 of file operserv.c.
References anope_cmd_global(), slist_::count, sxline_::expires, slist_::list, sxline_::mask, s_OperServ, slist_delete(), and WallSGLineExpire.
Referenced by expire_all().
| void expire_sqlines | ( | void | ) |
Definition at line 1303 of file operserv.c.
References anope_cmd_global(), slist_::count, sxline_::expires, slist_::list, sxline_::mask, s_OperServ, slist_delete(), and WallSQLineExpire.
Referenced by expire_all().
| void expire_szlines | ( | void | ) |
Definition at line 1472 of file operserv.c.
References anope_cmd_global(), slist_::count, sxline_::expires, slist_::list, sxline_::mask, s_OperServ, slist_delete(), and WallSZLineExpire.
Referenced by expire_all().
| static void free_adminlist_entry | ( | SList * | slist, | |
| void * | item | |||
| ) | [static] |
| static void free_akill_entry | ( | SList * | slist, | |
| void * | item | |||
| ) | [static] |
Definition at line 914 of file operserv.c.
References anope_cmd_remove_akill(), akill_::by, akill_::host, akill_::reason, and akill_::user.
| static void free_operlist_entry | ( | SList * | slist, | |
| void * | item | |||
| ) | [static] |
| static void free_sgline_entry | ( | SList * | slist, | |
| void * | item | |||
| ) | [static] |
Definition at line 1102 of file operserv.c.
References anope_cmd_unsgline(), sxline_::by, sxline_::mask, and sxline_::reason.
| static void free_sqline_entry | ( | SList * | slist, | |
| void * | item | |||
| ) | [static] |
Definition at line 1323 of file operserv.c.
References anope_cmd_unsqline(), sxline_::by, sxline_::mask, and sxline_::reason.
| static void free_szline_entry | ( | SList * | slist, | |
| void * | item | |||
| ) | [static] |
Definition at line 1491 of file operserv.c.
References anope_cmd_unszline(), sxline_::by, sxline_::mask, and sxline_::reason.
| static int is_akill_entry_equal | ( | SList * | slist, | |
| void * | item1, | |||
| void * | item2 | |||
| ) | [static] |
Definition at line 932 of file operserv.c.
References BUFSIZE, akill_::host, snprintf(), stricmp(), and akill_::user.
| int is_services_admin | ( | User * | u | ) |
Definition at line 592 of file operserv.c.
References nickcore_::flags, is_oper(), user_::na, nickalias_::nc, NI_SERVICES_ADMIN, NI_SERVICES_ROOT, nick_identified(), NSStrictPrivileges, and skeleton.
Referenced by access_del(), AnopeInit(), bahamut_set_umode(), check_email_limit_reached(), do_access(), do_akick(), do_alist(), do_assign(), do_badwords(), do_confirm(), do_cs_topic(), do_drop(), do_glist(), do_help_cmd(), do_help_limited(), do_info(), do_kickcmd(), do_levels(), do_list(), do_logout(), do_news(), do_os_mode(), do_register(), do_set(), do_set_founder(), do_set_limit(), do_set_noexpire(), do_stats(), do_unassign(), do_xop(), my_cs_appendtopic(), my_cs_enforce(), plexus_cmd_svid_umode3(), ptlink_set_umode(), solidircd_set_umode(), ultiamte2_set_umode(), ultimate3_set_umode(), and xop_del().
| int is_services_oper | ( | User * | u | ) |
Definition at line 607 of file operserv.c.
References is_oper(), user_::na, nickalias_::nc, NI_SERVICES_ADMIN, NI_SERVICES_OPER, NI_SERVICES_ROOT, nick_identified(), NSStrictPrivileges, and skeleton.
Referenced by AnopeInit(), do_confirm(), do_help_cmd(), do_help_limited(), do_rsend(), do_sendpass(), is_host_setter(), memo_send(), plexus_cmd_svid_umode3(), rageircd_set_umode(), ultiamte2_set_umode(), and ultimate3_set_umode().
| int is_services_root | ( | User * | u | ) |
Definition at line 578 of file operserv.c.
References nickcore_::flags, is_oper(), user_::na, nickalias_::nc, NI_SERVICES_ROOT, nick_identified(), NSStrictPrivileges, and skeleton.
Referenced by AnopeInit(), do_admin(), do_confirm(), do_getpass(), do_help_cmd(), do_help_limited(), do_oper(), do_saset_email(), do_saset_password(), MailBegin(), moduleAddOperServCmds(), plexus_cmd_svid_umode3(), ultiamte2_set_umode(), and ultimate3_set_umode().
| static int is_sgline_entry_equal | ( | SList * | slist, | |
| void * | item1, | |||
| void * | item2 | |||
| ) | [static] |
| static int is_sqline_entry_equal | ( | SList * | slist, | |
| void * | item1, | |||
| void * | item2 | |||
| ) | [static] |
| static int is_szline_entry_equal | ( | SList * | slist, | |
| void * | item1, | |||
| void * | item2 | |||
| ) | [static] |
| static void load_old_akill | ( | void | ) | [static] |
Definition at line 164 of file operserv.c.
References anope_cmd_remove_akill(), AutokillDBName, BUFSIZE, akill_::by, slist_::capacity, close_db(), slist_::count, akill_::expires, get_file_version(), akill_::host, slist_::list, match_wild_nocase(), NICKMAX, open_db(), read_buffer, read_int16(), read_int32(), read_string(), akill_::reason, SAFE, scalloc(), akill_::seton, slist_add(), slist_delete(), slist_indexof(), slist_setcapacity(), snprintf(), sstrdup(), and akill_::user.
Referenced by load_os_dbase().
| void load_os_dbase | ( | void | ) |
Definition at line 277 of file operserv.c.
References sxline_::by, akill_::by, slist_::capacity, close_db(), sxline_::expires, akill_::expires, findnick(), nickcore_::flags, get_file_version(), akill_::host, load_old_akill(), sxline_::mask, maxusercnt, maxusertime, nickalias_::nc, NI_SERVICES_ADMIN, NI_SERVICES_OPER, open_db(), OPER_VERSION, OperDBName, read_int16(), read_int32(), read_string(), sxline_::reason, akill_::reason, s_OperServ, SAFE, scalloc(), sxline_::seton, akill_::seton, slist_add(), slist_indexof(), slist_setcapacity(), and akill_::user.
Referenced by init_secondary().
| void moduleAddOperServCmds | ( | void | ) |
Definition at line 80 of file operserv.c.
References addCoreCommand(), c, createCommand(), is_services_root(), modules_core_init(), OPERSERV, OperServCoreModules, and OperServCoreNumber.
Referenced by os_init().
| int nick_is_services_admin | ( | NickCore * | nc | ) |
Definition at line 637 of file operserv.c.
References nickcore_::flags, NI_SERVICES_ADMIN, and NI_SERVICES_ROOT.
Referenced by cs_remove_nick(), do_saset_email(), and do_saset_password().
| int nick_is_services_oper | ( | NickCore * | nc | ) |
Definition at line 650 of file operserv.c.
References NI_SERVICES_ADMIN, NI_SERVICES_OPER, and NI_SERVICES_ROOT.
Referenced by do_staff().
| int nick_is_services_root | ( | NickCore * | nc | ) |
| void oper_global | ( | char * | nick, | |
| char * | fmt, | |||
| ... | ||||
| ) |
Definition at line 692 of file operserv.c.
References AnonymousGlobal, server_global(), servlist, snprintf(), and vsnprintf.
Referenced by do_defcon(), do_global(), do_os_quit(), do_restart(), do_shutdown(), and resetDefCon().
| void operserv | ( | User * | u, | |
| char * | buf | |||
| ) |
Definition at line 130 of file operserv.c.
References alog(), anope_cmd_ctcp(), mod_run_cmd(), user_::nick, OPERSERV, s_OperServ, and stricmp().
Referenced by m_privmsg().
| void os_init | ( | void | ) |
Definition at line 99 of file operserv.c.
References ircd, moduleAddOperServCmds(), slist_::opts, ircdvars_::sgline, slist_init(), ircdvars_::sqline, and ircdvars_::szline.
Referenced by init_secondary().
| void os_remove_nick | ( | NickCore * | nc | ) |
| void resetDefCon | ( | int | level | ) |
Automaticaly re-set the DefCon level if the time limit has expired.
Definition at line 1593 of file operserv.c.
References alog(), anope_cmd_global(), DefConLevel, DefconMessage, DefConOffMessage, DefConTimeOut, DefContimer, dotime(), EVENT_DEFCON_LEVEL, getstring, getstring2, GlobalOnDefcon, GlobalOnDefconMore, oper_global(), runDefCon(), s_OperServ, send_event(), and snprintf().
Referenced by main().
| void runDefCon | ( | void | ) |
Run DefCon level specific Functions.
Definition at line 1625 of file operserv.c.
References alog(), checkDefCon(), DEFCON_FORCE_CHAN_MODES, DefConChanModes, DefConModesSet, defconReverseModes(), and do_mass_mode().
Referenced by do_defcon(), and resetDefCon().
| void save_os_dbase | ( | void | ) |
Definition at line 434 of file operserv.c.
References sxline_::by, akill_::by, close_db(), slist_::count, sxline_::expires, akill_::expires, akill_::host, lastwarn, slist_::list, sxline_::mask, maxusercnt, maxusertime, open_db(), OPER_VERSION, OperDBName, sxline_::reason, akill_::reason, s_OperServ, SAFE, sxline_::seton, akill_::seton, akill_::user, write_int16(), write_int32(), and write_string().
Referenced by save_databases().
| void save_os_rdb_dbase | ( | void | ) |
Definition at line 500 of file operserv.c.
References alog(), maxusercnt, maxusertime, rdb_clean_table(), rdb_close(), rdb_empty_table(), rdb_open(), rdb_save_os_db(), and rdb_tag_table().
Referenced by save_databases().
Definition at line 669 of file operserv.c.
References server_::flags, server_::links, server_::next, notice_server(), s_GlobalNoticer, server_global(), SERVER_ISME, and SERVER_JUPED.
Referenced by oper_global(), and server_global().
Definition at line 25 of file operserv.c.
Definition at line 66 of file operserv.c.
Definition at line 51 of file operserv.c.
Definition at line 50 of file operserv.c.
Definition at line 49 of file operserv.c.
| int DefConModesSet = 0 |
Definition at line 46 of file operserv.c.
| time_t DefContimer |
Definition at line 45 of file operserv.c.
Initial value:
{ SLISTF_SORT, &compare_adminlist_entries, NULL,
&free_adminlist_entry
}
Definition at line 67 of file operserv.c.
Definition at line 21 of file operserv.c.
Definition at line 23 of file operserv.c.
Definition at line 25 of file operserv.c.
Definition at line 71 of file operserv.c.
Initial value:
{ SLISTF_SORT, &compare_operlist_entries, NULL, &free_operlist_entry }
Definition at line 72 of file operserv.c.
Definition at line 25 of file operserv.c.
Initial value:
{ SLISTF_SORT, NULL, &is_sqline_entry_equal, &free_sqline_entry }
Definition at line 74 of file operserv.c.
Definition at line 25 of file operserv.c.
Definition at line 76 of file operserv.c.
1.5.7.1