This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch, roland/symloop_max, created. glibc-2.16-ports-merge-98-gc954e12
- From: roland at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 31 Jul 2012 17:01:41 -0000
- Subject: GNU C Library master sources branch, roland/symloop_max, created. glibc-2.16-ports-merge-98-gc954e12
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 c954e12258e90fb2187957ea4976934f14588743 (commit)
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c954e12258e90fb2187957ea4976934f14588743
commit c954e12258e90fb2187957ea4976934f14588743
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 30b9a9e..2dc86c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +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.
+
* include/sys/socket.h (__libc_accept, __libc_accept4):
Add attribute_hidden.
* socket/accept4.c (__libc_accept4): Remove libc_hidden_def.
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