X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/6ce8910d97424320108dc438325c044f0060ab27..cb097b8840594b6a77aab21d0b4c20f036a7d012:/src/s_serv.c diff --git a/src/s_serv.c b/src/s_serv.c index 5aeee20..0cd1369 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -59,10 +59,6 @@ #define INADDR_NONE ((unsigned int) 0xffffffff) #endif -#ifndef HAVE_SOCKETPAIR -static int inet_socketpair(int d, int type, int protocol, int sv[2]); -#endif - int MaxConnectionCount = 1; int MaxClientCount = 1; int refresh_user_links = 0; @@ -510,6 +506,10 @@ burst_TS6(struct Client *client_p) IsIPSpoof(target_p) ? "0" : target_p->sockhost, target_p->id, target_p->info); + if(!EmptyString(target_p->certfp)) + sendto_one(client_p, ":%s ENCAP * CERTFP :%s", + use_id(target_p), target_p->certfp); + if(!IsCapable(client_p, CAP_EUID)) { if(IsDynSpoof(target_p)) @@ -547,8 +547,12 @@ burst_TS6(struct Client *client_p) msptr = uptr->data; tlen = strlen(use_id(msptr->client_p)) + 1; + if(is_owner(msptr)) + tlen++; if(is_chanop(msptr)) tlen++; + if(is_halfop(msptr)) + tlen++; if(is_voiced(msptr)) tlen++; @@ -1161,7 +1165,13 @@ serv_connect_ssl_callback(rb_fde_t *F, int status, void *data) serv_connect_callback(F, status, data); return; } - rb_socketpair(AF_UNIX, SOCK_STREAM, 0, &xF[0], &xF[1], "Outgoing ssld connection"); + if(rb_socketpair(AF_UNIX, SOCK_STREAM, 0, &xF[0], &xF[1], "Outgoing ssld connection") == -1) + { + ilog_error("rb_socketpair failed for server"); + serv_connect_callback(F, RB_ERROR, data); + return; + + } del_from_cli_fd_hash(client_p); client_p->localClient->F = xF[0]; add_to_cli_fd_hash(client_p); @@ -1285,60 +1295,3 @@ serv_connect_callback(rb_fde_t *F, int status, void *data) /* If we get here, we're ok, so lets start reading some data */ read_packet(F, client_p); } - -#ifndef HAVE_SOCKETPAIR -static int -inet_socketpair(int d, int type, int protocol, int sv[2]) -{ - struct sockaddr_in addr1, addr2, addr3; - int addr3_len = sizeof(addr3); - int fd, rc; - int port_no = 20000; - - if(d != AF_INET || type != SOCK_STREAM || protocol) - { - errno = EAFNOSUPPORT; - return -1; - } - if(((sv[0] = socket(AF_INET, SOCK_STREAM, 0)) < 0) || ((sv[1] = socket(AF_INET, SOCK_STREAM, 0)) < 0)) - return -1; - - addr1.sin_port = htons(port_no); - addr1.sin_family = AF_INET; - addr1.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - while ((rc = bind (sv[0], (struct sockaddr *) &addr1, sizeof (addr1))) < 0 && errno == EADDRINUSE) - addr1.sin_port = htons(++port_no); - - if(rc < 0) - return -1; - - if(listen(sv[0], 1) < 0) - { - close(sv[0]); - close(sv[1]); - return -1; - } - - addr2.sin_port = htons(port_no); - addr2.sin_family = AF_INET; - addr2.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - if(connect (sv[1], (struct sockaddr *) &addr2, sizeof (addr2)) < 0) - { - close(sv[0]); - close(sv[1]); - return -1; - } - - if((fd = accept(sv[1], (struct sockaddr *) &addr3, &addr3_len)) < 0) - { - close(sv[0]); - close(sv[1]); - return -1; - } - close(sv[0]); - sv[0] = fd; - - return(0); - -} -#endif