[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#215110: apache: Apache upgrade corrupting entries in httpd.conf



Yes we are aware of the problem -4 should be on the way anytime soon.
There are other bugs reporting the same issue so opening this one again is
useless.

Fabio

On Mon, 13 Oct 2003, John Harrison wrote:

> Package: apache
> Version: 1.3.28-3
> Severity: normal
> Followup-For: Bug #215110
>
> I'm still being affected by the same thing.
>
> I previously had this further up in httpd.conf:
>
>  SetEnvIf User-Agent Teleport go_away
>
> I noticed that it seems to have been affected by a previous upgrade by
> way of being changed to:
>
>  SetEnvIf User-Agent TelePort 80 User-Agent
>
> and at the same time for some weird reason the
>
>  Port 80
>
> line was being changed to:
>
>  Port 80 User-Agent
>
> I've corrected the "SetEnvIf" line and now in this verion of the apache
> package it is no longer changed, BUT...
>
> If I do the 'install -f' I find I now get the
>
>  Port 80
>
> line changed to:
>
>  Port User-Agent
>
> And I end up getting this:
>
> 8< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> # apt-get install -f
> Reading Package Lists... Done
> Building Dependency Tree... Done
> 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
> 1 not fully installed or removed.
> Need to get 0B of archives.
> After unpacking 0B of additional disk space will be used.
> Setting up apache (1.3.28-3) ...
> Configuration syntax error detected. Not reloading.
>
> Syntax error on line 236 of /etc/apache/httpd.conf:
> The port number "User-Agent" is outside the appropriate range (i.e., 1..65535).
> invoke-rc.d: initscript apache, action "start" failed.
> dpkg: error processing apache (--configure):
>  subprocess post-installation script returned error exit status 1
> Errors were encountered while processing:
>  apache
> E: Sub-process /usr/bin/dpkg returned an error code (1)
> 8< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
> If I change the
>
>  SetEnvIf User-Agent Teleport go_away
>
> line to NOT have the string "port" in it e.g.
>
>  SetEnvIf User-Agent FIX-ME-LATER go_away
>
> and run the 'install -f' the upgrade works fine:
>
> 8< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> # apt-get install -f
> Reading Package Lists... Done
> Building Dependency Tree... Done
> 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
> 1 not fully installed or removed.
> Need to get 0B of archives.
> After unpacking 0B of additional disk space will be used.
> Setting up apache (1.3.28-3) ...
> Starting web server: apache.
> 8< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
> This looks like a case of careless/dangerous global text matching to me.
>
> It seems that part of the upgrade process is doing a global replace on
> the string:
>
>  /Port (.*)$/i
>
> where it should probably be looking for:
>
> (in Perl speak)
>
>  /^[\s*]Port ([0-9]+)$/i
>
> i.e. start of line,
>      then none or more spaces/tabs,
> 	 then "Port ",
> 	 then a number,
> 	 then the end of line
>
> instead.
>
> It seems this is only happening if it has matched the string
>
>  /port /i
>
> earlier in the file.
>
> If it HAS matched it, it now seems to cache the SECOND ARGUMENT on the
> line which matches
>
>  /Port /i
>
> i.e. Normally finding /^Port 80/ this would be "80" but when it saw:
>
>  /SetEnvIf User-Agent Teleport go_away/
>
> this was "User-Agent"
>
> and uses that cached value as the "port number" to write after "Port "
> in the generated output.
>
> I'm sorry I don't know enough about the way that the setup process works
> to find the actual piece of code which is doing this.
>
> I hope this helps.
>
> Kind regards,
>
> John
>
> -- System Information:
> Debian Release: testing/unstable
> Architecture: i386
> Kernel: Linux aotea 2.4.22-1-686-smp #5 SMP Sat Oct 4 14:35:05 EST 2003 i686
> Locale: LANG=C, LC_CTYPE=en_GB
>
> Versions of packages apache depends on:
> ii  apache-common                 1.3.28-3   Support files for all Apache webse
> ii  debconf                       1.3.15     Debian configuration management sy
> ii  dpkg                          1.10.15    Package maintenance system for Deb
> ii  libc6                         2.3.2-8    GNU C Library: Shared libraries an
> ii  libdb4.1                      4.1.25-9   Berkeley v4.1 Database Libraries [
> ii  libexpat1                     1.95.6-6   XML parsing C library - runtime li
> ii  libmagic1                     4.04-1     File type determination library us
> ii  logrotate                     3.6.5-2    Log rotation utility
> ii  mime-support                  3.23-1     MIME files 'mime.types' & 'mailcap
> ii  perl [perl5]                  5.8.1-2    Larry Wall's Practical Extraction
>
>
>
>
>

-- 
Our mission: make IPv6 the default IP protocol
"We are on a mission from God" - Elwood Blues

http://www.itojun.org/paper/itojun-nanog-200210-ipv6isp/mgp00004.html



Reply to: