aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorjim-p <jim@pingle.org>2009-10-11 17:06:31 -0400
committerjim-p <jim@pingle.org>2009-10-11 17:06:31 -0400
commit38dad81a2c7e033205f8d2cdb1c4f6a52081bc23 (patch)
tree7d0d25a42e1022dfbb92fc9f326a08ff046351a6 /config
parentfb4ae17aabc42067f11488f843a9bc910a07e512 (diff)
downloadpfsense-packages-38dad81a2c7e033205f8d2cdb1c4f6a52081bc23.tar.gz
pfsense-packages-38dad81a2c7e033205f8d2cdb1c4f6a52081bc23.tar.bz2
pfsense-packages-38dad81a2c7e033205f8d2cdb1c4f6a52081bc23.zip
Add rw/ro calls to TFTP package. May fix its issues on nano
Diffstat (limited to 'config')
-rw-r--r--config/tftp/tftp_files.tmp8
1 files changed, 8 insertions, 0 deletions
diff --git a/config/tftp/tftp_files.tmp b/config/tftp/tftp_files.tmp
index 92d34e70..3141b8fa 100644
--- a/config/tftp/tftp_files.tmp
+++ b/config/tftp/tftp_files.tmp
@@ -33,9 +33,11 @@ require("/usr/local/pkg/tftp.inc");
$filename = $_GET['filename'];
if (($_GET['a'] == "download") && $_GET['t'] == "backup") {
+ conf_mount_rw();
$tmp = '/root/backup/';
$filename = 'tftp.bak.tgz';
system('cd /;tar cvzf /root/backup/tftp.bak.tgz tftpboot');
+ conf_mount_ro();
}
if (($_GET['a'] == "download") && file_exists("/root/backup/".$filename)) {
@@ -62,9 +64,11 @@ if ($_GET['a'] == "other") {
//extract a specific directory to /tftpboot
if (file_exists('/root/backup/'.$filename)) {
//echo "The file $filename exists";
+ conf_mount_rw();
system('cd /; tar xvpfz /root/backup/'.$filename);
system('chmod -R 744 /tftpboot/*');
header( 'Location: tftp_files.php?savemsg=Backup+has+been+restored.' ) ;
+ conf_mount_ro();
}
else {
header( 'Location: tftp_files.php?savemsg=Restore+failed.+Backup+file+not+found.' ) ;
@@ -76,16 +80,20 @@ if ($_GET['a'] == "other") {
if (($_POST['submit'] == "Upload") && is_uploaded_file($_FILES['ulfile']['tmp_name'])) {
+ conf_mount_rw();
move_uploaded_file($_FILES['ulfile']['tmp_name'], "/tftpboot/" . $_FILES['ulfile']['name']);
$savemsg = "Uploaded file to /tftpboot/" . htmlentities($_FILES['ulfile']['name']);
system('chmod -R 744 /tftpboot/*');
unset($_POST['txtCommand']);
+ conf_mount_ro();
}
if ($_GET['act'] == "del") {
if ($_GET['type'] == 'tftp') {
+ conf_mount_rw();
unlink_if_exists("/tftpboot/".$_GET['filename']);
+ conf_mount_ro();
header("Location: tftp_files.php");
exit;
}