mirror of
https://github.com/torvalds/linux.git
synced 2026-09-27 11:02:03 +02:00
ksmbd: allow I/O on directory named streams
Named streams are stored as extended attributes on the base inode. The VFS read and write helpers reject directory inodes before or together with checking whether the handle represents a stream. Permit read and write operations when a directory-backed handle is a named stream. Continue rejecting direct I/O on ordinary directory handles. This fixes creation of the directory stream in smb2.getinfo.complex. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
This commit is contained in:
parent
4ea46ea602
commit
8184c425a1
|
|
@ -345,7 +345,7 @@ int ksmbd_vfs_read(struct ksmbd_work *work, struct ksmbd_file *fp, size_t count,
|
|||
ssize_t nbytes = 0;
|
||||
struct inode *inode = file_inode(filp);
|
||||
|
||||
if (S_ISDIR(inode->i_mode))
|
||||
if (S_ISDIR(inode->i_mode) && !ksmbd_stream_fd(fp))
|
||||
return -EISDIR;
|
||||
|
||||
if (unlikely(count == 0))
|
||||
|
|
@ -474,7 +474,8 @@ int ksmbd_vfs_write(struct ksmbd_work *work, struct ksmbd_file *fp,
|
|||
|
||||
if (work->conn->connection_type) {
|
||||
if (!(fp->daccess & (FILE_WRITE_DATA_LE | FILE_APPEND_DATA_LE)) ||
|
||||
S_ISDIR(file_inode(fp->filp)->i_mode)) {
|
||||
(S_ISDIR(file_inode(fp->filp)->i_mode) &&
|
||||
!ksmbd_stream_fd(fp))) {
|
||||
pr_err("no right to write(%pD)\n", fp->filp);
|
||||
err = -EACCES;
|
||||
goto out;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user