Use sysconf(_SC_SYMLOOP_MAX) instead of MAXSYMLINKS. If sysconf
returns an error, fall back to MAXSYMLINKS on platforms that define it. Fixes build on Hurd. Patch from Justus Winter and Debian.
This commit is contained in:
@@ -376,6 +376,19 @@ out:
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the maximal number of symlinks to follow.
|
||||
*/
|
||||
static int maxsymlinks(void)
|
||||
{
|
||||
int v = sysconf(_SC_SYMLOOP_MAX);
|
||||
#ifdef MAXSYMLINKS
|
||||
if (v == -1)
|
||||
return MAXSYMLINKS;
|
||||
#endif
|
||||
return v;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check path is located on a network based partition.
|
||||
*/
|
||||
@@ -383,7 +396,7 @@ int check4nfs(const char * path, char * real)
|
||||
{
|
||||
char buf[PATH_MAX+1];
|
||||
const char *curr;
|
||||
int deep = MAXSYMLINKS;
|
||||
int deep = maxsymlinks();
|
||||
|
||||
if (!nlist) return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user