mirror of
git://sourceware.org/git/glibc.git
synced 2025-04-24 14:41:06 +08:00
(_nss_nis_getservbyname_r): Allow protocol=NULL to match any protocol
rather than returning an error.
This commit is contained in:
parent
59c37b6b21
commit
ea00844dfb
@ -204,7 +204,7 @@ _nss_nis_getservbyname_r (const char *name, char *protocol,
|
||||
enum nss_status status;
|
||||
int found;
|
||||
|
||||
if (name == NULL || protocol == NULL)
|
||||
if (name == NULL)
|
||||
{
|
||||
__set_errno (EINVAL);
|
||||
return NSS_STATUS_UNAVAIL;
|
||||
@ -219,7 +219,7 @@ _nss_nis_getservbyname_r (const char *name, char *protocol,
|
||||
((status = internal_nis_getservent_r (serv, buffer, buflen, &data))
|
||||
== NSS_STATUS_SUCCESS))
|
||||
{
|
||||
if (strcmp (serv->s_proto, protocol) == 0)
|
||||
if (protocol == NULL || strcmp (serv->s_proto, protocol) == 0)
|
||||
{
|
||||
char **cp;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user