aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2014-11-24 09:14:22 -0500
committerjim-p <jimp@pfsense.org>2014-11-24 09:15:19 -0500
commitfe6da2a94b93b769a664c5ec019bfe33ff048bce (patch)
tree54c1a11857e4d2e5d34829b5025e4b376cbbd1fc
parent47c892d0e3a21da98ddb164a62ea815a34c36914 (diff)
downloadpfsense-packages-fe6da2a94b93b769a664c5ec019bfe33ff048bce.tar.gz
pfsense-packages-fe6da2a94b93b769a664c5ec019bfe33ff048bce.tar.bz2
pfsense-packages-fe6da2a94b93b769a664c5ec019bfe33ff048bce.zip
Add some "install" code for nmap to check for the OUI database and symlink it if necessary.
-rw-r--r--config/nmap/nmap.inc22
-rw-r--r--config/nmap/nmap.xml5
-rw-r--r--pkg_config.10.xml2
-rw-r--r--pkg_config.8.xml2
-rw-r--r--pkg_config.8.xml.amd642
5 files changed, 29 insertions, 4 deletions
diff --git a/config/nmap/nmap.inc b/config/nmap/nmap.inc
index 272f27ef..f66f6be9 100644
--- a/config/nmap/nmap.inc
+++ b/config/nmap/nmap.inc
@@ -28,6 +28,28 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+function nmap_install() {
+ $destination_file = "/usr/local/share/nmap/nmap-mac-prefixes";
+ $pfs_version = substr(trim(file_get_contents("/etc/version")),0,3);
+ switch ($pfs_version) {
+ case "1.2":
+ case "2.0":
+ return null;
+ case "2.1":
+ $source_file = "/usr/pbi/nmap-" . php_uname("m") . "/share/nmap/nmap-mac-prefixes";
+ break;
+ default:
+ $source_file = "/usr/pbi/nmap-" . php_uname("m") . "/local/share/nmap/nmap-mac-prefixes";
+ }
+ /* Only copy the file if it doesn't exist */
+ if (file_exists($source_file) && !file_exists($destination_file)) {
+ if (!is_dir(dirname($destination_file))) {
+ @mkdir(dirname($destination_file), 0644, true);
+ }
+ @symlink($source_file, $destination_file);
+ }
+}
+
function nmap_custom_php_validation_command($post, & $input_errors) {
global $_POST, $savemsg, $config;
if (empty($_POST['hostname'])) {
diff --git a/config/nmap/nmap.xml b/config/nmap/nmap.xml
index b07b3982..ad0f8e0a 100644
--- a/config/nmap/nmap.xml
+++ b/config/nmap/nmap.xml
@@ -46,7 +46,7 @@
<requirements>Describe your package requirements here</requirements>
<faq>Currently there are no FAQ items provided.</faq>
<name>nmap</name>
- <version>6.40_2 pkg v1.2.1</version>
+ <version>6.40_2 pkg v1.3</version>
<title>Diagnostics: NMap</title>
<savetext>Scan</savetext>
<preoutput>yes</preoutput>
@@ -122,4 +122,7 @@
<custom_php_validation_command>
nmap_custom_php_validation_command($_POST, $input_errors);
</custom_php_validation_command>
+ <custom_php_install_command>
+ nmap_install();
+ </custom_php_install_command>
</packagegui>
diff --git a/pkg_config.10.xml b/pkg_config.10.xml
index df48fd80..219f17b3 100644
--- a/pkg_config.10.xml
+++ b/pkg_config.10.xml
@@ -684,7 +684,7 @@
<category>Security</category>
<depends_on_package_pbi>nmap-6.46-##ARCH##.pbi</depends_on_package_pbi>
<config_file>https://packages.pfsense.org/packages/config/nmap/nmap.xml</config_file>
- <version>nmap-6.46 pkg v1.2.2</version>
+ <version>nmap-6.46 pkg v1.3</version>
<status>Stable</status>
<pkginfolink>https://doc.pfsense.org/index.php/Nmap_package</pkginfolink>
<required_version>2.2</required_version>
diff --git a/pkg_config.8.xml b/pkg_config.8.xml
index a84223a7..9ee9ab4b 100644
--- a/pkg_config.8.xml
+++ b/pkg_config.8.xml
@@ -882,7 +882,7 @@
<depends_on_package>nmap-6.25_1.tbz</depends_on_package>
<depends_on_package_pbi>nmap-6.40_2-i386.pbi</depends_on_package_pbi>
<config_file>https://packages.pfsense.org/packages/config/nmap/nmap.xml</config_file>
- <version>nmap-6.40_2 pkg v1.2.2</version>
+ <version>nmap-6.40_2 pkg v1.3</version>
<status>Stable</status>
<pkginfolink>https://doc.pfsense.org/index.php/Nmap_package</pkginfolink>
<required_version>2.0</required_version>
diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64
index 6d04672e..a1efb462 100644
--- a/pkg_config.8.xml.amd64
+++ b/pkg_config.8.xml.amd64
@@ -869,7 +869,7 @@
<depends_on_package>nmap-6.25_1.tbz</depends_on_package>
<depends_on_package_pbi>nmap-6.40_2-amd64.pbi</depends_on_package_pbi>
<config_file>https://packages.pfsense.org/packages/config/nmap/nmap.xml</config_file>
- <version>nmap-6.40_2 pkg v1.2.2</version>
+ <version>nmap-6.40_2 pkg v1.3</version>
<status>Stable</status>
<pkginfolink>https://doc.pfsense.org/index.php/Nmap_package</pkginfolink>
<required_version>2.0</required_version>