完成目录权限告警整改
This commit is contained in:
1 parent
0e434e3819
commit
62a437810e
5 files changed
+10
-5
No files matched your search
@@ -985,7 +985,8 @@ 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 { // #nosec G302
|
||||
// #nosec G302 -- 迁移备份目录仅允许应用用户访问,目录权限需要保留执行位。
|
||||
if err := os.Chmod(backupDirectory, 0700); err != nil {
|
||||
return "", err
|
||||
}
|
||||
token := make([]byte, 8)
|
||||
|
||||
@@ -693,7 +693,8 @@ 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 { // #nosec G302
|
||||
// #nosec G302 -- 证书存储目录仅允许应用用户访问,目录权限需要保留执行位。
|
||||
if err := os.Chmod(current, 0700); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user