1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 50_allow-port.dpatch by Mario Holbe <Mario.Holbe@RZ.TU-Ilmenau.DE>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Add allow_port as a possible config option.
8
diff -ur cgiirc-0.5.4.orig/cgiirc.config.full cgiirc-0.5.4/cgiirc.config.full
9
--- cgiirc-0.5.4.orig/cgiirc.config.full 2003-10-29 13:28:32.000000000 +0100
10
+++ cgiirc-0.5.4/cgiirc.config.full 2004-06-06 14:54:51.000000000 +0200
12
# it is killed (kill -9) or maybe a bug - this option still counts those as users.
15
-# Allow access to servers and channels not set in the default
16
-# settings above and use access_channel and access_server below.
17
+# Allow access to servers, ports and channels not set in the default
18
+# settings above and use access_channel, access_port and access_server below.
21
# This is regular experssion that sets what channels access should
26
+# This is regular experssion that sets what ports access should
30
# A list of commands to allow and deny access to, this is a space
31
# seperated list of commands to allow access to or if prefixed
32
# with an ! commands to disallow access to.
33
diff -ur cgiirc-0.5.4.orig/formats/dark cgiirc-0.5.4/formats/dark
34
--- cgiirc-0.5.4.orig/formats/dark 2003-10-29 13:28:33.000000000 +0100
35
+++ cgiirc-0.5.4/formats/dark 2004-06-06 14:29:51.000000000 +0200
37
connecting = {prefix-client} Connecting to {server $0} [$1] port {hilight $2}
39
access denied = {prefix-client} Access Denied: $0
40
-access server denied = {prefix-client} Access to that server is blocked
41
-access channel denied = {prefix-client} Access to that channel is blocked
42
+access server denied = {prefix-client} Access to server $0 is blocked
43
+access port denied = {prefix-client} Access to port $0 is blocked
44
+access channel denied = {prefix-client} Access to channel $0 is blocked
45
command denied = {prefix-client} Access to that command is blocked
46
session timeout = {prefix-client} Timeout - Your session has been inactive too long
48
diff -ur cgiirc-0.5.4.orig/formats/default cgiirc-0.5.4/formats/default
49
--- cgiirc-0.5.4.orig/formats/default 2003-10-29 13:28:33.000000000 +0100
50
+++ cgiirc-0.5.4/formats/default 2004-06-06 14:30:28.000000000 +0200
52
connecting = {prefix-client} Connecting to {server $0} [$1] port {hilight $2}
54
access denied = {prefix-client} Access Denied: $0
55
-access server denied = {prefix-client} Access to that server is blocked
56
-access channel denied = {prefix-client} Access to that channel is blocked
57
+access server denied = {prefix-client} Access to server $0 is blocked
58
+access port denied = {prefix-client} Access to port $0 is blocked
59
+access channel denied = {prefix-client} Access to channel $0 is blocked
60
command denied = {prefix-client} Access to that command is blocked
61
session timeout = {prefix-client} Timeout - Your session has been inactive too long
63
diff -ur cgiirc-0.5.4.orig/formats/gothic cgiirc-0.5.4/formats/gothic
64
--- cgiirc-0.5.4.orig/formats/gothic 2003-10-29 13:28:33.000000000 +0100
65
+++ cgiirc-0.5.4/formats/gothic 2004-06-06 14:30:56.000000000 +0200
67
connecting = {prefix-client} Connecting to {server $0} [$1] port {hilight $2}
69
access denied = {prefix-client} Access Denied: $0
70
-access server denied = {prefix-client} Access to that server is blocked
71
-access channel denied = {prefix-client} Access to that channel is blocked
72
+access server denied = {prefix-client} Access to server $0 is blocked
73
+access port denied = {prefix-client} Access to port $0 is blocked
74
+access channel denied = {prefix-client} Access to channel $0 is blocked
75
command denied = {prefix-client} Access to that command is blocked
76
session timeout = {prefix-client} Timeout - Your session has been inactive too long
78
diff -ur cgiirc-0.5.4.orig/formats/mirc cgiirc-0.5.4/formats/mirc
79
--- cgiirc-0.5.4.orig/formats/mirc 2003-10-29 13:28:33.000000000 +0100
80
+++ cgiirc-0.5.4/formats/mirc 2004-06-06 14:31:32.000000000 +0200
82
connecting = {prefix-client} Connecting to {server $0} [$1] port {hilight $2}
84
access denied = {prefix-error} Access Denied: $0
85
-access server denied = {prefix-error} Access to that server is blocked
86
-access channel denied = {prefix-error} Access to that channel is blocked
87
+access server denied = {prefix-error} Access to server $0 is blocked
88
+access port denied = {prefix-error} Access to port $0 is blocked
89
+access channel denied = {prefix-error} Access to channel $0 is blocked
90
command denied = {prefix-error} Access to that command is blocked
91
session timeout = {prefix-error} Timeout - Your session has been inactive too long
93
diff -ur cgiirc-0.5.4.orig/formats/russian cgiirc-0.5.4/formats/russian
94
--- cgiirc-0.5.4.orig/formats/russian 2003-10-29 13:28:33.000000000 +0100
95
+++ cgiirc-0.5.4/formats/russian 2004-06-06 14:46:22.000000000 +0200
97
connecting = {prefix-client} ����������� � {server $0} [$1] port {hilight $2}
99
access denied = {prefix-client} ������ ������: $0
100
-access server denied = {prefix-client} ������ � ������� ����������
101
-access channel denied = {prefix-client} ������ � ������ ����������
102
+access server denied = {prefix-client} ������ � ������� $0 ����������
103
+access port denied = {prefix-client} ������ � ����� $0 ����������
104
+access channel denied = {prefix-client} ������ � ������ $0 ����������
105
command denied = {prefix-client} ������������� ������ ������� ���������
106
session timeout = {prefix-client} ������� - ���� ������ ���� ������� ����� �� �������
108
diff -ur cgiirc-0.5.4.orig/nph-irc.cgi cgiirc-0.5.4/nph-irc.cgi
109
--- cgiirc-0.5.4.orig/nph-irc.cgi 2004-01-29 12:24:48.000000000 +0100
110
+++ cgiirc-0.5.4/nph-irc.cgi 2004-06-06 14:27:55.000000000 +0200
111
@@ -1064,8 +1064,6 @@
112
$cgi->{nick} ||= $config->{default_nick};
113
$cgi->{name} ||= $config->{default_name};
115
- ($cgi->{port}) = $cgi->{port} =~ /(\d+)/;
117
$cgi->{nick} =~ s/\?/int rand 10/eg;
118
# Only valid nickname characters
119
$cgi->{nick} =~ s/[^A-Za-z0-9\[\]\{\}^\\\|\_\-\`]//g;
120
@@ -1083,6 +1081,11 @@
121
if($cgi->{serv} =~ s/:(\d+)$//) {
124
+ unless(access_configcheck('port', $cgi->{port})) {
125
+ message('access port denied', $cgi->{port});
126
+ $cgi->{port} = (split /,/, $config->{default_port})[0];
128
+ ($cgi->{port}) = $cgi->{port} =~ /(\d+)/;
130
if(config_set('encoded_ip')) {