From b4596b48f5e99ed174df1dd6d4a85d75b749fb72 Mon Sep 17 00:00:00 2001 From: Liav A Date: Fri, 10 Feb 2023 22:11:37 +0200 Subject: [PATCH] LibCore: Fix wrong call to stat on the Core::System::lstat method We should call lstat and not stat, because lstat gives information on the symbolic link itself (if the path is about a symbolic link). --- Userland/Libraries/LibCore/System.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibCore/System.cpp b/Userland/Libraries/LibCore/System.cpp index 29bb1333ad..941c21987e 100644 --- a/Userland/Libraries/LibCore/System.cpp +++ b/Userland/Libraries/LibCore/System.cpp @@ -503,7 +503,7 @@ ErrorOr lstat(StringView path) HANDLE_SYSCALL_RETURN_VALUE("lstat", rc, st); #else DeprecatedString path_string = path; - if (::stat(path_string.characters(), &st) < 0) + if (::lstat(path_string.characters(), &st) < 0) return Error::from_syscall("lstat"sv, -errno); return st; #endif