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
This commit is contained in:
Rick Macklem 2022-12-21 15:12:06 -08:00
parent 3266131908
commit 3fe0cb6695

View File

@ -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();