mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Fix failure to rename directory
os.Rename validates that the target doesn't exist, which is different from syscall.Rename which replace the target if both are directories. fsgofer needs the syscall behavior. PiperOrigin-RevId: 196194630 Change-Id: I87d08cad88b5ef310b245cd91647c4f5194159d8
This commit is contained in:
committed by
Shentubot
parent
7b6111b695
commit
7cff8489de
@@ -708,7 +708,7 @@ func (l *localFile) Rename(directory p9.File, name string) error {
|
||||
// TODO: change to renameat(2)
|
||||
parent := directory.(*localFile)
|
||||
newPath := path.Join(parent.hostPath, name)
|
||||
if err := os.Rename(l.hostPath, newPath); err != nil {
|
||||
if err := syscall.Rename(l.hostPath, newPath); err != nil {
|
||||
return extractErrno(err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user