git: 3fe0cb6695e0 - main - rpc.tlsclntd: Check for a tls syscall failure.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 21 Dec 2022 23:13:06 UTC
The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=3fe0cb6695e062b5474ae957bf1856e85ba890bd commit 3fe0cb6695e062b5474ae957bf1856e85ba890bd Author: Rick Macklem <rmacklem@FreeBSD.org> AuthorDate: 2022-12-21 23:12:06 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2022-12-21 23:12:06 +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. 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();