mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 10:01:13 +09:00
LibGUI+FileManager: Try better to detect executables
We will now consider a file to be an executable if any of the executable permission bits are set.
This commit is contained in:
parent
f983dfe319
commit
f9b4d981a8
Notes:
sideshowbarker
2024-07-19 09:45:42 +09:00
Author: https://github.com/bugaevc
Commit: f9b4d981a8
Pull-request: https://github.com/SerenityOS/serenity/pull/1147
3 changed files with 5 additions and 4 deletions
|
@ -68,8 +68,9 @@ void DirectoryView::handle_activation(const GModelIndex& index)
|
|||
return;
|
||||
}
|
||||
|
||||
// FIXME: This doesn't seem like the right way to fully detect executability.
|
||||
if (st.st_mode & S_IXUSR) {
|
||||
ASSERT(!S_ISLNK(st.st_mode));
|
||||
|
||||
if (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) {
|
||||
if (fork() == 0) {
|
||||
int rc = execl(path.characters(), path.characters(), nullptr);
|
||||
if (rc < 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue