diff --git a/glibc-nis-initgroups.diff b/glibc-nis-initgroups.diff new file mode 100644 index 0000000..59ac9c5 --- /dev/null +++ b/glibc-nis-initgroups.diff @@ -0,0 +1,39 @@ +2010-05-31 Petr Baudis + + * nis/nss_compat/compat-initgroups.c (internal_getgrent_r): Fix + initialization of skip_initgroups_dyn. + +diff --git a/nis/nss_compat/compat-initgroups.c b/nis/nss_compat/compat-initgroups.c +index 07a3b92..de8d95c 100644 +--- a/nis/nss_compat/compat-initgroups.c ++++ b/nis/nss_compat/compat-initgroups.c +@@ -474,18 +474,21 @@ internal_getgrent_r (ent_t *ent, char *buffer, size_t buflen, const char *user, + /* If the selected module does not support getgrent_r or + initgroups_dyn, abort. We cannot find the needed group + entries. */ +- if (nss_getgrent_r == NULL && nss_initgroups_dyn == NULL) ++ if (nss_initgroups_dyn == NULL || nss_getgrgid_r == NULL) ++ { ++ if (nss_setgrent != NULL) ++ { ++ nss_setgrent (1); ++ ent->need_endgrent = true; ++ } ++ ent->skip_initgroups_dyn = true; ++ } ++ ++ if (ent->skip_initgroups_dyn && nss_getgrent_r == NULL) + return NSS_STATUS_UNAVAIL; + + ent->files = false; + +- if (nss_initgroups_dyn == NULL && nss_setgrent != NULL) +- { +- nss_setgrent (1); +- ent->need_endgrent = true; +- } +- ent->skip_initgroups_dyn = true; +- + return getgrent_next_nss (ent, buffer, buflen, user, group, + start, size, groupsp, limit, errnop); + } diff --git a/glibc.changes b/glibc.changes index 805cb96..89c01c0 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jul 7 04:12:05 CEST 2010 - pbaudis@suse.cz + +- Fix NIS-compat initgroups routine to work reliably over multiple + invocations [bnc#607064] + ------------------------------------------------------------------- Thu Jul 1 19:52:56 UTC 2010 - jengelh@medozas.de diff --git a/glibc.spec b/glibc.spec index 155e90d..859668b 100644 --- a/glibc.spec +++ b/glibc.spec @@ -137,6 +137,7 @@ Patch61: glibc-ppc64-vdso-time.diff Patch64: glibc-gai-private4.diff Patch65: glibc-resolv-mdnshint.diff Patch66: glibc-ldconfigr-aux.diff +Patch67: glibc-nis-initgroups.diff Patch500: ARM_glibc-2.10.1-local-eabi-wchar.diff Patch501: ARM_glibc-2.10.1-local-hwcap-updates.diff Patch502: ARM_glibc-2.10.1-local-lowlevellock.diff @@ -359,6 +360,7 @@ rm nscd/s-stamp %patch64 %patch65 -p1 %patch66 -p1 +%patch67 -p1 %ifarch %arm armv5tel armv7l %patch500 %patch501