summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/httpd/src/modules/standard/Makefile.tmpl4
-rw-r--r--usr.sbin/httpd/src/modules/standard/mod_rewrite.c11
2 files changed, 11 insertions, 4 deletions
diff --git a/usr.sbin/httpd/src/modules/standard/Makefile.tmpl b/usr.sbin/httpd/src/modules/standard/Makefile.tmpl
index b100d6107ef..a67ea418461 100644
--- a/usr.sbin/httpd/src/modules/standard/Makefile.tmpl
+++ b/usr.sbin/httpd/src/modules/standard/Makefile.tmpl
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.tmpl,v 1.4 2002/07/17 12:55:15 henning Exp $
+# $OpenBSD: Makefile.tmpl,v 1.5 2002/07/31 08:52:55 henning Exp $
#Dependencies
@@ -205,7 +205,7 @@ mod_rewrite.o: mod_rewrite.c mod_rewrite.h $(INCDIR)/httpd.h \
$(INCDIR)/util_uri.h $(INCDIR)/http_config.h \
$(INCDIR)/http_conf_globals.h $(INCDIR)/http_request.h \
$(INCDIR)/http_core.h $(INCDIR)/http_log.h \
- $(INCDIR)/http_vhost.h
+ $(INCDIR)/http_vhost.h $(INCDIR)/fdcache.h
mod_setenvif.o: mod_setenvif.c $(INCDIR)/httpd.h \
$(INCDIR)/ap_config.h $(INCDIR)/ap_mmn.h \
$(INCDIR)/ap_config_auto.h $(OSDIR)/os.h \
diff --git a/usr.sbin/httpd/src/modules/standard/mod_rewrite.c b/usr.sbin/httpd/src/modules/standard/mod_rewrite.c
index 953b351572a..5b80b94d42e 100644
--- a/usr.sbin/httpd/src/modules/standard/mod_rewrite.c
+++ b/usr.sbin/httpd/src/modules/standard/mod_rewrite.c
@@ -91,6 +91,7 @@
#include "mod_rewrite.h"
+#include "fdcache.h"
#ifndef NO_WRITEV
#ifndef NETWARE
@@ -3107,8 +3108,14 @@ static void open_rewritelog(server_rec *s, pool *p)
conf->rewritelogfp = ap_piped_log_write_fd(pl);
}
else if (*conf->rewritelogfile != '\0') {
- if ((conf->rewritelogfp = ap_popenf(p, fname, rewritelog_flags,
- rewritelog_mode)) < 0) {
+ if (ap_server_chroot_desired()) {
+ conf->rewritelogfp = fdcache_open(fname, rewritelog_flags,
+ rewritelog_mode);
+ } else {
+ conf->rewritelogfp = ap_popenf(p, fname, rewritelog_flags,
+ rewritelog_mode);
+ }
+ if (conf->rewritelogfp < 0) {
ap_log_error(APLOG_MARK, APLOG_ERR, s,
"mod_rewrite: could not open RewriteLog "