2014-06-06 Alejandro Gallardo <alejandro.gallardo@artica.es>

* include/functions_snmp_browser.php: Fixed an error.
	
	* index.php: Modified the config.php permission check
	on Windows systems.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10128 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
alexhigh 2014-06-06 09:58:06 +00:00
parent ebd6216a5a
commit 2b8578c44d
3 changed files with 16 additions and 7 deletions

View File

@ -1,3 +1,10 @@
2014-06-06 Alejandro Gallardo <alejandro.gallardo@artica.es>
* include/functions_snmp_browser.php: Fixed an error.
* index.php: Modified the config.php permission check
on Windows systems.
2014-06-06 Hirofumi Kosaka <kosaka@rworks.jp> 2014-06-06 Hirofumi Kosaka <kosaka@rworks.jp>
* godmode/massive/massive_delete_agents.php, * godmode/massive/massive_delete_agents.php,

View File

@ -179,7 +179,7 @@ function snmp_browser_get_tree ($target_ip, $community, $starting_oid = '.', $ve
exec ($snmpwalk_bin . ' -m ALL -v 3 -u ' . escapeshellarg($snmp3_auth_user) . ' -A ' . escapeshellarg($snmp3_auth_pass) . ' -l ' . escapeshellarg($snmp3_security_level) . ' -a ' . escapeshellarg($snmp3_auth_method) . ' -x ' . escapeshellarg($snmp3_privacy_method) . ' -X ' . escapeshellarg($snmp3_privacy_pass) . ' ' . escapeshellarg($target_ip) . ' ' . escapeshellarg($starting_oid) . ' 2> ' . $error_redir_dir, $output, $rc); exec ($snmpwalk_bin . ' -m ALL -v 3 -u ' . escapeshellarg($snmp3_auth_user) . ' -A ' . escapeshellarg($snmp3_auth_pass) . ' -l ' . escapeshellarg($snmp3_security_level) . ' -a ' . escapeshellarg($snmp3_auth_method) . ' -x ' . escapeshellarg($snmp3_privacy_method) . ' -X ' . escapeshellarg($snmp3_privacy_pass) . ' ' . escapeshellarg($target_ip) . ' ' . escapeshellarg($starting_oid) . ' 2> ' . $error_redir_dir, $output, $rc);
} }
else { else {
exec ($snmpwalk_bin . ' -m ALL -M +' . escapeshellarg($config['homedir'] . '/attachment/mibs') . ' -Cc -c ' . escapeshellarg($community) . ' -v ' . escapeshellarg($version) . ' ' . escapeshellarg($target_ip) . ' ' . escapeshellarg($starting_oid) . ' 2> ' . $error_redirection, $output, $rc); exec ($snmpwalk_bin . ' -m ALL -M +' . escapeshellarg($config['homedir'] . '/attachment/mibs') . ' -Cc -c ' . escapeshellarg($community) . ' -v ' . escapeshellarg($version) . ' ' . escapeshellarg($target_ip) . ' ' . escapeshellarg($starting_oid) . ' 2> ' . $error_redir_dir, $output, $rc);
} }
//if ($rc != 0) { //if ($rc != 0) {
// return __('No data'); // return __('No data');

View File

@ -48,6 +48,7 @@ if ($develop_bypass != 1) {
exit; exit;
} }
// Check perms for config.php // Check perms for config.php
if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
if ((substr (sprintf ('%o', fileperms('include/config.php')), -4) != "0600") && if ((substr (sprintf ('%o', fileperms('include/config.php')), -4) != "0600") &&
(substr (sprintf ('%o', fileperms('include/config.php')), -4) != "0660") && (substr (sprintf ('%o', fileperms('include/config.php')), -4) != "0660") &&
(substr (sprintf ('%o', fileperms('include/config.php')), -4) != "0640")) { (substr (sprintf ('%o', fileperms('include/config.php')), -4) != "0640")) {
@ -55,6 +56,7 @@ if ($develop_bypass != 1) {
require('general/error_screen.php'); require('general/error_screen.php');
exit; exit;
} }
}
} }
if ((! file_exists ("include/config.php")) || (! is_readable ("include/config.php"))) { if ((! file_exists ("include/config.php")) || (! is_readable ("include/config.php"))) {