From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Layton Subject: [PATCH] error out if signing was requested, but can't be fulfilled Date: Thu, 5 Jul 2007 15:42:54 -0400 Message-ID: <20070705154254.5f0f2a65.jlayton@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: linux-cifs-client@lists.samba.org Return-path: Received: from mx1.redhat.com ([66.187.233.31]:36777 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758137AbXGETm6 (ORCPT ); Thu, 5 Jul 2007 15:42:58 -0400 Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Currently, if mount with a signing-enabled sec= option (e.g. sec=ntlmi), the kernel does a warning printk if the server doesn't support signing, and then proceeds without signatures. This is probably OK for people that think to look at the ring buffer, but seems wrong to me. If someone explicitly requests signing, we should error out if that request can't be satisfied. They can then reattempt the mount without signing if that's ok. Is there any reason not to do something like the following patch? Signed-off-by: Jeff Layton diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 4a2458e..c9cae48 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -650,6 +650,7 @@ signing_check: (SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED)) == 0) { cERROR(1, ("signing required but server lacks support")); + rc = -EOPNOTSUPP; } else server->secMode |= SECMODE_SIGN_REQUIRED; } else {