ganglia / ganglia-web

Ganglia Web Frontend
BSD 3-Clause "New" or "Revised" License
316 stars 168 forks source link

find_avg: check for existence of rrd file before exec'ing rrdtool #306

Closed jtfrey closed 8 years ago

jtfrey commented 8 years ago

We noted rrdtool crashing when an invalid clustername is passed to ganglia-web (e.g. ?c=not_our_cluster). While the segfault is due to a bug we isolated in rrdtool when using the caching daemon, it seems appropriate for ganglia-web to check the "c" CGI parameter to ensure it's a defined cluster. As it stands, this code change simply ensures the find_avg() function doesn't pass any non-existent files to rrdtool. The check for a valid cluster name should probably be implemented at a higher level, though, which might make the existence of the directory/file a valid precondition to find_avg() and negate this patch.

vvuksan commented 8 years ago

There appears to be a conflict with the current master. Can you fix this and resubmit. Thanks

jtfrey commented 8 years ago

The conflict is that someone deleted a trailing space on line 318...do you really need me to redo everything for that?

jtfrey commented 8 years ago

Merged upstream changes into my fork and reapplied my patch. Please try now.