补充目录权限扫描说明
Some checks are pending
Security Checks / security (push) Waiting to run

This commit is contained in:
smail 2026-09-22 03:43:39 +08:00
parent 200a399b4d
commit 3f3ee2c0e1
5 changed files with 5 additions and 5 deletions

View File

@ -985,7 +985,7 @@ func writeLegacyMigrationBackup(directory string, data []byte, now time.Time) (s
if err != nil || info.Mode()&os.ModeSymlink != 0 || !info.IsDir() {
return "", ErrManagerStorage
}
if err := os.Chmod(backupDirectory, 0700); err != nil {
if err := os.Chmod(backupDirectory, 0700); err != nil { // #nosec G302
return "", err
}
token := make([]byte, 8)

View File

@ -693,7 +693,7 @@ func ensureManagedDirectoryAtRoot(root, directory string) error {
if statErr != nil || info.Mode()&os.ModeSymlink != 0 || !info.IsDir() {
return ErrUnsafeSSLFile
}
if err := os.Chmod(current, 0700); err != nil {
if err := os.Chmod(current, 0700); err != nil { // #nosec G302
return err
}
}

View File

@ -33,7 +33,7 @@ func ListenUnix(path string, allowedUIDs []uint32) (*UnixServer, error) {
if err := validateControlDirectory(parent); err != nil {
return nil, err
}
if err := os.Chmod(parent, 0750); err != nil {
if err := os.Chmod(parent, 0750); err != nil { // #nosec G302
return nil, fmt.Errorf("set control directory permissions: %w", err)
}
if info, err := os.Lstat(path); err == nil {

View File

@ -64,7 +64,7 @@ func SecureDirectory(root, name string) (string, error) {
if err := safeDirectory(directory); err != nil {
return "", err
}
return directory, os.Chmod(directory, 0700)
return directory, os.Chmod(directory, 0700) // #nosec G302
}
func KeyDirectory(root string) string {

View File

@ -28,7 +28,7 @@ func Directory(root string) (string, error) {
if err != nil || !info.IsDir() || info.Mode()&os.ModeSymlink != 0 {
return "", errors.New("运行数据目录无效")
}
if err := os.Chmod(directory, 0700); err != nil {
if err := os.Chmod(directory, 0700); err != nil { // #nosec G302
return "", err
}
return directory, nil