Mail Archives: djgpp-workers/2000/08/14/17:12:11
Martin Str|mberg wrote:
[...examples of symlink resolving code...]
> So Linux doesn't even bother with a define!
But we want to be better, right? ;-)
Anyway, I've checked in the following fix to __solve_symlinks:
Laurynas
Index: xsymlink.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/compat/unistd/xsymlink.c,v
retrieving revision 1.1
diff -u -r1.1 xsymlink.c
--- xsymlink.c 2000/08/14 08:51:30 1.1
+++ xsymlink.c 2000/08/14 21:10:51
@@ -15,6 +15,11 @@
#include "xsymlink.h"
+/* How many levels of symbolic links process before thinking
+ * that we've found a link loop.
+ */
+#define MAX_SYMLINK 8
+
int __solve_symlinks(const char * __symlink_path, char * __real_path)
{
int bytes_copied;
@@ -94,7 +99,7 @@
}
}
} while ((bytes_copied != -1) && (link_level <= _POSIX_LINK_MAX));
- if (link_level > _POSIX_LINK_MAX)
+ if (link_level > MAX_SYMLINK)
{
errno = ELOOP;
return 0;
- Raw text -