]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal-remote: downgrade messages about input data to warnings
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 31 May 2021 10:11:48 +0000 (12:11 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 31 May 2021 17:29:07 +0000 (19:29 +0200)
Those are unexpected, so a user-visible message seems appropriate.
But they are not our errors, and to some extent we can recover from
them, so "warning" seems more appropriate than "error".

src/journal-remote/journal-remote-parse.c
src/shared/journal-importer.c

index 7bc349c304299e852fc3a0814c5a0709753dab28..2ece329251f84ac281629659ee05318dbbfda7ed 100644 (file)
@@ -74,7 +74,7 @@ int process_source(RemoteSource *source, bool compress, bool seal) {
                          &source->importer.boot_id,
                          compress, seal);
         if (r == -EBADMSG) {
-                log_error_errno(r, "Entry is invalid, ignoring.");
+                log_warning_errno(r, "Entry is invalid, ignoring.");
                 r = 0;
         } else if (r < 0)
                 log_error_errno(r, "Failed to write entry of %zu bytes: %m",
index 0d82acc25cdedcd017c5e269bdd00388c80d9558..9e11dc09c1cc190db729d16313f6007515a96ddd 100644 (file)
@@ -69,9 +69,9 @@ static int get_line(JournalImporter *imp, char **line, size_t *size) {
 
                 imp->scanned = imp->filled;
                 if (imp->scanned >= DATA_SIZE_MAX)
-                        return log_error_errno(SYNTHETIC_ERRNO(ENOBUFS),
-                                               "Entry is bigger than %u bytes.",
-                                               DATA_SIZE_MAX);
+                        return log_warning_errno(SYNTHETIC_ERRNO(ENOBUFS),
+                                                 "Entry is bigger than %u bytes.",
+                                                 DATA_SIZE_MAX);
 
                 if (imp->passive_fd)
                         /* we have to wait for some data to come to us */
@@ -163,9 +163,9 @@ static int get_data_size(JournalImporter *imp) {
 
         imp->data_size = unaligned_read_le64(data);
         if (imp->data_size > DATA_SIZE_MAX)
-                return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
-                                       "Stream declares field with size %zu > DATA_SIZE_MAX = %u",
-                                       imp->data_size, DATA_SIZE_MAX);
+                return log_warning_errno(SYNTHETIC_ERRNO(EINVAL),
+                                         "Stream declares field with size %zu > DATA_SIZE_MAX = %u",
+                                         imp->data_size, DATA_SIZE_MAX);
         if (imp->data_size == 0)
                 log_warning("Binary field with zero length");
 
@@ -203,8 +203,8 @@ static int get_data_newline(JournalImporter *imp) {
                 int l;
 
                 l = cescape_char(*data, buf);
-                return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
-                                       "Expected newline, got '%.*s'", l, buf);
+                return log_warning_errno(SYNTHETIC_ERRNO(EINVAL),
+                                         "Expected newline, got '%.*s'", l, buf);
         }
 
         return 1;