diff --git a/kernel/util/path.go b/kernel/util/path.go index 8711e87ae..c60d1eec1 100644 --- a/kernel/util/path.go +++ b/kernel/util/path.go @@ -380,6 +380,17 @@ func IsSensitivePath(p string) bool { } } + // Windows 开始启动菜单路径(小写比较) + startMenuPrefixes := []string{ + strings.ToLower(filepath.Join(os.Getenv("APPDATA"), "Microsoft", "Windows", "Start Menu")), + strings.ToLower(filepath.Join(os.Getenv("ProgramData"), "Microsoft", "Windows", "Start Menu")), + } + for _, sp := range startMenuPrefixes { + if strings.HasPrefix(pp, sp) { + return true + } + } + homePrefixes := []string{ strings.ToLower(filepath.Join(HomeDir, ".ssh")), strings.ToLower(filepath.Join(HomeDir, ".config")),