收紧证书与配置状态文件访问
Security Checks / security (push) Waiting to run

This commit is contained in:
xuans committed 2026-09-22 03:35:32 +08:00
1 parent 2dd5156018
commit 200a399b4d
3 files changed
+20 -4

No files matched your search

+3 -1
View File
@@ -7,6 +7,8 @@ import (
"path/filepath"
"strings"
securefile "git.pcux.cn/xuans/Smail/utils/file"
"git.pcux.cn/xuans/Smail/utils/runtimepath"
)
@@ -146,7 +148,7 @@ func readExternalSSLFile(path string, privateKey bool) ([]byte, error) {
if privateKey && info.Mode().Perm()&0077 != 0 && runtimeSupportsPermissionCheck() {
return nil, ErrSSLPrivateKeyPermission
}
file, err := os.Open(path)
file, err := securefile.OpenRegularFile(path, os.O_RDONLY, 0)
if err != nil {
return nil, ErrSSLFileUnavailable
}