[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r15482 - in /fsf/trunk/libc: ChangeLog manual/signal.texi nss/nss_files/files-initgroups.c



Author: eglibc
Date: Wed Sep 28 00:02:47 2011
New Revision: 15482

Log:
Import glibc-mainline for 2011-09-28

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/manual/signal.texi
    fsf/trunk/libc/nss/nss_files/files-initgroups.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Wed Sep 28 00:02:47 2011
@@ -1,3 +1,13 @@
+2011-09-27  Roland McGrath  <roland@xxxxxxxxxxxxx>
+
+	[BZ #13226]
+	* manual/signal.texi (Longjmp in Handler): Grammar fixes.
+
+2011-09-27  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* nss/nss_files/files-initgroups.c (_nss_files_initgroups_dyn):
+	Reread the line before reparsing it.
+
 2011-09-26  Andreas Schwab  <schwab@xxxxxxxxxx>
 
 	* sysdeps/x86_64/fpu/bits/mathinline.h: Use __asm instead of asm.

Modified: fsf/trunk/libc/manual/signal.texi
==============================================================================
--- fsf/trunk/libc/manual/signal.texi (original)
+++ fsf/trunk/libc/manual/signal.texi Wed Sep 28 00:02:47 2011
@@ -1544,8 +1544,8 @@
 Blocking the signal delays its delivery until it is unblocked, once the
 critical updating is finished.  @xref{Blocking Signals}.
 
-The other way to re-initialize the crucial data structures in the signal
-handler, or make their values consistent.
+The other way is to re-initialize the crucial data structures in the
+signal handler, or to make their values consistent.
 
 Here is a rather schematic example showing the reinitialization of one
 global variable.

Modified: fsf/trunk/libc/nss/nss_files/files-initgroups.c
==============================================================================
--- fsf/trunk/libc/nss/nss_files/files-initgroups.c (original)
+++ fsf/trunk/libc/nss/nss_files/files-initgroups.c Wed Sep 28 00:02:47 2011
@@ -52,8 +52,10 @@
   gid_t *groups = *groupsp;
 
   /* We have to iterate over the entire file.  */
-  while (!feof_unlocked (stream))
+  while (1)
     {
+      fpos_t pos;
+      fgetpos (stream, &pos);
       ssize_t n = getline (&line, &linelen, stream);
       if (n < 0)
 	{
@@ -64,9 +66,8 @@
 	}
 
       struct group grp;
-      int res;
-      while ((res = _nss_files_parse_grent (line, &grp, buffer, buflen,
-					    errnop)) == -1)
+      int res = _nss_files_parse_grent (line, &grp, buffer, buflen, errnop);
+      if (res == -1)
 	{
 	  size_t newbuflen = 2 * buflen;
 	  if (buffer_use_malloc || ! __libc_use_alloca (buflen + newbuflen))
@@ -85,6 +86,9 @@
 	    }
 	  else
 	    buffer = extend_alloca (buffer, buflen, newbuflen);
+	  /* Reread current line, the parser has clobbered it.  */
+	  fsetpos (stream, &pos);
+	  continue;
 	}
 
       if (res > 0 && grp.gr_gid != group)