journal: be fine with opening rotated/corrupted journal files
authorLennart Poettering <lennart@poettering.net>
Fri, 17 Aug 2012 20:10:36 +0000 (22:10 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 17 Aug 2012 20:10:36 +0000 (22:10 +0200)
src/journal/journal-file.c

index 4d7a6ff..08d4285 100644 (file)
@@ -1957,7 +1957,8 @@ int journal_file_open(
             (flags & O_ACCMODE) != O_RDWR)
                 return -EINVAL;
 
-        if (!endswith(fname, ".journal"))
+        if (!endswith(fname, ".journal") &&
+            !endswith(fname, ".journal~"))
                 return -EINVAL;
 
         f = new0(JournalFile, 1);