Skip to content

Commit 323ef68

Browse files
awhitcroftTyler Hicks
authored andcommitted
ecryptfs: read on a directory should return EISDIR if not supported
read() calls against a file descriptor connected to a directory are incorrectly returning EINVAL rather than EISDIR: [EISDIR] [XSI] [Option Start] The fildes argument refers to a directory and the implementation does not allow the directory to be read using read() or pread(). The readdir() function should be used instead. [Option End] This occurs because we do not have a .read operation defined for ecryptfs directories. Connect this up to generic_read_dir(). BugLink: http://bugs.launchpad.net/bugs/719691 Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
1 parent 70b8902 commit 323ef68

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎fs/ecryptfs/file.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ ecryptfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
317317

318318
const struct file_operations ecryptfs_dir_fops = {
319319
.readdir = ecryptfs_readdir,
320+
.read = generic_read_dir,
320321
.unlocked_ioctl = ecryptfs_unlocked_ioctl,
321322
#ifdef CONFIG_COMPAT
322323
.compat_ioctl = ecryptfs_compat_ioctl,

0 commit comments

Comments
 (0)