I noticed the following fix in glibc, so applied it here.
Do any of you know of a system other than the Hurd with no PATH_MAX
limitation?
Sorry about the split summary line.
>From 0eff06353f0b177646a9aa264c5a530546f0ccae Mon Sep 17 00:00:00 2001
From: Ulrich Drepper <[EMAIL PROTECTED]>
Date: Wed, 23 Jul 2008 10:24:43 +0200
Subject: [PATCH] * lib/canonicalize-lgpl.c (__realpath): readlink can write too
much into the buffer on platforms without PATH_MAX.
---
ChangeLog | 5 +++++
lib/canonicalize-lgpl.c | 2 +-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f741b9f..4d5f18e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-07-23 Ulrich Drepper <[EMAIL PROTECTED]>
+
+ * lib/canonicalize-lgpl.c (__realpath): readlink can write too
+ much into the buffer on platforms without PATH_MAX.
+
2008-07-21 Eric Blake <[EMAIL PROTECTED]>
Warn, not fail, on stale version.
diff --git a/lib/canonicalize-lgpl.c b/lib/canonicalize-lgpl.c
index 80bef72..3aaa310 100644
--- a/lib/canonicalize-lgpl.c
+++ b/lib/canonicalize-lgpl.c
@@ -260,7 +260,7 @@ __realpath (const char *name, char *resolved)
goto error;
}
- n = __readlink (rpath, buf, path_max);
+ n = __readlink (rpath, buf, path_max - 1);
if (n < 0)
{
int saved_errno = errno;
--
1.6.0.rc0.16.g6458d