042ef11
From 63a7dba681c148603c9606e9f841fdecc4e5b549 Mon Sep 17 00:00:00 2001
042ef11
From: Jakub Filak <jfilak@redhat.com>
042ef11
Date: Tue, 4 Aug 2015 19:18:38 +0200
042ef11
Subject: [PATCH] dd: stop warning about corrupted mandatory files
042ef11
042ef11
These messages are printed by abrtd to syslog when it finds a dump
042ef11
directory with such files. Unfortunately, abrtd prints out these
042ef11
messages too often and users do not know how to get rid of them because
042ef11
they make sense only to us (ABRT devels). Moreover, these messages are
042ef11
not necessary because abrtd follows them with
042ef11
"$PATH is not a valid problem directory" message. So admins are notified
042ef11
about strange problem directories and they can remove them.
042ef11
042ef11
The messages were accidentally turned on by me in these commits:
042ef11
8f9fa454bd8c653758cddf07597f0a5a17ff5793
042ef11
b9e7fb2ac2ea3064dc73dab26f80beab100af65f
042ef11
042ef11
Signed-off-by: Jakub Filak <jfilak@redhat.com>
042ef11
---
042ef11
 src/lib/dump_dir.c | 12 ++++++------
042ef11
 1 file changed, 6 insertions(+), 6 deletions(-)
042ef11
042ef11
diff --git a/src/lib/dump_dir.c b/src/lib/dump_dir.c
042ef11
index 66e2569..aed7a15 100644
042ef11
--- a/src/lib/dump_dir.c
042ef11
+++ b/src/lib/dump_dir.c
042ef11
@@ -218,7 +218,7 @@ static int read_number_from_file_at(int dir_fd, const char *filename, const char
042ef11
     const int fd = secure_openat_read(dir_fd, filename);
042ef11
     if (fd < 0)
042ef11
     {
042ef11
-        log_warning("Can't open '%s'", filename);
042ef11
+        log_info("Can't open '%s'", filename);
042ef11
         return fd;
042ef11
     }
042ef11
 
042ef11
@@ -235,14 +235,14 @@ static int read_number_from_file_at(int dir_fd, const char *filename, const char
042ef11
 
042ef11
     if (value_buf == NULL)
042ef11
     {
042ef11
-        log_warning("Can't read from '%s'", filename);
042ef11
+        log_info("Can't read from '%s'", filename);
042ef11
         ret = -EBADFD;
042ef11
         goto finito;
042ef11
     }
042ef11
 
042ef11
     if (total_read >= max_size)
042ef11
     {
042ef11
-        log_warning("File '%s' is too long to be valid %s "
042ef11
+        log_info("File '%s' is too long to be valid %s "
042ef11
                    "(max size %u)", filename, typename, (int)sizeof(value_buf));
042ef11
         ret = -EMSGSIZE;
042ef11
         goto finito;
042ef11
@@ -265,7 +265,7 @@ static int read_number_from_file_at(int dir_fd, const char *filename, const char
042ef11
         || (*endptr != '\0')
042ef11
         || endptr == value_buf
042ef11
     ) {
042ef11
-        log_warning("File '%s' doesn't contain valid %s"
042ef11
+        log_info("File '%s' doesn't contain valid %s"
042ef11
                         "('%s')", filename, typename, value_buf);
042ef11
         ret = -EINVAL;
042ef11
         goto finito;
042ef11
@@ -276,7 +276,7 @@ static int read_number_from_file_at(int dir_fd, const char *filename, const char
042ef11
      */
042ef11
     if (res <= min || res >= max)
042ef11
     {
042ef11
-        log_warning("File '%s' contains a number out-of-range of %s"
042ef11
+        log_info("File '%s' contains a number out-of-range of %s"
042ef11
                         "('%s')", filename, typename, value_buf);
042ef11
         ret = -ERANGE;
042ef11
         goto finito;
042ef11
@@ -441,7 +441,7 @@ static int dd_lock(struct dump_dir *dd, unsigned sleep_usec, int flags)
042ef11
             if (dd->owns_lock)
042ef11
                 xunlinkat(dd->dd_fd, ".lock", /*only files*/0);
042ef11
 
042ef11
-            log_warning("Unlocked '%s' (no or corrupted '%s' file)", dd->dd_dirname, missing_file);
042ef11
+            log_notice("Unlocked '%s' (no or corrupted '%s' file)", dd->dd_dirname, missing_file);
042ef11
             if (--count == 0 || flags & DD_DONT_WAIT_FOR_LOCK)
042ef11
             {
042ef11
                 errno = EISDIR; /* "this is an ordinary dir, not dump dir" */
042ef11
-- 
042ef11
2.4.3
042ef11