httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bnicho...@apache.org
Subject cvs commit: httpd-2.0/modules/arch/netware mod_netware.c
Date Fri, 11 Oct 2002 17:31:09 GMT
bnicholes    2002/10/11 10:31:09

  Modified:    modules/arch/netware mod_netware.c
  Log:
  Fixed a problem with the NetWare command line builder for building the CGI
  command line.  It did not handle building the command line when given a
  script rather than an executible.
  
  Revision  Changes    Path
  1.5       +27 -1     httpd-2.0/modules/arch/netware/mod_netware.c
  
  Index: mod_netware.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/arch/netware/mod_netware.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- mod_netware.c	25 Jul 2002 19:06:13 -0000	1.4
  +++ mod_netware.c	11 Oct 2002 17:31:09 -0000	1.5
  @@ -112,12 +112,25 @@
   static const char *set_extension_map(cmd_parms *cmd, netware_dir_config *m,
                                        char *CGIhdlr, char *ext, char *detach)
   {
  +    int i, len;
  +
       if (*ext == '.')
           ++ext;
  +  
  +    if (CGIhdlr != NULL) {
  +        len = strlen(CGIhdlr);    
  +        for (i=0; i<len; i++) {
  +            if (CGIhdlr[i] == '\\') {
  +                CGIhdlr[i] = '/';
  +            }
  +        }
  +    }
  +
       apr_table_set(m->file_type_handlers, ext, CGIhdlr);
       if (detach) {
           apr_table_set(m->file_handler_mode, ext, "y");
       }
  +
       return NULL;
   }
   
  @@ -148,34 +161,47 @@
               args = r->args;
           }
       }
  +
       cmd_only = apr_pstrdup(p, *cmd);
   
       /* truncate any arguments from the cmd */
       for (ptr = cmd_only; *ptr && (*ptr != ' '); ptr++);
       *ptr = '\0';
   
  +    /* Figure out what the extension is so that we can matche it. */
       ext = strrchr(apr_filename_of_pathname(cmd_only), '.');
       
  +    /* eliminate the '.' if there is one */
       if (*ext == '.')
           ++ext;
   
       /* If it is an NLM then just execute it. */
       if (stricmp(ext, "nlm")) {
  +        /* check if we have a registered command for the extension*/
           *cmd = apr_table_get(d->file_type_handlers, ext);
           if (*cmd == NULL) {
               ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                         "Could not find a command associated with the %s extension", ext);
               return APR_EBADF;
           }
  +
  +        /* If we have a registered command then add the file that was passed in as a
  +          parameter to the registered command. */
  +        *cmd = apr_pstrcat (p, *cmd, " ", cmd_only, NULL);
  +
  +        /* Run in its own address space if specified */
           detached = apr_table_get(d->file_handler_mode, ext);
           if (detached) {
               e_info->detached = 1;
           }
       }
   
  +    /* Tokenize the full command string into its arguments */
       apr_tokenize_to_argv(*cmd, (char***)argv, p);
       e_info->cmd_type = APR_PROGRAM;
  -    *cmd = ap_server_root_relative(p, cmd_only);
  +
  +    /* The first argument should be the executible */
  +    *cmd = ap_server_root_relative(p, *argv[0]);
   
       return APR_SUCCESS;
   }
  
  
  

Mime
View raw message