diff --git a/smb2pdu.c b/smb2pdu.c index 90ff349b..d7709f5a 100644 --- a/smb2pdu.c +++ b/smb2pdu.c @@ -1973,6 +1973,11 @@ int smb2_tree_connect(struct ksmbd_work *work) ksmbd_debug(SMB, "tree connect request for tree %s treename %s\n", name, treename); + if (ksmbd_override_fsids(work)) { + status.ret = KSMBD_TREE_CONN_STATUS_ERROR; + goto out_err1; + } + status = ksmbd_tree_conn_connect(conn, sess, name); if (status.ret == KSMBD_TREE_CONN_STATUS_OK) rsp->hdr.Id.SyncId.TreeId = cpu_to_le32(status.tree_conn->id); @@ -2012,6 +2017,7 @@ int smb2_tree_connect(struct ksmbd_work *work) write_unlock(&sess->tree_conns_lock); rsp->StructureSize = cpu_to_le16(16); out_err1: + ksmbd_revert_fsids(work); if (server_conf.flags & KSMBD_GLOBAL_FLAG_DURABLE_HANDLE && share && test_share_config_flag(share, KSMBD_SHARE_FLAG_CONTINUOUS_AVAILABILITY))