chiark / gitweb /
paranoia: refuse rm_rf("/")
[elogind.git] / src / journal / sd-journal.c
index 5ed8c3f7a5a6ae4b4f2d95fcb31fdae206b5a40b..75884594a19346819e683748d2fb65e6e6f2288d 100644 (file)
@@ -670,9 +670,10 @@ static int real_journal_next(sd_journal *j, direction_t direction) {
                 bool found;
 
                 r = next_beyond_location(j, f, direction, &o, &p);
-                if (r < 0)
-                        return r;
-                else if (r == 0)
+                if (r < 0) {
+                        log_debug("Can't iterate through %s, ignoring: %s", f->path, strerror(-r));
+                        continue;
+                } else if (r == 0)
                         continue;
 
                 if (!new_current)
@@ -943,7 +944,8 @@ static int add_file(sd_journal *j, const char *prefix, const char *dir, const ch
         assert(filename);
 
         if ((j->flags & SD_JOURNAL_SYSTEM_ONLY) &&
-            !startswith(filename, "system.journal"))
+            !(streq(filename, "system.journal") ||
+             (startswith(filename, "system@") && endswith(filename, ".journal"))))
                 return 0;
 
         if (dir)