Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Dec 2022 00:42:51 GMT
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: da838e17366c - stable/13 - rpc.tlsclntd: Check for a tls syscall failure.
Message-ID:  <202212280042.2BS0gplE040090@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by rmacklem:

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

commit da838e17366c42c8b1b719be322d2129a4e75d8c
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2022-12-21 23:12:06 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2022-12-28 00:41:31 +0000

    rpc.tlsclntd: Check for a tls syscall failure.
    
    Although the tls syscall to set up the upcall should
    not normally fail, the daemon should check for such
    a failure.  This patch adds a check for that failure.
    
    (cherry picked from commit 3fe0cb6695e062b5474ae957bf1856e85ba890bd)
---
 usr.sbin/rpc.tlsclntd/rpc.tlsclntd.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/usr.sbin/rpc.tlsclntd/rpc.tlsclntd.c b/usr.sbin/rpc.tlsclntd/rpc.tlsclntd.c
index 841c0b4e3114..caa3b5266e48 100644
--- a/usr.sbin/rpc.tlsclntd/rpc.tlsclntd.c
+++ b/usr.sbin/rpc.tlsclntd/rpc.tlsclntd.c
@@ -285,7 +285,14 @@ main(int argc, char **argv)
 		err(1, "Can't register service for local rpctlscd socket");
 	}
 
-	rpctls_syscall(RPCTLS_SYSC_CLSETPATH, _PATH_RPCTLSCDSOCK);
+	if (rpctls_syscall(RPCTLS_SYSC_CLSETPATH, _PATH_RPCTLSCDSOCK) < 0) {
+		if (rpctls_debug_level == 0) {
+			syslog(LOG_ERR,
+			    "Can't set upcall socket path errno=%d", errno);
+			exit(1);
+		}
+		err(1, "Can't set upcall socket path");
+	}
 
 	rpctls_svc_run();
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202212280042.2BS0gplE040090>