httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 47719] New: Broken symbolic link (symlink) cause wrong ErrorDocument to be returned
Date Fri, 21 Aug 2009 00:37:41 GMT
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: bugs@httpd.apache.org
        ReportedBy: asfbugzilla@nuru.net


--- Comment #0 from Jeremy Grodberg <asfbugzilla@nuru.net> 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: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message