1
0
mirror of https://github.com/irssi/irssi.git synced 2024-08-04 03:34:18 -04:00
Commit Graph

873 Commits

Author SHA1 Message Date
ailin-nemui
ff8ccaf08b module check irssi version
Add explicit checks into every module to match the ABI version defined
in common.h
2015-12-10 00:52:33 +01:00
ailin-nemui
4dc2bab4b4 Merge pull request #371 from LemonBoy/rampage
Rewrite some faulty logic handling the saved channels. Fixes #340
2015-12-09 23:07:48 +01:00
dequis
96766b7f05 Remove all WIN32 ifdefs (unifdef -UWIN32)
Just use cygwin.

This looks like it wasn't enough to do anything useful, and I don't
think anyone cares about supporting win32 the hard way.
2015-12-09 15:20:59 -03:00
LemonBoy
1749a7a5ab Minor adjustments.
Use g_strcmp0 instead of strcmp.
Explicit checks added for the g_strcmp0 clauses.
2015-12-09 16:16:03 +01:00
LemonBoy
971417caa3 Rewrite some faulty logic handling the saved servers. 2015-12-09 16:02:37 +01:00
LemonBoy
60c501625b Better function naming 2015-12-09 15:43:31 +01:00
LemonBoy
750df38e8c Rewrite some faulty logic handling the saved channels.
Issue #340 brought to our attention the fact that under certain
circumstances irssi would go on a wild rampage and carelessly overwrite
some saved channel records in the configuration file.
This happened because the code didn't take into account the case where
the channel index in setupchannels wouldn't match the one in the
configuration; this actually happens when the user removes a chatnet
without removing the associated channels.
2015-12-09 00:34:39 +01:00
LemonBoy
8701cbc972 Let ignore_check do its work when server is NULL
A NULL-check has been added to the ignore_match_server macro, making the
function safe from a pointer perspective.
Fixes #193 in the meanwhile.
2015-11-22 17:20:00 +01:00
LemonBoy
3d9b9d473f Strip the trailing whitespace from /join commands.
Fixes #99 for great good.
2015-11-09 18:42:49 +01:00
LemonBoy
1006fee802 Add an option to strip trailing whitespace when parsing commands 2015-11-09 17:32:51 +01:00
ailin-nemui
6d6e672e8e Merge pull request #313 from isundil/master
Fix #45 Make it easy to delete default channels, servers and networks
2015-11-09 16:45:19 +01:00
ailin-nemui
0188c1fb5d Merge pull request #341 from dequis/strsplit-len-fix
Fix invalid reads in strsplit_len when splitting on spaces
2015-11-09 16:21:33 +01:00
dequis
b054ade4b9 strsplit_len: make it look more like the original version 2015-11-09 06:46:40 -03:00
dequis
8736c12fc9 strsplit_len: use strlen() directly instead of a remaining_len variable 2015-11-09 06:33:08 -03:00
dx
8d1f667100 Merge pull request #320 from irssi/ahf/add-setting-type-any
Fix warnings
2015-11-01 13:40:54 -03:00
dequis
ed28483e75 Fix invalid reads in strsplit_len when splitting on spaces
The symptom for this one is randomly getting lines split before the last
word, even if there's no need for splitting. Also, this function is only
reached if recode is on, and iconv failed (for example, due to an
incorrect source charset). Thanks to vague for finding this and
providing valgrind logs.

The loop that looks for spaces tried to read backwards from the end of
the current line, with the end being determined by len. Assuming
strsplit_len() with len=400, this meant accessing str[399] in the first
iteration. For strings that don't need splitting, this means an invalid
read always.

If that invalid read happens to hit garbage that has a space character,
(len - offset) points after the end of string, which isn't a problem for
g_strndup() since it stops at the first null, and no splitting happens.
If the garbage doesn't have any spaces, it splits by the last word.

This commit avoids that loop entirely if (remaining_len > len). It also
changes the way it iterates over the string to be much less confusing.
2015-10-23 05:12:04 -03:00
dequis
f540ec9de1 Fix /reconnect RECON-1 saying "Reconnection tag 1 not found"
Turns out it was fixing the wrong string, and trying to do
atoi("RECON-1") instead of atoi("1").

"/reconnect 1" worked, but "/reconnect RECON-1" gave that confusing
error message.
2015-10-08 00:06:17 -03:00
Alexander Færøy
685d8fe5b0
Add SETTING_TYPE_ANY and replace -1 with it. 2015-10-03 19:01:16 +02:00
LemonBoy
b68a30cdfe Include write-buffer.h in log-away.c
Silence a warning and make the world a better place.
2015-10-03 14:32:38 +02:00
dequis
ef55e0f653 Add missing null terminator to the g_build_path() varargs
Lemon broke it a few commits ago.
2015-10-02 13:48:23 -03:00
Geert Hauwaerts
9c5f6780b2 Merge pull request #316 from LemonBoy/fix_mem_leak
Fix a memory leak.
2015-10-02 09:39:10 -07:00
LemonBoy
db5ae4adce Flush the dirty buffer to disk
Given a big enough write_buffer_size and a long enough
write_buffer_timeout it might be possible to show the user an incomplete
or empty awaylog.

Patch by: Petteri Aimonen
2015-10-02 17:21:17 +02:00
LemonBoy
b545bc96a9 Fix a memory leak.
g_get_current_dir() returns a heap-allocated string.
2015-10-02 12:39:08 +02:00
isundil
ef1a09b87d Fix return value of server_setup_remove_chatnet 2015-10-01 22:53:34 +02:00
isundil
6ca7dc6847 Updated server removal
Removing network will also remove attached channels
2015-10-01 22:36:02 +02:00
isundil
2ad6bb1295 Fix #45 Make it easy to delete default channels, servers and networks
Removing network will now also remove all attached servers
2015-10-01 21:14:30 +02:00
Jari Matilainen
a2277e84bd Added functionality to create dir if dir specified in rawlog filename 2015-09-24 11:59:18 +02:00
ailin-nemui
618a636f7c Merge pull request #297 from vague666/hilight_nick_matches
Add new setting to modify behaviour of hilight_nick_matches to match anywhere in message

Fixes #56
2015-09-23 00:07:03 +02:00
Jari Matilainen
3f2eaf1d3a Fix return value from nick_match_msg_everywhere, remove #include 'settings.h' 2015-09-22 23:16:41 +02:00
Jari Matilainen
b5c3e90802 Fix return value from nick_match_msg_everywhere 2015-09-22 23:09:55 +02:00
Jari Matilainen
5a4be0f4f5 Add new setting to optionally modify behaviour of hilight_nick_matches
Fix indentation

Remove unused variables that crept into the nick_match_msg_everywhere function
2015-09-22 22:49:50 +02:00
ailin-nemui
f5f3d7cc98 Revert "Network and IPv{4,6} related changes" 2015-09-22 21:59:17 +02:00
LemonBoy
564829610d Ding dong the switch is dead 2015-09-21 14:55:35 +02:00
LemonBoy
ffaa890e99 Initial work to make irssi respect the resolved ip order
Ip's aren't selected using random() anymore, also select the ip version
by using getaddrinfo and some proper hints.
2015-09-21 14:19:35 +02:00
LemonBoy
06040fb30b Merge remote-tracking branch 'origin' into sasl 2015-09-19 23:58:16 +02:00
LemonBoy
b8d3301d34 SASL support
The only supported methods are PLAIN and EXTERNAL, the latter is untested as of
now.
The code gets the values from the keys named sasl_{mechanism,username,password}
specified for each chatnet.
2015-09-11 00:30:16 +02:00
Alexander Færøy
7b46dae182 Merge pull request #248 from LemonBoy/chantypes
Implement CHANTYPES support
2015-09-10 01:37:08 +02:00
LemonBoy
21c1e4e9f8 Fix two minor issues outlined in the PR#222
irc-cap.c has now a licence header.
A minor style fix in misc.c
2015-09-02 22:40:10 +02:00
LemonBoy
16c71cf1fb Implement CHANTYPES support 2015-05-15 17:07:30 +02:00
LemonBoy
2d7030a844 Implement support for IRCv3.1 CAP negotiation 2015-05-05 23:14:26 +02:00
Alexander Færøy
eb0f09073c Merge pull request #199 from ailin-nemui/config-parser
Make config parser more robust
2015-04-17 21:23:03 +02:00
Alexander Færøy
03be2861dc Merge pull request #235 from dequis/g_strcmp0
Change all strcmp() to g_strcmp0() to handle nulls gracefully
2015-04-17 21:13:18 +02:00
Haw Loeung
349ed35ce0 ssl: Fixed call to SSL_CTX_set_cipher_list() only when ssl_ciphers specified and warn when no cipher suite could be selected. 2015-04-15 00:44:07 +10:00
Haw Loeung
50e955e342 ssl: Add option to specify SSL cipher suite preference. 2015-04-14 18:07:35 +10:00
dequis
f14199d9c1 Change all strcmp() to g_strcmp0() to handle nulls gracefully
Just a string replacement (but i did check every one of them)

    sed -i 's/strcmp(/g_strcmp0(/g' **/*.c
2015-04-07 22:41:05 -03:00
Adam
28aaa653cf Add SNI support 2015-04-07 15:01:57 -04:00
Ailin Nemui
96d4fb9156 add CONFIG_REC to config_node_section* APIs
this adds the CONFIG_REC * to the config_node_section and
config_node_section_index APIs as they will require access to the config
cache later on to make the config parser more robust.
2015-02-17 09:50:55 +01:00
Alexander Færøy
9abdeb8611 Merge pull request #152 from sebth/master
Try to split long lines on spaces
2015-01-05 01:03:58 +01:00
Alexander Færøy
89cdcecf76 Merge pull request #133 from pjcj/master
Speed up /reload when there are many ignores.
2014-12-16 20:39:33 +01:00
Geert Hauwaerts
08b390b11b Documentation fix for #185
Documentation fix for #185
2014-12-08 21:28:02 +01:00
Alexander Færøy
bbd7333924 Merge pull request #171 from vlajos/typofixes-vlajos-20141108
typo fixes - https://github.com/vlajos/misspell_fixer
2014-12-06 16:09:11 +01:00
Guillaume BROGI
86d263dd7d Check for unix sockets when reconnecting 2014-12-03 14:38:01 +01:00
Guillaume BROGI
f0a6e5f82a Correctly parse unix sockets servers in the config 2014-11-20 17:01:07 +01:00
Veres Lajos
f285332c5b typo fixes - https://github.com/vlajos/misspell_fixer 2014-11-08 22:26:53 +00:00
Sebastian Thorarensen
f81a54b937 Try to split long lines on spaces
Try to split long lines on spaces to avoid words being splitted. This
can be turned off with the option `split_line_on_space'. The code
assumes that the terminal encoding has ASCII spaces.
2014-10-19 17:03:20 +02:00
Alexander Færøy
8bd575df2e Disable SSLv3 2014-10-15 10:00:30 +02:00
Alexander Færøy
10078407f6 Remove unnecessary NULL check
Fixes: #135
2014-10-11 12:13:22 +02:00
Alexander Færøy
d9ea224628 Fix use-after-free bug with cached settings values
This patch fixes a couple of use-after-free bugs when caching various
string related setting values.

Fixes: #143
2014-09-30 18:07:13 +02:00
Paul Johnson
d9deafe57c Speed up /reload when there are many ignores.
With many ignores (a few thousand) /reload could take so long that connections
were dropped.  The problem is that nickmatch_rebuild() was being called for
every ignore.  The easy solution is to only call it once at the end.
2014-08-23 21:08:17 +02:00
David Leadbeater
1dbc3dba78 Fix rawlog saving after dac67a5 broke it 2014-08-05 17:33:50 +01:00
David Hill
6e45d68399 Avoid using uninitalized values. 2014-07-12 16:35:42 -04:00
Alexander Færøy
b2c3db4d5b Fix Clang warnings
This patch fixes a few warnings emitted by clang by removing the
initialization of the list by itself.
2014-07-07 22:26:04 +02:00
Sebastian Thorarensen
1c73bde239 Fix minor coding style issues in message splitting 2014-07-06 23:24:10 +02:00
Sebastian Thorarensen
695a6a7d9b Allow `server.split_message' being NULL
Now a module can set `server.split_message = NULL' to disable message
splitting, instead of having to implement the function.
2014-07-06 23:24:10 +02:00
Sebastian Thorarensen
28a3dbe164 Replace an indent of eight spaces with a tab 2014-07-06 23:24:10 +02:00
Sebastian Thorarensen
e6147fb8f2 Properly split long IRC messages
This commit adds handling of long IRC messages to the core. In contrast
to the `splitlong.pl' plugin, multi-byte encoded and recoded messages
are properly split.

To allow for this, a new function has been added to the server struct:
`split_message'. `split_message' returns a string array with the message
splitted to substrings of a length that the server can handle. If a
protocol module doesn't have any limit, it can simply return a singleton
array with a copy of the message.

The `MSG' chat command now calls `split_message' before `send_message',
and emits `message own_public' / `message own_private' with each
substring, so that the string splitting will be visible in the UI.

`split_message' in the IRC module uses `recode_split' which in turn uses
iconv to properly split multi-byte encoded (and recoded) messages.
2014-07-06 23:24:09 +02:00
David Leadbeater
dac67a567d Check return values from some syscalls and warn if they fail 2014-07-06 21:52:03 +01:00
David Leadbeater
7949e4c53f Initialize in6 correctly
This is technically wrong as it then gets used as an IPv4 sockaddr, but it only
needs to be some 0s so this is easier than changing the IPADDR data structure or
adding a new API.
2014-07-06 19:56:13 +01:00
David Leadbeater
beec29c305 Make configure checks able to build with -Werror
Also fix a few compiler warnings, this combined with pull #82 allows me to build
with CFLAGS="-Werror -Wall".
2014-07-06 18:56:17 +01:00
Alexander Færøy
ed51629514 Merge pull request #80 from dgl/noact
Change NO_ACT so it can be combined with other levels
2014-07-04 23:48:41 +02:00
David Leadbeater
a9d9756d4d Make /ignore -replies work with NO_ACT 2014-06-30 09:35:31 +01:00
David Leadbeater
d84811b192 Don't expand ALL when combined with NEVER/NO_ACT 2014-06-30 00:31:59 +01:00
David Leadbeater
819f9d16c9 Change NO_ACT so it can be used in addition to other ignores
This results in a more flexible system and is less surprising as it means levels
can be used in the way they normally can in an ignore.

As an example the current approach to NO_ACT provides no way to let HILIGHTS
be shown, with this change /set activity_hide_targets can be recreated with:
  /ignore #channel NO_ACT
  /ignore #channel -except -regexp -pattern . NO_ACT HILIGHTS
(but obviously this can be configured in many more ways if desired).
2014-06-30 00:31:53 +01:00
David Leadbeater
0086211236 Warn with error if regexp ignore fails to parse 2014-06-30 00:23:42 +01:00
Dave Reisner
f0925de16b s/INCLUDES/AM_CPPFLAGS/g
Silences warnings on recent automake such as:

src/core/Makefile.am:3: warning: 'INCLUDES' is the old name for
'AM_CPPFLAGS' (or '*_CPPFLAGS')
2014-06-27 09:06:21 -04:00
David Leadbeater
86fcadb85d Add some missing casts to silence compiler warnings 2014-06-26 00:44:07 +01:00
David Hill
5419a4b360 Fix compiler warning.
network.c:63:2: warning: missing braces around initializer [-Wmissing-braces]
network.c:63:2: warning: (near initialization for 'ip4_any.ip.__u6_addr') [-Wmissing-braces]
2014-06-20 00:41:52 -04:00
Tom Feist
7d87a02522 Add NO_ACT level
This patch adds a new NO_ACT level that can be used with /ignore to
ignore activity notifications
2014-06-18 23:40:26 +02:00
Ailin Nemui
a8c52d8c16 speed up nicklist by using hash 2014-06-15 23:38:05 +02:00
Ailin Nemui
a4c62a3fee speed up window_item_find by interning name and removing call to channel_find 2014-06-15 23:37:13 +02:00
Alexander Færøy
53f50d3dfa Merge pull request #33 from dajohi/modules_load
Silence a compiler warning.
2014-06-15 21:57:42 +02:00
David Hill
5b2d189ab5 Silence a compiler warning.
If the first g_module_symbol call failed, module_deinit was set
to value2, which is uninitialized.  Move the assignment after
checking variable found to silence the warning.
2014-06-15 15:40:08 -04:00
David Hill
138d4f4555 Replace deprecated g_io_channel_close with g_io_channel_shutdown.
g_io_channel_close flushes the buffer and does not return errors.
g_io_channel_shutdown(handle, TRUE, NULL) keeps that behavior.
2014-06-15 15:23:29 -04:00
David Hill
0d4f13d20f Replace deprecated g_str[n]casecmp with g_ascii_str[n]cmp. 2014-06-10 12:06:19 -04:00
Alexander Færøy
68f8229373 Add -ssl_pass to /connect and /server
Fixes: Bug #305

git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5231 dbcabf3a-b0e7-0310-adc4-f8d773084564
2014-01-11 19:53:17 +00:00
Geert Hauwaerts
03359ba0fe - Applied a patch from Jaroslav Škarvada (FTBFS if "-Werror=format-security" flag is used | https://bugzilla.redhat.com/show_bug.cgi?id=1037139)
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5229 dbcabf3a-b0e7-0310-adc4-f8d773084564
2014-01-10 20:29:42 +00:00
Alexander Færøy
eb8dfc8cc9 Clean-up after ourselves
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5223 dbcabf3a-b0e7-0310-adc4-f8d773084564
2013-06-25 21:35:13 +00:00
Alexander Færøy
4d36a9e498 Add TLSA related signals
This patch adds 3 new signals:

  * tlsa avalable: emitted if TLSA is available for a given domain.
  * tlsa verification success: emitted if the TLSA check was successful.
  * tlsa verification failed: emitted if the TLSA check was unsuccessful.

git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5220 dbcabf3a-b0e7-0310-adc4-f8d773084564
2013-06-23 23:50:32 +00:00
Alexander Færøy
cb873d5b91 Pass SERVER_REC directly to net_connect_ip_ssl
This patch refactors how we are passing connection information for SSL
connections. This will allow us to emit signals with a SERVER_REC as
parameter during SSL handshake.

git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5219 dbcabf3a-b0e7-0310-adc4-f8d773084564
2013-06-23 23:50:26 +00:00
Alexander Færøy
d826896f74 Implement experimental DNSSEC DANE support
This patch adds experimental support for the DNSSEC DANE verification
protocol using the libval library from the DNSSEC-Tools package.

Thanks to Thomas Steen Ramussen for creating a test setup and suggesting
the idea of experimenting with DANE support in Irssi :-)

git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5218 dbcabf3a-b0e7-0310-adc4-f8d773084564
2013-06-23 23:50:14 +00:00
Emanuele Giaquinta
7ae4919229 Do not set SSL_OP_ALL, it is not needed to disable SSLv2 and it can prevent
connections to TLSv1.1 servers from working. Patch by pi-rho.


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5216 dbcabf3a-b0e7-0310-adc4-f8d773084564
2012-06-24 09:50:08 +00:00
Alexander Færøy
796134ffbd Add -noautosendcmd to /SERVER and /CONNECT.
Passing this option will force Irssi to not execute the content of the
autosendcmd chatnet-setting upon connect.

Fixes: #738


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5209 dbcabf3a-b0e7-0310-adc4-f8d773084564
2011-11-21 21:27:58 +00:00
Jilles Tjoelker
81b8dcdeb2 Do not go beyond the end of the string when processing an octal escape.
This code is used, for example, when /set expand_escapes on.

I can't reproduce crashes but I can reproduce garbage if I type a\1.

bug #775


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5195 dbcabf3a-b0e7-0310-adc4-f8d773084564
2010-11-17 20:41:14 +00:00
Alexander Færøy
4976f75295 Fix indention.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5186 dbcabf3a-b0e7-0310-adc4-f8d773084564
2010-07-28 16:15:02 +00:00
Jase Thew
ec83dd762a Fix segfault generated by SSL disconnections. (Bug #752)
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5170 dbcabf3a-b0e7-0310-adc4-f8d773084564
2010-05-16 17:50:31 +00:00
Alexander Færøy
daf6adc0b0 Remove warnings about uninitialized variables.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5140 dbcabf3a-b0e7-0310-adc4-f8d773084564
2010-04-04 12:19:54 +00:00
Alexander Færøy
8728207191 deprecated glib strup/down fixes from exg.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5138 dbcabf3a-b0e7-0310-adc4-f8d773084564
2010-04-03 20:09:37 +00:00
Alexander Færøy
df1d7a7814 glib iochannel fixes from exg.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5137 dbcabf3a-b0e7-0310-adc4-f8d773084564
2010-04-03 20:04:15 +00:00
Alexander Færøy
dd23f39f09 Do not use SSLv2 protocol. From Bazerka.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5136 dbcabf3a-b0e7-0310-adc4-f8d773084564
2010-04-03 19:09:11 +00:00
Wouter Coekaerts
1aa10ece88 Fix crash when checking for fuzzy nick match when not on the channel. Reported by Aurelien Delaitre (SATE 2009)
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5126 dbcabf3a-b0e7-0310-adc4-f8d773084564
2010-03-21 20:23:34 +00:00