From dff5764a0cfce21dd1e48ed0cdf016efe78aa061 Mon Sep 17 00:00:00 2001 From: Eirik Oeverby Date: Sun, 8 Mar 2009 21:34:50 +0100 Subject: Create necessary directories, add 'local =' parameter Ensures stunnel can actually be used after installation. Add optional 'local =' parameter to a tunnel, to force binding to a particular IP for outgoing connections. Useful for transport mode IPSec, or with VPNs in general. Known issues: After (re)install, list of tunnels must be saved once to produce proper config file. Not sure why this isn't happening automagically. Signed-off-by: Bill Marquette Minor tweaks to original patch added as part of this commit --- config/stunnel.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/config/stunnel.xml b/config/stunnel.xml index d2f0dd3a..ef526309 100644 --- a/config/stunnel.xml +++ b/config/stunnel.xml @@ -149,16 +149,16 @@ /dev/null"); - chmod("/usr/local/etc/stunnel/stunnel.pem", 600); - system("/bin/mkdir -p /var/tmp/stunnel/var/tmp/run/stunnel"); - system("/usr/sbin/chown -R stunnel:stunnel /var/tmp/stunnel"); + safe_mkdir("/usr/local/etc/stunnel"); + system("/usr/bin/openssl req -new -x509 -days 365 -nodes -out /usr/local/etc/stunnel/stunnel.pem -keyout /usr/local/etc/stunnel/stunnel.pem 2>/dev/null"); + chmod("/usr/local/etc/stunnel/stunnel.pem", 600); + make_dirs("/var/tmp/stunnel/var/tmp/run/stunnel"); + system("/usr/sbin/chown -R stunnel:stunnel /var/tmp/stunnel"); $_rcfile['file']='stunnel.sh'; $_rcfile['start'].="/usr/local/bin/stunnel /usr/local/etc/stunnel/stunnel.conf \n\t"; $_rcfile['stop'].="killall stunnel \n\t"; write_rcfile($_rcfile); - system("rm /usr/local/etc/rc.d/stunnel"); + unlink_if_exists("/usr/local/etc/rc.d/stunnel"); conf_mount_rw(); config_lock(); @@ -183,7 +183,7 @@ -- cgit v1.2.3