]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/sslproc.c
presence: Add _butone() variant of sendto_common_channels_local_with_capability().
[irc/rqf/shadowircd.git] / src / sslproc.c
index 4789e86f197e26ef70709688c54368f0b72d147d..573482a5e5aa303d32b8e96b736b604cc69ee75d 100644 (file)
@@ -284,12 +284,21 @@ start_ssldaemon(int count, const char *ssl_cert, const char *ssl_private_key, co
        for(i = 0; i < count; i++)
        {
                ssl_ctl_t *ctl;
-               rb_socketpair(AF_UNIX, SOCK_DGRAM, 0, &F1, &F2, "SSL/TLS handle passing socket");
+               if(rb_socketpair(AF_UNIX, SOCK_DGRAM, 0, &F1, &F2, "SSL/TLS handle passing socket") == -1)
+               {
+                       ilog(L_MAIN, "Unable to create ssld - rb_socketpair failed: %s", strerror(errno));
+                       return started;
+               }
+               
                rb_set_buffers(F1, READBUF_SIZE);
                rb_set_buffers(F2, READBUF_SIZE);
                rb_snprintf(fdarg, sizeof(fdarg), "%d", rb_get_fd(F2));
                rb_setenv("CTL_FD", fdarg, 1);
-               rb_pipe(&P1, &P2, "SSL/TLS pipe");
+               if(rb_pipe(&P1, &P2, "SSL/TLS pipe") == -1)
+               {
+                       ilog(L_MAIN, "Unable to create ssld - rb_pipe failed: %s", strerror(errno));
+                       return started;
+               }
                rb_snprintf(fdarg, sizeof(fdarg), "%d", rb_get_fd(P1));
                rb_setenv("CTL_PIPE", fdarg, 1);
                rb_snprintf(s_pid, sizeof(s_pid), "%d", (int)getpid());
@@ -740,8 +749,14 @@ start_zlib_session(void *data)
 
        /* Pass the socket to ssld. */
        *buf = 'Z';
-       rb_socketpair(AF_UNIX, SOCK_STREAM, 0, &xF1, &xF2, "Initial zlib socketpairs");
-
+       if(rb_socketpair(AF_UNIX, SOCK_STREAM, 0, &xF1, &xF2, "Initial zlib socketpairs") == -1)
+       {
+               sendto_realops_snomask(SNO_GENERAL, L_ALL, "Error creating zlib socketpair - %s", strerror(errno));
+               ilog(L_MAIN, "Error creating zlib socketpairs - %s", strerror(errno));
+               exit_client(server, server, server, "Error creating zlib socketpair");
+               return;
+       }
+       
        if(IsSSL(server))
        {
                /* tell ssld the new connid for the ssl part*/