diff options
-rw-r--r-- | packages/stunnel.xml | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/packages/stunnel.xml b/packages/stunnel.xml index a9e9b36d..1fa6fbb3 100644 --- a/packages/stunnel.xml +++ b/packages/stunnel.xml @@ -72,14 +72,12 @@ </field> </fields> <custom_php_install_command> - system("mkdir /usr/local/etc/stunnel 2>/dev/null"); - system("mkdir /var/tmp/stunnel 2>/dev/null"); + 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"); - system("chmod a-r /usr/local/etc/stunnel/stunnel.pem"); - system("chmod u+r /usr/local/etc/stunnel/stunnel.pem"); - system("mkdir -p /var/tmp/stunnel/var/tmp"); - system("chmod a+rw /var/tmp/stunnel/var/tmp/."); - system("mv /usr/local/etc/rc.d/stunnel.sh.sample /usr/local/etc/rc.d/stunnel.sh"); + chmod("/usr/local/etc/stunnel/stunnel.pem", 600); + make_dirs("/var/tmp/stunnel/var/tmp"); + chmod("/var/tmp/stunnel/var/tmp/", 1777); + copy("/usr/local/etc/rc.d/stunnel.sh.sample", "/usr/local/etc/rc.d/stunnel.sh"); chmod("/usr/local/etc/rc.d/stunnel.sh", 0555); </custom_php_install_command> <custom_php_deinstall_command> @@ -90,7 +88,7 @@ conf_mount_rw(); config_lock(); $fout = fopen("/usr/local/etc/stunnel/stunnel.conf","w"); - fwrite($fout, "cert = /usr/local/etc/stunnel/mail.pem \n"); + fwrite($fout, "cert = /usr/local/etc/stunnel/stunnel.pem \n"); fwrite($fout, "chroot = /var/tmp/stunnel \n"); fwrite($fout, "setuid = stunnel \n"); fwrite($fout, "setgid = stunnel \n"); |