Skip to content

Commit 51f8dc9

Browse files
author
Thom Pol
committed
Enable TLS for PureFTPd if certificate file exists (#6263)
1 parent 9954d8f commit 51f8dc9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

install/dist/lib/gentoo.lib.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,13 @@ public function configure_pureftpd()
506506
*/
507507

508508

509-
$content = preg_replace('/MISC_OTHER="[^"]+"/', 'MISC_OTHER="-b -A -E -Z -D -H -O clf:'.$logdir.'/transfer.log"', $content);
509+
//* Enable TLS if certificate file exists
510+
$enable_tls = '';
511+
if(file_exists('/etc/ssl/private/pure-ftpd.pem')) {
512+
$enable_tls = ' -Y 1';
513+
}
514+
515+
$content = preg_replace('/MISC_OTHER="[^"]+"/', 'MISC_OTHER="-b -A -E -Z -D -H -O clf:'.$logdir.'/transfer.log'.$enable_tls.'"', $content);
510516

511517
$this->write_config_file($conf['pureftpd']['config_file'], $content);
512518
}

0 commit comments

Comments
 (0)