diff options
author | doktornotor <notordoktor@gmail.com> | 2015-10-31 10:57:11 +0100 |
---|---|---|
committer | doktornotor <notordoktor@gmail.com> | 2015-10-31 10:57:11 +0100 |
commit | 0c89aa154393f06c752187896922b5ba058ab1a2 (patch) | |
tree | f702e8670c9f97ca7a375642ed53aa49d1b1c383 | |
parent | 1b29b2b5314452ed4ee16bc89ec3dd2f046f3e68 (diff) | |
download | pfsense-packages-0c89aa154393f06c752187896922b5ba058ab1a2.tar.gz pfsense-packages-0c89aa154393f06c752187896922b5ba058ab1a2.tar.bz2 pfsense-packages-0c89aa154393f06c752187896922b5ba058ab1a2.zip |
Use mwexec(), cleanups
-rw-r--r-- | config/tftp2/tftp.inc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/config/tftp2/tftp.inc b/config/tftp2/tftp.inc index 67054619..75ddaac8 100644 --- a/config/tftp2/tftp.inc +++ b/config/tftp2/tftp.inc @@ -50,10 +50,10 @@ function tftp_install_command() { // Restore backup if it exists if (file_exists($tftpbackup)) { - system("/usr/bin/tar xvpfz {$tftpbackup} -C /"); - system("/bin/chmod -R 0744 {$tftpdir}/*"); - unset($tftpbackup); + mwexec("/usr/bin/tar xvpfz {$tftpbackup} -C /"); + mwexec("/bin/chmod -R 0744 {$tftpdir}/*"); } + unset($tftpdir, $tftpbackup); } function tftp_deinstall_command() { @@ -68,11 +68,9 @@ function tftp_generate_rules($type) { return; } - // Open inetd.conf write handle + // Add tftpd daemon to inetd $inetd_fd = fopen("/var/etc/inetd.conf", "a+"); - // Add tftp daemon fwrite($inetd_fd, "tftp\t\tdgram\tudp\twait\t\troot\t/usr/libexec/tftpd\ttftpd /tftpboot\n"); - // Close file handle fclose($inetd_fd); if (!empty($config['installedpackages']['tftpd']['config'][0]['tftpdinterface'])) { |