Realpath & context sensitive symlinks

Michael Eager eager@mvista.com
Thu Sep 27 11:40:00 GMT 2001


I looked through the Glibc archive but didn't see any comments on this.

Some file systems (like GFS) support context dependent symlinks (CDSL).  
Thesesymlinks contain macros like {os} or {uid} which get substituted with
the appropriate value to create an actual path name.  This macro 
substitution only occurs when the file system is following a symlink, 
otherwise the macro is left unmodified.

Realpath (canonicalize) doesn't know anything about these macros.
When it finds one of these CDSLs, it treats it like a regular text 
symlink, and sticks it in the path.  Lxstat fails on this path, since
it contains funny text and isn't a real path.

Anyone got a solution to this?  Or suggestions?

Is there a file system independent way to do this?
For example:

  find symlink path 
  chdir(path)
  getcwd (curpat)
  substitute curpath for symlink


--
Michael Eager     eager@mvista.com	408-328-8426	
MontaVista Software, Inc. 1237 E. Arques Ave., Sunnyvale, CA  94085



More information about the Libc-alpha mailing list