plugin "encrypted_webinterface":
* fix hang with stunnel newer than v4.20 (Closes: #218)
This commit is contained in:
parent
4301427e26
commit
7928ddecb7
|
@ -57,13 +57,21 @@ def run_stunnel(cert_file, src_port, dst_port, pid_file):
|
||||||
return False
|
return False
|
||||||
## the environment (especially PATH) should be clean, as 'stunnel' cares about
|
## the environment (especially PATH) should be clean, as 'stunnel' cares about
|
||||||
## this in a setuid situation
|
## this in a setuid situation
|
||||||
|
## since stunnel v4.21 the libwrap library is used - this causes a hang,
|
||||||
|
## if stdout and stderr are not redirected to /dev/null
|
||||||
|
## see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=482379
|
||||||
|
try:
|
||||||
|
devnull = open(os.devnull, "w")
|
||||||
|
except OSError, errmsg:
|
||||||
|
sys.stderr.write("Failed to open /dev/null: %s\n" % str(errmsg))
|
||||||
|
return False
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
shell = False,
|
shell = False,
|
||||||
env = {},
|
env = {},
|
||||||
stdin = subprocess.PIPE,
|
stdin = subprocess.PIPE,
|
||||||
args = [ STUNNEL_BIN,
|
stdout = devnull,
|
||||||
"-fd",
|
stderr = devnull,
|
||||||
"0"])
|
args = [STUNNEL_BIN, "-fd", "0"])
|
||||||
proc.stdin.write("setuid = %s\n" % username)
|
proc.stdin.write("setuid = %s\n" % username)
|
||||||
proc.stdin.write("pid = %s\n" % pid_file)
|
proc.stdin.write("pid = %s\n" % pid_file)
|
||||||
proc.stdin.write("[cryptobox-server]\n")
|
proc.stdin.write("[cryptobox-server]\n")
|
||||||
|
|
Loading…
Reference in New Issue