]> www.infradead.org Git - users/dwmw2/linux.git/commit
SMB2: Fix share type handling
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 12 May 2017 15:59:32 +0000 (17:59 +0200)
committerSasha Levin <alexander.levin@microsoft.com>
Wed, 23 May 2018 01:36:23 +0000 (21:36 -0400)
commit64e47d05e60788575f7070055ee4c888e2cb73ec
tree9b38565818d7ecb46531353624c20a15e888560a
parent3206d71e98ab56d4160ecb24db446d44040d8d3f
SMB2: Fix share type handling

[ Upstream commit cd1230070ae1c12fd34cf6a557bfa81bf9311009 ]

In fs/cifs/smb2pdu.h, we have:
#define SMB2_SHARE_TYPE_DISK    0x01
#define SMB2_SHARE_TYPE_PIPE    0x02
#define SMB2_SHARE_TYPE_PRINT   0x03

Knowing that, with the current code, the SMB2_SHARE_TYPE_PRINT case can
never trigger and printer share would be interpreted as disk share.

So, test the ShareType value for equality instead.

Fixes: faaf946a7d5b ("CIFS: Add tree connect/disconnect capability for SMB2")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
fs/cifs/smb2pdu.c