Last active
May 10, 2021 16:10
-
-
Save oskopek/9566780 to your computer and use it in GitHub Desktop.
Irssi notification script for KDE using kdialog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use vars qw($VERSION %IRSSI); | |
use Irssi; | |
$VERSION = '0.1.2'; | |
%IRSSI = ( | |
authors => 'Ondrej Skopek', | |
contact => '[email protected]', | |
name => 'kdialog', | |
description => 'A KDialog PassivePopup show\'s who is talking to you, on what IRC channel.', | |
url => 'https://gist.github.com/oskopek/9566780', | |
license => 'BSD', | |
changed => '$Date: 2014-03-15 13:55:00 +0100 (Sat, 15 Mar 2014) $' | |
); | |
#-------------------------------------------------------------------- | |
# Based on osd.pl 0.3.3 by Jeroen Coekaerts, Koenraad Heijlen | |
# http://www.irssi.org/scripts/scripts/osd.pl | |
#-------------------------------------------------------------------- | |
# Based on knotify.pl 0.1.1 by Hugo Haas | |
# http://larve.net/people/hugo/2003/scratchpad/IrssiKnotify.html | |
#-------------------------------------------------------------------- | |
#-------------------------------------------------------------------- | |
# Printing private messages | |
#-------------------------------------------------------------------- | |
sub priv_msg { | |
my ($server, $msg, $nick, $address) = @_; | |
kde_print("Private Message", "< " . $nick . "> " . $msg) | |
} | |
#-------------------------------------------------------------------- | |
# Printing hilight's | |
#-------------------------------------------------------------------- | |
sub hilight { | |
my ($dest, $text, $stripped) = @_; | |
if ($dest->{level} & MSGLEVEL_HILIGHT) { | |
kde_print($dest->{target}, $stripped); | |
} | |
} | |
#-------------------------------------------------------------------- | |
# The actual printing | |
#-------------------------------------------------------------------- | |
sub kde_print { | |
my ($title, $text) = @_; | |
system('kdialog', '--title', 'Irssi: '.$title, '--passivepopup', $text); | |
} | |
#-------------------------------------------------------------------- | |
# Irssi::signal_add_last | |
#-------------------------------------------------------------------- | |
Irssi::signal_add_last("message private", "priv_msg"); | |
Irssi::signal_add_last("print text", "hilight"); | |
#- end |
@oskopek, do you mind changing that line to remove the vulnerability? Tnx :)
@oskopek , please fix the gist to reflect the comments above
@oskopek ping ^^^
Done, sorry for the delay.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please, do not use this code as it makes your irssi vulnerable to arbitrary code execution sent between backticks, as described here : irssi/irssi#243
Instead, one MUST change line 50 to the following
system('kdialog', '--title', 'Irssi: '.$title, '--passivepopup', $text);
so that text contained in backticks do not get interpreted by perl.