GNU bug report logs - #30535
Output buffer overwritten when CR in file

Previous Next

Package: grep;

Reported by: Wayne Gemmell <wayne <at> gemmell.co.za>

Date: Mon, 19 Feb 2018 17:31:02 UTC

Severity: wishlist

Merged with 30652

Full log


View this message in rfc822 format

From: Wayne Gemmell <wayne <at> gemmell.co.za>
To: 30535 <at> debbugs.gnu.org
Subject: bug#30535: Output buffer overwritten when CR in file
Date: Mon, 19 Feb 2018 14:36:43 +0000
[Message part 1 (text/plain, inline)]
Hi

I have an issue with files that contain carriage returns. I have log files
that contain user input which sometime has carriage returns. The EOL
characters are fine so I can't throw mac2unix at the problem.

The issue is that when grep outputs the CR it follows the CR to the
beginning of the output buffer and overwrites the contents of the output
buffer.

E.g. the file, test.log with the following contents.

messag1^Mlogin^Mmask

The following command
$>/grep --color=never login test.log
Outputs as follows
$>maskng1

This seems like a security concern as you may be able to mask activity in
logs just by inserting CR in place. It would be superficial but it would
fool basic grep based logfile processing.

I would expect the CR to be output verbatim so as not to confuse the reader
of the output.


-- 
Regards
Wayne
[Message part 2 (text/html, inline)]

This bug report was last modified 5 years and 168 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.