httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kraemer <>
Subject [PATCH] Improve implementation of -c/-Cdirective reading
Date Thu, 15 Jan 1998 21:00:26 GMT

The recently added -C/-c directive handling has a few bugs I didn't
notice at the time they were added:

*   a "resource leak", or at least improper use of pcfg_openfile()
    without the matching cfg_closefile(). [cfg_closefile() added.]

*   A mis-use of the pcfg_openfile() interface which (as its name
    suggests) is supposed to open a file. Instead a NULL pointer was
    passed. In fact, the parms.config_file pointer was apparently simply
    assigned "to calm down the compiler". [using pcfg_open_custom() now.]

*   Instead of using srm_command_loop() to read from the "array based
    file", the lines were extracted from the table manually and passed
    to handle_command() individually (doesn't this break the nested
    commands?!?)    [using srm_command_loop() now]

*   In pcfg_openfile(), the (debug) logging code would log an undefined
    errno string and would not report on fopen() errors.
    [reports potential errors _after_ opening the file now.]

*   In pcfg_openfile(), an undefined file pointer would be entered into
    the configfile_t  structure and be returned to the caller.

*   Structured commands like
	httpd -C '<IfModule mod_speling.c>' \
	      -C 'CheckSpelling On' \
	      -C '</IfModule>' ....
    would not work because they were executed line-by-line. (Ehhmm..
    I may be wrong on that. Correct me.).  Now, the "memory file"
    looks just like a regular config file to the config line parser.

*   And finally, even devices would be considered valid input for config
    file reading (/dev/zero certainly being the one with the largest
    number of bytes in it).
    [allowing only /dev/null as a convenience, no other devices now.]


That is because I switched to using srm_command_loop(). But the perl
hook was coded into the explicit
    while (array has more lines) handle_command()
loop. I think it did NOT belong there!

Can one of the perl gurus please have a look at the proper place where
the "PerlModule" command could be checked? Is it in srm_command_loop()?

| S I E M E N S |  <>  |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request

View raw message