]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-journal: use stat_verify_linked()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 15 Feb 2024 01:08:23 +0000 (10:08 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 15 Feb 2024 18:48:18 +0000 (03:48 +0900)
src/libsystemd/sd-journal/journal-file.c

index e96e4b6b9b801a8156cfe9538de1803708f49777..6f29b47ff2f9df7ba4a9b563603f324c76a141e7 100644 (file)
@@ -734,8 +734,9 @@ int journal_file_fstat(JournalFile *f) {
                 return r;
 
         /* Refuse appending to files that are already deleted */
-        if (f->last_stat.st_nlink <= 0)
-                return -EIDRM;
+        r = stat_verify_linked(&f->last_stat);
+        if (r < 0)
+                return r;
 
         return 0;
 }