[stunnel-users] stunnel with libwrap does not disconnect from terminal

Lars Kruse lists at sumpfralle.de
Sat Jan 10 13:58:38 CET 2009


Hi,

starting with v4.21, stunnel does not disconnect from the terminal anymore. This
can cause problems, if the caller does not redirect stdout/stderr to /dev/null.
This did not happen with v4.20.

The problem disappears, when I use he "--disable-libwrap" configure switch when
compiling stunnel.

I am running debian testing on i386 with the stunnel4 package 4.22-2.


How to reproduce:

1) stunnel config file:
 setuid = lars
 pid = /tmp/stunnel.pid
 [server]
 connect = 8080
 accept = 443
 cert = /some/file

2) command line:
 cat stunnel.conf | stunnel4 -fd 0

3) process list:
 erker:~/ttt/stunnel/testing/stunnel-4.26# ps -ef| grep stun
 lars     29599     1  0 13:47 pts/1    00:00:00 src/stunnel -fd 0
 lars     29600     1  0 13:47 pts/1    00:00:00 src/stunnel -fd 0
 lars     29601     1  0 13:47 pts/1    00:00:00 src/stunnel -fd 0
 lars     29602     1  0 13:47 pts/1    00:00:00 src/stunnel -fd 0
 lars     29603     1  0 13:47 pts/1    00:00:00 src/stunnel -fd 0
 lars     29604     1  0 13:47 ?        00:00:00 src/stunnel -fd 0

4) FDs of spawned processes:
 erker:~/ttt/stunnel/testing/stunnel-4.26# ls -l /proc/29599/fd
 lrwx------ 1 root root 64 Jan 10 13:50 1 -> /dev/pts/1
 lrwx------ 1 root root 64 Jan 10 13:47 2 -> /dev/pts/1
 lrwx------ 1 root root 64 Jan 10 13:50 3 -> socket:[903037]


Is this the expected behaviour?
I use stunnel in one of my projects (http://cryptonas.org) and it started to
hang with v4.22. After redirecting stdout/stderr to /dev/null, the program
works again.
I assume, that stunnel should take care for stdout/stderr on its own, when
started in daemon mode, right?

thanks for your great work!
Lars



More information about the stunnel-users mailing list