]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journalctl: lstat() should suffice if we call canonicalize_file_name() first
authorLennart Poettering <lennart@poettering.net>
Mon, 18 May 2015 22:22:56 +0000 (00:22 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 18 May 2015 22:26:48 +0000 (00:26 +0200)
src/journal/journalctl.c

index 3a59d7ff1be985436527155d039917a0021d636b..d0cc5d9b2ee76c9fa37fffd6510e385e30dbd1f9 100644 (file)
@@ -795,7 +795,7 @@ static int add_matches(sd_journal *j, char **args) {
                         p = canonicalize_file_name(*i);
                         path = p ? p : *i;
 
-                        if (stat(path, &st) < 0)
+                        if (lstat(path, &st) < 0)
                                 return log_error_errno(errno, "Couldn't stat file: %m");
 
                         if (S_ISREG(st.st_mode) && (0111 & st.st_mode)) {