Skip to content

Commit 848574f

Browse files
committed
Fix crash on chmod/chown of the root directory of mountpoint
1 parent 4fe1ec9 commit 848574f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/goofys.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,6 +1622,11 @@ func (fs *Goofys) SetInodeAttributes(
16221622
return syscall.ESTALE
16231623
}
16241624

1625+
if inode.Parent == nil {
1626+
// chmod/chown on the root directory of mountpoint is not supported
1627+
return syscall.ENOTSUP
1628+
}
1629+
16251630
if op.Size != nil || op.Mode != nil || op.Mtime != nil || op.Uid != nil || op.Gid != nil {
16261631
inode.mu.Lock()
16271632
}

0 commit comments

Comments
 (0)