fix(auth): harden tht auth mutations

This commit is contained in:
2026-08-16 19:37:12 +02:00
parent 9646ae09a0
commit 856ac05edc
6 changed files with 245 additions and 31 deletions
+9
View File
@@ -118,6 +118,15 @@ func ReplaceCanonicalRegular(path string, contents []byte, mode os.FileMode) err
return replaceCanonicalRegular(path, contents)
}
// RemoveCanonicalPrivateRegular removes one existing private regular file without following a
// symlinked path component. It is intended only for rolling back a file this process published.
func RemoveCanonicalPrivateRegular(path string) error {
if err := ValidatePrivateRegular(path); err != nil {
return ErrUnsafeFile
}
return removeCanonicalPrivateRegular(path)
}
func randomTemporaryName() (string, error) {
bytes := make([]byte, 16)
if _, err := rand.Read(bytes); err != nil {