git: 1134f0d9a47a - stable/13 - nfscl: Improve NFSv4 error message for NFSERR_WRONGSEC

From: Rick Macklem <rmacklem_at_FreeBSD.org>
Date: Thu, 26 Jan 2023 03:01:49 UTC
The branch stable/13 has been updated by rmacklem:

URL: https://cgit.FreeBSD.org/src/commit/?id=1134f0d9a47acd65bc343a58a2eda274dc6a32b5

commit 1134f0d9a47acd65bc343a58a2eda274dc6a32b5
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2023-01-11 21:28:44 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2023-01-26 03:00:52 +0000

    nfscl: Improve NFSv4 error message for NFSERR_WRONGSEC
    
    The usual reason for an NFSv4 server replying NFSERR_WRONGSEC
    to an operation is that a Kerberos credential is required.
    This patch replaces a cryptic "err=10016" with a message
    suggesting that a Kerberos TGT is probably needed.
    
    (cherry picked from commit 39633fc1731c3feeed36aa452bbdfb7968a86383)
---
 sys/fs/nfsclient/nfs_clport.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c
index d530b848431e..4d8599c18363 100644
--- a/sys/fs/nfsclient/nfs_clport.c
+++ b/sys/fs/nfsclient/nfs_clport.c
@@ -1194,6 +1194,10 @@ nfscl_maperr(struct thread *td, int error, uid_t uid, gid_t gid)
 		printf("nfsv4 no file handle: usually means the file "
 		    "system is not exported on the NFSv4 server\n");
 		return (EIO);
+	case NFSERR_WRONGSEC:
+		tprintf(p, LOG_INFO, "NFSv4 error WrongSec: You probably need a"
+		    " Kerberos TGT\n");
+		return (EIO);
 	default:
 		tprintf(p, LOG_INFO, "nfsv4 err=%d\n", error);
 		return (EIO);