Skip to content

Commit

Permalink
CLIENT: don't try to lookup getservbyport(0, ...)
Browse files Browse the repository at this point in the history
'sssd_nss' won't handle this request anyway.
  • Loading branch information
alexey-tikhonov committed Nov 12, 2024
1 parent 2d408ed commit 4b4a467
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/sss_client/nss_services.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4b4a467

Please sign in to comment.