Changes with Apache 2.0.32-dev
+ *) Fix resolve_symlink to save the original symlink name if known.
+ [Justin Erenkrantz]
+
*) Be a bit more sane with regard to CanonicalNames. If the user has
specified they want to use the CanonicalName, but they have not
configured a port with the ServerName, then use the same port that
{
apr_finfo_t fi;
int res;
+ const char *savename;
if (!(opts & (OPT_SYM_OWNER | OPT_SYM_LINKS))) {
return HTTP_FORBIDDEN;
}
+ /* Save the name from the valid bits. */
+ savename = (lfi->valid & APR_FINFO_NAME) ? lfi->name : NULL;
+
if (opts & OPT_SYM_LINKS) {
- if ((res = apr_stat(&fi, d, lfi->valid, p)) != APR_SUCCESS) {
+ if ((res = apr_stat(&fi, d, lfi->valid & ~(APR_FINFO_NAME),
+ p)) != APR_SUCCESS) {
return HTTP_FORBIDDEN;
}
/* Give back the target */
memcpy(lfi, &fi, sizeof(fi));
+ if (savename) {
+ lfi->name = savename;
+ lfi->valid |= APR_FINFO_NAME;
+ }
return OK;
}
}
}
- if ((res = apr_stat(&fi, d, lfi->valid, p)) != APR_SUCCESS) {
+ if ((res = apr_stat(&fi, d, lfi->valid & ~(APR_FINFO_NAME), p)) != APR_SUCCESS) {
return HTTP_FORBIDDEN;
}
/* Give back the target */
memcpy(lfi, &fi, sizeof(fi));
+ if (savename) {
+ lfi->name = savename;
+ lfi->valid |= APR_FINFO_NAME;
+ }
return OK;
}