Your message dated Sat, 16 Aug 2025 12:55:27 +0100
with message-id 
<caj3buotvesmbx2n45cjjpjejobhfl_pbuhmphc0cdqsradl...@mail.gmail.com>
and subject line Re: logtail2 should not not print the final log entry if it 
does not end with "\n"
has caused the Debian Bug report #750232,
regarding logtail2 should not not print the final log entry if it does not end 
with "\n"
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 [email protected]
immediately.)


-- 
750232: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=750232
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: logtail
Version: 1.3.15
Severity: wishlist

logtail2 does not do any sanity checking on the final line of input to make sure that it is complete and "\n" terminated. If syslog is not set to flush on every write, it's possible for consecutive runs of logcheck to get a single log entry split in half for each run, resulting in false positives from logcheck.

logtail2 should be updated to put back $_ if it is not "\n" terminated. Maybe a change to something like:

sub print_from_offset {
    my ($filename, $offset) = @_;
    # this subroutine prints the contents of the file named $filename,
    # starting offset $offset.
    #print "print_from_offset $filename, $offset\n";
    unless (open(LOGFILE, $filename)) {
        print STDERR "File $logfile cannot be read: $!\n";
        exit 66;
    }

    seek(LOGFILE, $offset, 0);

    while (<LOGFILE>) {
        last if eof(LOGFILE) && substr($_, -1, 1) ne "\n" && seek(LOGFILE, -1 * 
length($_), 1);
        print $_ if
    }

    $size = tell LOGFILE;
    close LOGFILE;
    return $size;
}

--- End Message ---
--- Begin Message ---
On Sun, 12 May 2024 16:34:10 +0100 Richard Lewis
<[email protected]> wrote:
> On Mon, 2 Jun 2014 10:25:40 -0700 (PDT) Chris Stromsoe <[email protected]> wrote:
>
> > logtail2 does not do any sanity checking on the final line of input to
> > make sure that it is complete and "\n" terminated.  If syslog is not set
> > to flush on every write, it's possible for consecutive runs of logcheck to
> > get a single log entry split in half for each run, resulting in false
> > positives from logcheck.
>
> Is this still an issue in 2024? if not we could close this old bug.
>
> If you ran logtail2 on a non-syslog file (which might actually be an
> increasingly common usage in a systemd world?), then ignoring a line
> without a trailing \n means that last line might never be checked,
> which seems far worse than the occasional false-positive.


A year later, closing this -- i think logtail2 is functioning as
intended, and by default rsyslog is not even installed any more, and
why wouldnt you want your logging to be flushed?

(HOWEVER - this one is finely balanced to me, so If anyone disagrees
at all, do please re-open it)

--- End Message ---

Reply via email to