From bd1ebae0eb756824f9a8dbc66aa2913733c06354 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 7 Aug 2006 16:03:46 +0000 Subject: * nis/nis_call.c: Minor cleanups throughout. (rec_dirsearch) [HIGHER_NAME]: Correctly size ndomain array. (first_shoot): Add search_parent_first parameter. Only if it is set search parent server first. If directory for table found through cold start cache is not the same as referenced in the cache, don't use it. (__nisfind_server): Take additional parameter. Pass it on to first_shoot. (__prepare_niscall): Adjust __nisfind_server call. * nis/rpcsvc/nislib.h: Adjust __nisfind_server prototype. * nis/nis_table.c: Adjust __nisfind_server call. * nis/nis_lookup.c: Likewise. (nis_lookup): Don't loop endlessly if name is reduced to ".". --- nis/nis_lookup.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'nis/nis_lookup.c') diff --git a/nis/nis_lookup.c b/nis/nis_lookup.c index c198376..839ee4e 100644 --- a/nis/nis_lookup.c +++ b/nis/nis_lookup.c @@ -127,7 +127,7 @@ nis_lookup (const_nis_name name, const unsigned int flags) /* Otherwise __nisfind_server will not do anything. */ dir = NULL; - if (__nisfind_server (req.ns_name, &dir) + if (__nisfind_server (req.ns_name, 1, &dir) != NIS_SUCCESS) goto out; @@ -147,6 +147,11 @@ nis_lookup (const_nis_name name, const unsigned int flags) nis_domain_of_r (req.ns_name, ndomain, sizeof (ndomain)); req.ns_name = strdupa (ndomain); + if (strcmp (ndomain, ".") == 0) + { + NIS_RES_STATUS (res) = NIS_NAMEUNREACHABLE; + goto out; + } __nisbind_destroy (&bptr); nis_free_directory (dir); -- cgit v1.1