Exemplo n.º 1
0
void SnomaskDel(Snomask *sno)
{
	if (loop.ircd_rehashing)
		sno->unloaded = 1;
	else	
	{
		int i;
		for (i = 0; i <= LastSlot; i++)
		{
			aClient *cptr = local[i];
			long oldsno;
			if (!cptr || !IsPerson(cptr))
				continue;
			oldsno = cptr->user->snomask;
			cptr->user->snomask &= ~sno->mode;
			if (oldsno != cptr->user->snomask)
				sendto_one(cptr, rpl_str(RPL_SNOMASK), me.name,
					cptr->name, get_snostr(cptr->user->snomask));
		}
		sno->flag = '\0';
	}
	if (sno->owner) {
		ModuleObject *snoobj;
		for (snoobj = sno->owner->objects; snoobj; snoobj = snoobj->next) {
			if (snoobj->type == MOBJ_SNOMASK && snoobj->object.snomask == sno) {
				DelListItem(snoobj, sno->owner->objects);
				MyFree(snoobj);
				break;
			}
		}
		sno->owner = NULL;
	}
	return;
}
Exemplo n.º 2
0
void ExtbanDel(Extban *eb)
{
char tmpbuf[512];
	/* Just zero it all away.. */

	if (eb->owner)
	{
		ModuleObject *banobj;
		for (banobj = eb->owner->objects; banobj; banobj = banobj->next)
		{
			if (banobj->type == MOBJ_EXTBAN && banobj->object.extban == eb)
			{
				DelListItem(banobj, eb->owner->objects);
				MyFree(banobj);
				break;
			}
		}
	}
	memset(eb, 0, sizeof(Extban));
	make_extbanstr();
	ircsprintf(tmpbuf, "~,%s", extbanstr);
	IsupportSetValue(IsupportFind("EXTBAN"), tmpbuf);
	/* Hmm do we want to go trough all chans and remove the bans?
	 * I would say 'no' because perhaps we are just reloading,
	 * and else.. well... screw them?
	 */
}
Exemplo n.º 3
0
void	DCCdeny_del(ConfigItem_deny_dcc *deny)
{
	DelListItem(deny, conf_deny_dcc);
	if (deny->filename)
		MyFree(deny->filename);
	if (deny->reason)
		MyFree(deny->reason);
	MyFree(deny);
}
Exemplo n.º 4
0
/*
 * =================================================================
 * my_tkl_del_line:
 *     Modified version of tkl_del_line (from src/s_kline.c),
 *     because using loops is unnecessary here). Also, I don't
 *     delete any spamfilter entries with this module either.
 * =================================================================
 */
void my_tkl_del_line(aTKline *p, int tklindex)
{
	MyFree(p->hostmask);
	MyFree(p->reason);
	MyFree(p->setby);
	if ((p->type & TKL_KILL || p->type & TKL_ZAP || p->type & TKL_SHUN)
	    && p->ptr.netmask)
		MyFree(p->ptr.netmask);
	DelListItem(p, tklines[tklindex]);
	MyFree(p);
}
Exemplo n.º 5
0
void chanfloodtimer_stopchantimers(aChannel *chptr)
{
RemoveFld *e = removefld_list;
	while(e)
	{
		if (e->chptr == chptr)
			e = (RemoveFld *)DelListItem(e, removefld_list);
		else
			e = e->next;
	}
}
Exemplo n.º 6
0
void free_pending_net(aClient *sptr)
{
aPendingNet *e, *e_next;

	for (e = pendingnet; e; e = e_next)
	{
		e_next = e->next;
		if (e->sptr == sptr)
		{
			DelListItem(e, pendingnet);
			MyFree(e);
			/* Don't break, there can be multiple objects */
		}
	}
}
Exemplo n.º 7
0
void chanfloodtimer_del(aChannel *chptr, char mflag, long mbit)
{
RemoveFld *e;

	if (chptr->mode.floodprot && !(chptr->mode.floodprot->timer_flags & mbit))
		return; /* nothing to remove.. */
	e = chanfloodtimer_find(chptr, mflag);
	if (!e)
		return;

	DelListItem(e, removefld_list);

	if (chptr->mode.floodprot)
		chptr->mode.floodprot->timer_flags &= ~mbit;
}
Exemplo n.º 8
0
Event	*EventDel(Event *event)
{
	Event *p, *q;
	for (p = events; p; p = p->next) {
		if (p == event) {
			q = p->next;
			MyFree(p->name);
			DelListItem(p, events);
			if (p->owner) {
				ModuleObject *eventobjs;
				for (eventobjs = p->owner->objects; eventobjs; eventobjs = eventobjs->next) {
					if (eventobjs->type == MOBJ_EVENT && eventobjs->object.event == p) {
						DelListItem(eventobjs, p->owner->objects);
						MyFree(eventobjs);
						break;
					}
				}
			}
			MyFree(p);
			return q;		
		}
	}
	return NULL;
}
Exemplo n.º 9
0
Arquivo: ufs4tc.c Projeto: laz2/ufs4tc
PStorageDevice FsFindBsdPartitions()
{
    PStorageDevice pDev = NULL;
    PStorageDevice pDevList;
    BOOL fFindOk = FALSE;

    pDevList = DetectStorageDevices();
    if (pDevList)
    {
        pDev = pDevList;
        while (pDev != NULL)
        {
            HANDLE hDisk = OpenDisk(pDev->DevicePath);
            if (hDisk != INVALID_HANDLE_VALUE)
            {
                pDev->bpPartList = FindBsdPartitions(hDisk, DOSBBSECTOR);
                CloseDisk(hDisk);
            }
            if (pDev->bpPartList)
            {
                if (!fFindOk)
                {
                    fFindOk = TRUE;
                }
                pDev = pDev->pNext;
            }
            else
            {
                PStorageDevice pTemp = (PStorageDevice)DelListItem((PPListItem) &pDevList, (PListItem)pDev);
                pDev = pDev->pNext;
                HeapFree(g_hDevStorageHeap, 0, pTemp);
            }
        }

        if (fFindOk)
        {
            return pDevList;
        }
        else
        {
            FreeDevStorageList();
        }
    }

    return NULL;
}
Exemplo n.º 10
0
void dcc_wipe_services(void)
{
	ConfigItem_deny_dcc *dconf, *next;
	
	for (dconf = conf_deny_dcc; dconf; dconf = (ConfigItem_deny_dcc *) next)
	{
		next = (ConfigItem_deny_dcc *)dconf->next;
		if ((dconf->flag.type2 == CONF_BAN_TYPE_AKILL))
		{
			DelListItem(dconf, conf_deny_dcc);
			if (dconf->filename)
				MyFree(dconf->filename);
			if (dconf->reason)
				MyFree(dconf->reason);
			MyFree(dconf);
		}
	}

}
Exemplo n.º 11
0
void wipe_svsnlines(void)
{
	ConfigItem_ban *bconf, t;
	
	for (bconf = conf_ban; bconf; bconf = (ConfigItem_ban *) bconf->next)
	{
		if ((bconf->flag.type == CONF_BAN_REALNAME) &&
			(bconf->flag.type2 == CONF_BAN_TYPE_AKILL))
		{
			t.next = (ConfigItem *)DelListItem(bconf, conf_ban);
			if (bconf->mask)
				MyFree(bconf->mask);
			if (bconf->reason)
				MyFree(bconf->reason);
			MyFree(bconf);
			bconf = &t;
		}
	}
}
Exemplo n.º 12
0
void UmodeDel(Umode *umode)
{
	if (loop.ircd_rehashing)
		umode->unloaded = 1;
	else	
	{
		aClient *cptr;
		for (cptr = client; cptr; cptr = cptr->next)
		{
			long oldumode = 0;
			if (!IsPerson(cptr))
				continue;
			oldumode = cptr->umodes;
			cptr->umodes &= ~umode->mode;
			if (MyClient(cptr))
				send_umode_out(cptr, cptr, oldumode);
		}
		umode->flag = '\0';
		AllUmodes &= ~(umode->mode);
		SendUmodes &= ~(umode->mode);
		make_umodestr();
	}

	if (umode->owner) {
		ModuleObject *umodeobj;
		for (umodeobj = umode->owner->objects; umodeobj; umodeobj = umodeobj->next) {
			if (umodeobj->type == MOBJ_UMODE && umodeobj->object.umode == umode) {
				DelListItem(umodeobj, umode->owner->objects);
				MyFree(umodeobj);
				break;
			}
		}
		umode->owner = NULL;
	}
	return;
}