httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@znep.com>
Subject [PATCH] unreadable .htaccess
Date Sat, 23 Aug 1997 22:44:28 GMT
Reposted; minor change since the first posting by adding ENOTDIR.

I'm interested in if people think HTTP_FORBIDDEN or
HTTP_INTERNAL_SERVER_ERROR is the more appropriate.  

My view is that part of the resource is how the .htaccess file says it
should be presented, so if we can't read the .htaccess we can't read part
of the resource so forbidden is appropriate.

If you do server error, then the following situation:

    $ mkdir ~/public_html/dir
    $ chmod 700 !$
    $ lynx http://localhost/~user/dir/

will give a server error, which is counterintuitive in some ways.  The
current interpretation of forbidden does not just apply to the final file.

In any case, I could go for either so majority feedback probably wins.

Index: http_config.c
===================================================================
RCS file: /export/home/cvs/apachen/src/main/http_config.c,v
retrieving revision 1.74
diff -u -r1.74 http_config.c
--- http_config.c	1997/08/23 04:00:27	1.74
+++ http_config.c	1997/08/23 22:38:26
@@ -952,8 +952,15 @@
 	}
 	
 	*result = dc;
-    } else
-	dc = NULL;
+    } else {
+	if (errno == ENOENT || errno == ENOTDIR)
+	    dc = NULL;
+	else {
+	    log_unixerr("pfopen", filename, 
+		"unable to check for htaccess file", r->server);
+	    return HTTP_FORBIDDEN;
+	}
+    }
 
 /* cache it */
     new = palloc(r->pool, sizeof(struct htaccess_result));


Mime
View raw message