Add safe immutable directory promotion

This commit is contained in:
2026-08-09 23:37:02 +00:00
parent 98734644d6
commit dce721cdbd
8 changed files with 507 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
//go:build linux
package fileops
import "golang.org/x/sys/unix"
func renameDirectoryNoReplace(src, dst string) error {
return unix.Renameat2(unix.AT_FDCWD, src, unix.AT_FDCWD, dst, unix.RENAME_NOREPLACE)
}