[Nagiosplug-devel] oddity about check_procs plugin and solaris

Philip Brown ppb at usc.edu
Thu Mar 26 20:06:59 CET 2009


Andreas Ericsson wrote:
> 
>> Why is chgeck_procs truncating the prog path like that, when the raw PS 
>> command is clearly NOT truncating?!
>>
> 
> Again, it may not. Copy-paste the code snippets where it truncates the
> variables and then again where it actually uses the truncated variable.

it "may not"??

i finally looked at the code. It truncates. and its even commented that it 
truncates.


"check_procs.c" line 196

       /* Some ps return full pathname for command. This removes path */
       strcpy(procprog, base_name(procprog));

Older versions (1.3.1 specifically ) do not do this truncating.

It is sensible behaviour to check for the full path of an executable.
Particularly for security reasons, since args can be falsified I believe(?), 
the one and only way to check for full path of an executable, is in that field.
The field that currently has the information thrown away.





More information about the Devel mailing list