~ubuntu-branches/ubuntu/lucid/inspircd/lucid-security

« back to all changes in this revision

Viewing changes to src/users.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Giacomo Catenazzi, Darren Blaber, Matt Arnold, Giacomo Catenazzi
  • Date: 2008-03-06 07:56:47 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080306075647-z8a4phxkn3vo3ajx
Tags: 1.1.17+dfsg-1
[ Darren Blaber ]
* New upstream release, fix /etc/init.d/inspircd stop.
* Fix the postrm script so there is no duplicate update-rc.d
* Fix the manpage so there are no more errors in it

[ Matt Arnold ]
*  Fix prerm so it works (Closes: #466924)

[ Giacomo Catenazzi ]
* Added me as uploader
* Add again support of dpatch in debian/rules
* Build sources only once!
* Correct make clean target, not to include generated ./inspircd on sources
* Don't change permission of configuration files, when starting inspircd
  (separation of policy and program).

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 *       | Inspire Internet Relay Chat Daemon |
3
3
 *       +------------------------------------+
4
4
 *
5
 
 *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
 
5
 *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
6
6
 * See: http://www.inspircd.org/wiki/index.php/Credits
7
7
 *
8
8
 * This program is free but copyrighted software; see
328
328
        age = ServerInstance->Time(true);
329
329
        lines_in = lastping = signon = idle_lastmsg = nping = registered = 0;
330
330
        ChannelCount = timeout = flood = bytes_in = bytes_out = cmds_in = cmds_out = 0;
331
 
        muted = exempt = haspassed = dns_done = false;
 
331
        quitting = exempt = haspassed = dns_done = false;
332
332
        fd = -1;
333
333
        recvq.clear();
334
334
        sendq.clear();
341
341
        memset(modes,0,sizeof(modes));
342
342
        memset(snomasks,0,sizeof(snomasks));
343
343
        /* Invalidate cache */
344
 
        operquit = cached_fullhost = cached_hostip = cached_makehost = cached_fullrealhost = NULL;
 
344
        cached_fullhost = cached_hostip = cached_makehost = cached_fullrealhost = NULL;
345
345
}
346
346
 
347
347
void userrec::RemoveCloneCounts()
371
371
{
372
372
        this->InvalidateCache();
373
373
        this->DecrementModes();
374
 
        if (operquit)
375
 
                free(operquit);
 
374
 
376
375
        if (ip)
377
376
        {
378
377
                this->RemoveCloneCounts();
833
832
void userrec::QuitUser(InspIRCd* Instance, userrec *user, const std::string &quitreason, const char* operreason)
834
833
{
835
834
        user->Write("ERROR :Closing link (%s@%s) [%s]", user->ident, user->host, *operreason ? operreason : quitreason.c_str());
836
 
        user->muted = true;
837
835
        Instance->GlobalCulls.AddItem(user, quitreason.c_str(), operreason);
838
836
}
839
837
 
1059
1057
 
1060
1058
                if (r)
1061
1059
                {
1062
 
                        this->muted = true;
1063
1060
                        char reason[MAXBUF];
1064
1061
                        if (*ServerInstance->Config->MoronBanner)
1065
1062
                                this->WriteServ("NOTICE %s :*** %s", this->nick, ServerInstance->Config->MoronBanner);
1072
1069
 
1073
1070
                if (n)
1074
1071
                {
1075
 
                        this->muted = true;
1076
1072
                        char reason[MAXBUF];
1077
1073
                        if (*ServerInstance->Config->MoronBanner)
1078
1074
                                this->WriteServ("NOTICE %s :*** %s", this, ServerInstance->Config->MoronBanner);
1738
1734
        if (this->ServerInstance->Config->CycleHosts)
1739
1735
                this->WriteCommonExcept("%s","QUIT :Changing ident");
1740
1736
 
1741
 
        strlcpy(this->ident, newident, IDENTMAX+2);
 
1737
        strlcpy(this->ident, newident, IDENTMAX+1);
1742
1738
 
1743
1739
        this->InvalidateCache();
1744
1740
 
1944
1940
{
1945
1941
        /* WARNING: May delete this user! */
1946
1942
        int thisfd = this->GetFd();
1947
 
 
 
1943
        
1948
1944
        try
1949
1945
        {
1950
1946
                switch (et)
1951
1947
                {
1952
1948
                        case EVENT_READ:
 
1949
                                if (this->quitting)
 
1950
                                        return; // we just don't care anymore
1953
1951
                                ServerInstance->ProcessUser(this);
1954
1952
                        break;
1955
1953
                        case EVENT_WRITE:
1978
1976
 
1979
1977
void userrec::SetOperQuit(const std::string &oquit)
1980
1978
{
1981
 
        if (operquit)
1982
 
                return;
1983
 
 
1984
 
        operquit = strdup(oquit.c_str());
 
1979
        operquitmsg = oquit;
1985
1980
}
1986
1981
 
1987
1982
const char* userrec::GetOperQuit()
1988
1983
{
1989
 
        return operquit ? operquit : "";
 
1984
        return operquitmsg.c_str();
1990
1985
}
1991
1986
 
1992
1987
VisData::VisData()