smb: client: fix missing mode bits for SMB symlinks
authorPaulo Alcantara <pc@manguebit.com>
Sun, 26 Nov 2023 02:55:10 +0000 (23:55 -0300)
committerSteve French <stfrench@microsoft.com>
Wed, 29 Nov 2023 02:40:21 +0000 (20:40 -0600)
When instantiating inodes for SMB symlinks, add the mode bits from
@cifs_sb->ctx->file_mode as we already do for the other special files.

Cc: stable@vger.kernel.org
Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/inode.c

index 47f49be69ced2563b87161538cba78800375eca6..42ef8ca446d0dc8970d9e7e7e6487e99d6741e33 100644 (file)
@@ -790,7 +790,7 @@ bool cifs_reparse_point_to_fattr(struct cifs_sb_info *cifs_sb,
        case 0: /* SMB1 symlink */
        case IO_REPARSE_TAG_SYMLINK:
        case IO_REPARSE_TAG_NFS:
-               fattr->cf_mode = S_IFLNK;
+               fattr->cf_mode = S_IFLNK | cifs_sb->ctx->file_mode;
                fattr->cf_dtype = DT_LNK;
                break;
        default: