diff options
author | Chris Buechler <cmb@pfsense.org> | 2016-02-10 01:03:30 -0600 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2016-02-10 01:03:30 -0600 |
commit | 3bec4cd0e8acc4370b27e4538eca6086709dc765 (patch) | |
tree | b696ed579ff96c2b17e3a7a3c75615f192c9538f /src | |
parent | ca46f1de10659f747a4178d8a30242464ecac4a3 (diff) | |
download | pfsense-3bec4cd0e8acc4370b27e4538eca6086709dc765.zip pfsense-3bec4cd0e8acc4370b27e4538eca6086709dc765.tar.gz |
Remove process_alias_unzip, which never worked because of variable typo (at a minimum) and wasn't documented as an available feature so people don't expect to be able to use it.
Diffstat (limited to 'src')
-rw-r--r-- | src/etc/inc/pfsense-utils.inc | 37 | ||||
-rwxr-xr-x | src/usr/local/www/firewall_aliases_edit.php | 2 |
2 files changed, 0 insertions, 39 deletions
diff --git a/src/etc/inc/pfsense-utils.inc b/src/etc/inc/pfsense-utils.inc index 2144593..87039f6 100644 --- a/src/etc/inc/pfsense-utils.inc +++ b/src/etc/inc/pfsense-utils.inc @@ -1999,10 +1999,6 @@ function update_alias_url_data() { if (!process_alias_tgz($temp_filename)) { continue; } - } else if (stripos($alias_url, '.zip')) { - if (!process_alias_unzip($temp_filename)) { - continue; - } } if (file_exists("{$temp_filename}/aliases")) { $address = parse_aliases_file("{$temp_filename}/aliases", $alias['type'], 5000); @@ -2021,39 +2017,6 @@ function update_alias_url_data() { return $updated; } -function process_alias_unzip($temp_filename) { - if (!file_exists("/usr/local/bin/unzip")) { - log_error(gettext("Alias archive is a .zip file which cannot be decompressed because utility is missing!")); - return false; - } - rename("{$temp_filename}/aliases", "{$temp_filename}/aliases.zip"); - mwexec("/usr/local/bin/unzip {$temp_filename}/aliases.tgz -d {$temp_filename}/aliases/"); - unlink("{$temp_filename}/aliases.zip"); - $files_to_process = return_dir_as_array("{$temp_filename}/"); - /* foreach through all extracted files and build up aliases file */ - $fd = @fopen("{$temp_filename}/aliases", "w"); - if (!$fd) { - log_error(gettext("Could not open {$temp_filename}/aliases for writing!")); - return false; - } - foreach ($files_to_process as $f2p) { - $tmpfd = @fopen($f2p, 'r'); - if (!$tmpfd) { - log_error(gettext("The following file could not be read {$f2p} from {$temp_filename}")); - continue; - } - while (($tmpbuf = fread($tmpfd, 65536)) !== FALSE) { - fwrite($fd, $tmpbuf); - } - fclose($tmpfd); - unlink($f2p); - } - fclose($fd); - unset($tmpbuf); - - return true; -} - function process_alias_tgz($temp_filename) { if (!file_exists('/usr/bin/tar')) { log_error(gettext("Alias archive is a .tar/tgz file which cannot be decompressed because utility is missing!")); diff --git a/src/usr/local/www/firewall_aliases_edit.php b/src/usr/local/www/firewall_aliases_edit.php index a071b01..57d5fab 100755 --- a/src/usr/local/www/firewall_aliases_edit.php +++ b/src/usr/local/www/firewall_aliases_edit.php @@ -260,8 +260,6 @@ if ($_POST) { /* if the item is tar gzipped then extract */ if (stristr($_POST['address' . $x], ".tgz")) { process_alias_tgz($temp_filename); - } else if (stristr($_POST['address' . $x], ".zip")) { - process_alias_unzip($temp_filename); } if (!isset($alias['aliasurl'])) { |