1830400 Members
2674 Online
110002 Solutions
New Discussion

symbolic links in HPUX

 
Jose_11
Advisor

symbolic links in HPUX

Hi All,

I have a customer that have very complex directory structure - the directories
are linking one to other with many symbolic links (even accross the network ).

When he try to do "cd" to such directiry
he got a message:
: Too many levels of symbolic links
The error condition usually indicates that a
file is linked to itself - but this is NOT the case here

I found in /usr/include/sys/param.h
#define MAXPATHLEN 1024
#define MAXSYMLINKS 20

Is this values have any connection to the message he gets ?

Do somebody have any other idea ?

Thanks



3 REPLIES 3
James R. Ferguson
Acclaimed Contributor

Re: symbolic links in HPUX

Hi Joseph:

From '/usr/include/sys/param.h':

MAXPATHLEN defines the longest permissable path length after expanding symbolic links. It is used to allocate a temporary buffer from the buffer pool in which to do the name expansion, hence should be a power of two, and must be less than or equal to MAXBSIZE.

MAXSYMLINKS defines the maximum number of symbolic links that may be expanded in a path name. It should be set high enough to allow all legitimate uses, but halt infinite loops
reasonably quickly.

Further, from the symlink(4) man pages:

It is possible to make symbolic links point to themselves or other symbolic links in such a way that they form a closed loop. The system detects this situation by limiting the number of symbolic links it traverses while translating a path name.

Regards!

...JRF...
Jose_11
Advisor

Re: symbolic links in HPUX

Hi James,

Thanks for reply.

Can I increase MAXPATHLEN and MAXSYMLINKS ?

How can i do it ?

Joseph
John Palmer
Honored Contributor

Re: symbolic links in HPUX

You've got a real problem here. Yes, you can change the include file but in order for it to take effect, you'd have to recompile every program that needs to traverse this complicated structure.

For example, in order for 'cd' to work, you'd have to recompile the shell itself.

I'd be looking to reduce the complexity of the directory structure, possibly by creating symlinks that point further into the structure.

Regards,
John