Automated merge with ssh://hg.atheme.org//hg/charybdis

This commit is contained in:
William Pitcock 2010-01-30 19:21:28 -06:00
commit 436cf01700
9 changed files with 62 additions and 67 deletions

View File

@ -69,22 +69,6 @@ struct PreClient;
struct ListClient;
struct scache_entry;
/*
* Atheme's coding standards require that we use BSD-style user-defined types
* for stuff. Fun! --nenolod
*/
typedef struct User user_t;
typedef struct Server server_t;
typedef struct Client client_t;
typedef struct LocalUser local_user_t;
typedef struct Listener listener_t;
typedef struct DNSReply dns_reply_t;
typedef struct Whowas whowas_entry_t;
typedef struct ConfItem conf_item_t;
typedef struct AuthRequest auth_request_t;
typedef struct PreClient pre_client_t;
typedef struct ListClient list_client_t;
/*
* Client structures
*/
@ -100,7 +84,7 @@ struct User
struct Server
{
user_t *user; /* who activated this connection */
struct User *user; /* who activated this connection */
char by[NICKLEN];
rb_dlink_list servers;
rb_dlink_list users;
@ -123,12 +107,12 @@ struct Client
{
rb_dlink_node node;
rb_dlink_node lnode;
user_t *user; /* ...defined, if this is a User */
server_t *serv; /* ...defined, if this is a server */
client_t *servptr; /* Points to server this Client is on */
client_t *from; /* == self, if Local Client, *NEVER* NULL! */
struct User *user; /* ...defined, if this is a User */
struct Server *serv; /* ...defined, if this is a server */
struct Client *servptr; /* Points to server this Client is on */
struct Client *from; /* == self, if Local Client, *NEVER* NULL! */
whowas_entry_t *whowas; /* Pointers to whowas structs */
struct Whowas *whowas; /* Pointers to whowas structs */
time_t tsinfo; /* TS on the nick, SVINFO on server */
unsigned int umodes; /* opers, normal users subset */
unsigned int flags; /* client flags */
@ -173,8 +157,8 @@ struct Client
int received_number_of_privmsgs;
int flood_noticed;
local_user_t *localClient;
pre_client_t *preClient;
struct LocalUser *localClient;
struct PreClient *preClient;
time_t large_ctcp_sent; /* ctcp to large group sent, relax flood checks */
};
@ -219,8 +203,8 @@ struct LocalUser
unsigned int receiveK; /* Statistics: total k-bytes received */
unsigned short sendB; /* counters to count upto 1-k lots of bytes */
unsigned short receiveB; /* sent and received. */
listener_t *listener; /* listener accepted from */
conf_item_t *att_conf; /* attached conf */
struct Listener *listener; /* listener accepted from */
struct ConfItem *att_conf; /* attached conf */
struct server_conf *att_sconf;
struct rb_sockaddr_storage ip;
@ -267,14 +251,14 @@ struct LocalUser
int sent_parsed; /* how many messages we've parsed in this second */
time_t last_knock; /* time of last knock */
unsigned long random_ping;
auth_request_t *auth_request;
struct AuthRequest *auth_request;
/* target change stuff */
uint32_t targets[10]; /* targets were aware of (fnv32(use_id(target_p))) */
unsigned int targinfo[2]; /* cyclic array, no in use */
time_t target_last; /* last time we cleared a slot */
list_client_t *safelist_data;
struct ListClient *safelist_data;
char *mangledhost; /* non-NULL if host mangling module loaded and
applicable to this client */
@ -570,7 +554,7 @@ extern const char *get_client_name(struct Client *client, int show_ip);
extern const char *log_client_name(struct Client *, int);
extern int is_remote_connect(struct Client *);
extern void init_client(void);
extern client_t *make_client(struct Client *from);
extern struct Client *make_client(struct Client *from);
extern void free_pre_client(struct Client *client);
extern void free_client(struct Client *client);
@ -583,10 +567,10 @@ extern void error_exit_client(struct Client *, int);
extern void count_local_client_memory(size_t * count, size_t * memory);
extern void count_remote_client_memory(size_t * count, size_t * memory);
extern client_t *find_chasing(struct Client *, const char *, int *);
extern client_t *find_person(const char *);
extern client_t *find_named_person(const char *);
extern client_t *next_client(struct Client *, const char *);
extern struct Client *find_chasing(struct Client *, const char *, int *);
extern struct Client *find_person(const char *);
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);
@ -597,8 +581,8 @@ extern int show_ip_conf(struct ConfItem *aconf, struct Client *target_p);
extern void initUser(void);
extern void free_user(struct User *, struct Client *);
extern user_t *make_user(struct Client *);
extern server_t *make_server(struct Client *);
extern struct User *make_user(struct Client *);
extern struct Server *make_server(struct Client *);
extern void close_connection(struct Client *);
extern void init_uid(void);
extern char *generate_uid(void);

View File

@ -392,12 +392,6 @@ build_target_list(int p_or_n, const char *command, struct Client *client_p,
continue;
}
if(strchr(nick, '@') || (IsOper(source_p) && (*nick == '$')))
{
handle_special(p_or_n, command, client_p, source_p, nick, text);
continue;
}
if(IsServer(client_p) && *nick == '=' && nick[1] == '#')
{
nick++;
@ -424,6 +418,12 @@ build_target_list(int p_or_n, const char *command, struct Client *client_p,
continue;
}
if(strchr(nick, '@') || (IsOper(source_p) && (*nick == '$')))
{
handle_special(p_or_n, command, client_p, source_p, nick, text);
continue;
}
/* no matching anything found - error if not NOTICE */
if(p_or_n != NOTICE)
{

View File

@ -87,6 +87,8 @@ mo_links(struct Client *client_p, struct Client *source_p, int parc, const char
if(parc > 2)
{
if(strlen(parv[2]) > HOSTLEN)
return 0;
if(hunt_server(client_p, source_p, ":%s LINKS %s :%s", 1, parc, parv)
!= HUNTED_ISME)
return 0;
@ -138,19 +140,21 @@ clean_string(char *dest, const unsigned char *src, size_t len)
if(dest == NULL || src == NULL)
return NULL;
len -= 3; /* allow for worst case, '^A\0' */
while (*src && (len > 0))
while (*src && (len > 1))
{
if(*src & 0x80) /* if high bit is set */
{
*d++ = '.';
--len;
if(len <= 1)
break;
}
else if(!IsPrint(*src)) /* if NOT printable */
{
*d++ = '^';
--len;
if(len <= 1)
break;
*d++ = 0x40 + *src; /* turn it into a printable */
}
else

View File

@ -25,7 +25,7 @@ if [ "x$TIP" = "x" ]; then
fi
# Charybdis wants the hg tip to be in include/serno.h, in its own format.
MYTIP=`hg parents --template '#date|shortdate#_#node|short#' 2>/dev/null | sed -e s/-//g -e s/_/-/`
MYTIP=`hg parents --template '{date|shortdate}_{node|short}' 2>/dev/null | sed -e s/-//g -e s/_/-/`
echo "[charybdis] Generating include/serno.h for tip $MYTIP."
cat << _EOF_ > include/serno.h
/* Generated automatically by makepackage. Any changes made here will be lost. */

View File

@ -30,7 +30,7 @@ if [ "x$2" = "x--automatic" ]; then
AUTOMATIC="yes"
fi
TIP=`hg tip --template "#rev#:#node|short#"`
TIP=`hg parents --template "{rev}:{node|short}"`
WRKDIR=`pwd`

View File

@ -253,6 +253,8 @@ load_help(void)
while((ldirent = readdir(helpfile_dir)) != NULL)
{
if(ldirent->d_name[0] == '.')
continue;
rb_snprintf(filename, sizeof(filename), "%s/%s", HPATH, ldirent->d_name);
cacheptr = cache_file(filename, ldirent->d_name, HELP_OPER);
irc_dictionary_add(help_dict_oper, cacheptr->name, cacheptr);
@ -266,6 +268,8 @@ load_help(void)
while((ldirent = readdir(helpfile_dir)) != NULL)
{
if(ldirent->d_name[0] == '.')
continue;
rb_snprintf(filename, sizeof(filename), "%s/%s", UHPATH, ldirent->d_name);
#if defined(S_ISLNK) && defined(HAVE_LSTAT)

View File

@ -231,6 +231,7 @@ free_local_client(struct Client *client_p)
rb_free(client_p->localClient->passwd);
}
rb_free(client_p->localClient->auth_user);
rb_free(client_p->localClient->challenge);
rb_free(client_p->localClient->fullcaps);
rb_free(client_p->localClient->opername);
@ -1670,14 +1671,14 @@ make_user(struct Client *client_p)
* side effects - add's an Server information block to a client
* if it was not previously allocated.
*/
server_t *
struct Server *
make_server(struct Client *client_p)
{
server_t *serv = client_p->serv;
struct Server *serv = client_p->serv;
if(!serv)
{
serv = (server_t *) rb_malloc(sizeof(server_t));
serv = (struct Server *) rb_malloc(sizeof(struct Server));
client_p->serv = serv;
}
return client_p->serv;

View File

@ -52,14 +52,14 @@ static const struct in6_addr in6addr_any =
{ { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } };
#endif
static listener_t *ListenerPollList = NULL;
static struct Listener *ListenerPollList = NULL;
static int accept_precallback(rb_fde_t *F, struct sockaddr *addr, rb_socklen_t addrlen, void *data);
static void accept_callback(rb_fde_t *F, int status, struct sockaddr *addr, rb_socklen_t addrlen, void *data);
static listener_t *
static struct Listener *
make_listener(struct rb_sockaddr_storage *addr)
{
listener_t *listener = (listener_t *) rb_malloc(sizeof(listener_t));
struct Listener *listener = (struct Listener *) rb_malloc(sizeof(struct Listener));
s_assert(0 != listener);
listener->name = me.name;
listener->F = NULL;
@ -70,7 +70,7 @@ make_listener(struct rb_sockaddr_storage *addr)
}
void
free_listener(listener_t *listener)
free_listener(struct Listener *listener)
{
s_assert(NULL != listener);
if(listener == NULL)
@ -82,7 +82,7 @@ free_listener(listener_t *listener)
ListenerPollList = listener->next;
else
{
listener_t *prev = ListenerPollList;
struct Listener *prev = ListenerPollList;
for (; prev; prev = prev->next)
{
if(listener == prev->next)
@ -104,7 +104,7 @@ free_listener(listener_t *listener)
* returns "host.foo.org:6667" for a given listener
*/
const char *
get_listener_name(const listener_t *listener)
get_listener_name(const struct Listener *listener)
{
static char buf[HOSTLEN + HOSTLEN + PORTNAMELEN + 4];
int port = 0;
@ -133,7 +133,7 @@ get_listener_name(const listener_t *listener)
void
show_ports(struct Client *source_p)
{
listener_t *listener = 0;
struct Listener *listener = 0;
for (listener = ListenerPollList; listener; listener = listener->next)
{
@ -165,7 +165,7 @@ show_ports(struct Client *source_p)
#endif
static int
inetport(listener_t *listener)
inetport(struct Listener *listener)
{
rb_fde_t *F;
int ret;
@ -245,11 +245,11 @@ inetport(listener_t *listener)
return 1;
}
static listener_t *
static struct Listener *
find_listener(struct rb_sockaddr_storage *addr)
{
listener_t *listener = NULL;
listener_t *last_closed = NULL;
struct Listener *listener = NULL;
struct Listener *last_closed = NULL;
for (listener = ListenerPollList; listener; listener = listener->next)
{
@ -307,7 +307,7 @@ find_listener(struct rb_sockaddr_storage *addr)
void
add_listener(int port, const char *vhost_ip, int family, int ssl)
{
listener_t *listener;
struct Listener *listener;
struct rb_sockaddr_storage vaddr;
/*
@ -389,7 +389,7 @@ add_listener(int port, const char *vhost_ip, int family, int ssl)
* close_listener - close a single listener
*/
void
close_listener(listener_t *listener)
close_listener(struct Listener *listener)
{
s_assert(listener != NULL);
if(listener == NULL)
@ -414,8 +414,8 @@ close_listener(listener_t *listener)
void
close_listeners()
{
listener_t *listener;
listener_t *listener_next = 0;
struct Listener *listener;
struct Listener *listener_next = 0;
/*
* close all 'extra' listening ports we have
*/

View File

@ -892,7 +892,7 @@ conf_begin_auth(struct TopConf *tc)
static int
conf_end_auth(struct TopConf *tc)
{
struct ConfItem *yy_tmp;
struct ConfItem *yy_tmp, *found_conf;
rb_dlink_node *ptr;
rb_dlink_node *next_ptr;
@ -910,9 +910,11 @@ conf_end_auth(struct TopConf *tc)
collapse(yy_aconf->user);
collapse(yy_aconf->host);
conf_add_class_to_conf(yy_aconf);
if (find_exact_conf_by_address("*", CONF_CLIENT, "*"))
if ((found_conf = find_exact_conf_by_address("*", CONF_CLIENT, "*")) && found_conf->spasswd == NULL)
conf_report_error("Ignoring redundant auth block (after *@*)");
else if (find_exact_conf_by_address(yy_aconf->host, CONF_CLIENT, yy_aconf->user))
else if ((found_conf = find_exact_conf_by_address(yy_aconf->host, CONF_CLIENT, yy_aconf->user)) &&
(!found_conf->spasswd || (yy_aconf->spasswd &&
0 == irccmp(found_conf->spasswd, yy_aconf->spasswd))))
conf_report_error("Ignoring duplicate auth block for %s@%s",
yy_aconf->user, yy_aconf->host);
else