GNU C Library master sources branch, master, updated. glibc-2.12-234-gdb753e2

drepper@sourceware.org drepper@sourceware.org
Sun Dec 19 21:07:00 GMT 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  db753e2cfb2051ebf20dc089f87c5b1297cc2cff (commit)
      from  283007197c526f8f59bdc029a38d76538c70b0ff (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=db753e2cfb2051ebf20dc089f87c5b1297cc2cff

commit db753e2cfb2051ebf20dc089f87c5b1297cc2cff
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Sun Dec 19 16:00:59 2010 -0500

    More accurate computatin of reclen in readdir_r.
    
    Alignment issue can increase the reclen limit.
    Make sure Linux 64-bit readdir_r also accounts for 64-bit alignment
    in getdents.

diff --git a/ChangeLog b/ChangeLog
index 7650dba..3db482a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-12-19  Ulrich Drepper  <drepper@gmail.com>
+
+	* sysdeps/unix/readdir_r.c (__READDIR_R): Compute reclen more accurate.
+	* sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c: Define
+	GETDENTS_64BIT_ALIGNED.
+
 2010-12-14  Ulrich Drepper  <dreper@gmail.com>
 
 	* sysdeps/i386/i686/multiarch/strcmp.S: Undo accident checkin.
diff --git a/sysdeps/unix/readdir_r.c b/sysdeps/unix/readdir_r.c
index 9372791..e166174 100644
--- a/sysdeps/unix/readdir_r.c
+++ b/sysdeps/unix/readdir_r.c
@@ -117,7 +117,8 @@ __READDIR_R (DIR *dirp, DIRENT_TYPE *entry, DIRENT_TYPE **result)
 #ifdef GETDENTS_64BIT_ALIGNED
       /* The d_reclen value might include padding which is not part of
 	 the DIRENT_TYPE data structure.  */
-      reclen = MIN (reclen, sizeof (DIRENT_TYPE));
+      reclen = MIN (reclen,
+		    offsetof (DIRENT_TYPE, d_name) + sizeof (dp->d_name));
 #endif
       *result = memcpy (entry, dp, reclen);
 #ifdef GETDENTS_64BIT_ALIGNED
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c b/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c
index adb92db..12ca1a1 100644
--- a/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c
+++ b/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c
@@ -1,4 +1,5 @@
 #define readdir64_r __no_readdir64_r_decl
+#define GETDENTS_64BIT_ALIGNED 1
 #include <sysdeps/unix/readdir_r.c>
 #undef readdir64_r
 weak_alias (__readdir_r, readdir64_r)

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                       |    6 ++++++
 sysdeps/unix/readdir_r.c                        |    3 ++-
 sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c |    1 +
 3 files changed, 9 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources



More information about the Glibc-cvs mailing list