Your message dated Fri, 08 Nov 2024 18:15:54 +0000
with message-id <e1t9twu-0055wv...@fasolo.debian.org>
and subject line Bug#1084198: Removed package(s) from unstable
has caused the Debian Bug report #818321,
regarding mergelog fails to merge lines where there is an IPv6 in brackets 
before the date field
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
818321: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818321
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: mergelog
Version: 4.5.1-9
Severity: normal
Tags: ipv6 patch upstream

Dear Maintainer,

Mergelog fails to merge lines where there is an IPv6 in brackets before
the date field with the following message:

problem with ...logfile:
2001:1be0:1000:169:250:56ff:fe92:4eb6 [2a02:2178:0002:000c:0000:0000:0000:0013] 
- [13/Mar/2016:17:45:39 +0100] "GET / HTTP/1.1" 200 133845 "-" "Mozilla/5.0 
(compatible; oBot/2.3.1; http://filterdb.iss.net/crawler/)"

continuing...

This is because mergelog considers that the first string between brackets
must be the date field, which is wrong.

Attached is a patch which continues to the next field with brackets if the
date parsing failed until there is not more field with brackets instead
of only considering the first one.

Sylvain

-- System Information:
Debian Release: stretch/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'oldstable-updates'), (500, 
'unstable'), (500, 'stable'), (500, 'oldstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.3.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect

Versions of packages mergelog depends on:
ii  libc6   2.21-9
ii  zlib1g  1:1.2.8.dfsg-2+b1

mergelog recommends no packages.

mergelog suggests no packages.

-- no debconf information
diff -Nru a/src/mergelog.c b/src/mergelog.c
--- a/src/mergelog.c	2001-11-05 15:47:49.000000000 +0000
+++ b/src/mergelog.c	2016-03-15 22:17:05.488900070 +0000
@@ -222,31 +222,35 @@
      */
     if (mygets(log_buffer[i],BUFFER_SIZE,log_file[i],i) != NULL ) {
 
-      /*
-	get the date pointers
-      */
-      log_date=memchr(log_scan[i],'[',SCAN_SIZE);
-      if (log_date == NULL) {
-	fprintf(stderr,"abort due to a problem with %s:\n%s\n",argv[i+1],log_buffer[i]);
-	exit(1);
-      }
-      
-      /*
-	put the date in the tmp_date_buf
-       */
-       for (j=0;((j == 12)&&(memcmp(months+2*j,log_date+5,2) != 0));j++);
-       if (j == 12) {
-	 fprintf(stderr,"abort due to a problem with %s:\n%s\n",argv[i+1],log_buffer[i]);
-	 exit(1);
+      int off=0;
+      for (;;) {
+        /*
+	  get the date pointers
+        */
+        log_date=memchr(log_scan[i]+off,'[',SCAN_SIZE-off);
+        if (log_date == NULL) {
+	  fprintf(stderr,"abort due to a problem with %s:\n%s\n",argv[i+1],log_buffer[i]);
+	  exit(1);
+        }
+        
+        /*
+	  put the date in the tmp_date_buf
+         */
+         for (j=0;((j<12)&&(memcmp(months+2*j,log_date+5,2) != 0));j++);
+         if (j == 12) {
+	   off=log_date-log_scan[i]+1;
+	   continue;
+         }
+         memcpy(log_month[i],trans_digits[j],2);
+         memcpy(log_month[i]+2,months+2*j,2);
+         memcpy(tmp_date_buf[i],log_date+8,4);
+         memcpy(tmp_date_buf[i]+4,trans_digits[j],2);
+         memcpy(tmp_date_buf[i]+6,log_date+1,2);
+         memcpy(tmp_date_buf[i]+8,log_date+13,2);
+         memcpy(tmp_date_buf[i]+10,log_date+16,2);
+         memcpy(tmp_date_buf[i]+12,log_date+19,2);
+         break;
        }
-       memcpy(log_month[i],trans_digits[j],2);
-       memcpy(log_month[i]+2,months+2*j,2);
-       memcpy(tmp_date_buf[i],log_date+8,4);
-       memcpy(tmp_date_buf[i]+4,trans_digits[j],2);
-       memcpy(tmp_date_buf[i]+6,log_date+1,2);
-       memcpy(tmp_date_buf[i]+8,log_date+13,2);
-       memcpy(tmp_date_buf[i]+10,log_date+16,2);
-       memcpy(tmp_date_buf[i]+12,log_date+19,2);
 
       /*
 	extract the date of this first line
@@ -399,12 +403,16 @@
 	  *(tmp_date_buf[i])='9';
           break;
 	} else {
-
-	  /*
-	    prepare the new pointer for the date test
-	   */
-	  log_date=memchr(log_scan[i],'[',SCAN_SIZE);
-	  if (log_date != NULL) {
+          int off=0;
+          for (;;) {
+	    /*
+	      prepare the new pointer for the date test
+	     */
+	    log_date=memchr(log_scan[i]+off,'[',SCAN_SIZE-off);
+	    if (log_date == NULL) {
+	      fprintf(stderr,"problem with %s:\n%s\ncontinuing...\n",argv[i+1],log_buffer[i]);
+	      break;
+	    }
 
 	    /*
 	      convert the log line month if necessary
@@ -418,26 +426,26 @@
 	      memcpy(tmp_date_buf[i]+8,log_date+13,2);
 	      memcpy(tmp_date_buf[i]+10,log_date+16,2);
 	      memcpy(tmp_date_buf[i]+12,log_date+19,2);
+              break;
+	    }
 
-	    } else {
-	      for (j=0;((j<12)&&(memcmp(months+2*j,log_date+5,2) != 0));j++);
-	      if (j == 12) {
-		fprintf(stderr,"problem with %s:\n%s\ncontinuing...\n",argv[i+1],log_buffer[i]);
-	      } else {
-		memcpy(log_month[i],trans_digits[j],2);
-		memcpy(log_month[i]+2,months+2*j,2);
-		memcpy(tmp_date_buf[i]+4,trans_digits[j],2);
-		
-		memcpy(tmp_date_buf[i],log_date+8,4);
-		memcpy(tmp_date_buf[i]+6,log_date+1,2);
-		memcpy(tmp_date_buf[i]+8,log_date+13,2);
-		memcpy(tmp_date_buf[i]+10,log_date+16,2);
-		memcpy(tmp_date_buf[i]+12,log_date+19,2);
-	      }
+	    for (j=0;((j<12)&&(memcmp(months+2*j,log_date+5,2) != 0));j++);
+	    if (j == 12) {
+	      off=log_date-log_scan[i]+1;
+	      continue;
 	    }
-	  } else {
-	    fprintf(stderr,"problem with %s:\n%s\ncontinuing...\n",argv[i+1],log_buffer[i]);
-	  }
+
+	    memcpy(log_month[i],trans_digits[j],2);
+	    memcpy(log_month[i]+2,months+2*j,2);
+	    memcpy(tmp_date_buf[i]+4,trans_digits[j],2);
+		
+	    memcpy(tmp_date_buf[i],log_date+8,4);
+	    memcpy(tmp_date_buf[i]+6,log_date+1,2);
+	    memcpy(tmp_date_buf[i]+8,log_date+13,2);
+	    memcpy(tmp_date_buf[i]+10,log_date+16,2);
+	    memcpy(tmp_date_buf[i]+12,log_date+19,2);
+	    break;
+          }
 	}
       }
     }

--- End Message ---
--- Begin Message ---
Version: 4.5.1-10+rm

Dear submitter,

as the package mergelog has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/1084198

The version of this package that was in Debian prior to this removal
can still be found using https://snapshot.debian.org/.

Please note that the changes have been done on the master archive and
will not propagate to any mirrors until the next dinstall run at the
earliest.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmas...@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Thorsten Alteholz (the ftpmaster behind the curtain)

--- End Message ---

Reply via email to