Ok In finally figured out what was going on for certain and have it fixed for my installation.
In my particular install it just so happens that our SNMP community string contains a % symbol. In fact not only does it contain the % symbol, but it just so happens that the % symbol is immediately followed in the SNMP community string by an s. So the problem came in on this line in php.c
Code: Select all
snprintf(command, sizeof(command), php_command, strlen(php_command));
From what I can tell here, I'm not really sure why you're using the snprintf function here, as basically what you are trying to accomplish is to copy the string from php_command into command which is a character array with 5 more characters then the length of php_command. Then you add the /r/n to the end of it in the next line of code.
For now on my install I replace the above line with the following:
Unless I'm missing something that is all that is necessary in this case. with the snprintf function anyone who happens to have a %s in their SNMP community string (admitably probably pretty slim) will segfault at this point because the snprintf fucntion trys to find an argument to plug in place of the %s in the php_command, and can't find it.
Can anyone tell me a specific reason why strcpy doesn't work just as well in this case as snprintf?