re PR libgcj/24170 (libjava natFilePosix.cc seems to have a security problem)

PR libgcj/24170:
	* java/io/natFilePosix.cc (File::performList): Don't use
	readdir_r.
	* configure, include/config.h.in: Rebuilt.
	* configure.ac: Don't check for readdir_r.

From-SVN: r132491
This commit is contained in:
Tom Tromey 2008-02-20 19:09:09 +00:00 committed by Tom Tromey
parent 993ac7c7ef
commit c8910ef9e2
5 changed files with 11 additions and 13 deletions

View File

@ -1,3 +1,11 @@
2008-02-20 Tom Tromey <tromey@redhat.com>
PR libgcj/24170:
* java/io/natFilePosix.cc (File::performList): Don't use
readdir_r.
* configure, include/config.h.in: Rebuilt.
* configure.ac: Don't check for readdir_r.
2008-02-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR libgcj/33085

3
libjava/configure vendored
View File

@ -20791,11 +20791,10 @@ else
for ac_func in strerror_r select fstat open fsync sleep opendir \
localtime_r readdir_r getpwuid_r getcwd \
localtime_r getpwuid_r getcwd \
access stat lstat mkdir rename rmdir unlink utime chmod readlink \
nl_langinfo setlocale \
inet_pton uname inet_ntoa \

View File

@ -1023,7 +1023,7 @@ if test "x${with_newlib}" = "xyes"; then
PLATFORMNET=NoNet
else
AC_CHECK_FUNCS([strerror_r select fstat open fsync sleep opendir \
localtime_r readdir_r getpwuid_r getcwd \
localtime_r getpwuid_r getcwd \
access stat lstat mkdir rename rmdir unlink utime chmod readlink \
nl_langinfo setlocale \
inet_pton uname inet_ntoa \

View File

@ -214,9 +214,6 @@
/* Define to 1 if you have the <pwd.h> header file. */
#undef HAVE_PWD_H
/* Define to 1 if you have the `readdir_r' function. */
#undef HAVE_READDIR_R
/* Define to 1 if you have the `readlink' function. */
#undef HAVE_READLINK

View File

@ -1,6 +1,6 @@
// natFile.cc - Native part of File class for POSIX.
/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006
/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2008
Free Software Foundation
This file is part of libgcj.
@ -292,13 +292,7 @@ java::io::File::performList (java::io::FilenameFilter *filter,
java::util::ArrayList *list = new java::util::ArrayList ();
struct dirent *d;
#if defined(HAVE_READDIR_R) && defined(_POSIX_PTHREAD_SEMANTICS)
int name_max = pathconf (buf, _PC_NAME_MAX);
char dbuf[sizeof (struct dirent) + name_max + 1];
while (readdir_r (dir, (struct dirent *) dbuf, &d) == 0 && d != NULL)
#else /* HAVE_READDIR_R */
while ((d = readdir (dir)) != NULL)
#endif /* HAVE_READDIR_R */
{
// Omit "." and "..".
if (d->d_name[0] == '.'