This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Realpath & context sensitive symlinks
- To: Glibc Alpha <libc-alpha at sourceware dot cygnus dot com>
- Subject: Realpath & context sensitive symlinks
- From: Michael Eager <eager at mvista dot com>
- Date: Thu, 27 Sep 2001 11:40:38 -0700
- Organization: MontaVista Software, Inc.
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