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, roland/symloop_max, created. glibc-2.16-ports-merge-99-gf0e2ff7


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, roland/symloop_max has been created
        at  f0e2ff751edf1971d58671523a96aff502cff0a4 (commit)

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

commit f0e2ff751edf1971d58671523a96aff502cff0a4
Author: Roland McGrath <roland@hack.frob.com>
Date:   Tue Jul 31 09:56:46 2012 -0700

    Use SYMLOOP_MAX in place of MAXSYMLINKS.

diff --git a/ChangeLog b/ChangeLog
index 102a878..527d8a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-07-31  Roland McGrath  <roland@hack.frob.com>
+
+	* elf/chroot_canon.c (chroot_canon): Instead of MAXSYMLINKS, use
+	SYMLOOP_MAX if defined, or else call sysconf, or else fall back to
+	_POSIX_SYMLOOP_MAX.
+	* stdlib/canonicalize.c (__realpath): Likewise.
+
 2012-07-31  Pino Toscano  <toscano.pino@tiscali.it>
 
 	* sysdeps/mach/hurd/renameat.c: New file, mostly copied from rename.c.
diff --git a/elf/chroot_canon.c b/elf/chroot_canon.c
index a7a7d9b..a073d59 100644
--- a/elf/chroot_canon.c
+++ b/elf/chroot_canon.c
@@ -1,6 +1,5 @@
 /* Return the canonical absolute name of a given file inside chroot.
-   Copyright (C) 1996,1997,1998,1999,2000,2001,2004,2005,2010,2011
-	Free Software Foundation, Inc.
+   Copyright (C) 1996-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software; you can redistribute it and/or modify
@@ -127,7 +126,18 @@ chroot_canon (const char *chroot, const char *name)
 	      char *buf = alloca (PATH_MAX);
 	      size_t len;
 
-	      if (++num_links > MAXSYMLINKS)
+#ifdef SYMLOOP_MAX
+              const int symloop_max = SYMLOOP_MAX;
+#else
+              static long int sysconf_symloop_max;
+              if (sysconf_symloop_max == 0)
+                sysconf_symloop_max = sysconf (_SC_SYMLOOP_MAX);
+              const int symloop_max = (sysconf_symloop_max <= 0
+                                       ? _POSIX_SYMLOOP_MAX
+                                       : sysconf_symloop_max);
+#endif
+
+	      if (++num_links > symloop_max)
 		{
 		  __set_errno (ELOOP);
 		  goto error;
diff --git a/stdlib/canonicalize.c b/stdlib/canonicalize.c
index 876b482..2b71c8e 100644
--- a/stdlib/canonicalize.c
+++ b/stdlib/canonicalize.c
@@ -1,5 +1,5 @@
 /* Return the canonical absolute name of a given file.
-   Copyright (C) 1996-2002,2004,2005,2006,2008 Free Software Foundation, Inc.
+   Copyright (C) 1996-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
@@ -166,7 +166,19 @@ __realpath (const char *name, char *resolved)
 	      char *buf = __alloca (path_max);
 	      size_t len;
 
-	      if (++num_links > MAXSYMLINKS)
+
+#ifdef SYMLOOP_MAX
+              const int symloop_max = SYMLOOP_MAX;
+#else
+              static long int sysconf_symloop_max;
+              if (sysconf_symloop_max == 0)
+                sysconf_symloop_max = sysconf (_SC_SYMLOOP_MAX);
+              const int symloop_max = (sysconf_symloop_max <= 0
+                                       ? _POSIX_SYMLOOP_MAX
+                                       : sysconf_symloop_max);
+#endif
+
+	      if (++num_links > symloop_max)
 		{
 		  __set_errno (ELOOP);
 		  goto error;

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


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]