#include "queue.h"
#include "memoserv.h"
#include "string.h"
#include "struct.h"
Go to the source code of this file.
Defines | |
#define | NISOPER 0x0001 |
Is client +o ? | |
#define | NISAWAY 0x0002 |
Is client /AWAY ? | |
#define | NISHELPOP 0x0004 |
Is client +h ? | |
#define | NISONLINE 0x0008 |
Is client online? (huh?). | |
#define | NISAHURT 0x0010 |
Is client ahurt? | |
#define | NOISMASK 0x0020 |
Is client +m ? | |
#define | NCNICK 0x1000 |
CNICK sent? | |
#define | NKILL 0x00001 |
Enforcement. | |
#define | NVACATION 0x00002 |
Vacation */. | |
#define | NHOLD 0x00004 |
Held nickname for SN purposes */. | |
#define | NIDENT 0x00008 |
Require identification */. | |
#define | NTERSE 0x00010 |
Terse mode */. | |
#define | NOADDOP 0x00040 |
User not allowing addition to op lists. | |
#define | NEMAIL 0x00080 |
Show email. | |
#define | NBANISH 0x00100 |
Banished. | |
#define | NGRPOP 0x00200 |
Old grpop flag. | |
#define | NBYPASS 0x00400 |
Bypass AHURT. | |
#define | NUSEDPW 0x00800 |
Has ever identified. | |
#define | NDBISMASK 0x01000 |
+m option in nick db | |
#define | NMARK 0x02000 |
MARKED nick. | |
#define | NDOEDIT 0x04000 |
Not used anymore ATM, see /OS OVERRIDE. | |
#define | NOSENDPASS 0x08000 |
User doesn't want password recovery. | |
#define | NACTIVE 0x10000 |
User e-mail has been verified. | |
#define | NDEACC 0x20000 |
E-mail needs to be re-verified. | |
#define | NFORCEXFER 0x40000 |
by an oper | |
#define | NENCRYPT 0x80000 |
Password encrypted. | |
#define | NAHURT 0x100000 |
??? | |
#define | OROOT 0x000001 |
#define | OREMROOT 0x000002 |
#define | OADMIN 0x000004 |
#define | OSERVOP 0x000008 |
#define | OOPER 0x000010 |
#define | ORAKILL 0x000020 |
#define | OAKILL 0x000040 |
#define | OINFOPOST 0x000080 |
#define | OSETOP 0x000100 |
#define | OSETFLAG 0x000200 |
#define | ONBANDEL 0x000400 |
#define | OCBANDEL 0x000800 |
#define | OIGNORE 0x001000 |
#define | OGRP 0x002000 |
#define | ORAW 0x004000 |
#define | OJUPE 0x008000 |
#define | OLIST 0x010000 |
#define | OCLONE 0x020000 |
#define | OPROT 0x080000 |
#define | OACC 0x100000 |
#define | OHELPOP 0x200000 |
#define | ODMOD 0x400000 |
#define | OAHURT 0x800000 |
#define | OVERRIDE OACC |
#define | OPFLAG_DEFAULT (OOPER|ORAKILL|OINFOPOST|OACC) |
Default set of opflags that opers get. | |
#define | OPFLAG_ADMIN |
default flags assigned with A | |
#define | OPFLAG_PLUS ((~0) & ~(OPFLAG_MINUS)) |
All positive flags. | |
#define | OPFLAG_MINUS (0) |
All Negative/restrictive flags. | |
#define | OPFLAG_ROOTSET |
Root-controlled flags. | |
#define | OPFLAG_ROOT (OPFLAG_PLUS|OROOT) |
Flags granted to root. | |
Functions | |
void | addGhost (char *) |
Add a NickServ enforcer. | |
void | delGhost (char *) |
Remove a NickServ enforcer. | |
void | delTimedGhost (char *) |
Handle expiration of a NickServ ghost timer by removing the enforcer. | |
void | setIdentify (UserList *, RegNickList *) |
Identifies an online user to a registered nickname. | |
void | clearIdentify (UserList *) |
Clears any identify by an online user. | |
int | isIdentified (UserList *, RegNickList *) |
Reports TRUE or FALSE indicating whether or not the specified user is identified to the specified nickname. | |
int | isRecognized (UserList *, RegNickList *) |
Reports TRUE or FALSE indicating whether or not the specified user is recognized by access list (ACC 2) for the specified nickname. | |
int | isOper (UserList *) |
int | isRoot (UserList *) |
int | issRoot (UserList *) |
int | isGRPop (UserList *) |
int | opFlagged (UserList *, flag_t) |
flag_t | getOpFlags (UserList *) |
Returns the effective flags of an online user. | |
int | canAkill (UserList *) |
int | isServop (UserList *) |
int | checkAccess (char *, char *, RegNickList *) |
Used to test whether the specified user@hostname can be matched against an entry in an access list. | |
int | isGhost (char *) |
int | addFlood (UserList *, int) |
Services Flood Protection -- addFlood adds the specified amount to a user's flood level, assuming this was added within tens econds of the last addition otherwise, simply makes floodlevel equal to whatever is sent. This function also updates lastmsg. | |
int | addNReg (char *) |
int | addAccItem (RegNickList *, char *) |
Handles the work of placing an access item in a registered nickname's access list. | |
int | delAccItem (RegNickList *, char *, char *) |
Handles the work of removing an access item from a registered nickname's access list. | |
void | addNewUser (char **, int) |
Handles a server NICK message by adding a new user connection. | |
void | remUser (char *, int ignoreDesync) |
Handles the QUIT server message, it removes a user from the nickname list and destroys the allocated memory area. | |
void | sendToNickServ (UserList *, char **, int) |
Message handler for NickServ. | |
void | setMode (char *, char *) |
Changes the modes of an online user. | |
void | changeNick (char *, char *, char *) |
Handles a NICK command, allowing nicknames to change. | |
void | nDesynch (char *, char *) |
Handle user desyncs. | |
void | addNick (UserList *) |
Adds the online user item to the user hash tables and user list. | |
void | addRegNick (RegNickList *) |
Adds the registered nick item to the nickname hash tables and user list. | |
void | delNick (UserList *) |
Removes the online user item from the user hash tables and user list. When this function returns, 'killme' is no longer a valid pointer. | |
void | delRegNick (RegNickList *) |
Removes the registered nick item from the nickname hash tables and nick list. When this function returns, 'killme' is no longer a valid pointer. | |
void | setFlags (char *, int, char) |
Sets online flags of an online user structure. | |
void | addAccessMask (char *, UserList *) |
Handle the ACCESS ADD command. | |
void | delAccessMask (char *, UserList *) |
Handle the ACCESS DEL command. | |
void | delNReg (char *) |
void | initNickData (RegNickList *) |
void | syncNickData (time_t) |
Saves the NickServ database. | |
UserList * | getNickData (char *) |
Searches the user hash table for information about the specified online user by nickname. Returns a pointer to the online user item if found, otherwise returns NULL. | |
RegNickList * | getRegNickData (const char *) |
Searches the regnick hash table for information about the specified registered nick data by nickname. | |
void | addOpData (RegNickList *) |
Adds a user with opflags to the index. | |
void | delOpData (RegNickList *) |
Removes and frees a user's index item from the oper index. | |
char * | regnick_ugethost (UserList *, RegNickList *, int sM=1) |
Defines the various nickname flags, oper flags, and declares some nickname-related functions used throughout services.
Max Byrd
Greg Poma
James Hess
Definition in file nickserv.h.
|
by an oper Nick is subject to forced transfer Definition at line 87 of file nickserv.h. Referenced by IpcType::alterRegNickMessage(), IpcType::authObjMessage(), and isIdentified(). |
|
override user restrictions Definition at line 112 of file nickserv.h. Referenced by getOpFlags(), and opFlagged(). |
|
is admin Definition at line 95 of file nickserv.h. |
|
access to AutoHurt commands Definition at line 115 of file nickserv.h. |
|
full akill priv Definition at line 99 of file nickserv.h. Referenced by canAkill(), os_akill(), readConf(), removeAkill(), and removeAkillType(). |
|
can banish/del chans Definition at line 104 of file nickserv.h. Referenced by readConf(). |
|
can edit clonerules Definition at line 110 of file nickserv.h. Referenced by readConf(). |
|
direct modification Definition at line 114 of file nickserv.h. Referenced by do_chanop_add(). |
|
can getrealpass Definition at line 106 of file nickserv.h. Referenced by cs_set_memolvl(), and isGRPop(). |
|
user is a helpop Definition at line 113 of file nickserv.h. |
|
can set services ignores Definition at line 105 of file nickserv.h. Referenced by readConf(). |
|
high-priority info post Definition at line 100 of file nickserv.h. Referenced by is_postnews(). |
|
can jupe Definition at line 108 of file nickserv.h. |
|
can cs/ns list & cs whois Definition at line 109 of file nickserv.h. Referenced by readConf(). |
|
can banish/del nicks Definition at line 103 of file nickserv.h. Referenced by readConf(). |
|
basic oper privs Definition at line 97 of file nickserv.h. Referenced by getOpFlags(), is_listnews(), is_sendinfo(), newsNag(), and opFlagged(). |
|
Value: default flags assigned with A
Definition at line 122 of file nickserv.h. |
|
Value: (OADMIN|OSERVOP|OGRP|ORAW|OJUPE|OLIST|OSETOP|OSETFLAG| \ ONBANDEL|OCBANDEL|OIGNORE|OAKILL|OCLONE|OPROT|ODMOD|OAHURT)
Definition at line 131 of file nickserv.h. |
|
protect from normal setop Definition at line 111 of file nickserv.h. |
|
restricted akill priv Definition at line 98 of file nickserv.h. Referenced by os_akill(), and readConf(). |
|
can use raw Definition at line 107 of file nickserv.h. |
|
A secure flag Definition at line 94 of file nickserv.h. Referenced by readConf(). |
|
Services Root DONT CHANGE Definition at line 93 of file nickserv.h. Referenced by addOpData(), getOpFlags(), is_postnews(), isRoot(), isServop(), opFlagged(), parseLine(), readConf(), readNickData(), and saveNickData(). |
|
is servop (deprecated) Definition at line 96 of file nickserv.h. Referenced by is_postnews(), isServop(), readConf(), readNickData(), and saveNickData(). |
|
can use setflag Definition at line 102 of file nickserv.h. Referenced by readConf(). |
|
can use setop/add/del Definition at line 101 of file nickserv.h. |
|
symbolic alias Definition at line 116 of file nickserv.h. Referenced by do_chanop_add(), getMiscChanOp(), and isFounder(). |
|
Handle the ACCESS ADD command.
Definition at line 1472 of file nickserv.c. References AccessLimit, addAccItem(), isIdentified(), mask(), _userlist::nick, NickServ, _userlist::reg, and sSend(). Referenced by ns_addmask(). |
|
Handles the work of placing an access item in a registered nickname's access list.
Definition at line 2207 of file nickserv.c. Referenced by addAccessMask(), and readNickData(). |
|
Services Flood Protection -- addFlood adds the specified amount to a user's flood level, assuming this was added within tens econds of the last addition otherwise, simply makes floodlevel equal to whatever is sent. This function also updates lastmsg.
Definition at line 2053 of file nickserv.c. Referenced by BadPwChan(), BadPwNick(), gs_roll(), and parseLine(). |
|
Add a NickServ enforcer.
Definition at line 1811 of file nickserv.c. References addUser(), firstGhost, ghost_struct::ghost, GhostList, lastGhost, ghost_struct::next, oalloc(), ghost_struct::previous, strncpyzt, totalghosts, and totalusers. Referenced by addNewUser(), changeNick(), checkAkillAllUsers(), and parseLine(). |
|
Handles a server NICK message by adding a new user connection.
Definition at line 417 of file nickserv.c. References addClone(), addGhost(), addNick(), annoyNickThief(), applyAkill(), _userlist::caccess, checkAccess(), corelog, CTime, delTimedGhost(), dlogEntry(), freeUserListRec(), getNickData(), getRegNickData(), service_struct::host, _userlist::host, _userlist::idnum, InfoServ, isGhost(), logDump(), mostusers, service_struct::name, NBANISH, NDBISMASK, NDOEDIT, _userlist::nick, NickSeeUser(), NickServ, NISAHURT, NOISMASK, oalloc(), _userlist::oflags, OperServ, parse_str(), PutReply, _userlist::reg, RegId::SetNext(), SetUserNickHostReal(), sSend(), timer(), _userlist::timestamp, top_user_idnum(), totalusers, _userlist::user, and VERSION_NUM. Referenced by parseLine(). |
|
Adds the online user item to the user hash tables and user list.
Definition at line 1129 of file nickserv.c. References dlogEntry(), getHashKey(), LIST_ENTRY_INIT, LIST_INSERT_HEAD, _userlist::nick, totalusers, and UserHash. Referenced by addNewUser(), and changeNick(). |
|
Adds a user with opflags to the index.
Definition at line 2335 of file nickserv.c. References firstOper, operlist_struct::next, oalloc(), OROOT, and operlist_struct::who. Referenced by readConf(), and readNickData(). |
|
Adds the registered nick item to the nickname hash tables and user list.
Definition at line 1154 of file nickserv.c. References assert, corelog, freeRegNickListRec(), RegId::getHashKey(), getHashKey(), getRegNickData(), RegNickIdMap::id, LIST_ENTRY_INIT, LIST_FIRST, LIST_INSERT_AFTER, LIST_INSERT_BEFORE, LIST_INSERT_HEAD, LIST_NEXT, logDump(), RegNickIdMap::nick, oalloc(), RegNickHash, and RegNickIdHash. Referenced by IpcType::makeMessage(), and readNickData(). |
|
Definition at line 1067 of file nickserv.c. References isIdentified(), isOper(), OAKILL, and _userlist::reg. |
|
Handles a NICK command, allowing nicknames to change.
Definition at line 563 of file nickserv.c. References addGhost(), addNick(), annoyNickThief(), _userlist::caccess, changeNickOnAllChans(), checkAccess(), clearIdentify(), CTime, delNick(), delTimedGhost(), dlogEntry(), _userlist::floodlevel, _userlist::gecos, getNickData(), getRegNickData(), service_struct::host, _userlist::host, _userlist::id, _identifydata::idnum, _userlist::idnum, isAKilled(), isGhost(), isIdentified(), killide(), myname, service_struct::name, NBANISH, NCNICK, nDesynch(), _identifydata::nick, _userlist::nick, NickSeeUser(), NickServ, oalloc(), _userlist::oflags, _userlist::reg, remUser(), RegId::SetNext(), SetUserNickHostReal(), sSend(), timer(), _identifydata::timestamp, _userlist::timestamp, top_user_idnum(), and _userlist::user. Referenced by parseLine(). |
|
Used to test whether the specified user@hostname can be matched against an entry in an access list.
Definition at line 1343 of file nickserv.c. References LIST_FIRST, LIST_NEXT, _naccesslist::mask, and match(). Referenced by addNewUser(), changeNick(), getMiscChanOp(), and isRecognized(). |
|
Clears any identify by an online user.
Definition at line 819 of file nickserv.c. References _userlist::id, _identifydata::idnum, _identifydata::nick, and _identifydata::timestamp. Referenced by changeNick(), and delNick(). |
|
Handle the ACCESS DEL command.
Definition at line 1519 of file nickserv.c. References delAccItem(), isIdentified(), LIST_FIRST, LIST_NEXT, _naccesslist::mask, mask(), _userlist::nick, NickServ, _userlist::reg, and sSend(). |
|
Handles the work of removing an access item from a registered nickname's access list.
Definition at line 2255 of file nickserv.c. Referenced by delAccessMask(). |
|
Remove a NickServ enforcer.
Definition at line 1859 of file nickserv.c. References firstGhost, getGhost(), GhostList, lastGhost, ghost_struct::next, ghost_struct::previous, sSend(), totalghosts, and totalusers. Referenced by parseLine(). |
|
Removes the online user item from the user hash tables and user list. When this function returns, 'killme' is no longer a valid pointer.
Definition at line 1222 of file nickserv.c. References clearIdentify(), flush_ad(), freeUserListRec(), LIST_REMOVE, and totalusers. Referenced by changeNick(), and remUser(). |
|
Removes and frees a user's index item from the oper index.
Definition at line 2362 of file nickserv.c. References firstOper, operlist_struct::next, and operlist_struct::who. Referenced by delRegNick(), and readConf(). |
|
Removes the registered nick item from the nickname hash tables and nick list. When this function returns, 'killme' is no longer a valid pointer.
Definition at line 1243 of file nickserv.c. References delMemo(), delOpData(), freeRegNickListRec(), LIST_FIRST, LIST_NEXT, LIST_REMOVE, and _memolist::realto. |
|
Handle expiration of a NickServ ghost timer by removing the enforcer.
Definition at line 1898 of file nickserv.c. |
|
Searches the user hash table for information about the specified online user by nickname. Returns a pointer to the online user item if found, otherwise returns NULL.
Definition at line 1288 of file nickserv.c. References getHashKey(), LIST_FIRST, LIST_NEXT, _userlist::nick, and UserHash. Referenced by addNewUser(), changeNick(), getMiscChanOp(), guest_cnick(), isFounder(), killide(), make_clone(), IpcType::makeMessage(), nDesynch(), parseLine(), IpcType::queryRegNickMessage(), regnick_ugethost(), removeAkill(), removeAkillType(), remUser(), sendToNickServ(), setChanMode(), setFlags(), and setMode(). |
|
Returns the effective flags of an online user.
Definition at line 946 of file nickserv.c. References isIdentified(), isOper(), OACC, OOPER, OPFLAG_PLUS, OROOT, _userlist::reg, and userOverriding(). Referenced by sendToChanServ(), sendToGameServ(), sendToInfoServ(), sendToMemoServ(), sendToNickServ(), and sendToOperServ(). |
|
Searches the regnick hash table for information about the specified registered nick data by nickname.
Definition at line 1312 of file nickserv.c. References getHashKey(), LIST_FIRST, LIST_NEXT, and RegNickHash. Referenced by addNewUser(), addRegNick(), IpcType::alterObjMessage(), IpcType::authObjMessage(), changeNick(), getChanOpData(), getMiscChanOp(), killide(), make_clone(), IpcType::makeMessage(), ms_DelMemoBlock(), IpcType::queryObjMessage(), readChanData(), readConf(), readMemoData(), readNickData(), and setMode(). |
|
Definition at line 1926 of file nickserv.c. Referenced by addNewUser(), changeNick(), and parseLine(). |
|
Definition at line 1025 of file nickserv.c. References isIdentified(), isOper(), OGRP, and _userlist::reg. |
|
Reports TRUE or FALSE indicating whether or not the specified user is identified to the specified nickname.
Definition at line 842 of file nickserv.c. References _userlist::caccess, _userlist::id, _identifydata::idnum, NFORCEXFER, _identifydata::nick, NVACATION, _userlist::reg, _userlist::timestamp, and _identifydata::timestamp. Referenced by addAccessMask(), canAkill(), changeNick(), delAccessMask(), getMiscChanOp(), getOpFlags(), isGRPop(), isHelpop(), isRecognized(), isRoot(), isServop(), killide(), opFlagged(), remUser(), and setMode(). |
|
Definition at line 887 of file nickserv.c. References NISOPER, and _userlist::oflags. Referenced by addUserToChan(), canAkill(), getMiscChanOp(), getOpFlags(), is_listnews(), is_sendinfo(), isGRPop(), isRoot(), isServop(), newsNag(), opFlagged(), parseLine(), and sendToOperServ(). |
|
Reports TRUE or FALSE indicating whether or not the specified user is recognized by access list (ACC 2) for the specified nickname.
Definition at line 870 of file nickserv.c. References _userlist::caccess, checkAccess(), _userlist::host, isIdentified(), NVACATION, _userlist::reg, and _userlist::user. Referenced by getMiscChanOp(), isFounder(), regnick_ugethost(), and setMode(). |
|
Definition at line 983 of file nickserv.c. References isIdentified(), isOper(), OROOT, and _userlist::reg. |
|
Definition at line 1003 of file nickserv.c. References isIdentified(), isOper(), OROOT, OSERVOP, and _userlist::reg. |
|
Handle user desyncs.
Definition at line 252 of file nickserv.c. References dlogEntry(), getNickData(), myname, NickServ, and sSend(). Referenced by changeNick(), parseLine(), remUser(), sendToNickServ(), setFlags(), and setMode(). |
|
Definition at line 912 of file nickserv.c. References FALSE, isIdentified(), isOper(), OACC, OOPER, OPFLAG_ROOT, OROOT, _userlist::reg, and userOverriding(). Referenced by cs_set_memolvl(), do_chanop_add(), getMiscChanOp(), is_postnews(), isFounder(), removeAkill(), and removeAkillType(). |
|
Definition at line 1422 of file nickserv.c. References genHostMask(), getNickData(), isRecognized(), NDBISMASK, NISOPER, NOISMASK, _userlist::oflags, and strncpyzt. Referenced by do_chanop_list(), and GoodPwNick(). |
|
Handles the QUIT server message, it removes a user from the nickname list and destroys the allocated memory area.
Definition at line 1095 of file nickserv.c. References cleanMemos(), CTime, delClone(), delNick(), dlogEntry(), getNickData(), _userlist::host, isIdentified(), nDesynch(), _userlist::reg, remFromAllChans(), and _userlist::user. Referenced by changeNick(), checkAkillAllUsers(), and parseLine(). |
|
Message handler for NickServ.
Definition at line 1376 of file nickserv.c. References CTime, getNickData(), getOpFlags(), nDesynch(), nextNsync, _userlist::nick, NickServ, nickserv_commands, RET_FAIL, RET_OK_DB, and sSend(). Referenced by parseLine(). |
|
Sets online flags of an online user structure.
Definition at line 771 of file nickserv.c. References dlogEntry(), getNickData(), nDesynch(), and _userlist::oflags. Referenced by parseLine(). |
|
Identifies an online user to a registered nickname.
Definition at line 799 of file nickserv.c. References CTime, _userlist::id, _identifydata::idnum, MAX, _identifydata::nick, _userlist::nick, oalloc(), _userlist::timestamp, and _identifydata::timestamp. |
|
Changes the modes of an online user.
Definition at line 696 of file nickserv.c. References dlogEntry(), getNickData(), getRegNickData(), isIdentified(), isRecognized(), NDBISMASK, nDesynch(), _userlist::nick, NISAHURT, NISHELPOP, NISOPER, NOISMASK, and _userlist::oflags. Referenced by parseLine(). |
|
Saves the NickServ database.
Definition at line 2292 of file nickserv.c. References nextNsync. Referenced by sync_cfg(). |