From 4b4a467e0bb0d6abcd0ec2d172a2450e345f826d Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Tue, 12 Nov 2024 11:41:24 +0100 Subject: [PATCH] CLIENT: don't try to lookup `getservbyport(0, ...)` 'sssd_nss' won't handle this request anyway. --- src/sss_client/nss_services.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sss_client/nss_services.c b/src/sss_client/nss_services.c index 4f44cb29c03..53aa95fef05 100644 --- a/src/sss_client/nss_services.c +++ b/src/sss_client/nss_services.c @@ -292,6 +292,11 @@ _nss_sss_getservbyport_r(int port, const char *protocol, return NSS_STATUS_TRYAGAIN; } + if (port == 0) { + *errnop = EINVAL; + return NSS_STATUS_NOTFOUND; + } + if (protocol) { ret = sss_strnlen(protocol, SSS_NAME_MAX, &proto_len); if (ret != 0) {