2004-04-01  Jakub Jelinek  <jakub@redhat.com>

	* nis/nss_nis/nis-service.c (_nss_nis_getservbyname_r): If protocol
	is NULL, instead of trying yp_match (name/tcp), yp_match (name/udp),
	yp_all, try yp_match (name), yp_all.

2004-04-01  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/generic/dl-sysdep.c (_dl_show_auxv): Add handling for
	ignored entries.  Ignore AT_IGNOREPPC.
This commit is contained in:
Ulrich Drepper 2004-04-01 09:03:29 +00:00
parent bf244ee81f
commit dd047aa514
2 changed files with 58 additions and 51 deletions

View File

@ -1,3 +1,14 @@
2004-04-01 Jakub Jelinek <jakub@redhat.com>
* nis/nss_nis/nis-service.c (_nss_nis_getservbyname_r): If protocol
is NULL, instead of trying yp_match (name/tcp), yp_match (name/udp),
yp_all, try yp_match (name), yp_all.
2004-04-01 Ulrich Drepper <drepper@redhat.com>
* sysdeps/generic/dl-sysdep.c (_dl_show_auxv): Add handling for
ignored entries. Ignore AT_IGNOREPPC.
2004-03-31 Andreas Jaeger <aj@suse.de> 2004-03-31 Andreas Jaeger <aj@suse.de>
* libio/fileops.c (new_do_write): Return _IO_size_t to make 64-bit * libio/fileops.c (new_do_write): Return _IO_size_t to make 64-bit

View File

@ -279,60 +279,56 @@ _nss_nis_getservbyname_r (const char *name, const char *protocol,
return NSS_STATUS_UNAVAIL; return NSS_STATUS_UNAVAIL;
/* If the protocol is given, we could try if our NIS server knows /* If the protocol is given, we could try if our NIS server knows
about services.byservicename map. If yes, we only need one query. about services.byservicename map. If yes, we only need one query. */
If the protocol is not given, try first name/tcp, then name/udp char key[strlen (name) + (protocol ? strlen (protocol) : 0) + 2];
and then fallback to sequential scanning of services.byname map. */ char *cp, *result;
const char *proto = protocol != NULL ? protocol : "tcp"; size_t keylen, len;
do int int_len;
/* key is: "name/proto" */
cp = stpcpy (key, name);
if (protocol)
{ {
char key[strlen (name) + strlen (proto) + 2];
char *cp, *result;
size_t keylen, len;
int int_len;
/* key is: "name/proto" */
cp = stpcpy (key, name);
*cp++ = '/'; *cp++ = '/';
stpcpy (cp, proto); strcpy (cp, protocol);
keylen = strlen (key); }
status = yperr2nss (yp_match (domain, "services.byservicename", key, keylen = strlen (key);
keylen, &result, &int_len)); status = yperr2nss (yp_match (domain, "services.byservicename", key,
len = int_len; keylen, &result, &int_len));
len = int_len;
/* If we found the key, it's ok and parse the result. If not,
fall through and parse the complete table. */ /* If we found the key, it's ok and parse the result. If not,
if (status == NSS_STATUS_SUCCESS) fall through and parse the complete table. */
{ if (status == NSS_STATUS_SUCCESS)
struct parser_data *pdata = (void *) buffer; {
int parse_res; struct parser_data *pdata = (void *) buffer;
char *p; int parse_res;
char *p;
if ((size_t) (len + 1) > buflen)
{ if ((size_t) (len + 1) > buflen)
free (result); {
*errnop = ERANGE; free (result);
return NSS_STATUS_TRYAGAIN; *errnop = ERANGE;
} return NSS_STATUS_TRYAGAIN;
}
p = strncpy (buffer, result, len);
buffer[len] = '\0'; p = strncpy (buffer, result, len);
while (isspace (*p)) buffer[len] = '\0';
++p; while (isspace (*p))
free (result); ++p;
parse_res = _nss_files_parse_servent (p, serv, pdata, free (result);
buflen, errnop); parse_res = _nss_files_parse_servent (p, serv, pdata,
if (parse_res < 0) buflen, errnop);
{ if (parse_res < 0)
if (parse_res == -1) {
return NSS_STATUS_TRYAGAIN; if (parse_res == -1)
else return NSS_STATUS_TRYAGAIN;
return NSS_STATUS_NOTFOUND; else
} return NSS_STATUS_NOTFOUND;
else }
return NSS_STATUS_SUCCESS; else
} return NSS_STATUS_SUCCESS;
} }
while (protocol == NULL && (proto[0] == 't' ? (proto = "udp") : NULL));
struct ypall_callback ypcb; struct ypall_callback ypcb;
struct search_t req; struct search_t req;