This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, master, updated. glibc-2.15-962-g7cd195d


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  7cd195df6204a8575b3b1d303affb9aa5756a828 (commit)
      from  94b07d20dd07d8426dbde1e83bafcd15eeead281 (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=7cd195df6204a8575b3b1d303affb9aa5756a828

commit 7cd195df6204a8575b3b1d303affb9aa5756a828
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri May 18 07:12:47 2012 -0700

    Check d_ino/d_off before using getdents syscall

diff --git a/ChangeLog b/ChangeLog
index f59b01a..15a012f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2012-05-18  H.J. Lu  <hongjiu.lu@intel.com>
 
+	* sysdeps/unix/sysv/linux/getdents.c (__GETDENTS): Use
+	getdents system call only if kernel and user dirents have the
+	same d_ino and d_off.
+
 	* stdio-common/_itoa.c: Check _ITOA_NEEDED instead of
 	LLONG_MAX != LONG_MAX.
 	(_itoa_word): Use _ITOA_WORD_TYPE on value.
diff --git a/sysdeps/unix/sysv/linux/getdents.c b/sysdeps/unix/sysv/linux/getdents.c
index eb9cfef..ac4979e 100644
--- a/sysdeps/unix/sysv/linux/getdents.c
+++ b/sysdeps/unix/sysv/linux/getdents.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995-2004, 2006, 2007, 2010
-   Free Software Foundation, Inc.
+/* Copyright (C) 19932-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -99,7 +98,17 @@ __GETDENTS (int fd, char *buf, size_t nbytes)
   ssize_t retval;
 
 #ifdef __ASSUME_GETDENTS32_D_TYPE
-  if (sizeof (DIRENT_TYPE) == sizeof (struct dirent))
+  /* The d_ino and d_off fields in kernel_dirent and dirent must have
+     the same sizes and alignments.  */
+  if (sizeof (DIRENT_TYPE) == sizeof (struct dirent)
+      && (sizeof (((struct kernel_dirent *) 0)->d_ino)
+	  == sizeof (((struct dirent *) 0)->d_ino))
+      && (sizeof (((struct kernel_dirent *) 0)->d_off)
+	  == sizeof (((struct dirent *) 0)->d_off))
+      && (offsetof (struct kernel_dirent, d_off)
+	  == offsetof (struct dirent, d_off))
+      && (offsetof (struct kernel_dirent, d_reclen)
+	  == offsetof (struct dirent, d_reclen)))
     {
       retval = INLINE_SYSCALL (getdents, 3, fd, CHECK_N(buf, nbytes), nbytes);
 

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

Summary of changes:
 ChangeLog                          |    4 ++++
 sysdeps/unix/sysv/linux/getdents.c |   15 ++++++++++++---
 2 files changed, 16 insertions(+), 3 deletions(-)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]