mirror of
https://github.com/matrix-construct/construct
synced 2025-01-02 19:04:17 +01:00
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)
|
||||
[/] Bug fixes
|
||||
[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
|
||||
[ ] ircd shouldn't need bison/byacc/yacc or flex for compilation
|
||||
--- other stuff
|
||||
|
|
|
@ -298,6 +298,8 @@ struct PreClient
|
|||
|
||||
rb_dlink_list dnsbl_queries; /* list of struct BlacklistClient * */
|
||||
struct Blacklist *dnsbl_listed; /* first dnsbl where it's listed */
|
||||
|
||||
struct rb_sockaddr_storage lip; /* address of our side of the connection */
|
||||
};
|
||||
|
||||
struct ListClient
|
||||
|
|
|
@ -916,7 +916,6 @@ handle_special(int p_or_n, const char *command, struct Client *client_p,
|
|||
struct Client *target_p;
|
||||
char *server;
|
||||
char *s;
|
||||
int count;
|
||||
|
||||
/* user[%host]@server addressed?
|
||||
* 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;
|
||||
}
|
||||
|
||||
count = 0;
|
||||
|
||||
if(!IsOper(source_p))
|
||||
{
|
||||
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
|
||||
* 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_realops_snomask(SNO_GENERAL, L_ALL,
|
||||
|
|
|
@ -239,16 +239,9 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
|
|||
char *t;
|
||||
int tlen;
|
||||
hook_data_client hdata;
|
||||
char *name;
|
||||
char quest[] = "?";
|
||||
int visible;
|
||||
int extra_space = 0;
|
||||
|
||||
if(target_p->name[0] == '\0')
|
||||
name = quest;
|
||||
else
|
||||
name = target_p->name;
|
||||
|
||||
if(target_p->user == NULL)
|
||||
{
|
||||
s_assert(0);
|
||||
|
|
|
@ -1361,15 +1361,12 @@ static int
|
|||
qs_server(struct Client *client_p, struct Client *source_p, struct Client *from,
|
||||
const char *comment)
|
||||
{
|
||||
struct Client *target_p;
|
||||
|
||||
if(source_p->servptr && source_p->servptr->serv)
|
||||
rb_dlinkDelete(&source_p->lnode, &source_p->servptr->serv->servers);
|
||||
else
|
||||
s_assert(0);
|
||||
|
||||
rb_dlinkFindDestroy(source_p, &global_serv_list);
|
||||
target_p = source_p->from;
|
||||
|
||||
if(has_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)
|
||||
{
|
||||
const char *p;
|
||||
int invert = 0, result = EXTBAN_INVALID;
|
||||
int result = EXTBAN_INVALID;
|
||||
ExtbanFunc f;
|
||||
|
||||
if (*banstr != '$')
|
||||
return 0;
|
||||
p = banstr + 1;
|
||||
if (*p == '~')
|
||||
{
|
||||
invert = 1;
|
||||
p++;
|
||||
}
|
||||
f = extban_table[(unsigned char) ToLower(*p)];
|
||||
if (*p != '\0')
|
||||
{
|
||||
|
|
|
@ -446,7 +446,6 @@ find_exact_conf_by_address(const char *address, int type, const char *username)
|
|||
|
||||
if(address == NULL)
|
||||
address = "/NOMATCH!/";
|
||||
arec = rb_malloc(sizeof(struct AddressRec));
|
||||
masktype = parse_netmask(address, (struct sockaddr *)&addr, &bits);
|
||||
#ifdef RB_IPV6
|
||||
if(masktype == HM_IPV6)
|
||||
|
|
|
@ -435,7 +435,7 @@ close_listeners()
|
|||
* any client list yet.
|
||||
*/
|
||||
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;
|
||||
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);
|
||||
|
||||
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
|
||||
|
@ -553,7 +554,7 @@ accept_ssld(rb_fde_t *F, struct sockaddr *addr, struct sockaddr *laddr, struct L
|
|||
rb_fde_t *xF[2];
|
||||
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 */
|
||||
add_connection(listener, xF[0], addr, ctl);
|
||||
add_connection(listener, xF[0], addr, laddr, ctl);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
/* this shouldn't fail so... */
|
||||
/* XXX add logging of this */
|
||||
/* this can fail if the connection disappeared in the meantime */
|
||||
rb_close(F);
|
||||
return;
|
||||
}
|
||||
|
||||
if(listener->ssl)
|
||||
accept_ssld(F, addr, (struct sockaddr *)&lip, listener);
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
if (!yy_oper->privset)
|
||||
yy_oper->privset = privilegeset_get("default");
|
||||
|
||||
/* 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
|
||||
* we need to copy into each element in yy_oper_list
|
||||
|
@ -630,9 +634,6 @@ static void
|
|||
conf_set_oper_privset(void *data)
|
||||
{
|
||||
yy_oper->privset = privilegeset_get((char *) data);
|
||||
|
||||
if (!yy_oper->privset)
|
||||
yy_oper->privset = privilegeset_get("default");
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
10
src/s_auth.c
10
src/s_auth.c
|
@ -297,7 +297,6 @@ static int
|
|||
start_auth_query(struct AuthRequest *auth)
|
||||
{
|
||||
struct rb_sockaddr_storage localaddr, destaddr;
|
||||
socklen_t locallen = sizeof(struct rb_sockaddr_storage);
|
||||
rb_fde_t *F;
|
||||
int family;
|
||||
|
||||
|
@ -333,14 +332,7 @@ start_auth_query(struct AuthRequest *auth)
|
|||
* since the ident request must originate from that same address--
|
||||
* and machines with multiple IP addresses are common now
|
||||
*/
|
||||
memset(&localaddr, 0, locallen);
|
||||
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;
|
||||
}
|
||||
localaddr = auth->client->preClient->lip;
|
||||
|
||||
/* XXX mangle_mapped_sockaddr((struct sockaddr *)&localaddr); */
|
||||
#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;
|
||||
|
||||
rb_dlinkFindDestroy(source_p, &local_oper_list);
|
||||
privilegeset_unref(source_p->localClient->privset);
|
||||
source_p->localClient->privset = NULL;
|
||||
}
|
||||
|
||||
rb_dlinkFindDestroy(source_p, &oper_list);
|
||||
|
|
|
@ -19,7 +19,7 @@ generation=`expr $generation + 1`
|
|||
|
||||
uname=`uname -a`
|
||||
|
||||
creation=`date | \
|
||||
creation=`LC_ALL=C date | \
|
||||
awk '{if (NF == 6) \
|
||||
{ print $1 " " $2 " " $3 " " $6 " at " $4 " " $5 } \
|
||||
else \
|
||||
|
|
|
@ -1076,7 +1076,6 @@ main(int argc, char **argv)
|
|||
close(x);
|
||||
}
|
||||
|
||||
#if 0
|
||||
x = open("/dev/null", O_RDWR);
|
||||
if(x >= 0)
|
||||
{
|
||||
|
@ -1089,7 +1088,7 @@ main(int argc, char **argv)
|
|||
if(x > 2)
|
||||
close(x);
|
||||
}
|
||||
#endif
|
||||
|
||||
setup_signals();
|
||||
rb_lib_init(NULL, NULL, NULL, 0, maxfd, 1024, 4096);
|
||||
rb_init_rawbuffers(1024);
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
#!/bin/sh
|
||||
echo "Generating certificate request .. "
|
||||
openssl req -new -nodes -out ../etc/req.pem
|
||||
|
||||
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 .. "
|
||||
openssl dhparam -out ../etc/dh.pem 1024
|
||||
|
@ -11,8 +8,8 @@ openssl dhparam -out ../etc/dh.pem 1024
|
|||
echo "
|
||||
Now change these lines in the IRCd config file:
|
||||
|
||||
ssl_private_key = "etc/rsa.key";
|
||||
ssl_cert = "etc/cert.pem";
|
||||
ssl_private_key = "etc/test.key";
|
||||
ssl_cert = "etc/test.cert";
|
||||
ssl_dh_params = "etc/dh.pem";
|
||||
|
||||
Enjoy using ssl.
|
||||
|
|
Loading…
Reference in a new issue