From 51f8dc9f935db36380b353b6f0b2844cef48021a Mon Sep 17 00:00:00 2001 From: Thom Pol Date: Sat, 26 Feb 2022 22:28:19 +0100 Subject: [PATCH] Enable TLS for PureFTPd if certificate file exists (#6263) --- install/dist/lib/gentoo.lib.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/install/dist/lib/gentoo.lib.php b/install/dist/lib/gentoo.lib.php index ebb742a368..c98788e33c 100644 --- a/install/dist/lib/gentoo.lib.php +++ b/install/dist/lib/gentoo.lib.php @@ -506,7 +506,13 @@ class installer extends installer_base */ - $content = preg_replace('/MISC_OTHER="[^"]+"/', 'MISC_OTHER="-b -A -E -Z -D -H -O clf:'.$logdir.'/transfer.log"', $content); + //* Enable TLS if certificate file exists + $enable_tls = ''; + if(file_exists('/etc/ssl/private/pure-ftpd.pem')) { + $enable_tls = ' -Y 1'; + } + + $content = preg_replace('/MISC_OTHER="[^"]+"/', 'MISC_OTHER="-b -A -E -Z -D -H -O clf:'.$logdir.'/transfer.log'.$enable_tls.'"', $content); $this->write_config_file($conf['pureftpd']['config_file'], $content); } -- GitLab