[sslh] Close open pipes at startup

cuma at freetz.org cuma at freetz.org
Sun Feb 17 13:09:55 CET 2013


Hi,
if we execute sslh by our webinterface some pipes stay open. So we are
using this patch [1]. Maybe you want to in include it

[1] http://freetz.org/browser/trunk/make/sslh/patches/no_open_pipes.patch

--- sslh-main.c    2012-12-15 16:29:38.000000000 +0100
+++ sslh-main.c    2013-02-17 03:10:29.849709238 +0100
@@ -486,13 +486,10 @@
    num_addr_listen = start_listen_sockets(&listen_sockets, addr_listen);
 
    if (!foreground) {
-       if (fork() > 0) exit(0); /* Detach */
-
-       /* New session -- become group leader */
-       if (getuid() == 0) {
-           res = setsid();
-           CHECK_RES_DIE(res, "setsid: already process leader");
-       }
+      if (daemon(0,0) < 0) {
+         fprintf(stderr, "Failed to daemonize: %s\n", strerror(errno));
+         exit(1);
+      }
    }
 
    setup_signals();




More information about the sslh mailing list