summaryrefslogtreecommitdiff
path: root/www/wwwoffle/patches/patch-ac
blob: f7d7921cf78d8fa87bd0e9a50c5a665c51e11c00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
$NetBSD: patch-ac,v 1.6 2002/08/10 13:43:09 fredb Exp $

--- src/wwwoffled.c.orig	Sun Jun 23 06:02:35 2002
+++ src/wwwoffled.c
@@ -279,8 +279,7 @@
  if(uid!=-1 || gid!=-1)
     PrintMessage(Inform,"Running with uid=%d, gid=%d.",geteuid(),getegid());
 
-
- /* Bind the HTTP proxy sockets. */
+ /* Bind the HTTP proxy socket(s). */
 
 #if USE_IPV6
  if(ConfigString(Bind_IPv6))
@@ -291,40 +290,33 @@
    }
 #endif
 
-#if USE_IPV6
- if(http_fd[1]!=-1 && ConfigString(Bind_IPv4) && ConfigString(Bind_IPv6) &&
-    !strcmp(ConfigString(Bind_IPv6),"0:0:0:0:0:0:0:0") && !strcmp(ConfigString(Bind_IPv4),"0.0.0.0"))
-    PrintMessage(Inform,"Not creating HTTP IPv4 server socket on all addresses since IPv6 one is bound to all addresses.");
- else
+ if(ConfigString(Bind_IPv4))
    {
-#endif
-    if(ConfigString(Bind_IPv4))
+    http_fd[0]=OpenServerSocket(ConfigString(Bind_IPv4),ConfigInteger(HTTP_Port));
+    if(http_fd[0]==-1)
       {
-       http_fd[0]=OpenServerSocket(ConfigString(Bind_IPv4),ConfigInteger(HTTP_Port));
-       if(http_fd[0]==-1)
-         {
 #if USE_IPV6
+       if(http_fd[1]!=-1 && ConfigString(Bind_IPv4) && !strcmp(ConfigString(Bind_IPv4),"0.0.0.0") &&
+                            ConfigString(Bind_IPv6) && !strcmp(ConfigString(Bind_IPv6),"0:0:0:0:0:0:0:0"))
+          PrintMessage(Warning,"Cannot create HTTP IPv4 server socket (but the IPv6 one might accept IPv4 connections).");
+       else
           PrintMessage(Fatal,"Cannot create HTTP IPv4 server socket.");
 #else
-          PrintMessage(Fatal,"Cannot create HTTP server socket.");
+       PrintMessage(Fatal,"Cannot create HTTP server socket.");
 #endif
-         }
       }
-#if USE_IPV6
    }
-#endif
 
  if(http_fd[0]==-1 && http_fd[1]==-1)
    {
 #if USE_IPV6
-    PrintMessage(Fatal,"Neither IPv4 or IPv6 HTTP socket could be bound.");
+    PrintMessage(Fatal,"The IPv4 and IPv6 HTTP sockets were not bound; are they disabled in the config file?");
 #else
-    PrintMessage(Fatal,"The HTTP socket could not be bound.");
+    PrintMessage(Fatal,"The HTTP socket was not bound; are they disabled in the config file?");
 #endif
    }
 
-
- /* Bind the WWWOFFLE control sockets. */
+ /* Bind the WWWOFFLE control socket(s). */
 
 #if USE_IPV6
  if(ConfigString(Bind_IPv6))
@@ -335,35 +327,29 @@
    }
 #endif
 
-#if USE_IPV6
- if(wwwoffle_fd[1]!=-1 && ConfigString(Bind_IPv4) && ConfigString(Bind_IPv6) &&
-    !strcmp(ConfigString(Bind_IPv6),"0:0:0:0:0:0:0:0") && !strcmp(ConfigString(Bind_IPv4),"0.0.0.0"))
-    PrintMessage(Inform,"Not creating WWWOFFLE IPv4 server socket on all addresses since IPv6 one is bound to all addresses.");
- else
+ if(ConfigString(Bind_IPv4))
    {
-#endif
-    if(ConfigString(Bind_IPv4))
+    wwwoffle_fd[0]=OpenServerSocket(ConfigString(Bind_IPv4),ConfigInteger(WWWOFFLE_Port));
+    if(wwwoffle_fd[0]==-1)
       {
-       wwwoffle_fd[0]=OpenServerSocket(ConfigString(Bind_IPv4),ConfigInteger(WWWOFFLE_Port));
-       if(wwwoffle_fd[0]==-1)
-         {
 #if USE_IPV6
+       if(wwwoffle_fd[1]!=-1 && ConfigString(Bind_IPv4) && !strcmp(ConfigString(Bind_IPv4),"0.0.0.0") &&
+                                ConfigString(Bind_IPv6) && !strcmp(ConfigString(Bind_IPv6),"0:0:0:0:0:0:0:0"))
+          PrintMessage(Warning,"Cannot create WWWOFFLE IPv4 server socket (but the IPv6 one might accept IPv4 connections).");
+       else
           PrintMessage(Fatal,"Cannot create WWWOFFLE IPv4 server socket.");
 #else
-          PrintMessage(Fatal,"Cannot create WWWOFFLE server socket.");
+       PrintMessage(Fatal,"Cannot create WWWOFFLE server socket.");
 #endif
-         }
       }
-#if USE_IPV6
    }
-#endif
 
  if(wwwoffle_fd[0]==-1 && wwwoffle_fd[1]==-1)
    {
 #if USE_IPV6
-    PrintMessage(Fatal,"Neither IPv4 or IPv6 WWWOFFLE socket could be bound.");
+    PrintMessage(Fatal,"The IPv4 and IPv6 WWWOFFLE sockets were not bound; are they disabled in the config file?");
 #else
-    PrintMessage(Fatal,"The WWWOFFLE socket could not be bound.");
+    PrintMessage(Fatal,"The WWWOFFLE socket was not bound; are they disabled in the config file?");
 #endif
    }