Exemplo n.º 1
0
/* cancel_clients()
 *
 * inputs	- client who sent us the message, client with fake
 *		  direction
 * outputs	- a given warning about the fake direction
 * side effects -
 */
static void
cancel_clients(struct Client *client_p, struct Client *source_p)
{
	/* ok, fake prefix happens naturally during a burst on a nick
	 * collision with TS5, we cant kill them because one client has to
	 * survive, so we just send an error.
	 */
	if(IsServer(source_p) || IsMe(source_p))
	{
		sendto_realops_snomask(SNO_DEBUG, L_ALL,
				     "Message for %s[%s] from %s",
				     source_p->name, source_p->from->name,
				     client_p->name);
	}
	else
	{
		sendto_realops_snomask(SNO_DEBUG, L_ALL,
				     "Message for %s[%s@%s!%s] from %s (TS, ignored)",
				     source_p->name,
				     source_p->username,
				     source_p->host,
				     source_p->from->name,
				     client_p->name);
	}
}
Exemplo n.º 2
0
/*
 * Note: At least at protocol level ERROR has only one parameter,
 * although this is called internally from other functions
 * --msa
 *
 *      parv[*] = parameters
 */
static void
m_error(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
	const char *para;
	int hideit = ConfigFileEntry.hide_error_messages;

	para = (parc > 1 && *parv[1] != '\0') ? parv[1] : "<>";

	if (IsAnyServer(client_p))
	{
		ilog(L_SERVER, "Received ERROR message from %s: %s",
		     log_client_name(source_p, SHOW_IP), para);
	}

	if(is_safe_error(para))
		hideit = 0;
	if(IsAnyServer(client_p))
	{
		if (hideit < 2)
			sendto_realops_snomask(SNO_GENERAL, hideit ? L_ADMIN : (is_remote_connect(client_p) ? L_NETWIDE : L_ALL),
					"ERROR :from %s -- %s",
					client_p->name, para);
		if (hideit > 0)
			sendto_realops_snomask(SNO_GENERAL, (hideit == 1 ? L_OPER : L_ALL) | (is_remote_connect(client_p) ? L_NETWIDE : L_ALL),
					"ERROR :from %s -- <hidden>",
					client_p->name);
	}

	exit_client(client_p, source_p, source_p, "ERROR");
}
Exemplo n.º 3
0
static void
ms_error(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
	const char *para;
	int hideit = ConfigFileEntry.hide_error_messages;

	para = (parc > 1 && *parv[1] != '\0') ? parv[1] : "<>";

	ilog(L_SERVER, "Received ERROR message from %s: %s",
	     log_client_name(source_p, SHOW_IP), para);

	if(is_safe_error(para))
		hideit = 0;
	if(hideit == 2)
		return;

	if(client_p == source_p)
	{
		sendto_realops_snomask(SNO_GENERAL, hideit ? L_ADMIN : L_ALL, "ERROR :from %s -- %s",
				     client_p->name, para);
	}
	else
	{
		sendto_realops_snomask(SNO_GENERAL, hideit ? L_ADMIN : L_ALL, "ERROR :from %s via %s -- %s",
				     source_p->name, client_p->name, para);
	}
}
Exemplo n.º 4
0
/* SET SPAMNUM */
static void
quote_spamnum(struct Client *source_p, const char *arg, int newval)
{
	if(newval > 0)
	{
		if(newval == 0)
		{
			sendto_realops_snomask(SNO_GENERAL, L_ALL,
					     "%s has disabled ANTI_SPAMBOT", source_p->name);
			GlobalSetOptions.spam_num = newval;
			return;
		}
		if(newval < MIN_SPAM_NUM)
		{
			GlobalSetOptions.spam_num = MIN_SPAM_NUM;
		}
		else		/* if (newval < MIN_SPAM_NUM) */
		{
			GlobalSetOptions.spam_num = newval;
		}
		sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s has changed SPAMNUM to %i",
				     source_p->name, GlobalSetOptions.spam_num);
	}
	else
	{
		sendto_one_notice(source_p, ":SPAMNUM is currently %i", GlobalSetOptions.spam_num);
	}
}
Exemplo n.º 5
0
void
show_stats(hook_data_int *data)
{
	char statchar = (char) data->arg2;
	if (statchar == 'L' || statchar == 'l') {
		const char *name = data->arg1;
		if (!EmptyString(name))
			sendto_realops_snomask(SNO_SPY, L_ALL,
			                       "STATS %c requested by %s (%s@%s) [%s] on %s",
			                       statchar, data->client->name,
			                       data->client->username,
			                       data->client->host,
			                       data->client->servptr->name, name);
		else
			sendto_realops_snomask(SNO_SPY, L_ALL,
			                       "STATS %c requested by %s (%s@%s) [%s]",
			                       statchar, data->client->name,
			                       data->client->username,
			                       data->client->host, data->client->servptr->name);
	} else {
		sendto_realops_snomask(SNO_SPY, L_ALL,
		                       "STATS %c requested by %s (%s@%s) [%s]",
		                       statchar, data->client->name, data->client->username,
		                       data->client->host, data->client->servptr->name);
	}
}
Exemplo n.º 6
0
static int
do_chghost(struct Client *source_p, struct Client *target_p,
		const char *newhost, int is_encap)
{
	if (!clean_host(newhost))
	{
		sendto_realops_snomask(SNO_GENERAL, is_encap ? L_ALL : L_NETWIDE, "%s attempted to change hostname for %s to %s (invalid)",
				IsServer(source_p) ? source_p->name : get_oper_name(source_p),
				target_p->name, newhost);
		/* sending this remotely may disclose important
		 * routing information -- jilles */
		if (is_encap ? MyClient(target_p) : !ConfigServerHide.flatten_links)
			sendto_one_notice(target_p, ":*** Notice -- %s attempted to change your hostname to %s (invalid)",
					source_p->name, newhost);
		return 0;
	}
	change_nick_user_host(target_p, target_p->name, target_p->username, newhost, 0, "Changing host");
	if (irccmp(target_p->host, target_p->orighost))
	{
		SetDynSpoof(target_p);
		if (MyClient(target_p))
			sendto_one_numeric(target_p, RPL_HOSTHIDDEN, "%s :is now your hidden host (set by %s)", target_p->host, source_p->name);
	}
	else
	{
		ClearDynSpoof(target_p);
		if (MyClient(target_p))
			sendto_one_numeric(target_p, RPL_HOSTHIDDEN, "%s :hostname reset by %s", target_p->host, source_p->name);
	}
	if (MyClient(source_p))
		sendto_one_notice(source_p, ":Changed hostname for %s to %s", target_p->name, target_p->host);
	if (!IsServer(source_p) && !IsService(source_p))
		sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s changed hostname for %s to %s", get_oper_name(source_p), target_p->name, target_p->host);
	return 1;
}
Exemplo n.º 7
0
/* SET IDLETIME */
static void
quote_idletime(struct Client *source_p, int newval)
{
	if(newval >= 0)
	{
		if(newval == 0)
		{
			sendto_realops_snomask(SNO_GENERAL, L_ALL,
					     "%s has disabled idletime checking", source_p->name);
			GlobalSetOptions.idletime = 0;
		}
		else
		{
			sendto_realops_snomask(SNO_GENERAL, L_ALL,
					     "%s has changed IDLETIME to %i",
					     source_p->name, newval);
			GlobalSetOptions.idletime = (newval * 60);
		}
	}
	else
	{
		sendto_one(source_p, ":%s NOTICE %s :IDLETIME is currently %i",
			   me.name, source_p->name, GlobalSetOptions.idletime / 60);
	}
}
Exemplo n.º 8
0
/* send_linebuf_remote()
 *
 * inputs	- client to attach to, sender, linebuf
 * outputs	-
 * side effects - client has linebuf attached
 */
static void
send_linebuf_remote(struct Client *to, struct Client *from, buf_head_t *linebuf)
{
    if(to->from)
        to = to->from;

    /* test for fake direction */
    if(!MyClient(from) && IsPerson(to) && (to == from->from))
    {
        if(IsServer(from))
        {
            sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                   "Send message to %s[%s] dropped from %s(Fake Dir)",
                                   to->name, to->from->name, from->name);
            return;
        }

        sendto_realops_snomask(SNO_GENERAL, L_ALL,
                               "Ghosted: %s[%s@%s] from %s[%s@%s] (%s)",
                               to->name, to->username, to->host,
                               from->name, from->username, from->host, to->from->name);
        kill_client_serv_butone(NULL, to, "%s (%s[%s@%s] Ghosted %s)",
                                me.name, to->name, to->username,
                                to->host, to->from->name);

        to->flags |= FLAGS_KILLED;

        exit_client(NULL, to, &me, "Ghosted client");
        return;
    }

    _send_linebuf(to, linebuf);
    return;
}
Exemplo n.º 9
0
/*
 * ms_svinfo - SVINFO message handler
 *      parv[1] = TS_CURRENT for the server
 *      parv[2] = TS_MIN for the server
 *      parv[3] = unused, send 0
 *      parv[4] = server's idea of UTC time
 */
static int
ms_svinfo(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
    signed long deltat;
    time_t theirtime;
    char squitreason[120];

    /* SVINFO isnt remote. */
    if(source_p != client_p)
        return 0;

    if(TS_CURRENT < atoi(parv[2]) || atoi(parv[1]) < TS_MIN)
    {
        /* TS version is too low on one of the sides, drop the link */
        sendto_realops_snomask(SNO_GENERAL, L_ALL,
                               "Link %s dropped, wrong TS protocol version (%s,%s)",
                               source_p->name, parv[1], parv[2]);
        rb_snprintf(squitreason, sizeof squitreason, "Incompatible TS version (%s,%s)",
                    parv[1], parv[2]);
        exit_client(source_p, source_p, source_p, squitreason);
        return 0;
    }

    /*
     * since we're here, might as well set rb_current_time() while we're at it
     */
    rb_set_time();
    theirtime = atol(parv[4]);
    deltat = labs(theirtime - rb_current_time());

    if(deltat > ConfigFileEntry.ts_max_delta)
    {
        sendto_realops_snomask(SNO_GENERAL, L_ALL,
                               "Link %s dropped, excessive TS delta"
                               " (my TS=%ld, their TS=%ld, delta=%ld)",
                               source_p->name,
                               (long) rb_current_time(), (long) theirtime, deltat);
        ilog(L_SERVER,
             "Link %s dropped, excessive TS delta"
             " (my TS=%ld, their TS=%ld, delta=%ld)",
             log_client_name(source_p, SHOW_IP), (long) rb_current_time(), (long) theirtime, deltat);
        rb_snprintf(squitreason, sizeof squitreason, "Excessive TS delta (my TS=%ld, their TS=%ld, delta=%ld)",
                    (long) rb_current_time(), (long) theirtime, deltat);
        disable_server_conf_autoconn(source_p->name);
        exit_client(source_p, source_p, source_p, squitreason);
        return 0;
    }

    if(deltat > ConfigFileEntry.ts_warn_delta)
    {
        sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
                               "Link %s notable TS delta"
                               " (my TS=%ld, their TS=%ld, delta=%ld)",
                               source_p->name, (long) rb_current_time(), (long) theirtime, deltat);
    }

    return 0;
}
Exemplo n.º 10
0
/* SET SPLITMODE */
static void
quote_splitmode(struct Client *source_p, const char *charval, int intval)
{
	if(charval)
	{
		int newval;

		for (newval = 0; splitmode_values[newval]; newval++)
		{
			if(!irccmp(splitmode_values[newval], charval))
				break;
		}

		/* OFF */
		if(newval == 0)
		{
			sendto_realops_snomask(SNO_GENERAL, L_ALL,
					     "%s is disabling splitmode", get_oper_name(source_p));

			splitmode = false;
			splitchecking = false;

			rb_event_delete(check_splitmode_ev);
			check_splitmode_ev = NULL;
		}
		/* ON */
		else if(newval == 1)
		{
			sendto_realops_snomask(SNO_GENERAL, L_ALL,
					     "%s is enabling and activating splitmode",
					     get_oper_name(source_p));

			splitmode = true;
			splitchecking = false;

			/* we might be deactivating an automatic splitmode, so pull the event */
			rb_event_delete(check_splitmode_ev);
			check_splitmode_ev = NULL;
		}
		/* AUTO */
		else if(newval == 2)
		{
			sendto_realops_snomask(SNO_GENERAL, L_ALL,
					     "%s is enabling automatic splitmode",
					     get_oper_name(source_p));

			splitchecking = true;
			check_splitmode(NULL);
		}
	}
	else
		/* if we add splitchecking to splitmode*2 we get a unique table to
		 * pull values back out of, splitmode can be four states - but you can
		 * only set to three, which means we cant use the same table --fl_
		 */
		sendto_one_notice(source_p, ":SPLITMODE is currently %s",
			   splitmode_status[(splitchecking + (splitmode * 2))]);
}
Exemplo n.º 11
0
/* send_linebuf()
 *
 * inputs	- client to send to, linebuf to attach
 * outputs	-
 * side effects - linebuf is attached to client
 */
static int
_send_linebuf(struct Client *to, buf_head_t *linebuf)
{
    if(IsMe(to))
    {
        sendto_realops_snomask(SNO_GENERAL, L_ALL, "Trying to send message to myself!");
        return 0;
    }

    if(!MyConnect(to) || IsIOError(to))
        return 0;

    if(linebuf_len(&to->localClient->buf_sendq) > get_sendq(to))
    {
        if(IsServer(to))
        {
            sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                   "Max SendQ limit exceeded for %s: %u > %lu",
                                   get_server_name(to, HIDE_IP),
                                   linebuf_len(&to->localClient->buf_sendq),
                                   get_sendq(to));

            ilog(L_SERVER, "Max SendQ limit exceeded for %s: %u > %lu",
                 log_client_name(to, SHOW_IP),
                 linebuf_len(&to->localClient->buf_sendq),
                 get_sendq(to));
        }

        if(IsClient(to))
            to->flags |= FLAGS_SENDQEX;

        dead_link(to);
        return -1;
    }
    else
    {
        /* just attach the linebuf to the sendq instead of
         * generating a new one
         */
        linebuf_attach(&to->localClient->buf_sendq, linebuf);
    }

    /*
     ** Update statistics. The following is slightly incorrect
     ** because it counts messages even if queued, but bytes
     ** only really sent. Queued bytes get updated in SendQueued.
     */
    to->localClient->sendM += 1;
    me.localClient->sendM += 1;
    if(linebuf_len(&to->localClient->buf_sendq) > 0)
        send_queued_write(to->localClient->fd, to);
    return 0;
}
Exemplo n.º 12
0
void
show_trace(hook_data_client *data)
{
	if(data->target)
		sendto_realops_snomask(SNO_SPY, L_ALL,
				"trace requested by %s (%s@%s) [%s] on %s",
				data->client->name, data->client->username,
				data->client->host, data->client->servptr->name,
				data->target->name);
	else
		sendto_realops_snomask(SNO_SPY, L_ALL,
				"trace requested by %s (%s@%s) [%s]",
				data->client->name, data->client->username,
				data->client->host, data->client->servptr->name);
}
Exemplo n.º 13
0
/*
 * void eventAdd(const char *name, EVH *func, void *arg, time_t when)
 *
 * Input: Name of event, function to call, arguments to pass, and frequency
 *	  of the event.
 * Output: None
 * Side Effects: Adds the event to the event list.
 */
void
eventAdd(const char *name, EVH * func, void *arg, time_t when)
{
	int i;

	/* find first inactive index */
	for (i = 0; i < MAX_EVENTS; i++)
	{
		if(event_table[i].active == 0)
		{
			event_table[i].func = func;
			event_table[i].name = name;
			event_table[i].arg = arg;
			event_table[i].when = CurrentTime + when;
			event_table[i].frequency = when;
			event_table[i].active = 1;

			if((event_table[i].when < event_time_min) || (event_time_min == -1))
				event_time_min = event_table[i].when;

			return;
		}
	}

	/* erk! couldnt add to event table */
	sendto_realops_snomask(SNO_DEBUG, L_ALL, "Unable to add event [%s] to event table", name);

}
Exemplo n.º 14
0
static void
do_modreload(struct Client *source_p, const char *module)
{
	int modindex;
	int check_core;
	char *m_bn = rb_basename(module);

	if((modindex = findmodule_byname(m_bn)) == -1)
	{
		sendto_one_notice(source_p, ":Module %s is not loaded", m_bn);
		rb_free(m_bn);
		return;
	}

	check_core = modlist[modindex]->core;

	if(unload_one_module(m_bn, true) == false)
	{
		sendto_one_notice(source_p, ":Module %s is not loaded", m_bn);
		rb_free(m_bn);
		return;
	}

	if((load_one_module(m_bn, modlist[modindex]->origin, check_core) == false) && check_core)
	{
		sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
				     "Error reloading core module: %s: terminating ircd", m_bn);
		ilog(L_MAIN, "Error loading core module %s: terminating ircd", m_bn);
		exit(0);
	}

	rb_free(m_bn);
}
Exemplo n.º 15
0
/* SET MAX */
static void
quote_max(struct Client *source_p, const char *arg, int newval)
{
    if(newval > 0) {
        if(newval > maxconnections - MAX_BUFFER) {
            sendto_one_notice(source_p,
                              ":You cannot set MAXCLIENTS to > %d",
                              maxconnections - MAX_BUFFER);
            return;
        }

        if(newval < 32) {
            sendto_one_notice(source_p, ":You cannot set MAXCLIENTS to < 32 (%d:%d)",
                              GlobalSetOptions.maxclients, rb_getmaxconnect());
            return;
        }

        GlobalSetOptions.maxclients = newval;

        sendto_realops_snomask(SNO_GENERAL, L_ALL,
                               "%s!%s@%s set new MAXCLIENTS to %d (%lu current)",
                               source_p->name, source_p->username, source_p->host,
                               GlobalSetOptions.maxclients,
                               rb_dlink_list_length(&lclient_list));

        return;
    } else {
        sendto_one_notice(source_p, ":Current Maxclients = %d (%lu)",
                          GlobalSetOptions.maxclients, rb_dlink_list_length(&lclient_list));
    }
}
Exemplo n.º 16
0
void
server_reboot(void)
{
	int i;

	sendto_realops_snomask(SNO_GENERAL, L_ALL, "Restarting server...");

	ilog(L_MAIN, "Restarting server...");
	/*
	 * XXX we used to call flush_connections() here. But since this routine
	 * doesn't exist anymore, we won't be flushing. This is ok, since 
	 * when close handlers come into existance, comm_close() will be called
	 * below, and the data flushing will be implicit.
	 *    -- adrian
	 *
	 * bah, for now, the program ain't coming back to here, so forcibly
	 * close everything the "wrong" way for now, and just LEAVE...
	 */
	for (i = 0; i < MAXCONNECTIONS; ++i)
		close(i);

	unlink(pidFileName);
	execv(SPATH, myargv);

	exit(-1);
}
Exemplo n.º 17
0
void
server_reboot(void)
{
	int i;
	char path[PATH_MAX+1];

	sendto_realops_snomask(SNO_GENERAL, L_ALL, "Restarting server...");

	ilog(L_MAIN, "Restarting server...");

	/*
	 * XXX we used to call flush_connections() here. But since this routine
	 * doesn't exist anymore, we won't be flushing. This is ok, since
	 * when close handlers come into existance, rb_close() will be called
	 * below, and the data flushing will be implicit.
	 *    -- adrian
	 *
	 * bah, for now, the program ain't coming back to here, so forcibly
	 * close everything the "wrong" way for now, and just LEAVE...
	 */
	for (i = 0; i < maxconnections; ++i)
		close(i);

	unlink(pidFileName);
	execv(SPATH, (void *)myargv);

	/* use this if execv of SPATH fails */
	rb_snprintf(path, sizeof(path), "%s/bin/ircd", ConfigFileEntry.dpath);

	execv(path, (void *)myargv);
	exit(-1);
}
Exemplo n.º 18
0
static void
show_channeljoin(hook_data_channel_activity *info)
{
	sendto_realops_snomask(snomask_modes['j'], L_ALL,
		"%s (%s@%s) has joined channel %s", info->client->name,
		info->client->username, info->client->host, info->chptr->chname);
}
Exemplo n.º 19
0
void
show_motd(hook_data *data)
{
	sendto_realops_snomask(SNO_SPY, L_ALL,
			     "motd requested by %s (%s@%s) [%s]",
			     data->client->name, data->client->username,
			     data->client->host, data->client->servptr->name);
}
void
show_stats_p(hook_data *data)
{
	sendto_realops_snomask(SNO_SPY, L_ALL,
			     "STATS p requested by %s (%s@%s) [%s]",
			     data->client->name, data->client->username,
			     data->client->host, data->client->user->server);
}
Exemplo n.º 21
0
/*
** mr_dumb_proxy
**      parv[0] = sender prefix
**      parv[1] = comment
*/
static int
mr_dumb_proxy(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
	sendto_realops_snomask(SNO_REJ, L_ALL,
			     "HTTP Proxy disconnected: [%s@%s]",
			     client_p->username, client_p->host);
	exit_client(client_p, source_p, source_p, "Client Exit");

	return 0;
}
Exemplo n.º 22
0
void
show_links(hook_data *data)
{
	const char *mask = data->arg1;

	sendto_realops_snomask(SNO_SPY, L_ALL,
			     "LINKS '%s' requested by %s (%s@%s) [%s]",
			     mask, data->client->name, data->client->username,
			     data->client->host, data->client->servptr->name);
}
Exemplo n.º 23
0
/* now it is	-larne	*/
static int	challenge_load(void)
{
#ifndef STATIC_MODULES
	sendto_realops_snomask(SNO_GENERAL, L_ALL,
		"Challenge module not loaded because OpenSSL is not available.");
	ilog(L_MAIN, "Challenge module not loaded because OpenSSL is not available.");
	return -1;
#else
	return 0;
#endif
}
Exemplo n.º 24
0
static void
verify_logfile_access(const char *filename)
{
	char *dirname, *d;
	char buf[512];
	d = rb_dirname(filename);
	dirname = LOCAL_COPY(d);
	rb_free(d);
	
	if(access(dirname, F_OK) == -1)
	{
		rb_snprintf(buf, sizeof(buf), "WARNING: Unable to access logfile %s - parent directory %s does not exist", filename, dirname);
		if(testing_conf || server_state_foreground)
			fprintf(stderr, "%s\n", buf);
		sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s", buf);
		return;
	}

	if(access(filename, F_OK) == -1)
	{
		if(access(dirname, W_OK) == -1)
		{
			rb_snprintf(buf, sizeof(buf), "WARNING: Unable to access logfile %s - access to parent directory %s failed: %s", 
				    filename, dirname, strerror(errno));
			if(testing_conf || server_state_foreground)
				fprintf(stderr, "%s\n", buf);
			sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s", buf);
		}
		return;
	}
	
	if(access(filename, W_OK) == -1)
	{
		rb_snprintf(buf, sizeof(buf), "WARNING: Access denied for logfile %s: %s", filename, strerror(errno));
		if(testing_conf || server_state_foreground)
			fprintf(stderr, "%s\n", buf);	
		sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s", buf);
		return;
	}
	return;
}
Exemplo n.º 25
0
/* remove_unknown()
 *
 * inputs	- client who gave us message, supposed sender, buffer
 * output	-
 * side effects	- kills issued for clients, squits for servers
 */
static void
remove_unknown(struct Client *client_p, const char *lsender, char *lbuffer)
{
	int slen = strlen(lsender);
	char sid[4];
	struct Client *server;

	/* meepfoo	is a nickname (ignore)
	 * #XXXXXXXX	is a UID (KILL)
	 * #XX		is a SID (SQUIT)
	 * meep.foo	is a server (SQUIT)
	 */
	if((IsDigit(lsender[0]) && slen == 3) ||
	   (strchr(lsender, '.') != NULL))
	{
		sendto_realops_snomask(SNO_DEBUG, L_ALL,
				     "Unknown prefix (%s) from %s, Squitting %s",
				     lbuffer, client_p->name, lsender);

		sendto_one(client_p,
			   ":%s SQUIT %s :(Unknown prefix (%s) from %s)",
			   get_id(&me, client_p), lsender,
			   lbuffer, client_p->name);
	}
	else if(!IsDigit(lsender[0]))
		;
	else if(slen != 9)
		sendto_realops_snomask(SNO_DEBUG, L_ALL,
				     "Invalid prefix (%s) from %s",
				     lbuffer, client_p->name);
	else
	{
		memcpy(sid, lsender, 3);
		sid[3] = '\0';
		server = find_server(NULL, sid);
		if (server != NULL && server->from == client_p)
			sendto_one(client_p, ":%s KILL %s :%s (Unknown Client)",
					get_id(&me, client_p), lsender, me.name);
	}
}
Exemplo n.º 26
0
void
ilog_error(const char *error)
{
	int e;
	const char *errstr;

	e = errno;
	errstr = strerror(e);

	ilog(L_IOERROR, "%s: %d (%s)", error, e, errstr);
	sendto_realops_snomask(SNO_DEBUG, L_ALL, "%s: %d (%s)",
			error, e, errstr);
}
Exemplo n.º 27
0
/*
** mr_dumb_proxy
**      parv[1] = comment
*/
static int
mr_dumb_proxy(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
	sendto_realops_snomask(SNO_REJ, L_ALL,
			     "HTTP Proxy disconnected: [%s@%s]",
			     client_p->username, client_p->host);
    sendto_server(NULL, NULL, CAP_TS6, NOCAPS,
             ":%s ENCAP * SNOTE r :%s :HTTP Proxy disconnected: [%s@%s]",
             me.id, me.name, client_p->username, client_p->host);
	exit_client(client_p, source_p, source_p, "Client Exit");

	return 0;
}
Exemplo n.º 28
0
/* SET SPLITUSERS */
static void
quote_splitusers(struct Client *source_p, const char *arg, int newval)
{
    if(newval >= 0) {
        sendto_realops_snomask(SNO_GENERAL, L_ALL,
                               "%s has changed SPLITUSERS to %i", source_p->name, newval);
        split_users = newval;

        if(splitchecking)
            check_splitmode(NULL);
    } else
        sendto_one_notice(source_p, ":SPLITUSERS is currently %i", split_users);
}
Exemplo n.º 29
0
/* SET FLOODCOUNT */
static void
quote_floodcount(struct Client *source_p, const char *arg, int newval)
{
    if(newval >= 0) {
        GlobalSetOptions.floodcount = newval;
        sendto_realops_snomask(SNO_GENERAL, L_ALL,
                               "%s has changed FLOODCOUNT to %i", source_p->name,
                               GlobalSetOptions.floodcount);
    } else {
        sendto_one_notice(source_p, ":FLOODCOUNT is currently %i",
                          GlobalSetOptions.floodcount);
    }
}
Exemplo n.º 30
0
/* SET AUTOCONNALL */
static void
quote_autoconnall(struct Client *source_p, const char *arg, int newval)
{
    if(newval >= 0) {
        sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s has changed AUTOCONNALL to %i",
                               source_p->name, newval);

        GlobalSetOptions.autoconn = newval;
    } else {
        sendto_one_notice(source_p, ":AUTOCONNALL is currently %i",
                          GlobalSetOptions.autoconn);
    }
}