We have noticed since deploying 1.3.5 that our logs contain sequences 
like this:

May 15 04:05:15 mindseye nfsen[19269]: 2 channels/alerts to profile
May 15 04:05:15 mindseye for profiler 2
May 15 04:05:15 mindseye for profiler 1

It looks like the original line should be:

syslog('debug', "profile opts: $in for profiler $i");

But, the data in $in must include a CR or something, since everything is 
being chopped (including the process info!).  I suppose you could argue 
that is a syslog bug (and we are running syslog-ng 2.1.4 on that 
particular box), but it may be good to sanitize the $in variable first 
anyway.

The original code is:

                                 while ((my $in = <STDIN>) ne ".\n") {
                                         print NFPROFILE $in;
                                         syslog('debug', "profile opts: 
$in for profiler $i");
                                 }

How about this instead?

                                 while ((my $in = <STDIN>) {
                                         chomp($in);
                                         last if $in eq ".";
                                         print NFPROFILE $in;
                                         syslog('debug', "profile opts: 
$in for profiler $i");
                                 }

Regards,
Mark


------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Nfsen-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nfsen-discuss

Reply via email to