Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Dec 2022 01:28:59 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: 6e9ab1e63192 - stable/13 - rpc.tlsservd: Check for a tls syscall failure.
Message-ID:  <202212290128.2BT1Sxge071211@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=6e9ab1e63192130c4e2fdd16ac8c190e14a886d1

commit 6e9ab1e63192130c4e2fdd16ac8c190e14a886d1
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2022-12-22 17:10:27 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2022-12-29 01:27:24 +0000

    rpc.tlsservd: 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 ab3c59a107c56d4304b6ba2c36116b87a0122b4f)
---
 usr.sbin/rpc.tlsservd/rpc.tlsservd.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/usr.sbin/rpc.tlsservd/rpc.tlsservd.c b/usr.sbin/rpc.tlsservd/rpc.tlsservd.c
index 8c364584a76c..ffcb856643b9 100644
--- a/usr.sbin/rpc.tlsservd/rpc.tlsservd.c
+++ b/usr.sbin/rpc.tlsservd/rpc.tlsservd.c
@@ -343,7 +343,14 @@ main(int argc, char **argv)
 	rpctls_gothup = false;
 	LIST_INIT(&rpctls_ssllist);
 
-	rpctls_syscall(RPCTLS_SYSC_SRVSETPATH, _PATH_RPCTLSSDSOCK);
+	if (rpctls_syscall(RPCTLS_SYSC_SRVSETPATH, _PATH_RPCTLSSDSOCK) < 0) {
+		if (rpctls_debug_level == 0) {
+			syslog(LOG_ERR,
+			    "Can't set upcall socket errno=%d", errno);
+			exit(1);
+		}
+		err(1, "Can't set upcall socket");
+	}
 
 	rpctls_svc_run();
 



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