mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
basic/journal-importer: escape & ellipsize bad data in log entries
We shouldn't just log arbitrary stuff, in particular newlines and control chars Now: Unknown dunder line __CURSORFACILITY=6\nSYSLOG_IDENTIFIER=/USR/SBIN/CRON\nMES…, ignoring. Unknown dunder line __REALTIME_TIME[TAMP=1404101101501874\n__MONOTONIC_TIMEST…, ignoring.
This commit is contained in:
@@ -159,6 +159,9 @@ char *ellipsize_mem(const char *s, size_t old_length_bytes, size_t new_length_co
|
||||
char *ellipsize(const char *s, size_t length, unsigned percent);
|
||||
char *cellescape(char *buf, size_t len, const char *s);
|
||||
|
||||
/* This limit is arbitrary, enough to give some idea what the string contains */
|
||||
#define CELLESCAPE_DEFAULT_LENGTH 64
|
||||
|
||||
bool nulstr_contains(const char *nulstr, const char *needle);
|
||||
|
||||
char* strshorten(char *s, size_t l);
|
||||
|
||||
Reference in New Issue
Block a user