summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2016-01-25 10:25:21 -0500
committerStephen Beaver <sbeaver@netgate.com>2016-01-25 10:25:21 -0500
commit35c7fbb9f44d708e39ab50d9530abae4f5d332c4 (patch)
treea237757c03de782aa3061abf5224e1d8276ee3e8 /src
parent3f926b7abdf1f5f14d4b207f5a0ad5fafdb6f39e (diff)
parentae2915a4e9a3e351d849d0b3074981ea726a6449 (diff)
downloadpfsense-35c7fbb9f44d708e39ab50d9530abae4f5d332c4.zip
pfsense-35c7fbb9f44d708e39ab50d9530abae4f5d332c4.tar.gz
Merge pull request #2529 from phil-davis/patch-7
Diffstat (limited to 'src')
-rwxr-xr-xsrc/usr/local/www/pkg.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/usr/local/www/pkg.php b/src/usr/local/www/pkg.php
index 005495f..ac085b4 100755
--- a/src/usr/local/www/pkg.php
+++ b/src/usr/local/www/pkg.php
@@ -77,10 +77,20 @@ if ($xml == "") {
} else {
$pkg_xml_prefix = "/usr/local/pkg/";
$pkg_full_path = "{$pkg_xml_prefix}/{$xml}";
- if (substr_compare(realpath($pkg_full_path), $pkg_xml_prefix, 0, strlen($pkg_xml_prefix))) {
- print_info_box(gettext("ERROR: Invalid path specified."));
+ $pkg_realpath = realpath($pkg_full_path);
+ if (empty($pkg_realpath)) {
+ $path_error = sprintf(gettext("ERROR: Package path %s not found."), htmlspecialchars($pkg_full_path));
+ } else if (substr_compare($pkg_realpath, $pkg_xml_prefix, 0, strlen($pkg_xml_prefix))) {
+ $path_error = sprintf(gettext("ERROR: Invalid path %s specified."), htmlspecialchars($pkg_full_path));
+ }
+
+ if (!empty($path_error)) {
+ include("head.inc");
+ print_info_box($path_error . "<br />" . gettext("Try reinstalling the package."));
+ include("foot.inc");
die;
}
+
if (file_exists($pkg_full_path)) {
$pkg = parse_xml_config_pkg($pkg_full_path, "packagegui");
} else {
OpenPOWER on IntegriCloud