Automated merge with ssh://hg.atheme.org//hg/charybdis
This commit is contained in:
commit
86b6be08eb
15 changed files with 22 additions and 51 deletions
2
TODO
2
TODO
|
@ -59,7 +59,7 @@
|
||||||
[?] native win32 (VS2005/VS2008)
|
[?] native win32 (VS2005/VS2008)
|
||||||
[/] Bug fixes
|
[/] Bug fixes
|
||||||
[x] Compilation without zlib headers fails - fixed
|
[x] Compilation without zlib headers fails - fixed
|
||||||
[ ] Compilation date and time in server welcome message is in OS locale - looks ugly 'cause often it's not match user's codepage
|
[x] Compilation date and time in server welcome message is in OS locale - looks ugly 'cause often it's not match user's codepage
|
||||||
[ ] Improvments
|
[ ] Improvments
|
||||||
[ ] ircd shouldn't need bison/byacc/yacc or flex for compilation
|
[ ] ircd shouldn't need bison/byacc/yacc or flex for compilation
|
||||||
--- other stuff
|
--- other stuff
|
||||||
|
|
|
@ -298,6 +298,8 @@ struct PreClient
|
||||||
|
|
||||||
rb_dlink_list dnsbl_queries; /* list of struct BlacklistClient * */
|
rb_dlink_list dnsbl_queries; /* list of struct BlacklistClient * */
|
||||||
struct Blacklist *dnsbl_listed; /* first dnsbl where it's listed */
|
struct Blacklist *dnsbl_listed; /* first dnsbl where it's listed */
|
||||||
|
|
||||||
|
struct rb_sockaddr_storage lip; /* address of our side of the connection */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ListClient
|
struct ListClient
|
||||||
|
|
|
@ -916,7 +916,6 @@ handle_special(int p_or_n, const char *command, struct Client *client_p,
|
||||||
struct Client *target_p;
|
struct Client *target_p;
|
||||||
char *server;
|
char *server;
|
||||||
char *s;
|
char *s;
|
||||||
int count;
|
|
||||||
|
|
||||||
/* user[%host]@server addressed?
|
/* user[%host]@server addressed?
|
||||||
* NOTE: users can send to user@server, but not user%host@server
|
* NOTE: users can send to user@server, but not user%host@server
|
||||||
|
@ -931,8 +930,6 @@ handle_special(int p_or_n, const char *command, struct Client *client_p,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
count = 0;
|
|
||||||
|
|
||||||
if(!IsOper(source_p))
|
if(!IsOper(source_p))
|
||||||
{
|
{
|
||||||
if(strchr(nick, '%') || (strncmp(nick, "opers", 5) == 0))
|
if(strchr(nick, '%') || (strncmp(nick, "opers", 5) == 0))
|
||||||
|
|
|
@ -292,12 +292,6 @@ ms_server(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
* doesnt exist, although ircd can handle it, its not a realistic
|
* doesnt exist, although ircd can handle it, its not a realistic
|
||||||
* solution.. --fl_
|
* solution.. --fl_
|
||||||
*/
|
*/
|
||||||
/* It is behind a host-masked server. Completely ignore the
|
|
||||||
* server message(don't propagate or we will delink from whoever
|
|
||||||
* we propagate to). -A1kmm */
|
|
||||||
if(irccmp(target_p->name, name) && target_p->from == client_p)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
sendto_one(client_p, "ERROR :Server %s already exists", name);
|
sendto_one(client_p, "ERROR :Server %s already exists", name);
|
||||||
|
|
||||||
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||||
|
|
|
@ -239,16 +239,9 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
|
||||||
char *t;
|
char *t;
|
||||||
int tlen;
|
int tlen;
|
||||||
hook_data_client hdata;
|
hook_data_client hdata;
|
||||||
char *name;
|
|
||||||
char quest[] = "?";
|
|
||||||
int visible;
|
int visible;
|
||||||
int extra_space = 0;
|
int extra_space = 0;
|
||||||
|
|
||||||
if(target_p->name[0] == '\0')
|
|
||||||
name = quest;
|
|
||||||
else
|
|
||||||
name = target_p->name;
|
|
||||||
|
|
||||||
if(target_p->user == NULL)
|
if(target_p->user == NULL)
|
||||||
{
|
{
|
||||||
s_assert(0);
|
s_assert(0);
|
||||||
|
|
|
@ -1361,15 +1361,12 @@ static int
|
||||||
qs_server(struct Client *client_p, struct Client *source_p, struct Client *from,
|
qs_server(struct Client *client_p, struct Client *source_p, struct Client *from,
|
||||||
const char *comment)
|
const char *comment)
|
||||||
{
|
{
|
||||||
struct Client *target_p;
|
|
||||||
|
|
||||||
if(source_p->servptr && source_p->servptr->serv)
|
if(source_p->servptr && source_p->servptr->serv)
|
||||||
rb_dlinkDelete(&source_p->lnode, &source_p->servptr->serv->servers);
|
rb_dlinkDelete(&source_p->lnode, &source_p->servptr->serv->servers);
|
||||||
else
|
else
|
||||||
s_assert(0);
|
s_assert(0);
|
||||||
|
|
||||||
rb_dlinkFindDestroy(source_p, &global_serv_list);
|
rb_dlinkFindDestroy(source_p, &global_serv_list);
|
||||||
target_p = source_p->from;
|
|
||||||
|
|
||||||
if(has_id(source_p))
|
if(has_id(source_p))
|
||||||
del_from_id_hash(source_p->id, source_p);
|
del_from_id_hash(source_p->id, source_p);
|
||||||
|
|
|
@ -68,17 +68,14 @@ int
|
||||||
valid_extban(const char *banstr, struct Client *client_p, struct Channel *chptr, long mode_type)
|
valid_extban(const char *banstr, struct Client *client_p, struct Channel *chptr, long mode_type)
|
||||||
{
|
{
|
||||||
const char *p;
|
const char *p;
|
||||||
int invert = 0, result = EXTBAN_INVALID;
|
int result = EXTBAN_INVALID;
|
||||||
ExtbanFunc f;
|
ExtbanFunc f;
|
||||||
|
|
||||||
if (*banstr != '$')
|
if (*banstr != '$')
|
||||||
return 0;
|
return 0;
|
||||||
p = banstr + 1;
|
p = banstr + 1;
|
||||||
if (*p == '~')
|
if (*p == '~')
|
||||||
{
|
|
||||||
invert = 1;
|
|
||||||
p++;
|
p++;
|
||||||
}
|
|
||||||
f = extban_table[(unsigned char) ToLower(*p)];
|
f = extban_table[(unsigned char) ToLower(*p)];
|
||||||
if (*p != '\0')
|
if (*p != '\0')
|
||||||
{
|
{
|
||||||
|
|
|
@ -446,7 +446,6 @@ find_exact_conf_by_address(const char *address, int type, const char *username)
|
||||||
|
|
||||||
if(address == NULL)
|
if(address == NULL)
|
||||||
address = "/NOMATCH!/";
|
address = "/NOMATCH!/";
|
||||||
arec = rb_malloc(sizeof(struct AddressRec));
|
|
||||||
masktype = parse_netmask(address, (struct sockaddr *)&addr, &bits);
|
masktype = parse_netmask(address, (struct sockaddr *)&addr, &bits);
|
||||||
#ifdef RB_IPV6
|
#ifdef RB_IPV6
|
||||||
if(masktype == HM_IPV6)
|
if(masktype == HM_IPV6)
|
||||||
|
|
|
@ -435,7 +435,7 @@ close_listeners()
|
||||||
* any client list yet.
|
* any client list yet.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
add_connection(struct Listener *listener, rb_fde_t *F, struct sockaddr *sai, void *ssl_ctl)
|
add_connection(struct Listener *listener, rb_fde_t *F, struct sockaddr *sai, struct sockaddr *lai, void *ssl_ctl)
|
||||||
{
|
{
|
||||||
struct Client *new_client;
|
struct Client *new_client;
|
||||||
s_assert(NULL != listener);
|
s_assert(NULL != listener);
|
||||||
|
@ -447,6 +447,7 @@ add_connection(struct Listener *listener, rb_fde_t *F, struct sockaddr *sai, voi
|
||||||
new_client = make_client(NULL);
|
new_client = make_client(NULL);
|
||||||
|
|
||||||
memcpy(&new_client->localClient->ip, sai, sizeof(struct rb_sockaddr_storage));
|
memcpy(&new_client->localClient->ip, sai, sizeof(struct rb_sockaddr_storage));
|
||||||
|
memcpy(&new_client->preClient->lip, lai, sizeof(struct rb_sockaddr_storage));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* copy address to 'sockhost' as a string, copy it to host too
|
* copy address to 'sockhost' as a string, copy it to host too
|
||||||
|
@ -553,7 +554,7 @@ accept_ssld(rb_fde_t *F, struct sockaddr *addr, struct sockaddr *laddr, struct L
|
||||||
rb_fde_t *xF[2];
|
rb_fde_t *xF[2];
|
||||||
rb_socketpair(AF_UNIX, SOCK_STREAM, 0, &xF[0], &xF[1], "Incoming ssld Connection");
|
rb_socketpair(AF_UNIX, SOCK_STREAM, 0, &xF[0], &xF[1], "Incoming ssld Connection");
|
||||||
ctl = start_ssld_accept(F, xF[1], rb_get_fd(xF[0])); /* this will close F for us */
|
ctl = start_ssld_accept(F, xF[1], rb_get_fd(xF[0])); /* this will close F for us */
|
||||||
add_connection(listener, xF[0], addr, ctl);
|
add_connection(listener, xF[0], addr, laddr, ctl);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -567,13 +568,13 @@ accept_callback(rb_fde_t *F, int status, struct sockaddr *addr, rb_socklen_t add
|
||||||
|
|
||||||
if(getsockname(rb_get_fd(F), (struct sockaddr *) &lip, &locallen) < 0)
|
if(getsockname(rb_get_fd(F), (struct sockaddr *) &lip, &locallen) < 0)
|
||||||
{
|
{
|
||||||
/* this shouldn't fail so... */
|
/* this can fail if the connection disappeared in the meantime */
|
||||||
/* XXX add logging of this */
|
|
||||||
rb_close(F);
|
rb_close(F);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(listener->ssl)
|
if(listener->ssl)
|
||||||
accept_ssld(F, addr, (struct sockaddr *)&lip, listener);
|
accept_ssld(F, addr, (struct sockaddr *)&lip, listener);
|
||||||
else
|
else
|
||||||
add_connection(listener, F, addr, NULL);
|
add_connection(listener, F, addr, (struct sockaddr *)&lip, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -560,6 +560,10 @@ conf_end_oper(struct TopConf *tc)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!yy_oper->privset)
|
||||||
|
yy_oper->privset = privilegeset_get("default");
|
||||||
|
|
||||||
/* now, yy_oper_list contains a stack of oper_conf's with just user
|
/* now, yy_oper_list contains a stack of oper_conf's with just user
|
||||||
* and host in, yy_oper contains the rest of the information which
|
* and host in, yy_oper contains the rest of the information which
|
||||||
* we need to copy into each element in yy_oper_list
|
* we need to copy into each element in yy_oper_list
|
||||||
|
@ -630,9 +634,6 @@ static void
|
||||||
conf_set_oper_privset(void *data)
|
conf_set_oper_privset(void *data)
|
||||||
{
|
{
|
||||||
yy_oper->privset = privilegeset_get((char *) data);
|
yy_oper->privset = privilegeset_get((char *) data);
|
||||||
|
|
||||||
if (!yy_oper->privset)
|
|
||||||
yy_oper->privset = privilegeset_get("default");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
10
src/s_auth.c
10
src/s_auth.c
|
@ -297,7 +297,6 @@ static int
|
||||||
start_auth_query(struct AuthRequest *auth)
|
start_auth_query(struct AuthRequest *auth)
|
||||||
{
|
{
|
||||||
struct rb_sockaddr_storage localaddr, destaddr;
|
struct rb_sockaddr_storage localaddr, destaddr;
|
||||||
socklen_t locallen = sizeof(struct rb_sockaddr_storage);
|
|
||||||
rb_fde_t *F;
|
rb_fde_t *F;
|
||||||
int family;
|
int family;
|
||||||
|
|
||||||
|
@ -333,14 +332,7 @@ start_auth_query(struct AuthRequest *auth)
|
||||||
* since the ident request must originate from that same address--
|
* since the ident request must originate from that same address--
|
||||||
* and machines with multiple IP addresses are common now
|
* and machines with multiple IP addresses are common now
|
||||||
*/
|
*/
|
||||||
memset(&localaddr, 0, locallen);
|
localaddr = auth->client->preClient->lip;
|
||||||
if(getsockname(rb_get_fd(auth->client->localClient->F),
|
|
||||||
(struct sockaddr *) &localaddr, &locallen) == -1)
|
|
||||||
{
|
|
||||||
/* can happen if connection was just closed */
|
|
||||||
rb_close(F);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* XXX mangle_mapped_sockaddr((struct sockaddr *)&localaddr); */
|
/* XXX mangle_mapped_sockaddr((struct sockaddr *)&localaddr); */
|
||||||
#ifdef RB_IPV6
|
#ifdef RB_IPV6
|
||||||
|
|
|
@ -975,6 +975,8 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
source_p->localClient->opername = NULL;
|
source_p->localClient->opername = NULL;
|
||||||
|
|
||||||
rb_dlinkFindDestroy(source_p, &local_oper_list);
|
rb_dlinkFindDestroy(source_p, &local_oper_list);
|
||||||
|
privilegeset_unref(source_p->localClient->privset);
|
||||||
|
source_p->localClient->privset = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
rb_dlinkFindDestroy(source_p, &oper_list);
|
rb_dlinkFindDestroy(source_p, &oper_list);
|
||||||
|
|
|
@ -19,7 +19,7 @@ generation=`expr $generation + 1`
|
||||||
|
|
||||||
uname=`uname -a`
|
uname=`uname -a`
|
||||||
|
|
||||||
creation=`date | \
|
creation=`LC_ALL=C date | \
|
||||||
awk '{if (NF == 6) \
|
awk '{if (NF == 6) \
|
||||||
{ print $1 " " $2 " " $3 " " $6 " at " $4 " " $5 } \
|
{ print $1 " " $2 " " $3 " " $6 " at " $4 " " $5 } \
|
||||||
else \
|
else \
|
||||||
|
|
|
@ -1076,7 +1076,6 @@ main(int argc, char **argv)
|
||||||
close(x);
|
close(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
x = open("/dev/null", O_RDWR);
|
x = open("/dev/null", O_RDWR);
|
||||||
if(x >= 0)
|
if(x >= 0)
|
||||||
{
|
{
|
||||||
|
@ -1089,7 +1088,7 @@ main(int argc, char **argv)
|
||||||
if(x > 2)
|
if(x > 2)
|
||||||
close(x);
|
close(x);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
setup_signals();
|
setup_signals();
|
||||||
rb_lib_init(NULL, NULL, NULL, 0, maxfd, 1024, 4096);
|
rb_lib_init(NULL, NULL, NULL, 0, maxfd, 1024, 4096);
|
||||||
rb_init_rawbuffers(1024);
|
rb_init_rawbuffers(1024);
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
echo "Generating certificate request .. "
|
|
||||||
openssl req -new -nodes -out ../etc/req.pem
|
|
||||||
|
|
||||||
echo "Generating self-signed certificate .. "
|
echo "Generating self-signed certificate .. "
|
||||||
openssl req -x509 -days 365 -in ../etc/req.pem -key ../etc/rsa.key -out ../etc/cert.pem
|
openssl req -x509 -nodes -newkey rsa:1024 -keyout ../etc/test.key -out ../etc/test.cert
|
||||||
|
|
||||||
echo "Generating Diffie-Hellman file for secure SSL/TLS negotiation .. "
|
echo "Generating Diffie-Hellman file for secure SSL/TLS negotiation .. "
|
||||||
openssl dhparam -out ../etc/dh.pem 1024
|
openssl dhparam -out ../etc/dh.pem 1024
|
||||||
|
@ -11,8 +8,8 @@ openssl dhparam -out ../etc/dh.pem 1024
|
||||||
echo "
|
echo "
|
||||||
Now change these lines in the IRCd config file:
|
Now change these lines in the IRCd config file:
|
||||||
|
|
||||||
ssl_private_key = "etc/rsa.key";
|
ssl_private_key = "etc/test.key";
|
||||||
ssl_cert = "etc/cert.pem";
|
ssl_cert = "etc/test.cert";
|
||||||
ssl_dh_params = "etc/dh.pem";
|
ssl_dh_params = "etc/dh.pem";
|
||||||
|
|
||||||
Enjoy using ssl.
|
Enjoy using ssl.
|
||||||
|
|
Loading…
Add table
Reference in a new issue