-n2005-08-09 Michael Poole <mdpoole@troilus.org>
+2005-08-10 Michael Poole <mdpoole@troilus.org>
+
+ * ircd/channel.c (joinbuf_join): Do not send a MODE +o when a
+ local user creates a channel.
+
+ * ircd/umkpasswd.c (crypt_pass): Allocate the proper amount of
+ memory for the tagged output string.
+
+ * ircd/test/test-driver.pl: Add -vhost=... option.
+
+ * ircd/test/ircd-t1.conf: Add new Operator blocks.
+
+ * ircd/test/*.cmd: Rearrange and add more coverage tests.
+
+2005-08-09 Michael Poole <mdpoole@troilus.org>
* ircd/ircd_parser.y: Move error tokens to top level of parse, and
make ';' a synchronizing token for them. This avoids crashes in
sendcmdto_channel_butserv_butone(jbuf->jb_source, CMD_JOIN, chan, NULL, 0, "%H", chan);
/* send an op, too, if needed */
- if (flags & CHFL_CHANOP)
+ if (flags & CHFL_CHANOP && (oplevel < MAXOPLEVEL || !MyUser(jbuf->jb_source)))
sendcmdto_channel_butserv_butone((chan->mode.apass[0] ? &me : jbuf->jb_source),
CMD_MODE, chan, NULL, 0, "%H +o %C",
chan, jbuf->jb_source);
:cl2 wait cl1
:cl2 mode #test2 -D
:cl2 mode #test +v Alex
-:cl1 oper oper1 oper1
:cl1 wait cl2
-:cl1 raw die :testing over
define srv localhost:7701
connect cl1 Alex alex %srv% :Test client 1
-connect cl2 Bubb bubb %srv% :Test client 2
:cl1 oper oper1 oper1
-:cl2 wait cl1
+connect cl2 Bubb bubb %srv% :Test client 2
:cl2 oper oper3 oper4
+:cl2 oper oldoper wrongpass
+:cl2 oper md5oper wrongpass
+:cl2 oper cryptoper wrongpass
:cl2 oper oper2 oper2
-:cl1 raw :privs Bubb
:cl2 raw :privs Alex Alex
-sync cl1,cl2
+:cl1 wait cl2
+:cl1 raw :privs Bubb
+:cl1 nick A
+:cl1 nick Alexey
--- /dev/null
+connect cl1 Alex alex localhost:7701 :Test client 1
+:cl1 oper oper1 oper1
+:cl1 raw :restart brb
+:cl1 oper oper1 oper1
+:cl1 raw :die :testing over
--- /dev/null
+define srv localhost:7701
+
+connect cl1 Alex alex %srv% :Test client 1
+:cl1 oper oper1 oper1
+:cl1 raw :gline !+$Rbubb 30 :Bubb is not welcome here
+:cl1 sleep 35
+:cl1 raw :gline !+127.2.* 3600 :Localclone?
+:cl1 sleep 5
+:cl1 raw :gline !+127.2.* 3600 :Localclone?
+connect cl2 Bubb bubb %srv% :Test client 2
+:cl1 raw :gline
+:cl1 raw :gline $Rbubb
+:cl1 raw :gline -$Rbubb
+:cl1 wait cl2
+:cl1 raw :gline !+$Rbubb * 3600 :Bubb is not welcome here
+:cl1 sleep 5
+:cl1 raw :gline -$Rbubb
+:cl1 raw :gline +#warez 30 :Warez r bad mmkay
+:cl2 wait cl1
+:cl2 join #warez
+:cl1 sleep 35
+:cl1 raw :stats glines
+:cl1 raw :gline !+*@127.0.0.2 3600 :Localclone?
+:cl1 raw :gline !+127.1.* 3600 :Localclone?
+:cl1 raw :stats memory
+:cl2 raw :gline
Operator { name = "oper1"; host = "*@*"; password = "$PLAIN$oper1"; class = "Opers"; };
Operator { name = "oper2"; host = "*@*"; password = "$PLAIN$oper2"; class = "Opers"; local = yes; };
+Operator { name = "oldoper"; host = "*@*"; password = "Xlfc26b4eYGWs"; class = "Opers"; };
+Operator { name = "md5oper"; host = "*@*"; password = "$SMD5$2O$4O.rSAmhE4Fg05MmG.047/"; class = "Opers"; };
+Operator { name = "cryptoper"; host = "*@*"; password = "$CRYPT$41ndrxPQu3B66"; class = "Opers"; };
Kill { username = "sub7"; realname = "s*7*"; reason = "You are infected with a Trojan"; };
Kill { realname = "Chloe"; reason = "drones"; };
--- /dev/null
+#! /bin/sh
+set -e
+srcdir=$1
+for script in channel-1 client-1 stats-1 gline-1 ; do
+ echo "Running test $script."
+ ${srcdir}/test-driver.pl ${srcdir}/${script}.cmd
+done
+echo "Terminating server."
+${srcdir}/test-driver.pl ${srcdir}/die.cmd
+../ircd -?
+../ircd -v
+../ircd -x 6 -k -d ${srcdir} -f ircd-t1.conf -c user@127.0.0.1
$heap->{irc_debug} = 1;
} elsif ($arg =~ /^-V$/) {
$heap->{verbose} = 1;
+ } elsif ($arg =~ /^-vhost=(.*)$/) {
+ $heap->{vhost} = $1;
} else {
die "Extra command-line argument $arg\n" if $heap->{script};
$heap->{script} = new FileHandle($arg, 'r')
Debug => $heap->{irc_debug},
}
};
+ $client->params->{LocalAddr} = $heap->{vhost}
+ if $heap->{vhost};
$heap->{clients}->{$client->{name}} = $client;
$heap->{sessions}->{$client->{irc}} = $client;
$kernel->call($client->{irc}, 'register', 'all');
salt = make_salt(default_salts);
untagged = (char *)CryptFunc(crypt_mech->mech)(pw, salt);
- tagged = (char *)MyMalloc(strlen(salt)+CryptTokSize(crypt_mech->mech)+1);
+ tagged = (char *)MyMalloc(strlen(untagged)+CryptTokSize(crypt_mech->mech)+1);
memset(tagged, 0, strlen(untagged)+CryptTokSize(crypt_mech->mech)+1);
strncpy(tagged, CryptTok(crypt_mech->mech), CryptTokSize(crypt_mech->mech));
strncpy(tagged+CryptTokSize(crypt_mech->mech), untagged, strlen(untagged));