diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-03-03 16:13:42 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-03-03 18:59:16 +0100 |
commit | c1ac79906bde5c902be5cb0ae6b530da96e52169 (patch) | |
tree | 17f8b0c97f1aa16bce774216cea117b00d7b7af8 /shell | |
parent | c2432d011ba64f69bd64c08fc860d0bcbc7b3569 (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>
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 d33553022471..240113ae8271 100644 --- a/shell/source/unix/exec/shellexec.cxx +++ b/shell/source/unix/exec/shellexec.cxx @@ -131,12 +131,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) |