Skip to content

Commit f4ca4f5

Browse files
palismfrench
authored andcommitted
cifs: Fix parsing reparse point with native symlink in SMB1 non-UNICODE session
SMB1 NT_TRANSACT_IOCTL/FSCTL_GET_REPARSE_POINT even in non-UNICODE mode returns reparse buffer in UNICODE/UTF-16 format. This is because FSCTL_GET_REPARSE_POINT is NT-based IOCTL which does not distinguish between 8-bit non-UNICODE and 16-bit UNICODE modes and its path buffers are always encoded in UTF-16. This change fixes reading of native symlinks in SMB1 when UNICODE session is not active. Fixes: ed3e0a1 ("smb: client: implement ->query_reparse_point() for SMB1") Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 1f48660 commit f4ca4f5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/smb/client/smb1ops.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,12 +1000,11 @@ static int cifs_parse_reparse_point(struct cifs_sb_info *cifs_sb,
10001000
{
10011001
struct reparse_data_buffer *buf;
10021002
TRANSACT_IOCTL_RSP *io = rsp_iov->iov_base;
1003-
bool unicode = !!(io->hdr.Flags2 & SMBFLG2_UNICODE);
10041003
u32 plen = le16_to_cpu(io->ByteCount);
10051004

10061005
buf = (struct reparse_data_buffer *)((__u8 *)&io->hdr.Protocol +
10071006
le32_to_cpu(io->DataOffset));
1008-
return parse_reparse_point(buf, plen, cifs_sb, full_path, unicode, data);
1007+
return parse_reparse_point(buf, plen, cifs_sb, full_path, true, data);
10091008
}
10101009

10111010
static bool

0 commit comments

Comments
 (0)