You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2001/11/10 20:01:29 UTC

cvs commit: apache-1.3/src/main http_core.c

wrowe       01/11/10 11:01:29

  Modified:    src      CHANGES
               src/modules/standard mod_so.c
               src/main http_core.c
  Log:
       Prevent an Apache module from being loaded or added twice due
       to duplicate LoadModule or AddModule directives (or a missing
       ClearModuleList directive).
  
       LoadModule dupcheck (for 2.0) by Brian Pane <bp...@pacbell.net>
       Ported and added AddModule dupcheck by Will Rowe
       Identified by an old collegue of Will's who tripped over this.
  
  Revision  Changes    Path
  1.1739    +5 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1738
  retrieving revision 1.1739
  diff -u -r1.1738 -r1.1739
  --- CHANGES	2001/10/26 18:05:26	1.1738
  +++ CHANGES	2001/11/10 19:01:28	1.1739
  @@ -1,5 +1,10 @@
   Changes with Apache 1.3.23
   
  +  *) Prevent an Apache module from being loaded or added twice due
  +     to duplicate LoadModule or AddModule directives (or a missing
  +     ClearModuleList directive).
  +     [William Rowe, Brian Pane <bp...@pacbell.net>]
  +
     *) Add checkgid app to do run-time validation of Group directive
        values which might cause the server to fall over, but which
        are syntactically correct.  [Ken Coar]
  
  
  
  1.38      +4 -1      apache-1.3/src/modules/standard/mod_so.c
  
  Index: mod_so.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_so.c,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- mod_so.c	2001/02/27 03:59:53	1.37
  +++ mod_so.c	2001/11/10 19:01:29	1.38
  @@ -231,8 +231,11 @@
       modie = (moduleinfo *)sconf->loaded_modules->elts;
       for (i = 0; i < sconf->loaded_modules->nelts; i++) {
           modi = &modie[i];
  -        if (modi->name != NULL && strcmp(modi->name, modname) == 0)
  +        if (modi->name != NULL && strcmp(modi->name, modname) == 0) {
  +            ap_log_error(APLOG_MARK, APLOG_WARNING|APLOG_NOERRNO, cmd->server,
  +                          "module %s is already loaded, skipping", modname);
               return NULL;
  +        }
       }
       modi = ap_push_array(sconf->loaded_modules);
       modi->name = modname;
  
  
  
  1.298     +9 -0      apache-1.3/src/main/http_core.c
  
  Index: http_core.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/main/http_core.c,v
  retrieving revision 1.297
  retrieving revision 1.298
  diff -u -r1.297 -r1.298
  --- http_core.c	2001/09/04 18:15:15	1.297
  +++ http_core.c	2001/11/10 19:01:29	1.298
  @@ -1908,9 +1908,18 @@
   
   static const char *add_module_command(cmd_parms *cmd, void *dummy, char *arg)
   {
  +    module *modp;
       const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
       if (err != NULL) {
           return err;
  +    }
  +
  +    for (modp = top_module; modp; modp = modp->next) {
  +        if (modp->name != NULL && strcmp(modp->name, arg) == 0) {
  +            ap_log_error(APLOG_MARK, APLOG_WARNING|APLOG_NOERRNO, cmd->server,
  +                          "module %s is already added, skipping", arg);
  +            return NULL;
  +        }
       }
   
       if (!ap_add_named_module(arg)) {