From patchwork Wed Sep 8 04:45:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shirish Pargaonkar X-Patchwork-Id: 162841 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o884ktFJ003235 for ; Wed, 8 Sep 2010 04:49:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751241Ab0IHEtz (ORCPT ); Wed, 8 Sep 2010 00:49:55 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:33275 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751167Ab0IHEtz (ORCPT ); Wed, 8 Sep 2010 00:49:55 -0400 Received: by iwn5 with SMTP id 5so5991239iwn.19 for ; Tue, 07 Sep 2010 21:49:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=9/EagMZjiF74OYJK+swLID+SoFUl0b0dL1lOGGvMsw0=; b=HNvZS6k3DWcg1FrDVcC/It1yuelpTIdoqXcv97XFZ/jl2WS/9wcRC0lP6Z5mvPOp4m pO4lXwzualnhT8kykHYFbNCyOY3HqqFRX5Yct7ZY9P3BYZVd/WbeOTEVUFw8LRv1j0bZ Xby98+Noy94b9CNuriqx5L2fAr6Nxw/X8jo3U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=rChvEwZe5S/SWgPvFhyKdFkkoFVdP0N3bqgrVyq1M93q3LOjNFoDisfOSOF+xtmw/P cQCtJCLciloyuBRiqB681hM7ozq7s1715QYYFGRLlufRdUkqlKgZBGhselBkHkaW3W7j 8MCo5ug0s4SPym5cg+1uYx8V96Z9nbMMLpFGE= Received: by 10.231.172.83 with SMTP id k19mr9221468ibz.114.1283921394479; Tue, 07 Sep 2010 21:49:54 -0700 (PDT) Received: from localhost ([32.97.110.58]) by mx.google.com with ESMTPS id r3sm7866852ibk.7.2010.09.07.21.49.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 07 Sep 2010 21:49:53 -0700 (PDT) From: shirishpargaonkar@gmail.com To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, Shirish Pargaonkar Subject: [PATCH 3/8] ntlmv2/ntlmssp do not assume kerberos as default auth mech Date: Tue, 7 Sep 2010 23:45:18 -0500 Message-Id: <1283921118-13066-1-git-send-email-shirishpargaonkar@gmail.com> X-Mailer: git-send-email 1.6.0.2 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 08 Sep 2010 04:49:56 +0000 (UTC) diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index c65c341..1f1b097 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -604,12 +604,15 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) else rc = -EINVAL; - if (server->sec_kerberos || server->sec_mskerberos) - server->secType = Kerberos; - else if (server->sec_ntlmssp) - server->secType = RawNTLMSSP; - else - rc = -EOPNOTSUPP; + if (server->secType == Kerberos) { + if (!server->sec_kerberos && + !server->sec_mskerberos) + rc = -EOPNOTSUPP; + } else if (server->secType == RawNTLMSSP) { + if (!server->sec_ntlmssp) + rc = -EOPNOTSUPP; + } else + rc = -EOPNOTSUPP; } } else server->capabilities &= ~CAP_EXTENDED_SECURITY;