Compare commits

..

No commits in common. "519d9bc0f4ebdd941ca0dc5d842cc0531df6fb5f" and "c790520218b6da02e1c633e1ed57b310efe53ff4" have entirely different histories.

20 changed files with 56 additions and 111 deletions

View file

@ -371,7 +371,6 @@ channel {
displayed_usercount = 3;
strip_topic_colors = no;
opmod_send_statusmsg = no;
invite_notify_notice = yes;
};
serverhide {

View file

@ -360,11 +360,6 @@ auth {
user = "*@198.51.100.0/24";
user = "*test@2001:db8:1:*";
/* umodes; the user mode character string to apply to users
* when they get placed into this auth block.
*/
#umodes = "+w";
/* auth_user: This allows specifying a username:password instead of
* just a password in PASS, so that a fixed user@host is not
* necessary for a specific auth{} block.
@ -610,7 +605,6 @@ connect "irc.uplink.com" {
* autoconn - automatically connect to this server
* topicburst - burst topics between servers
* ssl - ssl/tls encrypted server connections
* sctp - use SCTP instead of TCP to connect to the server
* no-export - marks the link as a no-export link (not exported to other links)
*/
flags = topicburst;
@ -821,11 +815,6 @@ channel {
/* ip_bans_through_vhost: should channel IP bans see through dynamic spoofed hosts? */
ip_bans_through_vhost = yes;
/* invite_notify_notice: when using extensions/invite_notify, should
* we send a NOTICE to clients that don't support IRCv3 invite-notify
*/
invite_notify_notice = yes;
};

View file

@ -4,7 +4,6 @@
#include <client.h>
#include <hash.h>
#include <send.h>
#include <s_conf.h>
#include <s_serv.h>
static const char inv_notify_desc[] = "Notifies channel on /invite and provides the invite-notify client capability";
@ -33,16 +32,12 @@ mapi_clist_av1 inv_notify_clist[] = { &invited_msgtab, NULL };
static void
invite_notify(struct Client *source, struct Client *target, struct Channel *channel)
{
sendto_channel_local_with_capability(source, CHFL_CHANOP, CAP_INVITE_NOTIFY, 0, channel,
":%s!%s@%s INVITE %s %s", source->name, source->username,
source->host, target->name, channel->chname);
if (!ConfigChannel.invite_notify_notice)
return;
sendto_channel_local_with_capability(source, CHFL_CHANOP, 0, CAP_INVITE_NOTIFY, channel,
":%s NOTICE %s :%s is inviting %s to %s.",
me.name, channel->chname, source->name, target->name, channel->chname);
sendto_channel_local_with_capability(source, CHFL_CHANOP, CAP_INVITE_NOTIFY, 0, channel,
":%s!%s@%s INVITE %s %s", source->name, source->username,
source->host, target->name, channel->chname);
}
static void

View file

@ -603,7 +603,7 @@ extern struct Client *find_named_person(const char *);
extern struct Client *next_client(struct Client *, const char *);
#define accept_message(s, t) ((s) == (t) || (rb_dlinkFind((s), &((t)->localClient->allow_list))))
extern void del_all_accepts(struct Client *client_p, bool self_too);
extern void del_all_accepts(struct Client *client_p);
extern void dead_link(struct Client *client_p, int sendqex);
extern int show_ip(struct Client *source_p, struct Client *target_p);

View file

@ -28,7 +28,7 @@
#define DELAYED_EXIT_TIME 10
void init_reject(void);
int check_reject(rb_fde_t *F, struct sockaddr *addr, bool ssl);
int check_reject(rb_fde_t *F, struct sockaddr *addr);
void add_reject(struct Client *, const char *mask1, const char *mask2, struct ConfItem *aconf, const char *reason);
int is_reject_ip(struct sockaddr *addr);
void flush_reject(void);

View file

@ -297,7 +297,6 @@ struct config_channel_entry
int strip_topic_colors;
int opmod_send_statusmsg;
int ip_bans_through_vhost;
int invite_notify_notice;
};
struct config_server_hide

View file

@ -396,7 +396,7 @@ static void
restart_authd_cb(rb_helper * helper)
{
iwarn("authd helper died - attempting to restart");
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "authd helper died - attempting to restart");
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "authdd helper died - attempting to restart");
if(helper != NULL)
{

View file

@ -1385,7 +1385,7 @@ exit_generic_client(struct Client *client_p, struct Client *source_p, struct Cli
}
/* Clean up allow lists */
del_all_accepts(source_p, true);
del_all_accepts(source_p);
whowas_add_history(source_p, 0);
whowas_off_history(source_p);
@ -1793,19 +1793,19 @@ count_remote_client_memory(size_t * count, size_t * remote_client_memory_used)
/*
* del_all_accepts
*
* inputs - pointer to exiting client, flag to include own allow_list
* inputs - pointer to exiting client
* output - NONE
* side effects - Walk through given clients allow_list and on_allow_list
* remove all references to this client
*/
void
del_all_accepts(struct Client *client_p, bool self_too)
del_all_accepts(struct Client *client_p)
{
rb_dlink_node *ptr;
rb_dlink_node *next_ptr;
struct Client *target_p;
if(self_too && MyClient(client_p) && client_p->localClient->allow_list.head)
if(MyClient(client_p) && client_p->localClient->allow_list.head)
{
/* clear this clients accept list, and remove them from
* everyones on_accept_list
@ -1813,7 +1813,6 @@ del_all_accepts(struct Client *client_p, bool self_too)
RB_DLINK_FOREACH_SAFE(ptr, next_ptr, client_p->localClient->allow_list.head)
{
target_p = ptr->data;
rb_dlinkFindDestroy(client_p, &target_p->on_allow_list);
rb_dlinkDestroy(ptr, &client_p->localClient->allow_list);
}
@ -1823,13 +1822,6 @@ del_all_accepts(struct Client *client_p, bool self_too)
RB_DLINK_FOREACH_SAFE(ptr, next_ptr, client_p->on_allow_list.head)
{
target_p = ptr->data;
/* If we're not doing our own, we're doing this because of a nick change.
* Skip those that would see the nick change anyway
*/
if(!self_too && has_common_channel(client_p, target_p))
continue;
rb_dlinkFindDestroy(client_p, &target_p->localClient->allow_list);
rb_dlinkDestroy(ptr, &client_p->on_allow_list);
}

View file

@ -581,19 +581,13 @@ accept_precallback(rb_fde_t *F, struct sockaddr *addr, rb_socklen_t addrlen, voi
static time_t last_oper_notice = 0;
int len;
static const char *allinuse = "ERROR :All connections in use\r\n";
static const char *toofast = "ERROR :Reconnecting too fast, throttled.\r\n";
static const unsigned char ssldeniederrcode[] = {
static const unsigned char sslerrcode[] = {
// SSLv3.0 Fatal Alert: Access Denied
0x15, 0x03, 0x00, 0x00, 0x02, 0x02, 0x31
};
static const unsigned char sslinternalerrcode[] = {
// SSLv3.0 Fatal Alert: Internal Error
0x15, 0x03, 0x00, 0x00, 0x02, 0x02, 0x50
};
if(listener->ssl && (!ircd_ssl_ok || !get_ssld_count()))
{
rb_close(F);
@ -614,11 +608,7 @@ accept_precallback(rb_fde_t *F, struct sockaddr *addr, rb_socklen_t addrlen, voi
last_oper_notice = rb_current_time();
}
if(listener->ssl)
rb_write(F, sslinternalerrcode, sizeof(sslinternalerrcode));
else
rb_write(F, allinuse, strlen(allinuse));
rb_write(F, "ERROR :All connections in use\r\n", 31);
rb_close(F);
return 0;
}
@ -635,7 +625,7 @@ accept_precallback(rb_fde_t *F, struct sockaddr *addr, rb_socklen_t addrlen, voi
if(listener->ssl)
{
rb_write(F, ssldeniederrcode, sizeof(ssldeniederrcode));
rb_write(F, sslerrcode, sizeof(sslerrcode));
}
else if(ConfigFileEntry.dline_with_reason)
{
@ -658,7 +648,7 @@ accept_precallback(rb_fde_t *F, struct sockaddr *addr, rb_socklen_t addrlen, voi
return 0;
}
if(check_reject(F, addr, listener->ssl)) {
if(check_reject(F, addr)) {
/* Reject the connection without closing the socket
* because it is now on the delay_exit list. */
return 0;
@ -666,11 +656,7 @@ accept_precallback(rb_fde_t *F, struct sockaddr *addr, rb_socklen_t addrlen, voi
if(throttle_add(addr))
{
if(listener->ssl)
rb_write(F, ssldeniederrcode, sizeof(ssldeniederrcode));
else
rb_write(F, toofast, strlen(toofast));
rb_write(F, toofast, strlen(toofast));
rb_close(F);
return 0;
}

View file

@ -2821,7 +2821,6 @@ static struct ConfEntry conf_channel_table[] =
{ "strip_topic_colors", CF_YESNO, NULL, 0, &ConfigChannel.strip_topic_colors },
{ "opmod_send_statusmsg", CF_YESNO, NULL, 0, &ConfigChannel.opmod_send_statusmsg },
{ "ip_bans_through_vhost", CF_YESNO, NULL, 0, &ConfigChannel.ip_bans_through_vhost },
{ "invite_notify_notice", CF_YESNO, NULL, 0, &ConfigChannel.invite_notify_notice },
{ "\0", 0, NULL, 0, NULL }
};

View file

@ -58,7 +58,6 @@ typedef struct _delay_data
rb_fde_t *F;
struct ConfItem *aconf;
const char *reason;
bool ssl;
} delay_t;
typedef struct _throttle
@ -93,39 +92,28 @@ reject_exit(void *unused)
delay_t *ddata;
static const char *errbuf = "ERROR :Closing Link: (*** Banned (cache))\r\n";
static const unsigned char ssldeniederrcode[] = {
// SSLv3.0 Fatal Alert: Access Denied
0x15, 0x03, 0x00, 0x00, 0x02, 0x02, 0x31
};
RB_DLINK_FOREACH_SAFE(ptr, ptr_next, delay_exit.head)
{
ddata = ptr->data;
if (ddata->ssl)
{
rb_write(ddata->F, ssldeniederrcode, sizeof(ssldeniederrcode));
}
else
{
*dynamic_reason = '\0';
if (ddata->aconf)
snprintf(dynamic_reason, sizeof dynamic_reason, form_str(ERR_YOUREBANNEDCREEP) "\r\n",
me.name, "*", get_user_ban_reason(ddata->aconf));
else if (ddata->reason)
snprintf(dynamic_reason, sizeof dynamic_reason, ":%s 465 %s :%s\r\n",
me.name, "*", ddata->reason);
if (*dynamic_reason)
rb_write(ddata->F, dynamic_reason, strlen(dynamic_reason));
rb_write(ddata->F, errbuf, strlen(errbuf));
}
*dynamic_reason = '\0';
if (ddata->aconf)
deref_conf(ddata->aconf);
{
snprintf(dynamic_reason, sizeof dynamic_reason, form_str(ERR_YOUREBANNEDCREEP) "\r\n",
me.name, "*", get_user_ban_reason(ddata->aconf));
rb_write(ddata->F, dynamic_reason, strlen(dynamic_reason));
deref_conf(ddata->aconf);
}
else if (ddata->reason)
{
snprintf(dynamic_reason, sizeof dynamic_reason, ":%s 465 %s :%s\r\n",
me.name, "*", ddata->reason);
rb_write(ddata->F, dynamic_reason, strlen(dynamic_reason));
}
rb_write(ddata->F, errbuf, strlen(errbuf));
rb_close(ddata->F);
rb_free(ddata);
}
@ -240,7 +228,7 @@ add_reject(struct Client *client_p, const char *mask1, const char *mask2, struct
}
int
check_reject(rb_fde_t *F, struct sockaddr *addr, bool ssl)
check_reject(rb_fde_t *F, struct sockaddr *addr)
{
rb_patricia_node_t *pnode;
reject_t *rdata;
@ -288,7 +276,6 @@ check_reject(rb_fde_t *F, struct sockaddr *addr, bool ssl)
ddata->reason = NULL;
}
ddata->F = F;
ddata->ssl = ssl;
rb_dlinkAdd(ddata, &ddata->node, &delay_exit);
return 1;
}

View file

@ -829,8 +829,7 @@ set_default_conf(void)
ConfigChannel.disable_local_channels = false;
ConfigChannel.displayed_usercount = 3;
ConfigChannel.opmod_send_statusmsg = false;
ConfigChannel.ip_bans_through_vhost = true;
ConfigChannel.invite_notify_notice = true;
ConfigChannel.ip_bans_through_vhost= true;
ConfigChannel.autochanmodes = MODE_TOPICLIMIT | MODE_NOPRIVMSGS;

View file

@ -1725,7 +1725,7 @@ change_nick_user_host(struct Client *target_p, const char *nick, const char *use
if(changed)
{
monitor_signon(target_p);
del_all_accepts(target_p, false);
del_all_accepts(target_p);
}
}

View file

@ -286,7 +286,7 @@ do_modreload(struct Client *source_p, const char *module)
struct modreload *info = rb_malloc(sizeof *info);
strcpy(info->module, module);
strcpy(info->id, source_p->id);
rb_defer(&modules_do_reload, info);
rb_event_addonce("modules_do_reload", modules_do_reload, info, 1);
}
static void
@ -304,7 +304,7 @@ do_modrestart(struct Client *source_p)
*
* So, defer the restart to the event loop and return now.
*/
rb_defer(&modules_do_restart, NULL);
rb_event_addonce("modules_do_restart", modules_do_restart, NULL, 1);
}
static void

View file

@ -619,6 +619,8 @@ static void
change_local_nick(struct Client *client_p, struct Client *source_p,
char *nick, int dosend)
{
struct Client *target_p;
rb_dlink_node *ptr, *next_ptr;
struct Channel *chptr;
char note[NICKLEN + 10];
int samenick;
@ -702,7 +704,20 @@ change_local_nick(struct Client *client_p, struct Client *source_p,
/* Make sure everyone that has this client on its accept list
* loses that reference.
*/
del_all_accepts(source_p, false);
/* we used to call del_all_accepts() here, but theres no real reason
* to clear a clients own list of accepted clients. So just remove
* them from everyone elses list --anfl
*/
RB_DLINK_FOREACH_SAFE(ptr, next_ptr, source_p->on_allow_list.head)
{
target_p = ptr->data;
if (!has_common_channel(source_p, target_p))
{
rb_dlinkFindDestroy(source_p, &target_p->localClient->allow_list);
rb_dlinkDestroy(ptr, &source_p->on_allow_list);
}
}
snprintf(note, sizeof(note), "Nick: %s", nick);
rb_note(client_p->localClient->F, note);

View file

@ -226,8 +226,8 @@ m_challenge(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
if(ConfigFileEntry.failed_oper_notice)
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
"Failed CHALLENGE attempt - user@host mismatch or no operator block for %s by %s (%s@%s)",
parv[1], source_p->name, source_p->username, source_p->host);
"Failed CHALLENGE attempt - host mismatch by %s (%s@%s)",
source_p->name, source_p->username, source_p->host);
return;
}

View file

@ -636,11 +636,6 @@ static struct InfoStruct info_table[] = {
"Channel IP bans see through dynamic spoofs",
INFO_INTBOOL_YN(&ConfigChannel.ip_bans_through_vhost),
},
{
"invite_notify_notice",
"NOTICEs are sent to clients that do not support invite-notify",
INFO_INTBOOL_YN(&ConfigChannel.invite_notify_notice),
},
{
"hide_opers",
"Hide all opers from unprivileged users",

View file

@ -107,8 +107,8 @@ m_oper(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p
if(ConfigFileEntry.failed_oper_notice)
{
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
"Failed OPER attempt - user@host mismatch or no operator block for %s by %s (%s@%s)",
name, source_p->name, source_p->username, source_p->host);
"Failed OPER attempt - host mismatch by %s (%s@%s)",
source_p->name, source_p->username, source_p->host);
}
return;

View file

@ -280,10 +280,7 @@ doit:
monitor_signon(target_p);
/* Make sure everyone that has this client on its accept list
* loses that reference.
*/
del_all_accepts(target_p, false);
del_all_accepts(target_p);
snprintf(note, sizeof(note), "Nick: %s", target_p->name);
rb_note(target_p->localClient->F, note);

View file

@ -45,14 +45,7 @@ mapi_clist_av1 starttls_clist[] = { &starttls_msgtab, NULL };
unsigned int CLICAP_TLS = 0;
static bool
tls_visible(struct Client *ignored)
{
return ircd_ssl_ok && get_ssld_count();
}
static struct ClientCapability capdata_tls = {
.visible = tls_visible,
.flags = CLICAP_FLAGS_PRIORITY,
};