]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Jan 2024 16:10:32 +0000 (17:10 +0100)
[ Upstream commit ef22bb800d967616c7638d204bc1b425beac7f5f ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/smb/client/inode.c

index 7be51f9d2fa181ae655dcf1477d3eaf69274d5a6..5343898bac8a679d151689d7b45286d3ac53136c 100644 (file)
@@ -264,7 +264,7 @@ cifs_unix_basic_to_fattr(struct cifs_fattr *fattr, FILE_UNIX_BASIC_INFO *info,
                fattr->cf_dtype = DT_REG;
                break;
        case UNIX_SYMLINK:
-               fattr->cf_mode |= S_IFLNK;
+               fattr->cf_mode |= S_IFLNK | cifs_sb->ctx->file_mode;
                fattr->cf_dtype = DT_LNK;
                break;
        case UNIX_DIR: