Merge pull request #9754 from murrant/snmp-hide-fix

fix snmp debug clipping off quote when obscuring data
This commit is contained in:
TheGreatDoc 2019-01-29 16:43:18 +01:00 committed by GitHub
commit 83a53d7cd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,23 +90,23 @@ function external_exec($command)
if ($debug && !$vdebug) {
$patterns = [
'/-c\' \'[\S]+/',
'/-u\' \'[\S]+/',
'/-U\' \'[\S]+/',
'/-A\' \'[\S]+/',
'/-X\' \'[\S]+/',
'/-P\' \'[\S]+/',
'/-H\' \'[\S]+/',
'/-c\' \'[\S]+\'/',
'/-u\' \'[\S]+\'/',
'/-U\' \'[\S]+\'/',
'/-A\' \'[\S]+\'/',
'/-X\' \'[\S]+\'/',
'/-P\' \'[\S]+\'/',
'/-H\' \'[\S]+\'/',
'/(udp|udp6|tcp|tcp6):([^:]+):([\d]+)/',
];
$replacements = [
'-c\' \'COMMUNITY',
'-u\' \'USER',
'-u\' \'USER',
'-A\' \'PASSWORD',
'-X\' \'PASSWORD',
'-P\' \'PASSWORD',
'-H\' \'HOSTNAME',
'-c\' \'COMMUNITY\'',
'-u\' \'USER\'',
'-U\' \'USER\'',
'-A\' \'PASSWORD\'',
'-X\' \'PASSWORD\'',
'-P\' \'PASSWORD\'',
'-H\' \'HOSTNAME\'',
'\1:HOSTNAME:\3',
];