From 0008163a30fec920ede228aea2f6e06e75e76514 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 22 Aug 2007 16:04:18 +0000 Subject: [PATCH] * nis/nis_table.c (nis_list): Don't fail if __follow_path returned NIS_NOTFOUND. --- ChangeLog | 5 +++++ nis/nis_table.c | 13 +++++++++---- string/strfry.c | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3436b76f64..f02bd4b998 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-08-17 Jakub Jelinek + + * nis/nis_table.c (nis_list): Don't fail if __follow_path returned + NIS_NOTFOUND. + 2007-08-21 Ulrich Drepper [BZ #4566] diff --git a/nis/nis_table.c b/nis/nis_table.c index 70b4701419..3704b0094e 100644 --- a/nis/nis_table.c +++ b/nis/nis_table.c @@ -372,7 +372,8 @@ nis_list (const_nis_name name, unsigned int flags, &bptr); if (clnt_status != NIS_SUCCESS) { - NIS_RES_STATUS (res) = clnt_status; + if (clnt_status == NIS_NOMEMORY) + NIS_RES_STATUS (res) = clnt_status; ++done; } else @@ -452,10 +453,14 @@ nis_list (const_nis_name name, unsigned int flags, ++done; else { - NIS_RES_STATUS (res) + clnt_status = __follow_path (&tablepath, &tableptr, ibreq, &bptr); - if (NIS_RES_STATUS (res) != NIS_SUCCESS) - ++done; + if (clnt_status != NIS_SUCCESS) + { + if (clnt_status == NIS_NOMEMORY) + NIS_RES_STATUS (res) = clnt_status; + ++done; + } } } break; diff --git a/string/strfry.c b/string/strfry.c index a8b202d176..d392d5526b 100644 --- a/string/strfry.c +++ b/string/strfry.c @@ -42,7 +42,7 @@ strfry (char *string) { int32_t j; __random_r (&rdata, &j); - j = j % len + 1; + j = j % (len - i) + i; char c = string[i]; string[i] = string[j];