From 3fe0cb6695e062b5474ae957bf1856e85ba890bd Mon Sep 17 00:00:00 2001 From: Rick Macklem Date: Wed, 21 Dec 2022 15:12:06 -0800 Subject: [PATCH] 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. MFC after: 1 week --- 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();