Browse Source

plugin "encrypted_webinterface":

* fix hang with stunnel newer than v4.20 (Closes: #218)
master
lars 13 years ago
parent
commit
7928ddecb7
  1. 14
      plugins/encrypted_webinterface/root_action.py

14
plugins/encrypted_webinterface/root_action.py

@ -57,13 +57,21 @@ def run_stunnel(cert_file, src_port, dst_port, pid_file):
return False
## the environment (especially PATH) should be clean, as 'stunnel' cares about
## 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(
shell = False,
env = {},
stdin = subprocess.PIPE,
args = [ STUNNEL_BIN,
"-fd",
"0"])
stdout = devnull,
stderr = devnull,
args = [STUNNEL_BIN, "-fd", "0"])
proc.stdin.write("setuid = %s\n" % username)
proc.stdin.write("pid = %s\n" % pid_file)
proc.stdin.write("[cryptobox-server]\n")

Loading…
Cancel
Save