mirror of
				https://git.proxmox.com/git/mirror_zfs.git
				synced 2025-10-26 18:05:04 +03:00 
			
		
		
		
	Fix error code on __zpl_ioctl_setflags()
Other (all?) Linux filesystems seem to return -EPERM instead of -EACCESS when trying to set FS_APPEND_FL or FS_IMMUTABLE_FL without the CAP_LINUX_IMMUTABLE capability. This was detected by generic/545 test in the fstest suite. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Luis Henriques <henrix@camandro.org> Closes #11791
This commit is contained in:
		
							parent
							
								
									332cd2e313
								
							
						
					
					
						commit
						5072f37419
					
				@ -864,7 +864,7 @@ __zpl_ioctl_setflags(struct inode *ip, uint32_t ioctl_flags, xvattr_t *xva)
 | 
			
		||||
	if ((fchange(ioctl_flags, zfs_flags, FS_IMMUTABLE_FL, ZFS_IMMUTABLE) ||
 | 
			
		||||
	    fchange(ioctl_flags, zfs_flags, FS_APPEND_FL, ZFS_APPENDONLY)) &&
 | 
			
		||||
	    !capable(CAP_LINUX_IMMUTABLE))
 | 
			
		||||
		return (-EACCES);
 | 
			
		||||
		return (-EPERM);
 | 
			
		||||
 | 
			
		||||
	if (!zpl_inode_owner_or_capable(kcred->user_ns, ip))
 | 
			
		||||
		return (-EACCES);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user