mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Return EPERM for mknod
This more directly matches what Linux does with unsupported nodes. PiperOrigin-RevId: 248780425 Change-Id: I17f3dd0b244f6dc4eb00e2e42344851b8367fbec
This commit is contained in:
@@ -281,9 +281,9 @@ func (i *inodeOperations) Bind(ctx context.Context, dir *fs.Inode, name string,
|
||||
}
|
||||
|
||||
// CreateFifo implements fs.InodeOperations.CreateFifo. Gofer nodes do not support the
|
||||
// creation of fifos and always returns EOPNOTSUPP.
|
||||
// creation of fifos and always returns EPERM.
|
||||
func (*inodeOperations) CreateFifo(context.Context, *fs.Inode, string, fs.FilePermissions) error {
|
||||
return syscall.EOPNOTSUPP
|
||||
return syscall.EPERM
|
||||
}
|
||||
|
||||
// Remove implements InodeOperations.Remove.
|
||||
|
||||
@@ -287,7 +287,7 @@ func (*inodeOperations) CreateHardLink(context.Context, *fs.Inode, *fs.Inode, st
|
||||
|
||||
// CreateFifo implements fs.InodeOperations.CreateFifo.
|
||||
func (*inodeOperations) CreateFifo(context.Context, *fs.Inode, string, fs.FilePermissions) error {
|
||||
return syserror.EOPNOTSUPP
|
||||
return syserror.EPERM
|
||||
}
|
||||
|
||||
// Remove implements fs.InodeOperations.Remove.
|
||||
|
||||
@@ -860,7 +860,10 @@ func (l *localFile) Link(target p9.File, newName string) error {
|
||||
//
|
||||
// Not implemented.
|
||||
func (*localFile) Mknod(_ string, _ p9.FileMode, _ uint32, _ uint32, _ p9.UID, _ p9.GID) (p9.QID, error) {
|
||||
return p9.QID{}, syscall.ENOSYS
|
||||
// From mknod(2) man page:
|
||||
// "EPERM: [...] if the filesystem containing pathname does not support
|
||||
// the type of node requested."
|
||||
return p9.QID{}, syscall.EPERM
|
||||
}
|
||||
|
||||
// UnlinkAt implements p9.File.
|
||||
|
||||
Reference in New Issue
Block a user