From: Samuel Cabrero Date: Thu, 13 May 2021 15:01:47 +0000 (+0200) Subject: s3: smbd: Skip calling SMB_VFS_FREADDIR_ATTR() for symlinks X-Git-Tag: tevent-0.11.0~878 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=36a074bb1a23df2bc6e4d6c6b6cfd7023e6ea58d;p=thirdparty%2Fsamba.git s3: smbd: Skip calling SMB_VFS_FREADDIR_ATTR() for symlinks Signed-off-by: Samuel Cabrero --- diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 7977468bd95..2777124c8c6 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -1784,12 +1784,20 @@ static NTSTATUS smbd_marshall_dir_entry(TALLOC_CTX *ctx, } allocation_size = SMB_VFS_GET_ALLOC_SIZE(conn, NULL, &smb_fname->st); - status = SMB_VFS_FREADDIR_ATTR(smb_fname->fsp, - ctx, - &readdir_attr_data); - if (!NT_STATUS_IS_OK(status)) { - if (!NT_STATUS_EQUAL(NT_STATUS_NOT_SUPPORTED, status)) { - return status; + /* + * Skip SMB_VFS_FREADDIR_ATTR if the directory entry is a symlink or + * a DFS symlink. + */ + if (smb_fname->fsp != NULL && + !(mode & FILE_ATTRIBUTE_REPARSE_POINT)) { + status = SMB_VFS_FREADDIR_ATTR(smb_fname->fsp, + ctx, + &readdir_attr_data); + if (!NT_STATUS_IS_OK(status)) { + if (!NT_STATUS_EQUAL(NT_STATUS_NOT_SUPPORTED, + status)) { + return status; + } } }