apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Traver <tt-l...@simplenet.com>
Subject apr symbolic link resolving
Date Mon, 31 Jan 2011 23:33:26 GMT
Hi all,

ok, I'm in the process of writing an apache httpd module, and have been
looking through the docs for apr functions, as I want to use what I have
available to me, rather than include outside system sources.

When I do a stat on a symbolic link, I need to be able to see the links
target path, and I can't seem to figure out how to get that.

For instance, for a link that might look like this:

/links/dude.domain.com -> /home/sites/volume03/site/htdocs

When I do the apr_stat on the /link/dude.domain.com link, it appears I
get all the stat info on the link itself, but how do I read the
destination path from the structure?

Here's an example of how I'm using the code :

apr_finfo_t pathstat;
char *path;

path = "/links/dude.domain.com";


Then, I am trying to look at the data fields returned like
pathstat.fname, and pathstat.name, but I'm not getting the path of the
destination, only the original path to the link.

I tried using different parameters like APR_FINFO_NAME, or APR_FINFO_TYPE...

I can't figure out how to get the path to the target...

If it matters, I'm using the latest 2.2.17 httpd, which I believe uses
the 1.4 branch of the apr libraries, and I am on FreeBSD.

any help would be appreciated!



View raw message