From: Lennart Poettering Date: Mon, 18 May 2015 22:22:56 +0000 (+0200) Subject: journalctl: lstat() should suffice if we call canonicalize_file_name() first X-Git-Tag: v220~70 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=26b9f165c3ebf513110e3de88c92fcbf3011271d;p=thirdparty%2Fsystemd.git journalctl: lstat() should suffice if we call canonicalize_file_name() first --- diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 3a59d7ff1be..d0cc5d9b2ee 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -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)) {