From patchwork Thu Jun 27 00:18:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 2789311 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 168649F245 for ; Thu, 27 Jun 2013 00:18:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 00AF9201F9 for ; Thu, 27 Jun 2013 00:18:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D32A2201CA for ; Thu, 27 Jun 2013 00:18:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752066Ab3F0ASL (ORCPT ); Wed, 26 Jun 2013 20:18:11 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:32781 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751663Ab3F0ASK (ORCPT ); Wed, 26 Jun 2013 20:18:10 -0400 Received: by mail-pd0-f172.google.com with SMTP id z10so52239pdj.3 for ; Wed, 26 Jun 2013 17:18:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=VwdwROVjj8F7hL/KuJqzYSyRNzHdp7Bc+7TMGju2nnk=; b=hKz05AA/ws5aQNtSxlE7CPD+Q8KVqhzmBZ8rR8VhnZxC2hctabBxBvNN48VQIti8V+ UOoheFDFPaM76+sGZg7suWzyy0zs48b0vUHraylkYKfLNM826+kEez4tOn7hwYgz79UJ ZAVyo6v+3EF0s6J6b27L4xhFnn2o3XxelAFaVx4n9tAbi73A/Dl620Z7CK91ThgN1sGE wZb+ruabepntf0w8vNA0aThA4OfKZQJ3U7rR2ud7zH9AeiO85n57LdTzWIvzKbJUWIgD cHPhjl08DotIdwdxFSu0PAIy0VXVcFCmN1u0M1gDYPqrmzu+isuDvU4vg08qpnhwCGPt A1Dg== MIME-Version: 1.0 X-Received: by 10.66.248.68 with SMTP id yk4mr3245868pac.137.1372292290269; Wed, 26 Jun 2013 17:18:10 -0700 (PDT) Received: by 10.68.128.9 with HTTP; Wed, 26 Jun 2013 17:18:10 -0700 (PDT) Date: Wed, 26 Jun 2013 19:18:10 -0500 Message-ID: Subject: [CIFS][PATCH] Do not set DFS flag on SMB2 open From: Steve French To: linux-cifs@vger.kernel.org Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP commit f87ab88b4065a9ef00620224c4fafadc201a430c Author: Steve French Date: Wed Jun 26 19:14:55 2013 -0500 [CIFS] Do not set DFS flag on SMB2 open If we would set SMB2_FLAGS_DFS_OPERATIONS on open we also would have to pass the path on the Open SMB prefixed by \\server\share. Not sure when we would need to do the augmented path (if ever) and setting this flag breaks the SMB2 open operation since it is illegal to send an empty path name (without \\server\share prefix) when the DFS flag is set in the SMB open header. We could consider setting the flag on all operations other than open but it is safer to not set it for now. Note that we still get error path not covered (when needed to give us a dfs referral) even when the flag is off. Signed-off-by: Steve French out: diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 53275bf..2b312e4 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -120,13 +120,20 @@ smb2_hdr_assemble(struct smb2_hdr *hdr, __le16 smb2_cmd /* command */ , /* Uid is not converted */ if (tcon->ses) hdr->SessionId = tcon->ses->Suid; - /* BB check following DFS flags BB */ - /* BB do we have to add check for SHI1005_FLAGS_DFS_ROOT too? */ - if (tcon->share_flags & SHI1005_FLAGS_DFS) - hdr->Flags |= SMB2_FLAGS_DFS_OPERATIONS; - /* BB how does SMB2 do case sensitive? */ - /* if (tcon->nocase) - hdr->Flags |= SMBFLG_CASELESS; */ + + /* + * If we would set SMB2_FLAGS_DFS_OPERATIONS on open we also would have + * to pass the path on the Open SMB prefixed by \\server\share. + * Not sure when we would need to do the augmented path (if ever) and + * setting this flag breaks the SMB2 open operation since it is + * illegal to send an empty path name (without \\server\share prefix) + * when the DFS flag is set in the SMB open header. We could + * consider setting the flag on all operations other than open + * but it is safer to net set it for now. + */ +/* if (tcon->share_flags & SHI1005_FLAGS_DFS) + hdr->Flags |= SMB2_FLAGS_DFS_OPERATIONS; */ + if (tcon->ses && tcon->ses->server && tcon->ses->server->sign) hdr->Flags |= SMB2_FLAGS_SIGNED;