#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;
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))
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++;
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);
/* 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