cifs: Fix recognizing SFU symlinks
authorPali Rohár <pali@kernel.org>
Thu, 12 Sep 2024 12:05:42 +0000 (14:05 +0200)
committerSteve French <stfrench@microsoft.com>
Sun, 15 Sep 2024 15:42:45 +0000 (10:42 -0500)
SFU symlinks have 8 byte prefix: "IntxLNK\1".
So check also the last 8th byte 0x01.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/inode.c

index 73e2e6c230b735b9f97a1991626b7a38d22c5453..7d424e769a5670454f84abac599307d19e0fecb6 100644 (file)
@@ -612,7 +612,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const char *path,
                        cifs_dbg(FYI, "Socket\n");
                        fattr->cf_mode |= S_IFSOCK;
                        fattr->cf_dtype = DT_SOCK;
-               } else if (memcmp("IntxLNK", pbuf, 7) == 0) {
+               } else if (memcmp("IntxLNK\1", pbuf, 8) == 0) {
                        cifs_dbg(FYI, "Symlink\n");
                        fattr->cf_mode |= S_IFLNK;
                        fattr->cf_dtype = DT_LNK;