Commit Diff
Diff:
71d1e25001b7351b471a19c15a0a1633938f7f4d
92788e3adb0d10591ab17c83803d398a8e81c7ea
Commit:
92788e3adb0d10591ab17c83803d398a8e81c7ea
Tree:
c8e8d17f073e21f343e842641013cedc561773b2
Author:
Izzy Blacklock <izzyb@planetofnix.com>
Committer:
Izzy Blacklock <izzyb@planetofnix.com>
Date:
Sun Aug 6 03:21:27 2023 UTC
Message:
bug fixes - missing unveil and incorrect scope for variables znclog needed to be unveiled $sender and $val were defined before the loop but only needed inside the loop and every other use of it has local scope except where corrected. Fixed this in my libIRCNOW branch but backporting it to main branch.
blob - b5156896312b287db974aecd9bcbae60f58b6ea0
blob + 769896701006d59e17b892f2e62ba00dde6434d7
--- BNC.pm
+++ BNC.pm
@@ -57,6 +57,7 @@ sub init {
unveil("/usr/lib/libc.so.95.1", "r") or die "Unable to unveil $!";
unveil("/usr/libexec/ld.so", "r") or die "Unable to unveil $!";
unveil("/usr/bin/tail", "rx") or die "Unable to unveil $!";
+ unveil("$znclog", "r") or die "unable to unveil $!";
unveil("$netpath", "r") or die "Unable to unveil $!";
@networks = readnetworks($netpath);
blob - 7a377ea442291577a084b97eaba84c6bc7d64614
blob + 4905f46c904ff3c5e4bd19265da791a33103b12b
--- botnow
+++ botnow
@@ -227,7 +227,6 @@ foreach my $network (@networks) {
while(my @ready = $sel->can_read) {
my ($bot, $response);
- my ($sender, $val);
foreach my $socket (@ready) {
foreach my $b (@bots) {
if($socket == $b->{sock}) {
@@ -413,7 +412,7 @@ while(my @ready = $sel->can_read) {
debug(ALL, "$text");
} elsif ($code == 307 && $text =~ /^([-_\|`a-zA-Z0-9]+) (.*)/) {
my ($sender, $key) = ($1, "registered");
- $val = $2 eq ":is a registered nick" ? "True" : "$2";
+ my $val = $2 eq ":is a registered nick" ? "True" : "$2";
my $id = SQLite::id("irc", "nick", $sender, $expires);
SQLite::set("irc", "id", $id, "identified", $val);
debug(ALL, "$key: $val");
@@ -435,7 +434,7 @@ while(my @ready = $sel->can_read) {
} elsif ($code == 315 && $text =~ /^([-_\|`a-zA-Z0-9]+) :End of \/?WHO(IS)? list/) {
debug(ALL, "End of WHOIS");
} elsif ($code == 317 && $text =~ /^([-_\|`a-zA-Z0-9]+) (\d+) (\d+) :?(.*)/) {
- ($sender, my $idle, my $epochtime) = ($1, $2, $3);
+ my ($sender, $idle, $epochtime) = ($1, $2, $3);
my $id = SQLite::id("irc", "nick", $sender, $expires);
SQLite::set("irc", "id", $id, "idle", $idle);
# SQLite::set("irc", "id", $id, "epochtime", time());
IRCNow