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 8464] New: - mod_rewrite not executing external rewriting engine
Date Wed, 24 Apr 2002 12:42:22 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8464>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8464

mod_rewrite not executing external rewriting engine

           Summary: mod_rewrite not executing external rewriting engine
           Product: Apache httpd-2.0
           Version: 2.0.35
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Major
          Priority: Other
         Component: mod_rewrite
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: JTait@wyrddreams.demon.co.uk
                CC: JTait@wyrddreams.demon.co.uk


NOTE: This bug has been reproduced on Solaris 8 as well.

I have the following working config for Apache 1.3.24:

RewriteMap DAAC "prg:/usr/j2se/bin/java -classpath
/usr/apache/libexec/rewrite:/usr/apache/libexec/rewrite/jlog.jar DAAC 550
/var/apache/logs/daac_log"
RewriteRule ^/Prot([^/]*)/(.+)     /${DAAC:Prot$1/$2|DENIED} [C]
RewriteRule ^/DENIED$              - [F]

The config is simple enough, if the incoming request is for a file within a
directory named, for example, /Protected, then the external rewrite engine gets
called to perform authorisation (in reality there'd be an auth token or
something in the URI).

However, transferring this configuration to 2.0.35 does not have the desired
effect -- in fact, the external rewrite engine is never exec'd.  This has been
tested with the above command line, a very basic shell script, a Perl script and
a natively compiled binary -- none of them ever appear to get called (they
should all touch a file in the filesystem when they are run, and do so when run
from the command line).

The C program I used is as follows:

#include <stdio.h>
#include <sys/time.h>

int main(int argc, char *argv[]) {
  char input[1024];
  FILE *error_log;
  struct timeval tv;
  long delay;

  if(argc < 2) {
    printf("Usage: %s <millisecond delay>\n", argv[0]);
    printf("Defaulting to 500ms\n");
    delay = 500000;
  } else {
    delay = (atol(argv[1]) * 1000);
  }
  if (delay < 0) {
    printf("Delay must be a positive integer\n");
    return 1;
  }

  if((error_log = fopen("/tmp/DAAC.log", "a")) == NULL) {
    printf("Unable to open logfile\n");
    return 2;
  }

  while (scanf("%1023s", input)) {
    tv.tv_sec = 0;
    tv.tv_usec = delay;
    fprintf(error_log, "%s\n", input);
    fflush(error_log);
    select(0, NULL, NULL, NULL, &tv);
    printf("%s\n", input);
    fflush(stdout);
  }
  fclose(error_log);
  return 0;
}

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message