Forráskód Böngészése

LaunchServer: Do not provide file handlers for special files

With this change, LaunchServer will always return an empty list of file
handlers for special files e.g. sockets and devices. Before this change,
TextEditor was always returned as a default handler for these files.
Tetsui Ohkubo 4 éve
szülő
commit
1479ee3f3e
1 módosított fájl, 3 hozzáadás és 0 törlés
  1. 3 0
      Userland/Services/LaunchServer/Launcher.cpp

+ 3 - 0
Userland/Services/LaunchServer/Launcher.cpp

@@ -266,6 +266,9 @@ void Launcher::for_each_handler_for_path(const String& path, Function<bool(const
         return;
         return;
     }
     }
 
 
+    if (!S_ISREG(st.st_mode) && !S_ISLNK(st.st_mode))
+        return;
+
     if ((st.st_mode & S_IFMT) == S_IFREG && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
     if ((st.st_mode & S_IFMT) == S_IFREG && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
         f(get_handler_for_executable(Handler::Type::Application, path));
         f(get_handler_for_executable(Handler::Type::Application, path));