httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Skolnick <cl...@organic.com>
Subject WWW Form Bug Report: "check_hostalias bug?" on Solaris 2.x (fwd)
Date Tue, 21 May 1996 00:09:26 GMT

No ack sent.


--
Cliff Skolnick                                      cliff@organic.com

"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." -- Benjamin Franklin, 1759

---------- Forwarded message ----------
Date: Mon May 20 12:27:49 1996
From: jk@tools.de
To: cliff@organic.com
Subject: WWW Form Bug Report: "check_hostalias bug?" on Solaris 2.x

Submitter: jk@tools.de
Operating system: Solaris 2.x, version: 5.5
Version of Apache Used: 1.1b2
Extra Modules used: none
URL exhibiting problem: 

Symptoms:
--
It seems that you can define virtual hosts on a
specific tcp/ip port, using something like the
following in conf/httpd.conf (My idea was to
use SSL with <VirtualHost *:443>, using one
server for both normal http requests to port 80
and SSL to port 443) 

...
Port 80
...
Listen 80
Listen 443
...
<VirtualHost *:443>
...
</VirtualHost>


Problem is, that both the main server running on
port 80 and the virtual server running on port 443
have the same server_name and check_hostalias in
http_protocol.c will replace the r->server (pointing
to the main server) with a pointer to the virtual
server, when a netscape (2.0+) browser connects to
port 80 (note that netscape sends a Host:, thus
check_hostalias is called).

- shouldn't check_hostalias consider only virtual hosts
  with s->is_virtual == 2?

  ( <VirtualHost *:443> uses is_virtual == 1  )

- if a virtual host want's to match a specific port,
  shouldn't check_hostalias ignore connections
  to a different port

- what the reason for the atoi(r->hostname) != r->server->port)
  check in check_hostalias?


Any comments on the following diffs below:

diff -rc3 apache_1.1b2-orig/src/http_protocol.c apache_1.1b2/src/http_protocol.c
*** apache_1.1b2-orig/src/http_protocol.c	Tue Apr 16 15:00:10 1996
--- apache_1.1b2/src/http_protocol.c	Sat May 18 16:26:39 1996
***************
*** 348,362 ****
  
  void check_hostalias (request_rec *r) {
    char *host = getword(r->pool, &r->hostname, ':');	/* Get rid of port */
    server_rec *s;
  
!   if (*r->hostname && (atoi(r->hostname) != r->server->port))
      return;
  
    r->hostname = host;
  
    for (s = r->server->next; s; s = s->next) {
      char *names = s->names;
  
      if (!strcasecmp(host, s->server_hostname)) {
        r->server = r->connection->server = s;
--- 348,367 ----
  
  void check_hostalias (request_rec *r) {
    char *host = getword(r->pool, &r->hostname, ':');	/* Get rid of port */
+   short port = (*r->hostname) ? atoi(r->hostname) : 0;
    server_rec *s;
  
!   if (*r->hostname && port != r->server->port)	/* jk: ??? */
      return;
  
    r->hostname = host;
  
    for (s = r->server->next; s; s = s->next) {
      char *names = s->names;
+ 
+     if (s->is_virtual != 2 ||
+ 	(s->host_port && s->host_port != port))
+ 	continue;
  
      if (!strcasecmp(host, s->server_hostname)) {
        r->server = r->connection->server = s;

--

Backtrace:
--

--


Mime
View raw message