diff options
author | Ermal Luçi <eri@pfsense.org> | 2009-12-28 09:41:47 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2009-12-28 09:42:23 +0000 |
commit | 6955830f96ee6f3912a89e271eb59e501dfe3514 (patch) | |
tree | f1f6cbf3f4e76be76594a04ee0f90a937f49282d /etc/inc/pkg-utils.inc | |
parent | 39618326e0ddd3d79f2596b6a11d9bc09da6ded0 (diff) | |
download | pfsense-6955830f96ee6f3912a89e271eb59e501dfe3514.zip pfsense-6955830f96ee6f3912a89e271eb59e501dfe3514.tar.gz |
Replace some occurrence of /tmp with the propper global variable in attempt to minimize the search for what changes /tmp permissions.
Diffstat (limited to 'etc/inc/pkg-utils.inc')
-rw-r--r-- | etc/inc/pkg-utils.inc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index 8cabced..47bd7dc 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -374,7 +374,7 @@ function pkg_fetch_recursive($pkgname, $filename, $dependlevel = 0, $base_url = global $pkgent, $static_output, $g, $fd_log; $pkg_extension = strrchr($filename, '.'); $static_output .= "\n" . str_repeat(" ", $dependlevel * 2) . $pkgname . " "; - $fetchto = "/tmp/apkg_" . $pkgname . $pkg_extension; + $fetchto = "{$g['tmp_path']}/apkg_" . $pkgname . $pkg_extension; download_file_with_progress_bar($base_url . '/' . $filename, $fetchto); $static_output .= " (extracting)"; update_output_window($static_output); @@ -777,6 +777,7 @@ function delete_package_recursive($pkg) { function delete_package_xml($pkg) { global $g, $config, $fd_log, $static_output, $pkg_interface; + if(($pkgid = get_pkg_id($pkg)) == -1) { $static_output .= "The {$pkg} package is not installed.\n\nDeletion aborted."; update_output_window($static_output); @@ -929,12 +930,12 @@ function delete_package_xml($pkg) { foreach($ctag as $line) { if(trim($line) != "") $towrite[] = $line; } - $tmptab = fopen("/tmp/crontab", "w"); + $tmptab = fopen("{$g['tmp_path']}/crontab", "w"); foreach($towrite as $line) { fwrite($tmptab, $line); } fclose($tmptab); - rename("/tmp/crontab", "/etc/crontab"); + rename("{$g['tmp_path']}/crontab", "/etc/crontab"); } function expand_to_bytes($size) { @@ -1002,4 +1003,4 @@ function squash_from_bytes($size, $round = "") { return; } -?>
\ No newline at end of file +?> |