This commit is contained in:
parent
200a399b4d
commit
3f3ee2c0e1
@ -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)
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user