Permissions: set sane mode (755) instead of just executable for downloaded binaries

This commit is contained in:
MischaPanch authored and Michael Panchenko committed 2025-08-03 15:53:43 +02:00
1 parent 574eb7b327
commit a5db2f4616
8 files changed
+9 -17

No files matched your search

@@ -5,7 +5,6 @@ Provides C/C++ specific instantiation of the LanguageServer class. Contains vari
import logging
import os
import pathlib
import stat
import threading
from solidlsp.ls import SolidLanguageServer
@@ -95,7 +94,7 @@ class ClangdLanguageServer(SolidLanguageServer):
f"Clangd executable not found at {clangd_executable_path}.\n"
"Make sure you have installed clangd. See https://clangd.llvm.org/installation"
)
os.chmod(clangd_executable_path, stat.S_IEXEC)
os.chmod(clangd_executable_path, 0o755)
return clangd_executable_path
+1 -2
View File
@@ -6,7 +6,6 @@ import logging
import os
import pathlib
import shutil
import stat
import subprocess
import threading
@@ -118,7 +117,7 @@ class ClojureLSP(SolidLanguageServer):
deps.install(logger, clojurelsp_ls_dir)
if not os.path.exists(clojurelsp_executable_path):
raise FileNotFoundError(f"Download failed? Could not find clojure-lsp executable at {clojurelsp_executable_path}")
os.chmod(clojurelsp_executable_path, stat.S_IEXEC)
os.chmod(clojurelsp_executable_path, 0o755)
return clojurelsp_executable_path
@staticmethod
@@ -7,7 +7,6 @@ import logging
import os
import platform
import shutil
import stat
import subprocess
import tarfile
import threading
@@ -314,7 +313,7 @@ class CSharpLanguageServer(SolidLanguageServer):
# Make executable on Unix systems
if platform.system().lower() != "windows":
server_dll.chmod(server_dll.stat().st_mode | stat.S_IEXEC)
server_dll.chmod(0o755)
logger.log(f"Successfully installed Microsoft.CodeAnalysis.LanguageServer to {server_dll}", logging.INFO)
return str(server_dll)
@@ -456,7 +455,7 @@ class CSharpLanguageServer(SolidLanguageServer):
# Make dotnet executable on Unix
if platform.system().lower() != "windows":
dotnet_exe.chmod(dotnet_exe.stat().st_mode | stat.S_IEXEC)
dotnet_exe.chmod(0o755)
logger.log(f"Successfully installed .NET 9 runtime to {dotnet_exe}", logging.INFO)
return str(dotnet_exe)
@@ -1,7 +1,6 @@
import logging
import os
import pathlib
import stat
from solidlsp.ls import SolidLanguageServer
from solidlsp.ls_logger import LanguageServerLogger
@@ -84,7 +83,7 @@ class DartLanguageServer(SolidLanguageServer):
deps.install(logger, dart_ls_dir)
assert os.path.exists(dart_executable_path)
os.chmod(dart_executable_path, stat.S_IEXEC)
os.chmod(dart_executable_path, 0o755)
return f"{dart_executable_path} language-server --client-id multilspy.dart --client-version 1.2"
@@ -7,7 +7,6 @@ import logging
import os
import pathlib
import shutil
import stat
import threading
import uuid
from pathlib import PurePath
@@ -279,7 +278,7 @@ class EclipseJDTLS(SolidLanguageServer):
):
FileUtils.download_and_extract_archive(logger, dependency["url"], vscode_java_path, dependency["archiveType"])
os.chmod(jre_path, stat.S_IEXEC)
os.chmod(jre_path, 0o755)
assert os.path.exists(vscode_java_path)
assert os.path.exists(jre_home_path)
+1 -2
View File
@@ -6,7 +6,6 @@ import json
import logging
import os
import pathlib
import stat
import threading
from collections.abc import Iterable
@@ -194,7 +193,7 @@ class OmniSharp(SolidLanguageServer):
FileUtils.download_and_extract_archive(logger, runtime_dependencies["OmniSharp"]["url"], omnisharp_ls_dir, "zip")
omnisharp_executable_path = os.path.join(omnisharp_ls_dir, runtime_dependencies["OmniSharp"]["binaryName"])
assert os.path.exists(omnisharp_executable_path)
os.chmod(omnisharp_executable_path, stat.S_IEXEC)
os.chmod(omnisharp_executable_path, 0o755)
razor_omnisharp_ls_dir = os.path.join(cls.ls_resources_dir(solidlsp_settings), "RazorOmnisharp")
if not os.path.exists(razor_omnisharp_ls_dir):
@@ -5,7 +5,6 @@ Provides Rust specific instantiation of the LanguageServer class. Contains vario
import logging
import os
import pathlib
import stat
import threading
from overrides import override
@@ -104,7 +103,7 @@ class RustAnalyzer(SolidLanguageServer):
os.makedirs(rustanalyzer_ls_dir)
deps.install(logger, rustanalyzer_ls_dir)
assert os.path.exists(rustanalyzer_executable_path)
os.chmod(rustanalyzer_executable_path, stat.S_IEXEC)
os.chmod(rustanalyzer_executable_path, 0o755)
return rustanalyzer_executable_path
@@ -1,7 +1,6 @@
import logging
import os
import shutil
import stat
import threading
from overrides import override
@@ -112,7 +111,7 @@ class TerraformLS(SolidLanguageServer):
# Make the executable file executable on Unix-like systems
if platform_id.value != "win-x64":
os.chmod(terraform_ls_executable_path, stat.S_IEXEC | stat.S_IREAD)
os.chmod(terraform_ls_executable_path, 0o755)
return terraform_ls_executable_path