git: 39633fc1731c - main - nfscl: Improve NFSv4 error message for NFSERR_WRONGSEC

From: Rick Macklem <rmacklem_at_FreeBSD.org>
Date: Wed, 11 Jan 2023 21:29:45 UTC
The branch main has been updated by rmacklem:

URL: https://cgit.FreeBSD.org/src/commit/?id=39633fc1731c3feeed36aa452bbdfb7968a86383

commit 39633fc1731c3feeed36aa452bbdfb7968a86383
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2023-01-11 21:28:44 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2023-01-11 21:28:44 +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.
    
    MFC after:      2 weeks
---
 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 fc62783e3965..7f9b18e9970a 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);