From 38c10a1ddb24b9fa9f25b6c21d0390a9723ae6d6 Mon Sep 17 00:00:00 2001 From: Jeff Date: Fri, 6 Jul 2007 21:10:07 +0000 Subject: [CIFS] Mount should fail if server signing off but client mount option requires it 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. Signed-off-by: Jeff Layton Signed-off-by: Steve French --- fs/cifs/cifssmb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fs/cifs/cifssmb.c') diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 4a2458e78784..b4916eb6fd43 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -645,11 +645,12 @@ signing_check: ~(SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED); } else if ((secFlags & CIFSSEC_MUST_SIGN) == CIFSSEC_MUST_SIGN) { /* signing required */ - cFYI(1, ("Must sign - segFlags 0x%x", secFlags)); + cFYI(1, ("Must sign - secFlags 0x%x", secFlags)); if ((server->secMode & (SECMODE_SIGN_ENABLED | SECMODE_SIGN_REQUIRED)) == 0) { cERROR(1, ("signing required but server lacks support")); + rc = -EOPNOTSUPP; } else server->secMode |= SECMODE_SIGN_REQUIRED; } else { -- cgit v1.2.3