From b42bf88828cde60772dc08201d0a4f1a0663d7bc Mon Sep 17 00:00:00 2001 From: Pavel Shilovsky Date: Wed, 14 Aug 2013 19:25:21 +0400 Subject: CIFS: Implement follow_link for SMB2 that allows to access files through symlink created on a server. Acked-by: Jeff Layton Signed-off-by: Pavel Shilovsky Signed-off-by: Steve French --- fs/cifs/smb2misc.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fs/cifs/smb2misc.c') diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c index b0c43345cd98..6103359fb598 100644 --- a/fs/cifs/smb2misc.c +++ b/fs/cifs/smb2misc.c @@ -171,6 +171,10 @@ smb2_check_message(char *buf, unsigned int length) if (4 + len != clc_len) { cifs_dbg(FYI, "Calculated size %u length %u mismatch mid %llu\n", clc_len, 4 + len, mid); + /* create failed on symlink */ + if (command == SMB2_CREATE_HE && + hdr->Status == STATUS_STOPPED_ON_SYMLINK) + return 0; /* Windows 7 server returns 24 bytes more */ if (clc_len + 20 == len && command == SMB2_OPLOCK_BREAK_HE) return 0; -- cgit v1.2.3