rse 98/07/11 03:56:09
Modified: src CHANGES src/modules/standard mod_rewrite.c mod_rewrite.h Log: mod_rewrite created RewriteLock files under the uid of the parent process, thus the child processes had no write access to the files. Now a chown() is done to the uid of the childs if applicable. Submitted by: Lars Eilebrecht Reviewed and fixed by: Ralf S. Engelschall PR: 2341 PS: Lars, I've changed s->server_uid to ap_user_id because s->server_uid can be different inside virtual hosts for the suEXEC mechanism. But we need the uid of the process, so ap_user_id is correct IMHO. And I've searched for the PR in the bugdb for you and noted it above. Revision Changes Path 1.960 +5 -0 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.959 retrieving revision 1.960 diff -u -r1.959 -r1.960 --- CHANGES 1998/07/11 10:24:05 1.959 +++ CHANGES 1998/07/11 10:56:03 1.960 @@ -1,5 +1,10 @@ Changes with Apache 1.3.1 + *) mod_rewrite created RewriteLock files under the uid of the parent + process, thus the child processes had no write access to the files. + Now a chown() is done to the uid of the childs if applicable. + [Lars Eilebrecht, Ralf S. Engelschall] PR#2341 + *) Autogenerate some HAVE_XXXXX_H defines in conf_auto.h (determined via TestCompile) instead of defining them manually in conf.h based on less accurate platform definitions. This way we no longer have to fiddle with 1.123 +4 -0 apache-1.3/src/modules/standard/mod_rewrite.c Index: mod_rewrite.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_rewrite.c,v retrieving revision 1.122 retrieving revision 1.123 diff -u -r1.122 -r1.123 --- mod_rewrite.c 1998/07/09 17:13:56 1.122 +++ mod_rewrite.c 1998/07/11 10:56:07 1.123 @@ -3213,6 +3213,10 @@ "file %s", conf->rewritelockfile); exit(1); } + /* make sure the childs have access to this file */ + if (geteuid() == 0 /* is superuser */) + chown(conf->rewritelockfile, ap_user_id, -1 /* no gid change */); + return; } 1.54 +1 -0 apache-1.3/src/modules/standard/mod_rewrite.h Index: mod_rewrite.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_rewrite.h,v retrieving revision 1.53 retrieving revision 1.54 diff -u -r1.53 -r1.54 --- mod_rewrite.h 1998/05/29 08:32:40 1.53 +++ mod_rewrite.h 1998/07/11 10:56:08 1.54 @@ -107,6 +107,7 @@ /* Include from the Apache server ... */ #include "httpd.h" #include "http_config.h" +#include "http_conf_globals.h" #include "http_request.h" #include "http_core.h" #include "http_log.h"