nfprofile [from nfdump 1.6.13] creates log messages to syslog like this:

May 23 16:25:15 lch-mon1 nfprofile[23932]: Process line 
'.#v4-v6#6#ix-v6-out#lch-fw1
'

Note the single quote on a line of its own. This confuses log parsing 
programs like tenshi, which see the second line as a log without a prefix.

The solution is just to move the LogInfo line (which as a side effect 
also makes it safe against lines >511 characters long):


--- bin/nfprofile.c.orig    2014-02-16 12:59:29.000000000 +0000
+++ bin/nfprofile.c    2016-05-23 16:30:42.748231512 +0100
@@ -364,7 +364,6 @@

      profile_list = NULL;
      while ( ( fgets(line, 512, stdin) != NULL )) {
-        LogInfo("Process line '%s'\n", line);
          line[511] = '\0';

          if ( *list == NULL )
@@ -388,6 +387,7 @@
          // 
<profilegroup>#<profilename>#<profiletype>#<channelname>#<channel_sourcelist>
          p = strchr(line, '\n');
          if ( p ) *p = '\0';
+        LogInfo("Process line '%s'\n", line);

          q = line;
          p = strchr(q, '#');


Additionally, there's an unused variable "tstring" which can be removed 
to silence a compiler warning:


@@ -528,12 +528,11 @@
  unsigned int        num_channels, compress;
  struct stat stat_buf;
  profile_param_info_t *profile_list;
-char *rfile, *ffile, *filename, *Mdirs, *tstring;
+char *rfile, *ffile, *filename, *Mdirs;
  char    *profile_datadir, *profile_statdir, *nameserver;
  int c, syntax_only, subdir_index, stdin_profile_params, do_xstat;
  time_t tslot;

-    tstring         = NULL;
      profile_datadir = NULL;
      profile_statdir = NULL;
      Mdirs             = NULL;


Regards,

Brian Candler.


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Nfdump-discuss mailing list
Nfdump-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfdump-discuss

Reply via email to