www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davin Milun <mi...@cs.buffalo.edu>
Subject general/722: SymLinksIfOwnerMatch and root-owned links
Date Wed, 11 Jun 1997 20:30:02 GMT

>Number:         722
>Category:       general
>Synopsis:       SymLinksIfOwnerMatch and root-owned links
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache (Apache HTTP Project)
>State:          open
>Class:          change-request
>Submitter-Id:   apache
>Arrival-Date:   Wed Jun 11 13:30:01 1997
>Originator:     milun@cs.buffalo.edu
>Organization:
apache
>Release:        1.2.0
>Environment:
Solaris 2.x
>Description:
We use SymLinksIfOwnerMatch for our user directories.
There is a problem, however, if we restore/move their home directory (which
includes their public_html directory).  The problem is that Solaris's 
ufsrestore program does not set the owner of a symbolic link to the user:
rather the link remains owned by root.  This causes many user web pages
to break after we're moved/restored their directories.
>How-To-Repeat:

>Fix:
Create a separate directive called SymLinksIfRootOrOwnerMatch.

Locally, I've hacked http_request.c to make this the action of SymLinksIfOwnerMatch
(however, this does open some possible security issues, related to people
specifically deleting symbolic links (such as "ln -s /etc/passwd foo") and 
then asking for foo to be restored.)  In or environment, it is worth the
risk.

My changes are:

--- http_request.c_dist Wed May 14 15:22:52 1997
+++ http_request.c      Wed Jun 11 10:50:37 1997
@@ -129,7 +129,8 @@
        
     if (stat (d, &fi) < 0) return HTTP_FORBIDDEN;
     
-    return (fi.st_uid == lfi.st_uid) ? OK : HTTP_FORBIDDEN;
+    /* Added hack to allow root-owned slinks to work too */
+    return ((!lfi.st_uid) || (fi.st_uid == lfi.st_uid)) ? OK : HTTP_FORBIDDEN;
 
 #endif    
%0
>Audit-Trail:
>Unformatted:



Mime
View raw message