]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
smb3: warn on confusing error scenario with sec=krb5
authorSteve French <stfrench@microsoft.com>
Thu, 16 Jul 2020 05:34:21 +0000 (00:34 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Aug 2020 11:05:19 +0000 (13:05 +0200)
commit 0a018944eee913962bce8ffebbb121960d5125d9 upstream.

When mounting with Kerberos, users have been confused about the
default error returned in scenarios in which either keyutils is
not installed or the user did not properly acquire a krb5 ticket.
Log a warning message in the case that "ENOKEY" is returned
from the get_spnego_key upcall so that users can better understand
why mount failed in those two cases.

CC: Stable <stable@vger.kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/smb2pdu.c

index 06b1a86d76b1855b67279ccbb0d42ce574d24d07..7ff05c06f2a4cb2b3382b311ebc1f46c640a2736 100644 (file)
@@ -1323,6 +1323,8 @@ SMB2_auth_kerberos(struct SMB2_sess_data *sess_data)
        spnego_key = cifs_get_spnego_key(ses);
        if (IS_ERR(spnego_key)) {
                rc = PTR_ERR(spnego_key);
+               if (rc == -ENOKEY)
+                       cifs_dbg(VFS, "Verify user has a krb5 ticket and keyutils is installed\n");
                spnego_key = NULL;
                goto out;
        }