https://issues.apache.org/bugzilla/show_bug.cgi?id=47719
Summary: Broken symbolic link (symlink) cause wrong
ErrorDocument to be returned
Product: Apache httpd-2
Version: 2.2.8
Platform: Other
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Core
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Jeremy Grodberg <[email protected]> 2009-08-20 17:37:38
PDT ---
When a symbolic link is broken (points to a non-existent file), the
ErrorDocument specified in the VirtualHost section is returned instead of the
ErrorDocument specified in the Directory section.
Using out-of-the-box Unbutnu 8.04 server running Apache httpd 2.2.8. Did not
touch anything but Virtual Host config. Here is the complete Virtual Host
config:
NameVirtualHost *
<VirtualHost *>
ErrorDocument 403 "Vhost 403"
DocumentRoot /var/www/
<Directory />
ErrorDocument 403 "root 403"
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
ErrorDocument 403 "/var/www 403"
Options Indexes FollowSymLinks MultiViews
AllowOverride None
</Directory>
</VirtualHost>
I then went to /var/www which already had an index.html file in it and ran the
following commands:
cp index.html noperm.html
chmod a-r noperm.html
ln -s noperm.html goodlink.html
ln -s broken badlink.html
This means:
* index.html is a valid, readable file
* noperm.html is a valid file but httpd does not have permission to read it
* goodlink.html is a valid symbolic link to noperm.html
* badlink.html is a symbolic link to a non-existent file in the same directory
Expected result:
http://localhost/index.html returns the contents of index.html
http://localhost/noperm.html returns "/var/www 403" and status code 403
http://localhost/goodlink.html returns "/var/www 403" and status code 403
http://localhost/badlink.html returns "/var/www 403" and status code 403
(I would actually prefer that badlink returns status code 404, but that is a
battle I am not going to fight right now.)
Actual result:
Index, noperm, and goodlink work as expected.
http://localhost/badlink.html returns "Vhost 403" and status code 403
Note: setting EnableSendfile off does not change the results.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]