fix(auth): harden Windows auth store privacy
This commit is contained in:
@@ -77,6 +77,10 @@ func WriteCanonicalNewFile(path string, contents []byte, mode os.FileMode) error
|
||||
return ErrUnsafeFile
|
||||
}
|
||||
defer file.Close()
|
||||
if err := ProtectPrivateRegular(path); err != nil {
|
||||
_ = os.Remove(path)
|
||||
return ErrUnsafeFile
|
||||
}
|
||||
if _, err := file.Write(contents); err != nil {
|
||||
_ = os.Remove(path)
|
||||
return ErrUnsafeFile
|
||||
|
||||
Reference in New Issue
Block a user