diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-03-03 16:13:42 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-03-04 11:02:10 +0100 |
commit | b709e2aabe0f3981a36d7de92856033fd4cf111c (patch) | |
tree | 4f1675c8147f42e67df111f534d27e2505614a69 /shell | |
parent | a8234d497011a5b045ce263652f1465cab14e708 (diff) |
Handle symlinks
LIBREOFFICE-PQ967WYM
Change-Id: I5e4df92401e009fe6b7238565d1223cfb77d10ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130930
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit c1ac79906bde5c902be5cb0ae6b530da96e52169)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130861
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'shell')
-rw-r--r-- | shell/source/unix/exec/shellexec.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
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) |