Blob Blame History Raw
From 63a7dba681c148603c9606e9f841fdecc4e5b549 Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@redhat.com>
Date: Tue, 4 Aug 2015 19:18:38 +0200
Subject: [PATCH] dd: stop warning about corrupted mandatory files

These messages are printed by abrtd to syslog when it finds a dump
directory with such files. Unfortunately, abrtd prints out these
messages too often and users do not know how to get rid of them because
they make sense only to us (ABRT devels). Moreover, these messages are
not necessary because abrtd follows them with
"$PATH is not a valid problem directory" message. So admins are notified
about strange problem directories and they can remove them.

The messages were accidentally turned on by me in these commits:
8f9fa454bd8c653758cddf07597f0a5a17ff5793
b9e7fb2ac2ea3064dc73dab26f80beab100af65f

Signed-off-by: Jakub Filak <jfilak@redhat.com>
---
 src/lib/dump_dir.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/lib/dump_dir.c b/src/lib/dump_dir.c
index 66e2569..aed7a15 100644
--- a/src/lib/dump_dir.c
+++ b/src/lib/dump_dir.c
@@ -218,7 +218,7 @@ static int read_number_from_file_at(int dir_fd, const char *filename, const char
     const int fd = secure_openat_read(dir_fd, filename);
     if (fd < 0)
     {
-        log_warning("Can't open '%s'", filename);
+        log_info("Can't open '%s'", filename);
         return fd;
     }
 
@@ -235,14 +235,14 @@ static int read_number_from_file_at(int dir_fd, const char *filename, const char
 
     if (value_buf == NULL)
     {
-        log_warning("Can't read from '%s'", filename);
+        log_info("Can't read from '%s'", filename);
         ret = -EBADFD;
         goto finito;
     }
 
     if (total_read >= max_size)
     {
-        log_warning("File '%s' is too long to be valid %s "
+        log_info("File '%s' is too long to be valid %s "
                    "(max size %u)", filename, typename, (int)sizeof(value_buf));
         ret = -EMSGSIZE;
         goto finito;
@@ -265,7 +265,7 @@ static int read_number_from_file_at(int dir_fd, const char *filename, const char
         || (*endptr != '\0')
         || endptr == value_buf
     ) {
-        log_warning("File '%s' doesn't contain valid %s"
+        log_info("File '%s' doesn't contain valid %s"
                         "('%s')", filename, typename, value_buf);
         ret = -EINVAL;
         goto finito;
@@ -276,7 +276,7 @@ static int read_number_from_file_at(int dir_fd, const char *filename, const char
      */
     if (res <= min || res >= max)
     {
-        log_warning("File '%s' contains a number out-of-range of %s"
+        log_info("File '%s' contains a number out-of-range of %s"
                         "('%s')", filename, typename, value_buf);
         ret = -ERANGE;
         goto finito;
@@ -441,7 +441,7 @@ static int dd_lock(struct dump_dir *dd, unsigned sleep_usec, int flags)
             if (dd->owns_lock)
                 xunlinkat(dd->dd_fd, ".lock", /*only files*/0);
 
-            log_warning("Unlocked '%s' (no or corrupted '%s' file)", dd->dd_dirname, missing_file);
+            log_notice("Unlocked '%s' (no or corrupted '%s' file)", dd->dd_dirname, missing_file);
             if (--count == 0 || flags & DD_DONT_WAIT_FOR_LOCK)
             {
                 errno = EISDIR; /* "this is an ordinary dir, not dump dir" */
-- 
2.4.3