From 545cf164e211f591b58590a21164701869db4e5e Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 24 May 2006 07:30:09 +0000 Subject: [PATCH] Updated to fedora-glibc-20060524T0721 --- ChangeLog | 9 +++++++ fedora/branch.mk | 4 +-- fedora/glibc.spec.in | 8 +++++- nis/nis_call.c | 2 +- nis/nis_domain_of_r.c | 9 +++++-- nis/nis_lookup.c | 67 +++++++++++++++++++-------------------------------- 6 files changed, 51 insertions(+), 48 deletions(-) diff --git a/ChangeLog b/ChangeLog index 52a54eaec4..3de745cf0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-05-23 Ulrich Drepper + + * nis/nis_lookup.c (nis_lookup): Use __prepare_niscall instead of + doing it all here. When server does not know the answer do not + fail immediate, try parent first. + + * nis/nis_domain_of_r.c (nis_domain_of_r): Add missing buffer + overflow test. + 2006-05-20 Ulrich Drepper * nis/nis_call.c (__prepare_niscall): New function. Split out diff --git a/fedora/branch.mk b/fedora/branch.mk index 089526bce8..773fe3e523 100644 --- a/fedora/branch.mk +++ b/fedora/branch.mk @@ -3,5 +3,5 @@ glibc-branch := fedora glibc-base := HEAD DIST_BRANCH := devel COLLECTION := dist-fc4 -fedora-sync-date := 2006-05-21 21:53 UTC -fedora-sync-tag := fedora-glibc-20060521T2153 +fedora-sync-date := 2006-05-24 07:21 UTC +fedora-sync-tag := fedora-glibc-20060524T0721 diff --git a/fedora/glibc.spec.in b/fedora/glibc.spec.in index 076dae064a..0360f5dd66 100644 --- a/fedora/glibc.spec.in +++ b/fedora/glibc.spec.in @@ -1,4 +1,4 @@ -%define glibcrelease 9 +%define glibcrelease 10 %define auxarches i586 i686 athlon sparcv9 alphaev6 %define prelinkarches noarch %define xenarches i686 athlon @@ -839,6 +839,7 @@ cd build-%{nptl_target_cpu}-linuxnptl && \ %endif %if %{buildxen} +%define nosegneg_subdir_base i686 %define nosegneg_subdir i686/nosegneg cd build-%{nptl_target_cpu}-linuxnptl-nosegneg SubDir=%{nosegneg_subdir} @@ -1308,6 +1309,7 @@ rm -f *.filelist* %files -f rpm.filelist %defattr(-,root,root) %if %{buildxen} && !%{xenpackage} +%dir /%{_lib}/%{nosegneg_subdir_base} %dir /%{_lib}/%{nosegneg_subdir} %endif %ifarch s390x @@ -1392,6 +1394,10 @@ rm -f *.filelist* %endif %changelog +* Wed May 24 2006 Jakub Jelinek 2.4.90-10 +- on i686 make glibc owner of /lib/i686 directory (#192597) +- search parent NIS+ domains (#190803) + * Sun May 21 2006 Jakub Jelinek 2.4.90-9 - update from CVS - big NIS+ changes diff --git a/nis/nis_call.c b/nis/nis_call.c index 9769f68174..f8f00d8c82 100644 --- a/nis/nis_call.c +++ b/nis/nis_call.c @@ -405,7 +405,7 @@ rec_dirsearch (const_nis_name name, directory_obj *dir, nis_error *status) ++run; } while (nis_dir_cmp (domain, dir->do_name) != SAME_NAME); - printf("%s: run=%u\n", __func__, run); + if (run == 1) { /* We have found the directory above. Use it. */ diff --git a/nis/nis_domain_of_r.c b/nis/nis_domain_of_r.c index 1fedcfe074..e2db146038 100644 --- a/nis/nis_domain_of_r.c +++ b/nis/nis_domain_of_r.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1997, 2004 Free Software Foundation, Inc. +/* Copyright (c) 1997, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk , 1997. @@ -29,6 +29,7 @@ nis_domain_of_r (const_nis_name name, char *buffer, size_t buflen) if (buffer == NULL) { + erange: __set_errno (ERANGE); return NULL; } @@ -44,7 +45,11 @@ nis_domain_of_r (const_nis_name name, char *buffer, size_t buflen) cptr_len = strlen (cptr); if (cptr_len == 0) - return strcpy (buffer, "."); + { + if (buflen < 2) + goto erange; + return strcpy (buffer, "."); + } if (__builtin_expect (cptr_len >= buflen, 0)) { diff --git a/nis/nis_lookup.c b/nis/nis_lookup.c index 821b9bce73..c198376464 100644 --- a/nis/nis_lookup.c +++ b/nis/nis_lookup.c @@ -21,6 +21,8 @@ #include #include "nis_xdr.h" #include "nis_intern.h" +#include + nis_result * nis_lookup (const_nis_name name, const unsigned int flags) @@ -61,36 +63,18 @@ nis_lookup (const_nis_name name, const unsigned int flags) req.ns_object.ns_object_len = 0; req.ns_object.ns_object_val = NULL; - status = __nisfind_server (req.ns_name, &dir); - if (status != NIS_SUCCESS) + status = __prepare_niscall (req.ns_name, &dir, &bptr, flags); + if (__builtin_expect (status != NIS_SUCCESS, 0)) { NIS_RES_STATUS (res) = status; goto out; } - status = __nisbind_create (&bptr, dir->do_servers.do_servers_val, - dir->do_servers.do_servers_len, flags); - if (status != NIS_SUCCESS) - { - NIS_RES_STATUS (res) = status; - nis_free_directory (dir); - goto out;; - } - - while (__nisbind_connect (&bptr) != NIS_SUCCESS) - { - if (__nisbind_next (&bptr) != NIS_SUCCESS) - { - nis_free_directory (dir); - NIS_RES_STATUS (res) = NIS_NAMEUNREACHABLE; - goto out; - } - } - do { static const struct timeval RPCTIMEOUT = {10, 0}; enum clnt_stat result; + char ndomain[strlen (req.ns_name) + 1]; again: result = clnt_call (bptr.clnt, NIS_LOOKUP, @@ -106,11 +90,9 @@ nis_lookup (const_nis_name name, const unsigned int flags) if (NIS_RES_STATUS (res) == NIS_SUCCESS) { - if (__type_of(NIS_RES_OBJECT (res)) == NIS_LINK_OBJ + if (__type_of (NIS_RES_OBJECT (res)) == NIS_LINK_OBJ && (flags & FOLLOW_LINKS)) /* We are following links */ { - if (count_links) - free (req.ns_name); /* if we hit the link limit, bail */ if (count_links > NIS_MAXLINKS) { @@ -119,31 +101,15 @@ nis_lookup (const_nis_name name, const unsigned int flags) } ++count_links; req.ns_name = - strdup (NIS_RES_OBJECT (res)->LI_data.li_name); - if (req.ns_name == NULL) - { - nis_free_directory (dir); - res = NULL; - goto out; - } + strdupa (NIS_RES_OBJECT (res)->LI_data.li_name); /* The following is a non-obvious optimization. A nis_freeresult call would call xdr_free as the following code. But it also would unnecessarily free the result structure. We avoid this here along with the necessary tests. */ -#if 1 xdr_free ((xdrproc_t) _xdr_nis_result, (char *) res); memset (res, '\0', sizeof (*res)); -#else - nis_freeresult (res); - res = calloc (1, sizeof (nis_result)); - if (res == NULL) - { - __nisbind_destroy (&bptr); - return NULL; - } -#endif link_first_try = 1; /* Try at first the old binding */ goto again; @@ -176,7 +142,24 @@ nis_lookup (const_nis_name name, const unsigned int flags) } else if (__nisbind_next (&bptr) != NIS_SUCCESS) - break; /* No more servers to search */ + { + /* No more servers to search. Try parent. */ + nis_domain_of_r (req.ns_name, ndomain, + sizeof (ndomain)); + req.ns_name = strdupa (ndomain); + + __nisbind_destroy (&bptr); + nis_free_directory (dir); + dir = NULL; + status = __prepare_niscall (req.ns_name, &dir, + &bptr, flags); + if (__builtin_expect (status != NIS_SUCCESS, 0)) + { + NIS_RES_STATUS (res) = status; + goto out; + } + goto again; + } while (__nisbind_connect (&bptr) != NIS_SUCCESS) { -- 2.11.4.GIT