diff options
author | jim-p <jimp@pfsense.org> | 2017-01-07 18:57:06 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2017-01-07 18:57:06 -0500 |
commit | 43de83978ed93c9a4886e2844e341af0f3fe9a05 (patch) | |
tree | 8ebe76e2eba00513ff7acffe66d6eeb4596dc5c5 | |
parent | 9a54824095c4b809326e5326877c20d40cb07fab (diff) | |
download | pfsense-43de83978ed93c9a4886e2844e341af0f3fe9a05.zip pfsense-43de83978ed93c9a4886e2844e341af0f3fe9a05.tar.gz |
Don't allow SNMP hostres module to be selected or used with VMware VMs that have a CD/DVD Drive device. Fixes #6882
-rw-r--r-- | src/etc/inc/services.inc | 3 | ||||
-rw-r--r-- | src/usr/local/www/services_snmp.php | 24 |
2 files changed, 20 insertions, 7 deletions
diff --git a/src/etc/inc/services.inc b/src/etc/inc/services.inc index 7b02bbd..57c4181 100644 --- a/src/etc/inc/services.inc +++ b/src/etc/inc/services.inc @@ -2470,7 +2470,8 @@ begemotSnmpdModulePath."pf" = "/usr/lib/snmp_pf.so" EOD; } - if (isset($config['snmpd']['modules']['hostres'])) { + if (isset($config['snmpd']['modules']['hostres']) + && !(($specplatform['name'] == 'VMware') && (file_exists('/dev/cd0')))) { $snmpdconf .= <<<EOD begemotSnmpdModulePath."hostres" = "/usr/lib/snmp_hostres.so" diff --git a/src/usr/local/www/services_snmp.php b/src/usr/local/www/services_snmp.php index 66caf4f..e138300 100644 --- a/src/usr/local/www/services_snmp.php +++ b/src/usr/local/www/services_snmp.php @@ -33,6 +33,8 @@ require_once("guiconfig.inc"); require_once("functions.inc"); +$specplatform = system_identify_specific_platform(); + if (!is_array($config['snmpd'])) { $config['snmpd'] = array(); $config['snmpd']['rocommunity'] = "public"; @@ -316,12 +318,14 @@ $group->add(new Form_MultiCheckbox( $pconfig['pf'] )); -$group->add(new Form_MultiCheckbox( - 'hostres', - null, - 'Host Resources', - $pconfig['hostres'] -)); +if (!(($specplatform['name'] == 'VMware') && (file_exists('/dev/cd0')))) { + $group->add(new Form_MultiCheckbox( + 'hostres', + null, + 'Host Resources', + $pconfig['hostres'] + )); +} $group->add(new Form_MultiCheckbox( 'ucd', @@ -338,6 +342,14 @@ $group->add(new Form_MultiCheckbox( )); $section->add($group); +if ((($specplatform['name'] == 'VMware') && (file_exists('/dev/cd0')))) { + $section->addInput(new Form_StaticText( + NULL, + NULL + ))->setHelp(sprint_info_box('The hostres module is not compatible with VMware virtual ' . + 'machines configured with a virtual CD/DVD Drive.', 'warning', false)); +} + $form->add($section); $section = new Form_Section('Interface Binding'); |