diff mbox

[CIFS] Warn on requesting default security (ntlm) on mount

Message ID AANLkTi=VmBDQm_1+6j0TzOuhrd+tkydkoJOWJbKsicsb@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Steve French March 16, 2011, 8:19 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 4066e3e..33e11a8 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1888,6 +1888,8 @@  cifs_put_smb_ses(struct cifs_ses *ses)
 	cifs_put_tcp_session(server);
 }

+static bool warned_on_ntlm;  /* globals init to false automatically */
+
 static struct cifs_ses *
 cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
 {
@@ -1962,6 +1964,15 @@  cifs_get_smb_ses(struct TCP_Server_Info
*server, struct smb_vol *volume_info)
 	}
 	ses->cred_uid = volume_info->cred_uid;
 	ses->linux_uid = volume_info->linux_uid;
+
+	/* ntlmv2 is much stronger than ntlm security, and has been broadly
+	supported for many years, time to update default security mechanism */
+	if ((volume_info->secFlg == 0) && warned_on_ntlm == false) {
+		warned_on_ntlm = true;
+		cERROR(1, "default security mechanism requested.  The default "
+			"security mechanism will be upgraded from ntlm to "
+			"ntlmv2 in kernel release 2.6.41");
+	}
 	ses->overrideSecFlg = volume_info->secFlg;