Skip to content

Commit 8e58c8c

Browse files
committed
6.97: fixed broken CONNECT command.
added ->do_mode_string_local() which is the same as ->do_mode_string() except it doesn't tell other servers about the change.
1 parent eab481d commit 8e58c8c

File tree

6 files changed

+22
-13
lines changed

6 files changed

+22
-13
lines changed

INDEV

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,4 +1917,8 @@ CHANGES:
19171917
95. handle modes from the local server rather than the user in Access module.
19181918

19191919
96. solved an issue where some users may not be ->quit()ted during netsplit due to modification of the {users} array during iteration.
1920+
1921+
97. fixed broken CONNECT command.
1922+
added ->do_mode_string_local() which is the same as ->do_mode_string() except it doesn't tell other servers about the change.
1923+
19201924

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.96
1+
6.97

lib/channel/mine.pm

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,15 @@ sub prefix {
131131
return q..
132132
}
133133

134+
# same as do_mode_string() except it never sends to other servers.
135+
sub do_mode_string_local {
136+
$_[6] = 1;
137+
do_mode_string(@_);
138+
}
139+
134140
# handle a mode string, tell our local users, and tell other servers.
135141
sub do_mode_string {
136-
my ($channel, $perspective, $source, $modestr, $force, $protocol) = @_;
142+
my ($channel, $perspective, $source, $modestr, $force, $protocol, $local_only) = @_;
137143

138144
# handle the mode.
139145
my ($user_result, $server_result) = $channel->handle_mode_string(
@@ -155,7 +161,7 @@ sub do_mode_string {
155161
$main::pool->fire_command_all(cmode =>
156162
$source, $channel, $channel->{time},
157163
$perspective->{sid}, $server_result
158-
);
164+
) unless $local_only;
159165

160166
}
161167

lib/connection.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ sub handle {
116116
if (defined ( my $addr = conn($connection->{name}, 'address') )) {
117117

118118
# check for matching IPs
119-
if (lc $connection->{ip} ne $addr) {
119+
if ($connection->{ip} ne $addr) {
120120
$connection->done('Invalid credentials');
121121
return;
122122
}

modules/Core.module/submodules/ServerCommands.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ sub cum {
497497

498498
# set modes. tell our local users.
499499
my $final_modestr = $modes.' '.(($uid.' ') x length $modes);
500-
$channel->do_mode_string($serv, $serv, $final_modestr, 1, 1);
500+
$channel->do_mode_string_local($serv, $serv, $final_modestr, 1, 1);
501501

502502
}
503503
return 1

modules/Core.module/submodules/UserCommands.pm

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -784,23 +784,22 @@ sub part {
784784
}
785785

786786
sub sconnect {
787-
my ($user, $data, @args) = @_;
788-
my $server = $args[1];
787+
my ($user, $data, $sname) = @_;
789788

790789
# make sure the server exists
791-
if (!$ircd::conf->has_block($server)) {
792-
$user->server_notice('CONNECT', 'no such server '.$server);
790+
if (!$ircd::conf->has_block($sname)) {
791+
$user->server_notice('CONNECT', 'no such server '.$sname);
793792
return
794793
}
795794

796795
# make sure it's not already connected
797-
if ($main::pool->lookup_server_name($server)) {
798-
$user->server_notice('CONNECT', "$server is already connected.");
796+
if ($main::pool->lookup_server_name($sname)) {
797+
$user->server_notice('CONNECT', "$sname is already connected.");
799798
return
800799
}
801800

802-
if (!server::linkage::connect_server($server)) {
803-
$user->server_notice('CONNECT', 'couldn\'t connect to '.$server);
801+
if (!server::linkage::connect_server($sname)) {
802+
$user->server_notice('CONNECT', 'couldn\'t connect to '.$sname);
804803
}
805804
}
806805

0 commit comments

Comments
 (0)