refactor: 迁移 winapi 到 windows-sys,修复配置解析漏洞
- 依赖替换为 windows-sys 0.61,main.rs 全面适配新 API - 配置解析错误显式传播:env/args 类型错误、数组空洞、非法键不再静默 吞错 - 修正空环境变量与空参数语义,补充 UTF-8 与路径拼接校验 - require 容错移至 Rust 侧,模块加载失败记录日志并跳过 - 新增配置解析与运行时单元测试(19 个)
This commit is contained in:
39
Cargo.toml
39
Cargo.toml
@@ -1,32 +1,31 @@
|
||||
[package]
|
||||
name = "rshim"
|
||||
version = "0.1.0"
|
||||
authors = ["anonymous <anonymous@example.com>"]
|
||||
edition = "2024"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
rust-version = "1.85"
|
||||
license = "MIT OR Unlicense"
|
||||
description = "A fast, safe Rust shim launcher for Scoop"
|
||||
|
||||
[profile.release]
|
||||
opt-level = "z"
|
||||
panic = "abort"
|
||||
|
||||
[dependencies]
|
||||
fs-err = "3.3.1"
|
||||
unicode-bom = "2.0.3"
|
||||
thiserror={version = "2.0.20"}
|
||||
thiserror = "2.0.20"
|
||||
|
||||
mlua = { version = "0.12.0", features = ["lua54", "vendored"] }
|
||||
winapi = { version = "0.3", features = [
|
||||
"wincon",
|
||||
"consoleapi",
|
||||
"minwindef",
|
||||
"shellapi",
|
||||
"winuser",
|
||||
"synchapi",
|
||||
"combaseapi",
|
||||
"winbase",
|
||||
"processthreadsapi",
|
||||
"objbase",
|
||||
"impl-default"
|
||||
windows-sys = { version = "0.61.2", features = [
|
||||
"Win32_Foundation",
|
||||
"Win32_System_Com",
|
||||
"Win32_System_Console",
|
||||
"Win32_System_Registry",
|
||||
"Win32_System_Threading",
|
||||
"Win32_UI_Shell",
|
||||
"Win32_UI_WindowsAndMessaging",
|
||||
] }
|
||||
dunce = "1.0.5"
|
||||
|
||||
|
||||
# 日志
|
||||
tracing = "0.1.44"
|
||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||
tracing-appender = "0.2"
|
||||
|
||||
Reference in New Issue
Block a user