shell/source/unix/exec/shellexec.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
New commits: commit b709e2aabe0f3981a36d7de92856033fd4cf111c Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Thu Mar 3 16:13:42 2022 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Fri Mar 4 11:02:10 2022 +0100 Handle symlinks LIBREOFFICE-PQ967WYM Change-Id: I5e4df92401e009fe6b7238565d1223cfb77d10ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130930 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> (cherry picked from commit c1ac79906bde5c902be5cb0ae6b530da96e52169) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130861 Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/shell/source/unix/exec/shellexec.cxx b/shell/source/unix/exec/shellexec.cxx index c95549aae173..ab50e9e412f1 100644 --- a/shell/source/unix/exec/shellexec.cxx +++ b/shell/source/unix/exec/shellexec.cxx @@ -124,12 +124,12 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar 0); } struct stat st; - auto const e2 = stat(pathname8.getStr(), &st); + auto const e2 = lstat(pathname8.getStr(), &st); if (e2 != 0) { auto const e3 = errno; - SAL_INFO("shell", "stat(" << pathname8 << ") failed with errno " << e3); + SAL_INFO("shell", "lstat(" << pathname8 << ") failed with errno " << e3); } - if (e2 == 0 && S_ISDIR(st.st_mode)) { + if (e2 == 0 && (S_ISDIR(st.st_mode) || S_ISLNK(st.st_mode))) { dir = true; } else if (e2 != 0 || !S_ISREG(st.st_mode) || (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) != 0)