Booooooo! Halloween Special

HybridRC5 Merge (I'm pretty soon going to give up the Hybrid RC Merges..... To Many Bugs)
Needs Testing... Eggy?!?!
This commit is contained in:
fishwaldo 2002-10-31 13:01:58 +00:00
parent 996b6970f1
commit e8b97bdfd7
50 changed files with 553 additions and 247 deletions

View file

@ -4,6 +4,8 @@ Symbols are:
(F) - Fish (fish@dynam.ac)
(S) - Shmad (shmad@neostats.net)
(HP) - Hybrid Team Patches to Hybrid Source
* NeoIRCd Version 0.9.6 - 31st Oct (Halloween!), 2002 - Fish
(HP) - Hybrid Team Halloween Special :) (No suprises this time!) (RC5 Merge)
* NeoIRCd Version 0.9.5 - 12th Oct, 2002 - Fish
(S) - Fixed up event.c for a possible serious bug reported by Dianora from hybrid team

View file

@ -51,7 +51,7 @@
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
* $Id: adns.h,v 1.2 2002/08/13 14:44:59 fishwaldo Exp $
* $Id: adns.h,v 1.3 2002/10/31 13:01:53 fishwaldo Exp $
*/
#ifndef ADNS_H_INCLUDED
@ -115,6 +115,7 @@ typedef enum {
adns__qtf_deref= 0x10000, /* dereference domains and perhaps produce extra data */
adns__qtf_mail822= 0x20000, /* make mailboxes be in RFC822 rcpt field format */
adns__qtf_in6= 0x40000, /* ptr is IPv6 -- This is a hack but it works damnit. If you don't like it fix it yourself */
adns__qtf_in6_old= 0x80000, /* ptr is IPv6 -- This is a hack but it works damnit. If you don't like it fix it yourself */
adns_r_none= 0,
@ -131,7 +132,7 @@ typedef enum {
adns_r_ptr_raw= 12,
adns_r_ptr= adns_r_ptr_raw|adns__qtf_deref,
adns_r_ptr_ip6= adns_r_ptr_raw|adns__qtf_deref|adns__qtf_in6,
adns_r_ptr_ip6_old= adns_r_ptr_raw|adns__qtf_deref|adns__qtf_in6_old,
adns_r_hinfo= 13,
adns_r_mx_raw= 15,

View file

@ -26,7 +26,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id: internal.h,v 1.2 2002/08/13 14:44:59 fishwaldo Exp $
* $Id: internal.h,v 1.3 2002/10/31 13:01:53 fishwaldo Exp $
*/
#ifndef ADNS_INTERNAL_H_INCLUDED
@ -77,6 +77,7 @@ typedef unsigned char byte;
#define IP6STRLEN 47
#define DNS_INADDR_ARPA "in-addr", "arpa"
#define DNS_IP6_INT "ip6", "int"
#define DNS_IP6_ARPA "ip6", "arpa"
#define MAX_POLLFDS ADNS_POLLFDS_RECOMMENDED

View file

@ -26,7 +26,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id: query.c,v 1.3 2002/09/24 14:02:09 fishwaldo Exp $
* $Id: query.c,v 1.4 2002/10/31 13:01:53 fishwaldo Exp $
*/
#include "stdinc.h"
@ -342,11 +342,14 @@ int adns_submit_reverse(adns_state ads,
adns_queryflags flags,
void *context,
adns_query *query_r) {
if (type != adns_r_ptr && type != adns_r_ptr_raw && type != adns_r_ptr_ip6 ) return EINVAL;
if (type != adns_r_ptr && type != adns_r_ptr_raw && type != adns_r_ptr_ip6 && type != adns_r_ptr_ip6_old ) return EINVAL;
#ifdef IPV6
if(addr->sa_family == AF_INET6)
if(addr->sa_family == AF_INET6 && type == adns_r_ptr_ip6_old)
return adns_submit_reverse_ip6(ads,addr,"ip6.int", type,flags,context,query_r);
else
if(addr->sa_family == AF_INET6 && type == adns_r_ptr_ip6)
return adns_submit_reverse_ip6(ads,addr,"ip6.arpa", type,flags,context,query_r);
else
#endif
return adns_submit_reverse_any(ads,addr,"in-addr.arpa",type,flags,context,query_r);
}

View file

@ -24,7 +24,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id: types.c,v 1.2 2002/08/13 14:44:59 fishwaldo Exp $
* $Id: types.c,v 1.3 2002/10/31 13:01:53 fishwaldo Exp $
*/
#include "stdinc.h"
@ -760,6 +760,85 @@ static void icb_ptr(adns_query parent, adns_query child) {
}
#ifdef IPV6
static adns_status pa_ptr6(const parseinfo *pai, int dmstart, int max, void *datap) {
static const char *(expectdomain[])= { DNS_IP6_ARPA };
char **rrp= datap;
adns_status st;
adns_rr_addr *ap;
findlabel_state fls;
char labbuf[4], ipv[34], ip6[72], *pt;
int cbyte, i, lablen, labstart, id, x, l;
adns_query nqu;
qcontext ctx;
cbyte= dmstart;
st= pap_domain(pai, &cbyte, max, rrp,
pai->qu->flags & adns_qf_quoteok_anshost ? pdf_quoteok : 0);
if (st) return st;
if (cbyte != max) return adns_s_invaliddata;
memset(labbuf, 0, sizeof(labbuf));
memset(ipv,0, sizeof(ipv));
ap= &pai->qu->ctx.info.ptr_parent_addr;
if (!ap->len) {
adns__findlabel_start(&fls, pai->ads, -1, pai->qu,
pai->qu->query_dgram, pai->qu->query_dglen,
pai->qu->query_dglen, DNS_HDRSIZE, 0);
for(i = 0; i < 32; i++)
{
st= adns__findlabel_next(&fls,&lablen,&labstart); assert(!st);
if (lablen<=0 || lablen > 1) return adns_s_querydomainwrong;
memcpy(labbuf, pai->qu->query_dgram + labstart, lablen); labbuf[lablen]= 0;
strcat(ipv, labbuf);
if (lablen>1 && pai->qu->query_dgram[labstart]=='0')
return adns_s_querydomainwrong;
}
pt = ip6;
for(i = 32, x = 0; i >= 0; i--)
{
if(x >= 3 && i > 2)
{
pt += ircsprintf(pt,"%c:", ipv[i-1]);
x = 0;
} else {
pt += ircsprintf(pt,"%c", ipv[i-1]);
x++;
}
}
for (i=0; i<sizeof(expectdomain)/sizeof(*expectdomain); i++) {
st= adns__findlabel_next(&fls,&lablen,&labstart); assert(!st);
l= strlen(expectdomain[i]);
if (lablen != l || memcmp(pai->qu->query_dgram + labstart, expectdomain[i], l))
return adns_s_querydomainwrong;
}
ap->len= sizeof(struct sockaddr_in6);
memset(&ap->addr,0,sizeof(ap->addr.inet6));
ap->addr.inet6.sin6_family=AF_INET6;
inetpton(AF_INET6, ip6, ap->addr.inet6.sin6_addr.s6_addr);
}
st= adns__mkquery_frdgram(pai->ads, &pai->qu->vb, &id,
pai->dgram, pai->dglen, dmstart,
adns_r_addr6, adns_qf_quoteok_query);
if (st) return st;
ctx.ext= 0;
ctx.callback= icb_ptr;
memset(&ctx.info,0,sizeof(ctx.info));
st= adns__internal_submit(pai->ads, &nqu, adns__findtype(adns_r_addr6),
&pai->qu->vb, id,
adns_qf_quoteok_query, pai->now, &ctx);
if (st) return st;
nqu->parent= pai->qu;
LIST_LINK_TAIL_PART(pai->qu->children,nqu,siblings.);
return adns_s_ok;
}
static adns_status pa_ptr6_old(const parseinfo *pai, int dmstart, int max, void *datap) {
static const char *(expectdomain[])= { DNS_IP6_INT };
char **rrp= datap;
@ -837,6 +916,8 @@ static adns_status pa_ptr6(const parseinfo *pai, int dmstart, int max, void *dat
LIST_LINK_TAIL_PART(pai->qu->children,nqu,siblings.);
return adns_s_ok;
}
#endif
static adns_status pa_ptr(const parseinfo *pai, int dmstart, int max, void *datap) {
static const char *(expectdomain[])= { DNS_INADDR_ARPA };
@ -1148,6 +1229,7 @@ DEEP_TYPE(soa, "SOA","822", soa, pa_soa, 0, cs_soa
DEEP_TYPE(rp, "RP", "822", strpair, pa_rp, 0, cs_rp ),
#ifdef IPV6
DEEP_TYPE(ptr_ip6,"PTR","checked",str, pa_ptr6, 0, cs_domain ),
DEEP_TYPE(ptr_ip6_old,"PTR","checked",str, pa_ptr6_old, 0, cs_domain ),
#endif
};

View file

@ -3,7 +3,7 @@
*
* ported from Hybrid7 by fish
*
* $Id: example.conf,v 1.6 2002/09/26 13:56:13 fishwaldo Exp $
* $Id: example.conf,v 1.7 2002/10/31 13:01:54 fishwaldo Exp $
*/
/* IMPORTANT NOTES:
@ -168,6 +168,7 @@ listen {
/* host: set a specific IP/host the ports after the line will listen
* on. This may be ipv4 or ipv6.
*/
#host = "10.1.1.2"
};
/* auth {}: allow users to connect to the ircd (OLD I:) */

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: client.h,v 1.9 2002/10/16 05:04:23 fishwaldo Exp $
* $Id: client.h,v 1.10 2002/10/31 13:01:54 fishwaldo Exp $
*/
#ifndef INCLUDED_client_h
@ -395,6 +395,7 @@ struct LocalUser
#define FLAGS_WAITAUTH 0x8000 /* waiting for CRYPTLINK AUTH command */
#define FLAGS_SERVLINK 0x10000 /* servlink has servlink process */
#define FLAGS_MARK 0x20000 /* marked client */
#define FLAGS_CANFLOOD 0x40000 /* client has the ability to flood */
/* umodes, settable flags */
#define FLAGS_SERVNOTICE 0x0001 /* server notices such as kill */
@ -497,6 +498,9 @@ struct LocalUser
#define IsRegNick(x) ((x)->flags & FLAGS_REGNICK)
#define SetRegNick(x) ((x)->flags |= FLAGS_REGNICK)
#define ClearRegNick(x) ((x)->flags &= ~FLAGS_REGNICK)
#define SetCanFlood(x) ((x)->flags |= FLAGS_CANFLOOD)
#define ClearCanFlood(x) ((x)->flags &= FLAGS_CANFLOOD)
#define IsCanFlood(x) ((x)->flags & FLAGS_CANFLOOD)
/* oper flags */

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: event.h,v 1.3 2002/09/13 06:50:06 fishwaldo Exp $
* $Id: event.h,v 1.4 2002/10/31 13:01:54 fishwaldo Exp $
*/
#ifndef INCLUDED_event_h
@ -42,7 +42,6 @@ struct ev_entry
const char *name;
time_t frequency;
time_t when;
struct ev_entry *next;
int active;
};

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: hook.h,v 1.3 2002/09/13 06:50:06 fishwaldo Exp $
* $Id: hook.h,v 1.4 2002/10/31 13:01:54 fishwaldo Exp $
*/
#ifndef __HOOK_H_INCLUDED
@ -90,5 +90,6 @@ int hook_call_event(char *, void *);
int hook_del_event(char *);
int hook_del_hook(char *event, hookfn *fn);
void init_hooks(void);
hook *find_hook(char *);
#endif

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: msg.h,v 1.3 2002/09/13 06:50:06 fishwaldo Exp $
* $Id: msg.h,v 1.4 2002/10/31 13:01:54 fishwaldo Exp $
*/
#ifndef INCLUDED_msg_h
@ -69,6 +69,8 @@ struct Message
* clients. */
#define MFLG_IGNORE 0x04 /* silently ignore command from
* unregistered clients */
#define MFLG_HIDDEN 0x08 /* Command is hidden from everyone *
* but opers */
#define MAXPARA 15
#endif /* INCLUDED_msg_h */

View file

@ -19,9 +19,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: patchlevel.h,v 1.7 2002/10/15 02:44:33 fishwaldo Exp $
* $Id: patchlevel.h,v 1.8 2002/10/31 13:01:54 fishwaldo Exp $
*/
#ifndef PATCHLEVEL
#define PATCHLEVEL "NeoIRCd 0.9.5"
#define PATCHLEVEL "NeoIRCd 0.9.6(CVS)"
#endif

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: res.h,v 1.3 2002/09/13 06:50:06 fishwaldo Exp $
* $Id: res.h,v 1.4 2002/10/31 13:01:54 fishwaldo Exp $
*/
#ifndef _RES_H_INCLUDED
@ -47,7 +47,7 @@ void dns_readable (int fd , void *ptr );
void dns_do_callbacks(void);
void dns_select (void);
void adns_gethost (const char *name , int aftype , struct DNSQuery *req );
void adns_getaddr (struct irc_inaddr *addr , int aftype , struct DNSQuery *req );
void adns_getaddr (struct irc_inaddr *addr , int aftype , struct DNSQuery *req, int arpa_type );
void delete_adns_queries(struct DNSQuery *q);
void report_adns_servers(struct Client *);
#endif

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: s_auth.h,v 1.3 2002/09/13 06:50:06 fishwaldo Exp $
* $Id: s_auth.h,v 1.4 2002/10/31 13:01:54 fishwaldo Exp $
*/
#ifndef INCLUDED_s_auth_h
@ -42,6 +42,9 @@ struct AuthRequest {
unsigned int flags; /* current state of request */
int fd; /* file descriptor for auth queries */
time_t timeout; /* time when query expires */
#ifdef IPV6
unsigned int ip6_int;
#endif
};
/*

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: s_conf.h,v 1.6 2002/09/17 06:09:35 fishwaldo Exp $
* $Id: s_conf.h,v 1.7 2002/10/31 13:01:54 fishwaldo Exp $
*/
#ifndef INCLUDED_s_conf_h
@ -122,6 +122,7 @@ struct ConfItem
#define CONF_FLAGS_REDIR 0x00000800
#define CONF_FLAGS_EXEMPTGLINE 0x00001000
#define CONF_FLAGS_RESTRICTED 0x00002000
#define CONF_FLAGS_CAN_FLOOD 0x00100000
/* server flags */
#define CONF_FLAGS_ALLOW_AUTO_CONN 0x00004000
#define CONF_FLAGS_LAZY_LINK 0x00008000
@ -134,6 +135,7 @@ struct ConfItem
#define IsLimitIp(x) ((x)->flags & CONF_FLAGS_LIMIT_IP)
#define IsNoTilde(x) ((x)->flags & CONF_FLAGS_NO_TILDE)
#define IsConfCanFlood(x) ((x)->flags & CONF_FLAGS_CAN_FLOOD)
#define IsNeedIdentd(x) ((x)->flags & CONF_FLAGS_NEED_IDENTD)
#define IsPassIdentd(x) ((x)->flags & CONF_FLAGS_PASS_IDENTD)
#define IsNoMatchIp(x) ((x)->flags & CONF_FLAGS_NOMATCH_IP)
@ -212,6 +214,7 @@ struct config_file_entry
int pace_wait_simple;
int short_motd;
int no_oper_flood;
int true_no_oper_flood;
int glines;
int gline_time;
int idletime;
@ -230,6 +233,9 @@ struct config_file_entry
int use_egd;
int ping_cookie;
int use_help;
#ifdef IPV6
int fallback_to_ip6_int;
#endif
#ifdef HAVE_LIBCRYPTO
struct EncCapability *default_cipher_preference;
#endif
@ -244,6 +250,7 @@ struct config_channel_entry
int no_create_on_split;
int no_join_on_split;
int persist_time;
int oper_pass_resv;
int quiet_on_ban;
int default_split_server_count;
int default_split_user_count;

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: send.h,v 1.4 2002/09/13 06:50:06 fishwaldo Exp $
* $Id: send.h,v 1.5 2002/10/31 13:01:54 fishwaldo Exp $
*/
#ifndef INCLUDED_send_h
@ -68,6 +68,9 @@ extern void sendto_common_channels_local(struct Client *, const char *,
extern void sendto_channel_local(int type, struct Channel *,
const char *, ...) AFP(3, 4);
extern void sendto_channel_local_butone(struct Client *, int, struct Channel *,
const char *, ...) AFP(4,5);
extern void sendto_channel_remote(struct Client *one,
struct Client *from, int type,
int caps, int nocaps, struct Channel *chptr,

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: tools.h,v 1.4 2002/09/19 05:41:10 fishwaldo Exp $
* $Id: tools.h,v 1.5 2002/10/31 13:01:54 fishwaldo Exp $
*/
#ifndef __TOOLS_H__
@ -231,6 +231,28 @@ dlinkMoveList(dlink_list *from, dlink_list *to)
/* I think I got that right */
}
extern inline dlink_node *
dlinkFindDelete(dlink_list *list, void *data)
{
dlink_node *m;
DLINK_FOREACH(m, list->head)
{
if(m->data != data)
continue;
if (m->next != NULL)
m->next->prev = m->prev;
else
list->tail = m->prev;
m->next = m->prev = NULL;
list->length--;
return m;
}
return(NULL);
}
#endif /* __GNUC__ */
#endif /* __TOOLS_H__ */

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: m_message.c,v 1.12 2002/10/25 11:13:08 fishwaldo Exp $
* $Id: m_message.c,v 1.13 2002/10/31 13:01:57 fishwaldo Exp $
*/
#include "stdinc.h"
@ -122,7 +122,7 @@ _moddeinit(void)
mod_del_cmd(&notice_msgtab);
}
const char *_version = "$Revision: 1.12 $";
const char *_version = "$Revision: 1.13 $";
#endif
/*
@ -542,11 +542,21 @@ msg_channel_flags(int p_or_n, char *command, struct Client *client_p,
/* idletime shouldnt be reset by notice --fl */
if ((p_or_n != NOTICE) && source_p->user)
source_p->user->last = CurrentTime;
}
sendto_channel_local(type, vchan, ":%s!%s@%s %s %c%s :%s",
source_p->name, source_p->username,
source_p->vhost, command, c, chname, text);
sendto_channel_local_butone(source_p, type, vchan, ":%s!%s@%s %s %c%s :%s",
source_p->name, source_p->username,
source_p->vhost, command, c, chname, text);
}
else
{
/*
* another good catch, lee. we never would echo to remote clients anyway,
* so use slightly less intensive sendto_channel_local()
*/
sendto_channel_local(type, vchan, ":%s!%s@%s %s %c%s :%s",
source_p->name, source_p->username,
source_p->vhost, command, c, chname, text);
}
if (chptr->chname[0] == '&')
return;
@ -670,7 +680,7 @@ flood_attack_client(int p_or_n, struct Client *source_p,
int delta;
if (GlobalSetOptions.floodcount && MyConnect(target_p)
&& IsClient(source_p))
&& IsClient(source_p) && !IsConfCanFlood(source_p))
{
if ((target_p->localClient->first_received_message_time + 1)
< CurrentTime)
@ -728,7 +738,7 @@ flood_attack_channel(int p_or_n, struct Client *source_p,
{
int delta;
if (GlobalSetOptions.floodcount)
if (GlobalSetOptions.floodcount && !IsConfCanFlood(source_p))
{
if ((chptr->first_received_message_time + 1) < CurrentTime)
{
@ -837,6 +847,10 @@ handle_opers(int p_or_n, char *command, struct Client *client_p,
nick + 1,
(*nick == '#') ? MATCH_HOST : MATCH_SERVER,
"%s $%s :%s", command, nick, text);
if ((p_or_n != NOTICE) && source_p->user)
source_p->user->last = CurrentTime;
return;
}
@ -854,7 +868,9 @@ handle_opers(int p_or_n, char *command, struct Client *client_p,
if (!IsMe(target_p))
{
sendto_one(target_p, ":%s %s %s :%s", source_p->name,
"PRIVMSG", nick, text);
command, nick, text);
if ((p_or_n != NOTICE) && source_p->user)
source_p->user->last = CurrentTime;
return;
}
@ -885,14 +901,23 @@ handle_opers(int p_or_n, char *command, struct Client *client_p,
if (host != NULL)
*--host = '%';
if (count == 1)
sendto_anywhere(target_p, source_p, "%s %s :%s", "PRIVMSG",
if (count == 1) {
sendto_anywhere(target_p, source_p, "%s %s :%s", command,
nick, text);
if ((p_or_n != NOTICE) && source_p->user)
source_p->user->last = CurrentTime;
}
else
sendto_one(source_p, form_str(ERR_TOOMANYTARGETS),
me.name, source_p->name, nick);
}
}
else if (server && *(server+1) && (target_p == NULL))
sendto_one(source_p, form_str(ERR_NOSUCHSERVER), me.name,
source_p->name, server+1);
else if (server && (target_p == NULL))
sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name,
source_p->name, nick);
}
/*

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: m_nick.c,v 1.19 2002/10/23 03:53:22 fishwaldo Exp $
* $Id: m_nick.c,v 1.20 2002/10/31 13:01:57 fishwaldo Exp $
*/
#include "stdinc.h"
@ -97,7 +97,7 @@ _moddeinit(void)
mod_del_cmd(&client_msgtab);
}
const char *_version = "$Revision: 1.19 $";
const char *_version = "$Revision: 1.20 $";
#endif
/*
@ -138,7 +138,8 @@ mr_nick(struct Client *client_p, struct Client *source_p,
}
/* check if the nick is resv'd */
if(find_nick_resv(nick))
if(find_nick_resv(nick) &&
!(IsOper(source_p) && ConfigChannel.oper_pass_resv))
{
sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE),
me.name, BadPtr(parv[0]) ? "*" : parv[0], nick);
@ -227,7 +228,8 @@ mr_nick(struct Client *client_p, struct Client *source_p,
return;
}
if(find_nick_resv(nick))
if(find_nick_resv(nick) &&
!(IsOper(source_p) && ConfigChannel.oper_pass_resv))
{
sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE),
me.name, parv[0], nick);

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: m_server.c,v 1.10 2002/10/15 07:30:09 fishwaldo Exp $
* $Id: m_server.c,v 1.11 2002/10/31 13:01:57 fishwaldo Exp $
*/
#include "stdinc.h"
@ -67,7 +67,7 @@ _moddeinit(void)
{
mod_del_cmd(&server_msgtab);
}
const char *_version = "$Revision: 1.10 $";
const char *_version = "$Revision: 1.11 $";
#endif
int bogus_host(char *host);
@ -479,9 +479,6 @@ static void ms_server(struct Client *client_p, struct Client *source_p,
}
target_p = make_client(client_p);
make_server(target_p);
target_p->hopcount = hop;
if(strlen(name) > HOSTLEN)
{
@ -496,6 +493,10 @@ static void ms_server(struct Client *client_p, struct Client *source_p,
return;
}
target_p = make_client(client_p);
make_server(target_p);
target_p->hopcount = hop;
strlcpy(target_p->name, name, HOSTLEN+1);
/* clear the Ulined flag before we look at info for (U) */

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: m_challenge.c,v 1.5 2002/09/19 05:41:10 fishwaldo Exp $
* $Id: m_challenge.c,v 1.6 2002/10/31 13:01:54 fishwaldo Exp $
*/
#include "stdinc.h"
@ -55,7 +55,7 @@ _moddeinit(void)
return;
}
const char *_version = "$Revision: 1.5 $";
const char *_version = "$Revision: 1.6 $";
#endif
#else
@ -80,7 +80,7 @@ _moddeinit(void)
mod_del_cmd(&challenge_msgtab);
}
const char *_version = "$Revision: 1.5 $";
const char *_version = "$Revision: 1.6 $";
#endif
/*
* m_challenge - generate RSA challenge for wouldbe oper
@ -158,7 +158,7 @@ static void m_challenge( struct Client *client_p, struct Client *source_p,
MyFree(source_p->user->response);
MyFree(source_p->user->auth_oper);
source_p->user->response = NULL;
source_p->user->response = NULL;
source_p->user->auth_oper = NULL;
if (!(aconf = find_conf_exact(parv[1], source_p->username, source_p->host,
CONF_OPERATOR)) &&
@ -167,7 +167,14 @@ static void m_challenge( struct Client *client_p, struct Client *source_p,
CONF_OPERATOR)))
{
sendto_one (source_p, form_str(ERR_NOOPERHOST), me.name, parv[0]);
log_failed_oper(source_p, source_p->user->auth_oper);
/* they suck, do we tell the world? */
if (ConfigFileEntry.failed_oper_notice)
{
sendto_realops_flags(FLAGS_ALL, L_ALL, "Failed CHALLENGE attempt - host"
" mismatch by %s (%s@%s)",
source_p->name, source_p->username, source_p->host);
}
log_failed_oper(source_p, parv[1]);
return;
}
if (!aconf->rsa_public_key)

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: m_cryptlink.c,v 1.5 2002/09/13 16:30:03 fishwaldo Exp $
* $Id: m_cryptlink.c,v 1.6 2002/10/31 13:01:54 fishwaldo Exp $
*/
/*
@ -68,7 +68,7 @@
void _modinit(void) {}
void _moddeinit(void) {}
const char *_version = "$Revision: 1.5 $";
const char *_version = "$Revision: 1.6 $";
#endif
#else
@ -114,7 +114,7 @@ _moddeinit(void)
mod_del_cmd(&cryptlink_msgtab);
}
const char *_version = "$Revision: 1.5 $";
const char *_version = "$Revision: 1.6 $";
#endif
@ -239,7 +239,7 @@ static void cryptlink_auth(struct Client *client_p, struct Client *source_p,
client_p->localClient->in_cipher->keylen) != 0)
{
cryptlink_error(client_p, "AUTH",
"Unauthorised server connection attempt",
"Unauthorized server connection attempt",
"Malformed CRYPTLINK AUTH reply");
return;
}
@ -329,7 +329,7 @@ static void cryptlink_serv(struct Client *client_p, struct Client *source_p,
if (ConfigFileEntry.warn_no_nline)
{
cryptlink_error(client_p, "SERV",
"Unauthorised server connection attempt: No entry for server",
"Unauthorized server connection attempt: No entry for server",
NULL);
}
exit_client(client_p, client_p, client_p, "Invalid server name");
@ -337,14 +337,14 @@ static void cryptlink_serv(struct Client *client_p, struct Client *source_p,
break;
case -2:
cryptlink_error(client_p, "SERV",
"Unauthorised server connection attempt: CRYPTLINK not "
"Unauthorized server connection attempt: CRYPTLINK not "
"enabled on remote server",
"CRYPTLINK not enabled");
return;
break;
case -3:
cryptlink_error(client_p, "SERV",
"Unauthorised server connection attempt: Invalid host",
"Unauthorized server connection attempt: Invalid host",
"Invalid host");
return;
break;

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: m_info.c,v 1.5 2002/09/13 06:50:06 fishwaldo Exp $
* $Id: m_info.c,v 1.6 2002/10/31 13:01:55 fishwaldo Exp $
*/
#include "stdinc.h"
@ -69,7 +69,7 @@ _moddeinit(void)
hook_del_event("doing_info");
mod_del_cmd(&info_msgtab);
}
const char *_version = "$Revision: 1.5 $";
const char *_version = "$Revision: 1.6 $";
#endif
/*
@ -390,6 +390,12 @@ static struct InfoStruct info_table[] =
&ConfigChannel.persist_time,
"Delay before persistent channels expire",
},
{
"oper_pass_resv",
OUTPUT_BOOLEAN_YN,
&ConfigChannel.oper_pass_resv,
"Opers can over-ride RESVs",
},
{
"quiet_on_ban",
OUTPUT_BOOLEAN_YN,

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: m_join.c,v 1.11 2002/09/23 10:47:30 fishwaldo Exp $
* $Id: m_join.c,v 1.12 2002/10/31 13:01:55 fishwaldo Exp $
*/
#include "stdinc.h"
@ -64,7 +64,7 @@ _moddeinit(void)
{
mod_del_cmd(&join_msgtab);
}
const char *_version = "$Revision: 1.11 $";
const char *_version = "$Revision: 1.12 $";
#endif
static void do_join_0(struct Client *client_p, struct Client *source_p);
@ -166,7 +166,8 @@ m_join(struct Client *client_p,
}
/* see if its resv'd */
if(find_channel_resv(name))
if(find_channel_resv(name) &&
!(IsOper(source_p) && ConfigChannel.oper_pass_resv))
{
sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE),
me.name, source_p->name, name);
@ -232,8 +233,7 @@ m_join(struct Client *client_p,
if(!ServerInfo.hub)
{
/* LazyLinks */
if( (*name != '&') && uplink
&& IsCapable(uplink, CAP_LL) )
if((*name != '&') && uplink && IsCapable(uplink, CAP_LL))
{
sendto_one(uplink,":%s CBURST %s %s %s",
me.name,name,source_p->name, key ? key: "" );
@ -343,15 +343,13 @@ m_join(struct Client *client_p,
{
sendto_one(source_p, form_str(RPL_TOPICWHOTIME),
me.name, parv[0], root_chptr->chname,
chptr->topic_info,
chptr->topic_time);
chptr->topic_info, chptr->topic_time);
}
else /* Hide from nonops */
{
sendto_one(source_p, form_str(RPL_TOPICWHOTIME),
me.name, parv[0], root_chptr->chname,
me.name,
chptr->topic_time);
me.name, chptr->topic_time);
}
}

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: m_motd.c,v 1.4 2002/09/13 06:50:07 fishwaldo Exp $
* $Id: m_motd.c,v 1.5 2002/10/31 13:01:56 fishwaldo Exp $
*/
#include "stdinc.h"
@ -63,7 +63,7 @@ _moddeinit(void)
mod_del_cmd(&motd_msgtab);
}
const char *_version = "$Revision: 1.4 $";
const char *_version = "$Revision: 1.5 $";
#endif
/* mr_motd()
@ -98,7 +98,7 @@ static void m_motd(struct Client *client_p, struct Client *source_p,
last_used = CurrentTime;
/* This is safe enough to use during non hidden server mode */
if(!ConfigServerHide.disable_remote)
if(!ConfigServerHide.disable_remote && !ConfigServerHide.hide_servers)
{
if (hunt_server(client_p, source_p, ":%s MOTD :%s", 1,parc,parv)!=HUNTED_ISME)
return;

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: m_ping.c,v 1.3 2002/09/13 06:50:07 fishwaldo Exp $
* $Id: m_ping.c,v 1.4 2002/10/31 13:01:56 fishwaldo Exp $
*/
#include "stdinc.h"
@ -57,7 +57,7 @@ _moddeinit(void)
mod_del_cmd(&ping_msgtab);
}
const char *_version = "$Revision: 1.3 $";
const char *_version = "$Revision: 1.4 $";
#endif
/*
** m_ping
@ -89,7 +89,7 @@ static void m_ping(struct Client *client_p,
return;
}
if (!EmptyString(destination) && !match(destination, me.name))
if (!EmptyString(destination) && irccmp(destination, me.name) != 0)
{
/* We're sending it across servers.. origin == client_p->name --fl_ */
origin = client_p->name;
@ -150,7 +150,7 @@ static void ms_ping(struct Client *client_p,
origin = client_p->name;
#endif
if (!EmptyString(destination) && !match(destination, me.name))
if (!EmptyString(destination) && irccmp(destination, me.name) != 0)
{
if ((target_p = find_server(destination)))
sendto_one(target_p,":%s PING %s :%s", parv[0],

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: m_svscmds.c,v 1.8 2002/09/25 07:43:28 fishwaldo Exp $
* $Id: m_svscmds.c,v 1.9 2002/10/31 13:01:56 fishwaldo Exp $
*/
/* List of ircd includes from ../include/ */
@ -134,7 +134,7 @@ _moddeinit(void)
/* When we last modified the file (shown in /modlist), this is usually:
*/
const char *_version = "$Revision: 1.8 $";
const char *_version = "$Revision: 1.9 $";
#endif
/*
@ -153,12 +153,7 @@ static void ms_svshost(struct Client *client_p, struct Client *source_p,
target_p = find_person(parv[1]);
/* first find the target that we want to change */
if (target_p != NULL) {
ilog(L_WARN, "svshost: Found Target %s", target_p->name);
if (IsServer(source_p) && IsUlined(source_p)) {
ilog(L_WARN, "svshost: Setting his own hostname %s (from %s)", target_p->name, client_p->name);
SetHidden(target_p);
strncpy(target_p->vhost, parv[2], HOSTLEN);
@ -379,7 +374,7 @@ static void ms_svsjoin(struct Client *client_p, struct Client *source_p,
add_user_to_channel(chptr, target_p, type);
if (chptr->chname[0] != '&')
sendto_server(target_p, target_p, chptr, NOCAPS, NOCAPS, LL_ICLIENT,
sendto_server(NULL, target_p, chptr, NOCAPS, NOCAPS, LL_ICLIENT,
":%s SJOIN %lu %s + :%c%s",
me.name, (unsigned long) chptr->channelts,
chptr->chname, type ? sjmode : ' ', target_p->name);
@ -448,7 +443,7 @@ static void ms_svsjoin(struct Client *client_p, struct Client *source_p,
/* send out a join, make target_p join chptr */
if (chptr->chname[0] != '&')
sendto_server(target_p, target_p, chptr, NOCAPS, NOCAPS, LL_ICLIENT,
sendto_server(NULL, target_p, chptr, NOCAPS, NOCAPS, LL_ICLIENT,
":%s SJOIN %lu %s +nt :!%s", me.name,
(unsigned long) chptr->channelts, chptr->chname,
target_p->name);

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: m_swhois.c,v 1.2 2002/09/17 06:09:35 fishwaldo Exp $
* $Id: m_swhois.c,v 1.3 2002/10/31 13:01:56 fishwaldo Exp $
*/
#include "stdinc.h"
#include "tools.h"
@ -70,7 +70,7 @@ _moddeinit(void)
mod_del_cmd(&swhois_msgtab);
}
const char *_version = "$Revision: 1.2 $";
const char *_version = "$Revision: 1.3 $";
/* show a whois notice
source_p does a /whois on client_p */
@ -108,7 +108,6 @@ static void mo_swhois(struct Client *client_p, struct Client *source_p, int parc
strncpy(target_p->swhois, parv[2], REALLEN);
sendto_one(source_p, ":%s NOTICE %s :*** NOTICE: swhois updated for %s", me.name, source_p->name, target_p->name);
sendto_server(NULL, target_p, NULL, NOCAPS, NOCAPS, LL_ICLIENT, ":%s SWHOIS %s :%s", me.name, target_p->name, parv[2]);
}
/*
@ -132,6 +131,5 @@ static void ms_swhois(struct Client *client_p, struct Client *source_p, int parc
return;
}
strncpy(target_p->swhois, parv[2], REALLEN);
sendto_server(client_p, target_p, NULL, NOCAPS, NOCAPS, LL_ICLIENT, ":%s SWHOIS %s :%s", me.name, target_p->name, parv[2]);
sendto_server(client_p, target_p, NULL, NOCAPS, NOCAPS, LL_ICLIENT, ":%s SWHOIS %s :%s", source_p->name, target_p->name, parv[2]);
}

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: m_who.c,v 1.12 2002/09/20 14:49:36 fishwaldo Exp $
* $Id: m_who.c,v 1.13 2002/10/31 13:01:56 fishwaldo Exp $
*/
#include "stdinc.h"
#include "tools.h"
@ -60,7 +60,7 @@ _moddeinit(void)
{
mod_del_cmd(&who_msgtab);
}
const char *_version = "$Revision: 1.12 $";
const char *_version = "$Revision: 1.13 $";
#endif
static void do_who_on_channel(struct Client *source_p,
struct Channel *chptr, char *real_name,
@ -186,11 +186,15 @@ static void m_who(struct Client *client_p,
member = IsMember(source_p, chptr);
if (isinvis && !member)
{
chptr = NULL;
continue;
}
if (member || (!isinvis && PubChannel(chptr)))
{
break;
}
chptr = NULL;
}
if (chptr != NULL)

View file

@ -20,7 +20,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: adns.c,v 1.3 2002/09/13 06:50:07 fishwaldo Exp $
* $Id: adns.c,v 1.4 2002/10/31 13:01:57 fishwaldo Exp $
*/
#include "stdinc.h"
@ -231,19 +231,23 @@ void adns_gethost(const char *name, int aftype, struct DNSQuery *req)
}
/* void adns_getaddr(struct irc_inaddr *addr, int aftype,
* struct DNSQuery *req);
* struct DNSQuery *req, int arpa_type);
* Input: An address, an address family, a DNSQuery structure.
* arpa_type is used for deciding on using ip6.int or ip6.arpa
* 0 is ip6.arpa and 1 is ip6.int, of course this applies to ipv6
* connections only and has no effect on ipv4.
* Output: None
* Side effects: Sets up a query entry and sends it to the DNS server to
* resolve an IP address to a domain name.
*/
void adns_getaddr(struct irc_inaddr *addr, int aftype,
struct DNSQuery *req)
struct DNSQuery *req, int arpa_type)
{
struct irc_sockaddr ipn;
memset(&ipn, 0, sizeof(struct irc_sockaddr));
assert(dns_state->nservers > 0);
#ifdef IPV6
if (aftype == AF_INET6)
{
@ -251,10 +255,21 @@ void adns_getaddr(struct irc_inaddr *addr, int aftype,
ipn.sins.sin6.sin6_port = 0;
memcpy(&ipn.sins.sin6.sin6_addr.s6_addr, &addr->sins.sin6.s6_addr,
sizeof(struct in6_addr));
adns_submit_reverse(dns_state, (struct sockaddr *)&ipn.sins.sin6,
adns_r_ptr_ip6,
adns_qf_owner|adns_qf_cname_loose|adns_qf_quoteok_anshost,
req, &req->query);
if(!arpa_type)
{
adns_submit_reverse(dns_state,(struct sockaddr *)&ipn.sins.sin6,
adns_r_ptr_ip6,
adns_qf_owner|adns_qf_cname_loose|adns_qf_quoteok_anshost,
req, &req->query);
} else
{
adns_submit_reverse(dns_state,(struct sockaddr *)&ipn.sins.sin6,
adns_r_ptr_ip6_old,
adns_qf_owner|adns_qf_cname_loose|adns_qf_quoteok_anshost,
req, &req->query);
}
}
else
{

View file

@ -25,7 +25,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: balloc.c,v 1.4 2002/09/13 06:50:08 fishwaldo Exp $
* $Id: balloc.c,v 1.5 2002/10/31 13:01:57 fishwaldo Exp $
*/
/*
@ -406,6 +406,7 @@ BlockHeapAlloc(BlockHeap * bh)
}
assert(0 == 1);
outofmemory();
return NULL;
}

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: channel.c,v 1.13 2002/09/23 10:47:30 fishwaldo Exp $
* $Id: channel.c,v 1.14 2002/10/31 13:01:57 fishwaldo Exp $
*/
#include "stdinc.h"
@ -1130,7 +1130,7 @@ is_voiced(struct Channel *chptr, struct Client *who)
int
can_send(struct Channel *chptr, struct Client *source_p)
{
if(MyClient(source_p) && find_channel_resv(chptr->chname))
if(MyClient(source_p) && find_channel_resv(chptr->chname) && !(IsOper(source_p)) && ConfigChannel.oper_pass_resv)
return (CAN_SEND_NO);
if (is_any_op(chptr, source_p))
@ -1268,19 +1268,15 @@ allocate_topic(struct Channel *chptr)
return FALSE;
ptr = BlockHeapAlloc(topic_heap);
if(ptr != NULL)
{
/* Basically we allocate one large block for the topic and
* the topic info. We then split it up into two and shove it
* in the chptr
*/
chptr->topic = ptr;
chptr->topic_info = (char *)ptr + TOPICLEN+1;
*chptr->topic = '\0';
*chptr->topic_info = '\0';
return (TRUE);
}
return (FALSE);
/* Basically we allocate one large block for the topic and
* the topic info. We then split it up into two and shove it
* in the chptr
*/
chptr->topic = ptr;
chptr->topic_info = (char *)ptr + TOPICLEN+1;
*chptr->topic = '\0';
*chptr->topic_info = '\0';
return (TRUE);
}
void

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: client.c,v 1.10 2002/09/24 11:50:16 fishwaldo Exp $
* $Id: client.c,v 1.11 2002/10/31 13:01:58 fishwaldo Exp $
*/
#include "stdinc.h"
#include "config.h"
@ -124,8 +124,6 @@ struct Client* make_client(struct Client* from)
dlink_node *m;
client_p = BlockHeapAlloc(client_heap);
if(client_p == NULL)
return NULL;
memset(client_p, 0, sizeof(struct Client));
if (from == NULL)
{
@ -1121,9 +1119,9 @@ remove_dependents(struct Client* client_p,
*/
if ((aconf = to->serv->sconf) != NULL)
strlcpy(myname, my_name_for_link(me.name, aconf), HOSTLEN + 1);
strlcpy(myname, my_name_for_link(me.name, aconf), sizeof(myname));
else
strlcpy(myname, me.name, HOSTLEN + 1);
strlcpy(myname, me.name, sizeof(myname));
recurse_send_quits(client_p, source_p, to, comment1, myname);
}
@ -1560,7 +1558,7 @@ set_initial_nick(struct Client *client_p, struct Client *source_p,
if (source_p->user != NULL)
{
strlcpy(buf, source_p->username, USERLEN);
strlcpy(buf, source_p->username, sizeof(buf));
/*
* USER already received, now we have NICK.
* *NOTE* For servers "NICK" *must* precede the

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: hash.c,v 1.5 2002/09/13 16:30:04 fishwaldo Exp $
* $Id: hash.c,v 1.6 2002/10/31 13:01:58 fishwaldo Exp $
*/
#include "stdinc.h"
@ -324,7 +324,7 @@ add_to_resv_hash_table(const char *name, struct ResvChannel *resv_p)
/*
* del_from_client_hash_table - remove a client/server from the client
* del_from_id_hash_table - remove a client/server from the id
* hash table
*/
void
@ -417,11 +417,14 @@ del_from_channel_hash_table(const char* name, struct Channel* chptr)
struct Channel* found_chptr;
struct Channel* prev = NULL;
unsigned int hashv;
#ifdef INVARIANTS
assert(name != NULL);
assert(chptr != NULL);
#else
if(name == NULL || chptr == NULL)
return;
#endif
hashv = hash_channel_name(name);
found_chptr = (struct Channel*) channelTable[hashv].list;
@ -577,7 +580,7 @@ hash_find_masked_server(const char* name)
/*
* copy the damn thing and be done with it
*/
strlcpy(buf, name, HOSTLEN + 1);
strlcpy(buf, name, sizeof(buf));
while ((s = strchr(p, '.')) != 0)
{
@ -732,7 +735,7 @@ get_or_create_channel(struct Client *client_p, char *chname, int *isnew)
chptr = BlockHeapAlloc(channel_heap);
memset(chptr, 0, sizeof(struct Channel));
strlcpy(chptr->chname, chname, CHANNELLEN+1);
strlcpy(chptr->chname, chname, sizeof(chptr->chname));
if (GlobalChannelList)
GlobalChannelList->prevch = chptr;

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: ircd_lexer.l,v 1.6 2002/09/17 06:09:35 fishwaldo Exp $
* $Id: ircd_lexer.l,v 1.7 2002/10/31 13:01:58 fishwaldo Exp $
*/
%option case-insensitive
@ -139,6 +139,7 @@ auth { return AUTH; }
autoconn { return AUTOCONN; }
autojoin { return OPERAUTOJOIN; }
caller_id_wait { return CALLER_ID_WAIT; }
can_flood { return CAN_FLOOD; }
channel { return CHANNEL; }
cipher_preference { return CIPHER_PREFERENCE; }
class { return CLASS; }
@ -167,6 +168,7 @@ encrypted { return ENCRYPTED; }
exceed_limit { return EXCEED_LIMIT; }
exempt { return EXEMPT; }
fakename { return FAKENAME; }
fallback_to_ip6_int { return FALLBACK_IP6_INT; }
flatten_links { return FLATTEN_LINKS; }
fname_foperlog { return FNAME_FOPERLOG; }
fname_operlog { return FNAME_OPERLOG; }
@ -225,6 +227,7 @@ no_tilde { return NO_TILDE; }
number_per_ip { return NUMBER_PER_IP; }
oper { return OPERATOR; }
oper_log { return OPER_LOG; }
oper_pass_resv { return OPER_PASS_RESV; }
operator { return OPERATOR; }
passwd { return PASSWORD; }
password { return PASSWORD; }
@ -251,6 +254,7 @@ servlink_path { return SERVLINK_PATH; }
set_ulined { return ULINE_SERVER; }
short_motd { return SHORT_MOTD; }
silent { return SILENT; }
true_no_oper_flood { return TRUE_NO_OPER_FLOOD; }
unkline { return UNKLINE; }
use_egd { return USE_EGD; }
use_help { return USE_HELP; }

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: ircd_parser.y,v 1.10 2002/09/26 12:34:46 fishwaldo Exp $
* $Id: ircd_parser.y,v 1.11 2002/10/31 13:01:58 fishwaldo Exp $
*/
%{
@ -102,6 +102,7 @@ int class_redirport_var;
%token OPERAUTOJOIN
%token BYTES KBYTES MBYTES GBYTES TBYTES
%token CALLER_ID_WAIT
%token CAN_FLOOD
%token CHANNEL
%token CIPHER_PREFERENCE
%token CLASS
@ -130,6 +131,7 @@ int class_redirport_var;
%token EXEMPT
%token FAILED_OPER_NOTICE
%token FAKENAME
%token FALLBACK_IP6_INT
%token FLATTEN_LINKS
%token FNAME_FOPERLOG
%token FNAME_OPERLOG
@ -193,6 +195,7 @@ int class_redirport_var;
%token OPERATOR
%token OPER_LOG
%token OPER_ONLY_UMODES
%token OPER_PASS_RESV
%token OPER_UMODES
%token PACE_WAIT
%token PACE_WAIT_SIMPLE
@ -263,6 +266,7 @@ int class_redirport_var;
%token T_UNAUTH
%token T_WALLOP
%token THROTTLE_TIME
%token TRUE_NO_OPER_FLOOD
%token UNKLINE
%token USER
%token USE_EGD
@ -276,8 +280,10 @@ int class_redirport_var;
%type <string> QSTRING
%type <number> NUMBER
%type <number> timespec, timespec_
%type <number> sizespec, sizespec_
%type <number> timespec
%type <number> timespec_
%type <number> sizespec
%type <number> sizespec_
%%
conf:
@ -292,7 +298,7 @@ conf_item: admin_entry
| listen_entry
| auth_entry
| serverinfo_entry
| serverhide_entry;
| serverhide_entry
| resv_entry
| connect_entry
| kill_entry
@ -1062,7 +1068,7 @@ auth_items: auth_items auth_item |
auth_item: auth_user | auth_passwd | auth_class |
auth_kline_exempt | auth_have_ident | auth_is_restricted |
auth_exceed_limit | auth_no_tilde | auth_gline_exempt |
auth_redir_serv | auth_redir_port |
auth_redir_serv | auth_redir_port | auth_can_flood |
error;
auth_user: USER '=' QSTRING ';'
@ -1148,6 +1154,16 @@ auth_have_ident: HAVE_IDENT '=' TYES ';'
yy_achead->flags &= ~CONF_FLAGS_NEED_IDENTD;
};
auth_can_flood: CAN_FLOOD '=' TYES ';'
{
yy_achead->flags |= CONF_FLAGS_CAN_FLOOD;
}
|
CAN_FLOOD '=' TNO ';'
{
yy_achead->flags &= ~CONF_FLAGS_CAN_FLOOD;
};
auth_no_tilde: NO_TILDE '=' TYES ';'
{
yy_achead->flags |= CONF_FLAGS_NO_TILDE;
@ -1865,6 +1881,7 @@ general_item: general_failed_oper_notice |
general_pace_wait | general_stats_i_oper_only |
general_pace_wait_simple | general_stats_P_oper_only |
general_short_motd | general_no_oper_flood |
general_true_no_oper_flood |
general_iauth_server |
general_iauth_port |
general_glines | general_gline_time |
@ -1883,7 +1900,7 @@ general_item: general_failed_oper_notice |
general_compression_level | general_client_flood |
general_throttle_time | general_havent_read_conf |
general_dot_in_ip6_addr | general_ping_cookie |
general_oper_autojoin |
general_fallback_to_ip6_int |
error;
general_failed_oper_notice: FAILED_OPER_NOTICE '=' TYES ';'
@ -2098,6 +2115,16 @@ general_no_oper_flood: NO_OPER_FLOOD '=' TYES ';'
ConfigFileEntry.no_oper_flood = 0;
};
general_true_no_oper_flood: TRUE_NO_OPER_FLOOD '=' TYES ';'
{
ConfigFileEntry.true_no_oper_flood = 1;
}
|
TRUE_NO_OPER_FLOOD '=' TNO ';'
{
ConfigFileEntry.true_no_oper_flood = 0;
};
general_iauth_server: IAUTH_SERVER '=' QSTRING ';'
{
#if 0
@ -2274,6 +2301,19 @@ general_throttle_time: THROTTLE_TIME '=' timespec ';'
ConfigFileEntry.throttle_time = yylval.number;
} ;
general_fallback_to_ip6_int: FALLBACK_IP6_INT '=' TYES ';'
{
#ifdef IPV6
ConfigFileEntry.fallback_to_ip6_int = 1;
#endif
} |
FALLBACK_IP6_INT '=' TNO ';'
{
#ifdef IPV6
ConfigFileEntry.fallback_to_ip6_int = 0;
#endif
} ;
general_oper_umodes: OPER_UMODES
{
ConfigFileEntry.oper_umodes = 0;
@ -2465,6 +2505,7 @@ channel_item: channel_max_bans |
channel_default_split_server_count |
channel_no_create_on_split |
channel_no_join_on_split |
channel_oper_pass_resv |
error;
@ -2533,6 +2574,15 @@ channel_no_join_on_split: NO_JOIN_ON_SPLIT '=' TYES ';'
ConfigChannel.no_join_on_split = 0;
} ;
channel_oper_pass_resv: OPER_PASS_RESV '=' TYES ';'
{
ConfigChannel.oper_pass_resv = 1;
}
|
OPER_PASS_RESV '=' TNO ';'
{
ConfigChannel.oper_pass_resv = 0;
} ;
/***************************************************************************
* section serverhide

View file

@ -20,7 +20,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: linebuf.c,v 1.4 2002/09/13 06:50:08 fishwaldo Exp $
* $Id: linebuf.c,v 1.5 2002/10/31 13:01:58 fishwaldo Exp $
*/
#include "stdinc.h"
@ -75,9 +75,6 @@ linebuf_allocate(void)
{
buf_line_t *t;
t = BlockHeapAlloc(linebuf_heap);
assert(t != NULL);
if(t == NULL)
return NULL;
t->refcount = 0;
return(t);

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: list.c,v 1.4 2002/09/13 16:30:04 fishwaldo Exp $
* $Id: list.c,v 1.5 2002/10/31 13:01:58 fishwaldo Exp $
*/
#include "stdinc.h"
@ -183,7 +183,7 @@ make_dlink_node(void)
{
dlink_node *lp;
lp = (dlink_node *)BlockHeapAlloc(dnode_heap);;
lp = (dlink_node *)BlockHeapAlloc(dnode_heap);
++links_count;
lp->next = NULL;

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: m_error.c,v 1.4 2002/09/13 16:30:04 fishwaldo Exp $
* $Id: m_error.c,v 1.5 2002/10/31 13:01:58 fishwaldo Exp $
*/
#include "stdinc.h"
@ -51,33 +51,7 @@ struct Message error_msgtab = {
void m_error(struct Client *client_p, struct Client *source_p,
int parc, char *parv[])
{
char* para;
para = (parc > 1 && *parv[1] != '\0') ? parv[1] : "<>";
ilog(L_ERROR, "Received ERROR message from %s: %s",
source_p->name, para);
if (client_p == source_p)
{
sendto_realops_flags(FLAGS_ALL|FLAGS_REMOTE, L_ADMIN,
"ERROR :from %s -- %s",
get_client_name(client_p, HIDE_IP), para);
sendto_realops_flags(FLAGS_ALL|FLAGS_REMOTE, L_OPER,
"ERROR :from %s -- %s",
get_client_name(client_p, MASK_IP), para);
}
else
{
sendto_realops_flags(FLAGS_ALL|FLAGS_REMOTE, L_OPER,
"ERROR :from %s via %s -- %s",
source_p->name, get_client_name(client_p, MASK_IP), para);
sendto_realops_flags(FLAGS_ALL|FLAGS_REMOTE, L_ADMIN,"ERROR :from %s via %s -- %s",
source_p->name,
get_client_name(client_p, HIDE_IP), para);
}
if(MyClient(source_p))
if (MyClient(source_p))
exit_client(client_p, source_p, source_p, "ERROR");
}

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: motd.c,v 1.3 2002/09/13 06:50:08 fishwaldo Exp $
* $Id: motd.c,v 1.4 2002/10/31 13:01:58 fishwaldo Exp $
*/
#include "stdinc.h"
@ -46,7 +46,7 @@
void
InitMessageFile(MotdType motdType, char *fileName, MessageFile *motd)
{
strlcpy(motd->fileName, fileName, PATH_MAX);
strlcpy(motd->fileName, fileName, sizeof(motd->fileName));
motd->motdType = motdType;
motd->contentsOfFile = NULL;
motd->lastChangedDate[0] = '\0';
@ -197,7 +197,7 @@ ReadMessageFile(MessageFile *MessageFileptr)
*p = '\0';
newMessageLine = (MessageFileLine*) MyMalloc(sizeof(MessageFileLine));
strlcpy(newMessageLine->line, buffer, MESSAGELINELEN);
strlcpy(newMessageLine->line, buffer, sizeof(newMessageLine->line));
newMessageLine->next = (MessageFileLine *)NULL;
if(MessageFileptr->contentsOfFile)

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: packet.c,v 1.4 2002/09/13 06:50:08 fishwaldo Exp $
* $Id: packet.c,v 1.5 2002/10/31 13:01:58 fishwaldo Exp $
*/
#include "stdinc.h"
#include "tools.h"
@ -107,9 +107,11 @@ parse_client_queued(struct Client *client_p)
}
else if(IsClient(client_p))
{
checkflood = 0;
if (ConfigFileEntry.no_oper_flood && (IsOper(client_p) || IsCanFlood(client_p)))
if (ConfigFileEntry.true_no_oper_flood)
checkflood = -1;
if (ConfigFileEntry.no_oper_flood && IsOper(client_p))
checkflood = 0;
/*
* Handle flood protection here - if we exceed our flood limit on
* messages in this loop, we simply drop out of the loop prematurely.
@ -130,7 +132,7 @@ parse_client_queued(struct Client *client_p)
* as sent_parsed will always hover around the allow_read limit
* and no 'bursts' will be permitted.
*/
if(checkflood)
if(checkflood > 0)
{
if(lclient_p->sent_parsed >= lclient_p->allow_read)
break;
@ -139,7 +141,7 @@ parse_client_queued(struct Client *client_p)
/* allow opers 4 times the amount of messages as users. why 4?
* why not. :) --fl_
*/
else if(lclient_p->sent_parsed >= (4 * lclient_p->allow_read))
else if(lclient_p->sent_parsed >= (4 * lclient_p->allow_read) && checkflood != -1)
break;
dolen = linebuf_get(&client_p->localClient->buf_recvq, readBuf,

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: parse.c,v 1.7 2002/09/19 05:41:11 fishwaldo Exp $
* $Id: parse.c,v 1.8 2002/10/31 13:01:58 fishwaldo Exp $
*/
#include "stdinc.h"
@ -667,14 +667,14 @@ cancel_clients(struct Client *client_p, struct Client *source_p, char *cmd)
if (source_p->user)
{
sendto_realops_flags(FLAGS_DEBUG, L_ADMIN,
"Message for %s[%s@%s!%s] from %s (TS, ignored)",
"Message for %s[%s@%s!%s] from %s (TS, ignored): %s",
source_p->name, source_p->username, source_p->host,
source_p->from->name, get_client_name(client_p, SHOW_IP));
source_p->from->name, get_client_name(client_p, SHOW_IP), cmd);
sendto_realops_flags(FLAGS_DEBUG, L_OPER,
"Message for %s[%s@%s!%s] from %s (TS, ignored)",
"Message for %s[%s@%s!%s] from %s (TS, ignored): %s",
source_p->name, source_p->username, source_p->host,
source_p->from->name, get_client_name(client_p, MASK_IP));
source_p->from->name, get_client_name(client_p, MASK_IP), cmd);
}
return 0;

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: resv.c,v 1.4 2002/09/13 16:30:04 fishwaldo Exp $
* $Id: resv.c,v 1.5 2002/10/31 13:01:58 fishwaldo Exp $
*/
#include "stdinc.h"
@ -58,7 +58,7 @@ create_channel_resv(char *name, char *reason, int conf)
resv_p = (struct ResvChannel *)MyMalloc(sizeof(struct ResvChannel));
strlcpy(resv_p->name, name, CHANNELLEN+1);
strlcpy(resv_p->name, name, sizeof(resv_p->name));
DupString(resv_p->reason, reason);
resv_p->conf = conf;
@ -92,7 +92,7 @@ create_nick_resv(char *name, char *reason, int conf)
resv_p = (struct ResvNick *)MyMalloc(sizeof(struct ResvNick));
strlcpy(resv_p->name, name, RESVNICKLEN);
strlcpy(resv_p->name, name, sizeof(resv_p->name));
DupString(resv_p->reason, reason);
resv_p->conf = conf;

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: s_auth.c,v 1.6 2002/09/19 05:41:11 fishwaldo Exp $
* $Id: s_auth.c,v 1.7 2002/10/31 13:01:58 fishwaldo Exp $
*/
/*
@ -186,52 +186,33 @@ static void release_auth_client(struct Client* client)
* set the client on it's way to a connection completion, regardless
* of success of failure
*/
static void auth_dns_callback(void* vptr, adns_answer* reply)
static void
auth_dns_callback(void* vptr, adns_answer* reply)
{
struct AuthRequest* auth = (struct AuthRequest*) vptr;
char *str = auth->client->host;
ClearDNSPending(auth);
*auth->client->host = '\0';
if(reply && (reply->status == adns_s_ok))
{
if(strlen(*reply->rrs.str) <= HOSTLEN)
{
strlcpy(str, *reply->rrs.str, HOSTLEN+1);
strlcpy(auth->client->host, *reply->rrs.str, sizeof(auth->client->host));
sendheader(auth->client, REPORT_FIN_DNS);
}
else
{
#ifdef IPV6
if(*auth->client->localClient->sockhost == ':')
{
strlcat(str, "0",HOSTLEN+1);
}
if(auth->client->localClient->aftype == AF_INET6 && ConfigFileEntry.dot_in_ip6_addr == 1)
{
strlcat(str, auth->client->localClient->sockhost,HOSTLEN+1);
strlcat(str, ".",HOSTLEN+1);
} else
#endif
strlcat(str, auth->client->localClient->sockhost,HOSTLEN+1);
} else
sendheader(auth->client, REPORT_HOST_TOOLONG);
}
}
else
{
#ifdef IPV6
if(*auth->client->localClient->sockhost == ':')
if(auth->client->localClient->aftype == AF_INET6 && ConfigFileEntry.fallback_to_ip6_int == 1 && auth->ip6_int == 0)
{
strlcat(str, "0",HOSTLEN);
struct Client *client = auth->client;
auth->ip6_int = 1;
MyFree(reply);
SetDNSPending(auth);
adns_getaddr(&client->localClient->ip, client->localClient->aftype, client->localClient->dns_query, 1);
return;
}
if(auth->client->localClient->aftype == AF_INET6 && ConfigFileEntry.dot_in_ip6_addr == 1)
{
strlcat(str, auth->client->localClient->sockhost,HOSTLEN+1);
strlcat(str, ".",HOSTLEN+1);
sendheader(auth->client, REPORT_FAIL_DNS);
} else
#endif
strlcat(str, auth->client->localClient->sockhost,HOSTLEN+1);
sendheader(auth->client, REPORT_FAIL_DNS);
}
@ -426,7 +407,7 @@ void start_auth(struct Client* client)
sendheader(client, REPORT_DO_DNS);
/* No DNS cache now, remember? -- adrian */
adns_getaddr(&client->localClient->ip, client->localClient->aftype, client->localClient->dns_query);
adns_getaddr(&client->localClient->ip, client->localClient->aftype, client->localClient->dns_query, 0);
SetDNSPending(auth);
start_auth_query(auth);

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: s_bsd.c,v 1.7 2002/09/19 05:41:11 fishwaldo Exp $
* $Id: s_bsd.c,v 1.8 2002/10/31 13:01:58 fishwaldo Exp $
*/
#include "stdinc.h"
@ -397,13 +397,24 @@ void add_connection(struct Listener* listener, int fd)
#else
new_client->localClient->aftype = AF_INET;
#endif
*new_client->host = '\0';
#ifdef IPV6
if(*new_client->localClient->sockhost == ':')
strlcat(new_client->host, "0",HOSTLEN+1);
if(new_client->localClient->aftype == AF_INET6 && ConfigFileEntry.dot_in_ip6_addr == 1)
{
strlcat(new_client->host, new_client->localClient->sockhost,HOSTLEN+1);
strlcat(new_client->host, ".",HOSTLEN+1);
} else
#endif
strlcat(new_client->host, new_client->localClient->sockhost,HOSTLEN+1);
strcpy(new_client->host, new_client->localClient->sockhost);
/* we also copy it to vhost here as well */
strcpy(new_client->vhost, new_client->localClient->sockhost);
new_client->localClient->fd = fd;
new_client->localClient->fd = fd;
new_client->localClient->listener = listener;
++listener->ref_count;

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: s_conf.c,v 1.10 2002/10/16 05:01:53 fishwaldo Exp $
* $Id: s_conf.c,v 1.11 2002/10/31 13:01:58 fishwaldo Exp $
*/
#include "stdinc.h"
@ -507,8 +507,8 @@ verify_access(struct Client* client_p, const char* username)
}
else
{
non_ident[0] = '~';
strlcpy(&non_ident[1],username, USERLEN + 1);
strlcpy(non_ident, "~", sizeof(non_ident));
strlcat(non_ident, username, USERLEN + 1);
aconf = find_address_conf(client_p->host,non_ident,
&client_p->localClient->ip,
client_p->localClient->aftype);
@ -758,7 +758,7 @@ static int
hash_ip(struct irc_inaddr *addr)
{
int hash;
u_int32_t *ip = (unsigned long *)&PIN_ADDR(addr);
u_int32_t *ip = (u_int32_t *)&PIN_ADDR(addr);
if(IN6_IS_ADDR_V4MAPPED((struct in6_addr *)ip))
{
@ -1245,7 +1245,7 @@ rehash(int sig)
if (ServerInfo.description != NULL)
{
strlcpy(me.info, ServerInfo.description, REALLEN);
strlcpy(me.info, ServerInfo.description, sizeof(me.info));
}
flush_deleted_I_P();
@ -1301,7 +1301,7 @@ set_default_conf(void)
AdminInfo.description = NULL;
set_log_level(L_NOTICE);
ConfigFileEntry.failed_oper_notice = YES;
ConfigFileEntry.anti_nick_flood = NO;
ConfigFileEntry.max_nick_time = 20;
@ -1324,6 +1324,7 @@ set_default_conf(void)
ConfigFileEntry.pace_wait_simple = 1;
ConfigFileEntry.short_motd = NO;
ConfigFileEntry.no_oper_flood = NO;
ConfigFileEntry.true_no_oper_flood = NO;
ConfigFileEntry.fname_userlog[0] = '\0';
ConfigFileEntry.fname_foperlog[0] = '\0';
ConfigFileEntry.fname_operlog[0] = '\0';
@ -1372,6 +1373,7 @@ set_default_conf(void)
ConfigChannel.default_split_server_count = 0;
ConfigChannel.no_join_on_split = NO;
ConfigChannel.no_create_on_split = NO;
ConfigChannel.oper_pass_resv = YES;
ConfigServerHide.flatten_links = 0;
ConfigServerHide.hide_servers = 0;
@ -1384,6 +1386,10 @@ set_default_conf(void)
ConfigFileEntry.default_floodcount = 8;
ConfigFileEntry.client_flood = CLIENT_FLOOD_DEFAULT;
#ifdef IPV6
ConfigFileEntry.fallback_to_ip6_int = 1;
#endif
#ifdef EFNET
ConfigFileEntry.use_help = 0;
#else
@ -1687,6 +1693,8 @@ oper_privs_as_string(struct Client *client_p,int port)
SetOperN(client_p);
*privs_ptr++ = 'N';
}
else
*privs_ptr++ = 'n';
if(port & CONF_OPER_GLOBAL_KILL)
{
@ -1894,7 +1902,7 @@ read_conf_files(int cold)
- Gozem 2002-07-21
*/
strlcpy(conffilebuf, filename, IRCD_BUFSIZE);
strlcpy(conffilebuf, filename, sizeof(conffilebuf));
if ((conf_fbfile_in = fbopen(filename,"r")) == NULL)
{

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: s_serv.c,v 1.13 2002/09/24 11:50:16 fishwaldo Exp $
* $Id: s_serv.c,v 1.14 2002/10/31 13:01:58 fishwaldo Exp $
*/
#include "stdinc.h"
@ -1985,8 +1985,8 @@ serv_connect(struct ConfItem *aconf, struct Client *by)
client_p = make_client(NULL);
/* Copy in the server, hostname, fd */
strlcpy(client_p->name, aconf->name, HOSTLEN + 1);
strlcpy(client_p->host, aconf->host, HOSTLEN + 1);
strlcpy(client_p->name, aconf->name, sizeof(client_p->name));
strlcpy(client_p->host, aconf->host, sizeof(client_p->host));
inetntop(DEF_FAM, &IN_ADDR(aconf->ipnum), client_p->localClient->sockhost, HOSTIPLEN);
client_p->localClient->fd = fd;

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: s_user.c,v 1.39 2002/10/16 06:23:30 fishwaldo Exp $
* $Id: s_user.c,v 1.40 2002/10/31 13:01:58 fishwaldo Exp $
*/
#include "stdinc.h"
@ -308,7 +308,6 @@ register_local_user(struct Client *client_p, struct Client *source_p,
source_p->localClient->random_ping = (unsigned long)rand();
sendto_one(source_p, "PING :%lu", (unsigned long)source_p->localClient->random_ping);
source_p->flags |= FLAGS_PINGSENT;
strlcpy(source_p->username, username, USERLEN + 1);
return -1;
}
if(!(source_p->flags2 & FLAGS2_PING_COOKIE))
@ -502,9 +501,8 @@ register_local_user(struct Client *client_p, struct Client *source_p,
return CLIENT_EXITED;
}
user_welcome(source_p);
introduce_client(client_p, source_p, user, nick);
return (0);
return (introduce_client(client_p, source_p, user, nick));
}
/*
@ -530,7 +528,7 @@ register_remote_user(struct Client *client_p, struct Client *source_p,
user->last = CurrentTime;
strlcpy(source_p->username, username, USERLEN + 1);
strlcpy(source_p->username, username, sizeof(source_p->username));
SetClient(source_p);
@ -824,6 +822,13 @@ report_and_set_user_flags(struct Client *source_p,struct ConfItem *aconf)
":%s NOTICE %s :*** You are exempt from idle limits. congrats.",
me.name,source_p->name);
}
if (IsConfCanFlood(aconf))
{
SetCanFlood(source_p);
sendto_one(source_p, ":%s NOTICE %s :*** You are exempt from flood "
"protection, aren't you feersome.",
me.name, source_p->name);
}
}
@ -859,23 +864,22 @@ do_local_user(char* nick, struct Client* client_p, struct Client* source_p,
*/
user->server = me.name;
strlcpy(source_p->info, realname, REALLEN);
strlcpy(source_p->info, realname, sizeof(source_p->info));
if (!IsGotId(source_p))
{
/*
* save the username in the client
* If you move this you'll break ping cookies..you've been warned
*/
strlcpy(source_p->username, username, sizeof(source_p->username));
}
if (source_p->name[0])
{
/* NICK already received, now I have USER... */
return register_local_user(client_p, source_p, source_p->name, username);
}
else
{
if (!IsGotId(source_p))
{
/*
* save the username in the client
*/
strlcpy(source_p->username, username, USERLEN + 1);
}
}
return 0;
}

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: scache.c,v 1.4 2002/09/13 06:50:09 fishwaldo Exp $
* $Id: scache.c,v 1.5 2002/10/31 13:01:58 fishwaldo Exp $
*/
#include "stdinc.h"
@ -96,7 +96,7 @@ const char* find_or_add(const char* name)
ptr = (SCACHE*) MyMalloc(sizeof(SCACHE));
assert(0 != ptr);
strlcpy(ptr->name, name, HOSTLEN + 1);
strlcpy(ptr->name, name, sizeof(ptr->name));
ptr->next = scache_hash[hash_index];
scache_hash[hash_index] = ptr;

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: send.c,v 1.8 2002/09/19 05:41:11 fishwaldo Exp $
* $Id: send.c,v 1.9 2002/10/31 13:01:58 fishwaldo Exp $
*/
#include "stdinc.h"
@ -62,6 +62,10 @@ unsigned long current_serial=0L;
static void
sendto_list_local(dlink_list *list, buf_head_t *linebuf);
static void
sendto_list_local_butone(struct Client *one, dlink_list *list,
buf_head_t *linebuf);
static void
sendto_list_remote(struct Client *one,
struct Client *from, dlink_list *list, int caps,
@ -793,6 +797,56 @@ sendto_channel_local(int type,
linebuf_donebuf(&linebuf);
} /* sendto_channel_local() */
/*
* sendto_channel_local_butone
*
* inputs - pointer to client to NOT send message to
* - int type, i.e. ALL_MEMBERS, NON_CHANOPS,
* ONLY_CHANOPS_VOICED, ONLY_CHANOPS
* - pointer to channel to send to
* - var args pattern
* output - NONE
* side effects - Send a message to all members of a channel that are
* locally connected to this server except one.
*/
void
sendto_channel_local_butone(struct Client *one, int type,
struct Channel *chptr,
const char *pattern, ...)
{
va_list args;
buf_head_t linebuf;
linebuf_newbuf(&linebuf);
va_start(args, pattern);
linebuf_putmsg(&linebuf, pattern, &args, NULL);
va_end(args);
/* Serial number checking isn't strictly necessary, but won't hurt */
++current_serial;
switch(type)
{
case NON_CHANOPS:
sendto_list_local_butone(one, &chptr->locvoiced, &linebuf);
sendto_list_local_butone(one, &chptr->locpeons, &linebuf);
break;
default:
case ALL_MEMBERS:
sendto_list_local_butone(one, &chptr->locpeons, &linebuf);
case ONLY_CHANOPS_HALFOPS_VOICED:
sendto_list_local_butone(one, &chptr->locvoiced, &linebuf);
case ONLY_CHANOPS_HALFOPS:
sendto_list_local_butone(one, &chptr->lochalfops, &linebuf);
case ONLY_CHANOPS:
sendto_list_local_butone(one, &chptr->locchanops, &linebuf);
case ONLY_CHANADMIN:
sendto_list_local_butone(one, &chptr->locchanadmins, &linebuf);
}
linebuf_donebuf(&linebuf);
} /* sendto_channel_local_butone() */
/*
* sendto_channel_remote
*
@ -877,11 +931,52 @@ sendto_list_local(dlink_list *list, buf_head_t *linebuf_ptr)
continue;
target_p->serial = current_serial;
if (!IsDead(target_p))
send_linebuf(target_p, linebuf_ptr);
send_linebuf(target_p, linebuf_ptr);
}
} /* sendto_list_local() */
/*
* sendto_list_local_butone
*
* inputs - pointer to client not to send to
* - pointer to all members of this list
* - buffer to send
* - length of buffer
* output - NONE
* side effects - all members who are locally on this server on given list
* are sent given message, except one. Right now, its always
* a channel list but there is no reason we could not use
* another dlink list to send a message to a group of people.
*/
static void
sendto_list_local_butone(struct Client *one, dlink_list *list,
buf_head_t *linebuf_ptr)
{
dlink_node *ptr;
dlink_node *ptr_next;
struct Client *target_p;
DLINK_FOREACH_SAFE(ptr, ptr_next, list->head)
{
if ((target_p = ptr->data) == NULL)
continue;
if (target_p == one)
continue;
if (!MyConnect(target_p) || IsDead(target_p))
continue;
if (target_p->serial == current_serial)
continue;
target_p->serial = current_serial;
send_linebuf(target_p, linebuf_ptr);
}
} /* sendto_list_local_butone() */
/*
* sendto_list_remote(struct Client *one,
* struct Client *from, dlink_list *list, int caps,

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: whowas.c,v 1.3 2002/09/13 06:50:09 fishwaldo Exp $
* $Id: whowas.c,v 1.4 2002/10/31 13:01:58 fishwaldo Exp $
*/
#include "stdinc.h"
@ -82,7 +82,7 @@ void add_history(struct Client* client_p, int online)
* NOTE: strcpy ok here, the sizes in the client struct MUST
* match the sizes in the whowas struct
*/
strlcpy(who->name, client_p->name, NICKLEN);
strlcpy(who->name, client_p->name, sizeof(client_p->name));
strcpy(who->username, client_p->username);
strcpy(who->hostname, client_p->host);
strcpy(who->vhostname, client_p->vhost);