1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-15 04:28:09 -04:00
Commit Graph

1096 Commits

Author SHA1 Message Date
Nei
495bdd11cf Merge branch 'fix-16' into 'security'
Prevent a OOB read when parsing IRCNet ! channels

See merge request irssi/irssi!22
2017-10-20 13:23:28 +00:00
Nei
c46bed1e17 Merge branch 'fix-gl-15' into 'security'
Don't proceed with cmd_msg if there was an error splitting msg

See merge request irssi/irssi!21
2017-10-20 15:22:32 +02:00
Nei
3c2ae68073 Merge branch 'fix-dcc' into 'security'
fix dcc

See merge request irssi/irssi!20
2017-10-20 15:22:32 +02:00
Joseph Bisch
0840eaec7b Make split functions return an array with NULL instead of NULL
This avoids undefined behavior in functions that call these split
functions and expect an array back instead of just a NULL pointer.
2017-10-20 15:22:32 +02:00
Nei
f4c8018cfb Merge branch 'fix-gl-13' into 'security'
Fix use after free when channel is destroyed inbetween being synced

See merge request irssi/irssi!19
2017-10-20 15:22:32 +02:00
ailin-nemui
9f0dc4766c fix dcc issue 2017-10-20 15:14:10 +02:00
LemonBoy
45dfe2ba38 Prevent a OOB read when parsing IRCNet ! channels
Make sure the string has enough data.
Fixes #16
2017-10-19 11:17:56 +02:00
Paul Townsend
7b94015f8f Changes based on comments in pull #771. 2017-10-14 17:42:45 +01:00
Paul Townsend
87955b69cb Add alternate_nick as a network-specific property. 2017-10-11 21:33:14 +01:00
Joseph Bisch
2edd816e7d
Fix segfault in query_remove_all
It is possible for rec to be NULL in query_remove_all, resulting in a
segfault. So return without doing anything if rec is NULL.
2017-10-08 22:02:44 -04:00
ailin-nemui
49ace3251b fix uaf in chanquery module
the chanquery needs to be removed in any case if a channel rec is
destroyed, regardless of any state

Fixes GL#13
2017-10-08 19:48:11 +02:00
LemonBoy
d971c02920 Allow the user to clear the sasl-related fields
There was no easy way for the user to disable the SASL authentication or
to clear the username/password once the network was created.
Closes #718
2017-07-25 22:53:33 +02:00
Nei
200eb5922e Merge branch 'fix-gl9' into 'security'
Fix dcc_request where addr is NULL

See merge request !13
2017-05-30 19:39:06 +00:00
Joseph Bisch
528f51bfbe
Fix dcc_request where addr is NULL 2017-05-29 14:53:26 -04:00
Joseph Bisch
30a92754bb
Fix oob read of one byte in get_file_params_count{,_resume}
We can use continue to handle cases such as:
"ab<space><space>c"
2017-05-29 14:43:24 -04:00
ailin-nemui
7bd1b80687 fix dcc get
fixes #656
2017-03-07 23:27:08 +01:00
ailin-nemui
62fd3ac180 Revert "Quote the filename when dcc requests are auto accepted." 2017-03-06 11:27:55 +01:00
ailin-nemui
29f27cfb39 Merge pull request #658 from LemonBoy/dcc-autoaccept
Quote the filename when dcc requests are auto accepted.
2017-03-04 21:43:21 +01:00
LemonBoy
027acffb42 Handle file names with quotes.
Let's repurpose escape_string and make it more flexible by letting us
choose the characters to escape.
2017-02-22 11:49:09 +01:00
LemonBoy
db85ab7c90 Quote the filename when dcc requests are auto accepted.
PR #453 forces the user to quote the filenames given to /DCC commands
when they contain spaces but the autoget functionality didn't get
updated so the filename was always passed without quotes.

Closes #656.
2017-02-21 15:17:37 +01:00
dequis
15736ba5ab notify-ison: Don't send ison before the connection is done 2017-02-11 00:07:03 -03:00
LemonBoy
19c5178996 Prevent a memory leak during the processing of the SASL response.
We also get rid of an allocation in the process of doing so.
2017-01-24 22:19:50 +01:00
dx
b15c27cc63 Revert "Don't reset wait_cmd during connection registration (fixes early ISON)" 2017-01-10 03:09:36 -03:00
LemonBoy
38ea52d09f Merge pull request #608 from tijko/master
Follow g_strsplit with call to g_strfreev
2017-01-08 21:55:39 +01:00
Tim Konick
5917bc6f75 Follow g_strsplit with call to g_strfreev 2017-01-07 14:31:35 -08:00
dequis
1831a8e1a7 Don't reset wait_cmd during connection registration (fixes early ISON) 2017-01-06 12:49:56 -03:00
Nei
7a112e0217 Merge branch 'master' into 'security'
Sync to master

See merge request !6
2017-01-03 13:30:39 +01:00
Nei
124bcd4804 Merge branch '4-use-after-free-when-receiving-numeric-432-invalid-nick' into 'security'
avoid server_disconnect

See merge request !4
2017-01-02 17:01:29 +00:00
ailin-nemui
91f48c6f0e Merge pull request #586 from LemonBoy/fix-580
Process the nick changes in queries before the PRIVMSG is handled.
2017-01-02 14:44:07 +01:00
ailin-nemui
508d2e0860 bail out if nick is NULL in irc_query_find
Closes #1
2016-12-19 21:41:47 +01:00
ailin-nemui
77aab79057 avoid server_disconnect
Closes #4
2016-12-19 21:16:37 +01:00
LemonBoy
0d6add02cf Process the nick changes in queries before the PRIVMSG is handled.
Otherwise we end up with the message in the status window since the
frontend knows jack shit about the casemapping option when it tries to
find the associated window for the query.
2016-12-15 19:36:44 +01:00
LemonBoy
91c9e871c7 Add an option to stop the connection when SASL fails. 2016-12-12 21:41:06 +01:00
ailin-nemui
dcffa98d46 add a static buffer for dcc received data
increased buffersize might make irssi freeze less / #159
2016-11-23 17:02:29 +01:00
Alexander Færøy
2be7289085
Rename SSL to TLS.
This patch changes the internal name of SSL to TLS. We also add -tls_*
options to /CONNECT and /SERVER, but make sure that the -ssl_* versions
of the commands continue to work like before.
2016-10-22 20:36:50 +02:00
LemonBoy
3667fd9fd1 Make the cap_complete field unsigned.
Fixes a problem where the field would end up as a negative number when
exposed to the perl scripts.
And move it near the other bit-packed fields so we take advantage of the
packing.
2016-09-30 19:30:43 +02:00
ailin-nemui
8d4d313cc9 Merge pull request #506 from kruton/sasl-400-byte-chunk
SASL: handle fragmentation
2016-09-26 16:43:33 +02:00
Kenny Root
60d9ec621f SASL: handle fragmentation
The IRCv3 SASL extension says that AUTHENTICATION payloads of exactly
400 bytes in length indicate that the message is fragmented and will
continue in a subsequent message. Handle the reassembly and splitting of
these messages so that we are compliant with the specification.
2016-08-29 22:56:30 -07:00
dequis
3429c1a0a0 Set the default STATUSMSG to @ instead of @+ if it's missing
This fixes two issues:

- IRCNet doesn't have STATUSMSG, but it supports +channels, and
  including + in the default value meant processing those incorrectly

- The "bahamut hack", for old servers that support but don't advertise
  STATUSMSG, didn't work since ischannel_func doesn't use the default.

The choice of @ intentionally leaves out support for other STATUSMSG
(for example, AzzurraNet's bahamut 1.4 fork seemed to support + and % in
any order, contradicting the comment in the code).

I think this is a decent tradeoff, given how those servers are uncommon
and relying on +# or %# is even less common than @#.

Fixes #531
2016-08-24 19:56:23 -03:00
ailin-nemui
fd371cc345 Merge pull request #422 from LemonBoy/misc-cleanup
Clean up misc.c
2016-06-14 12:35:30 +02:00
LemonBoy
439e21f127 Use ; as separator instead of , 2016-06-13 14:07:04 +02:00
LemonBoy
86c5e56ef4 Make rejoin_channels_mode of type CHOICE 2016-06-12 16:26:18 +02:00
LemonBoy
cc70e8c581 Clean up some GTimeVal juggling 2016-06-05 16:48:27 +02:00
LemonBoy
7a3c6fe86c Replace strarray_length with g_strv_length 2016-06-05 16:24:55 +02:00
LemonBoy
72712a0c62 Replace strocpy with g_strlcpy
The only difference was that the former returned 1 if the buffer was
overflown, but the return value was never checked.
2016-06-05 16:24:55 +02:00
LemonBoy
f1d0c8ff99 Correct the name of the emitted signal.
There's a typo in 'sasl_fail', the signal that's emitted should be
'server sasl failure' and not 'server sasl fail'.
2016-06-01 22:29:13 +02:00
pisculichi
47e792da05 Fix some ANSI C issues. 2016-05-03 15:28:20 +00:00
ailin-nemui
1349755bb5 Merge pull request #453 from LemonBoy/dcc-quote
Support quoted filenames in some /DCC commands
2016-04-05 22:39:54 +02:00
ailin-nemui
ec4ecd844b Revert "Removed the obsolete SQUERY and SERVLIST commands"
This reverts commit 4beebe3238.
2016-03-29 22:41:01 +02:00
LemonBoy
8b54366d95 Support quoted filenames in some /DCC commands 2016-03-22 16:00:00 +01:00
ailin-nemui
195c44a76e Merge pull request #446 from ailin-nemui/fix_445
strip less whitespace from commands
2016-03-22 15:23:37 +01:00
ailin-nemui
132d3c49f3 strip less whitespace from commands
fixes #445
2016-03-20 22:39:06 +01:00
ailin-nemui
2ab2636713 Merge pull request #442 from LemonBoy/fix-435
Do not assume any default value for statusmsg.
2016-03-20 22:06:41 +01:00
LemonBoy
550fe6f010 Use 0 as a sentinel value for sasl_timeout
If sasl_timeout is never initialized with a valid timeout id then
calling /disconnect on the server calls g_source_remove() with 0 as tag,
causing an harmless error message to be printed.
Beside that, the sasl_timeout field is defined as a unsigned int.
We can use 0 as sentiel since g_timeout_add returns tags that are always
greater than zero.
2016-03-20 21:47:02 +01:00
LemonBoy
f31d37a852 Make ischannel_func return false for empty strings 2016-03-19 12:11:53 +01:00
LemonBoy
f6c2805b91 Do not assume any default value for statusmsg.
If the server didn't send it then just skip the check, the old value it
defaulted to was possibly overlapping with the CHANTYPES leading to an
incorrect behaviour. Fixes #435.
2016-03-17 22:27:05 +01:00
dequis
e853392f43 Remove sasl timeout source when the server disconnects 2016-03-11 14:55:31 -03:00
Mantas Mikulėnas
4baefd2574 Fix SASL EXTERNAL authentication
The "AUTHENTICATE" command is always required – it's part of the IRCv3
SASL framing. RFC 4422 only documents the Base64 payload.
2016-03-08 23:13:03 +02:00
Lukas Mai
8c1da2890c irssi proxy: allow listening on unix sockets 2016-03-02 00:53:56 +01:00
Lukas Mai
3fc7e4d4ea reindent 2016-03-02 00:51:01 +01:00
Lukas Mai
4d234c175c fix proxy server name 2016-02-26 18:40:51 +01:00
Lukas Mai
3167ccfbc2 remove redundant check 2016-02-18 02:23:09 +01:00
Lukas Mai
c9ce0c521a make pointer check explicit 2016-02-18 02:23:00 +01:00
Lukas Mai
4732e33ca9 irssi proxy: allow multiplexing multiple networks over a single port 2016-02-18 01:20:33 +01:00
Lukas Mai
88e2449f83 fix formatting 2016-02-18 01:20:33 +01:00
LemonBoy
eba160ca6d Duplicate the code paths for autocommands. 2016-01-24 23:02:40 +01:00
LemonBoy
2502080871 Change when the autocmds are sent.
As per #175 if a -botcmd is specified for a given channel without a
-bots parameter then the command is sent right after joining the
channel.
2016-01-14 23:54:42 +01:00
ailin-nemui
62cab9d662 Merge pull request #393 from ailin-nemui/moduleversion-perl
forward ABI to perl modules
2016-01-11 21:19:35 +01:00
ailin-nemui
d16f57b378 Merge pull request #390 from LemonBoy/ignore-find
Clean up the ignore_find API to make it more powerful.
2016-01-11 21:04:27 +01:00
Lukas Mai
41088b6f65 make /knockout use /unban to remove bans
/knockout uses /ban to set bans but calls ban_remove() directly to
remove them. This commit makes it use /unban instead. This allows
scripts that hook ban/unban to work automatically with /knockout.
2016-01-08 19:37:29 +01:00
Lukas Mai
cf90b2122e irc/core/irc-commands.c: fix indentation 2016-01-08 18:52:59 +01:00
Lukas Mai
837e03bd8f irssiproxy: avoid using pointer after freeing it 2016-01-06 12:45:18 +01:00
LemonBoy
dbee606c60 Don't break the API.
Have a ignore_find_full method that is the one that all the new code
should be using and provide some working stubs for ignore_find and
ignore_find_noact.
2016-01-03 21:26:57 +01:00
LemonBoy
609f3ba6c2 Clean up the ignore_find API to make it more powerful.
This way we prevent the creation of duplicate ignores since the old code
skipped the ignore_find call when a pattern was specified.
It should also cover all the cases where the ignores would be wrongly
overwritten, such as the case outlined in #78.
2016-01-03 19:49:18 +01:00
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
dequis
82ce1de5b0 irc-cap: Don't send a space at the beginning of the CAP REQ parameter
Turns out it confuses inspircd, making it reply a NAK with empty
parameter. The rest is ACKed anyway. I've already whined at saberuk
and there's a pending pull request over there fixing this issue.

And, of course, this is cleaner.
2015-11-26 19:50:58 -03:00
LemonBoy
d7ef9c590f Correctly alias 'channel' to '#channel'
Use the same approach used in 'irc_channels_join'.
Remove 'irc_nick_strip' since it was unused.
2015-11-19 15:31:32 +01:00
LemonBoy
d4676c9855 Use the PARAM_FLAG_STRIP_TRAILING_WS flag wherever possible. 2015-11-09 23:02:41 +01:00
LemonBoy
8094e87cdf Preserve the sasl_ options across reconnects. 2015-10-28 21:56:35 +01:00
dx
15a40ea6d3 Merge pull request #314 from LemonBoy/sasl_session
Save the sasl state in the session
2015-10-03 22:15:17 -03:00
Alexander Færøy
da3f2f0d01
Set HOST_NAME_MAX to 255, if it's undefined.
Thanks to Jilles and dx.

Fixes #309
2015-10-02 19:55:29 +02:00
LemonBoy
cfff402fe6 Don't set the usermode field if blank
Fixes FS#919
2015-10-02 11:25:30 +02:00
LemonBoy
a475d57183 Save the sasl state in the session
This is seemingly required to have irssi re-authenticate after a
restart.
2015-10-02 10:52:13 +02:00
ailin-nemui
18989e76db Merge pull request #304 from LemonBoy/sasl_user_options
Allow the user to set and modify the SASL parameters
2015-09-26 19:07:54 +02:00
LemonBoy
1a2c479bc0 Allow the user to set and modify the SASL parameters
The /NETWORK ADD command now is able to modify the SASL mechanism, the
username and the password on a chatnet basis.
2015-09-26 18:53:10 +02:00
Geert Hauwaerts
fc3c0a8420 Merge pull request #301 from dequis/dcc-get-ntfs-temp-bug
dcc-get: close() the temp fd so we don't get ETXTBSY in ntfs mounts
2015-09-24 10:05:30 +02:00
Robert C Jensen
b984f1fa25 dcc-get: close() the temp fd so we don't get ETXTBSY in ntfs mounts
Patch from debian bug 696963 [1]

Fixes github bug #220 and flyspray bug 867 [2]

[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=696963
[2]: http://bugs.irssi.org/index.php?do=details&task_id=867
2015-09-23 23:39:37 -03:00
dequis
7ae7422939 Add multi-prefix to list of capabilities to request
Turns out event_names_list() in irc-nicklist.c already handles this.

event_who() just ignores it, which is probably a good idea since some of
the irc servers I tested this with have a bug that results in sending
multiple prefixes in the NAMES reply but not in the WHO one (they were
forks of ircd-hybrid before 7.3.0)

And NAMES always happens, anyway. WHO is omitted sometimes for huge
channels.
2015-09-23 03:17:29 -03:00
ailin-nemui
f5f3d7cc98 Revert "Network and IPv{4,6} related changes" 2015-09-22 21:59:17 +02:00
ailin-nemui
2d69deb0a3 Merge pull request #290 from LemonBoy/ipv6
Network and IPv{4,6} related changes
2015-09-22 17:43:31 +02:00
ailin-nemui
211e84c1e9 Merge pull request #267 from kyak/master
Add expandos for hostname
2015-09-21 18:47:09 +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
dx
0912a11050 Merge pull request #278 from LemonBoy/sasl
SASL support
2015-09-20 19:19:49 -03:00
LemonBoy
203c00938a Use formats instead of g_warning
Add some copyright headers here and there too.
2015-09-21 00:04:37 +02:00
Alexander Færøy
a44c4b82de
More format warnings removed. 2015-09-20 23:11:39 +02:00
Alexander Færøy
6c9dcffb5e
Fix formatting warnings. 2015-09-20 22:51:13 +02:00
Alexander Færøy
be977bf1b7
Fix warning. 2015-09-20 21:21:40 +02:00
Alexander Færøy
1079ad46d2
Use g_string_append() instead of g_string_append_c() for string. 2015-09-20 21:12:07 +02:00
Alexander Færøy
ca363efe00
Use g_string_append() instead of g_string_append_c() for string. 2015-09-20 21:01:25 +02:00
LemonBoy
06040fb30b Merge remote-tracking branch 'origin' into sasl 2015-09-19 23:58:16 +02:00
Jari Matilainen
9586766d87 Add setting to configure rejoin on reconnect behaviour
Closes #169
2015-09-19 18:34:05 -03:00
ailin-nemui
2b13e793c4 Merge pull request #259 from dequis/irssiproxy
Updates for irssiproxy
2015-09-19 02:53:25 +02:00
LemonBoy
24d32c28ee Don't handle 908 as a critical failure
"if the mechanism is unknown, 908 is optional, 904 (or equivalent error condition) is required"
2015-09-11 23:21:33 +02:00
LemonBoy
49c4ea5fd9 Parse the error string received by the server
So that in case of SASL failure the user sees a nice error message.
2015-09-11 23:20:07 +02:00
LemonBoy
1f114d75c6 Consider the SASL handshake successful on 903 2015-09-11 23:17:46 +02:00
LemonBoy
55387dd93d Handle event 906 and 908 2015-09-11 22:23:38 +02:00
LemonBoy
6645d0d38d Explicitly set the authorization id during the PLAIN handshake
On error show the user the message sent by the server.
2015-09-11 22:09:47 +02:00
LemonBoy
171b67441d Replace spaces with tabs 2015-09-11 01:17:18 +02:00
LemonBoy
c90c7deac3 Address all the points outlined in the first review
Replace G_SOURCE_REMOVE with FALSE for the compatibility sake.
Zero the timeout id after g_source_remove and when exipred.
Save the sasl_* options in sig_chatnet_saved().
2015-09-11 01:07:43 +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
35d30c19a1 Whitespace fix 2015-09-02 20:24:47 +02:00
kyak
2f9cca8ec6 Remove extra line break
How did this extra break cripple in here?
2015-08-29 15:40:17 +03:00
kyak
b065f2a011 Use HOST_NAME_MAX for userhost and hostname expandos
Use HOST_NAME_MAX instead of hardcoded 100 for userhost
and hostname expandos.
2015-08-29 15:36:05 +03:00
kyak
b7d82ecdce Use "(none)" as fallback for hostname and userhost expandos
Use "(none)" instead of "??" for hostname and userhost expandos
when these can't be reliably detected.
2015-08-29 15:32:22 +03:00
kyak
19760679eb In expando_hostname, set *free_ret to TRUE
*free_ret must be set to TRUE in both cases, since we return
some newly initialised memory
2015-08-29 15:29:57 +03:00
kyak
0435331912 Clean up in hostname expando before return
Clean up the vector resulting from g_strsplit before
returning from expando_hostname(). Also, use g_strdup()
instead of g_strconcat() to return the pointer to hostname.
2015-08-26 09:34:48 +03:00
Alexander Færøy
d2c9f30977 Merge pull request #222 from LemonBoy/cap-support
[RFC] CAP support
2015-08-24 22:22:01 +02:00
LemonBoy
b0e7c18376 Send the CAP LS after sending the proxy strings
Patch by @dequis
2015-08-20 23:37:34 +02:00
blha303
92d03fe11e Replace \n with \r\n in irssiproxy source, fixes bug 2015-07-25 02:41:26 -04:00
kyak
8e71d6ec73 Add expandos for hostname
See http://bugs.irssi.org/index.php?do=details&task_id=829
2015-07-19 09:45:50 +03:00
dequis
51496cd09f Fix 'address already in use' when changing irssiproxy_ports
When changing the value of irssiproxy_ports to use a different network
name in a port that was already bound (so like changing from asd=6667 to
sdf=6667) it would throw "address already in use".

This fixes it by delaying the add_listen() calls after all the
remove_listen() were called.
2015-06-14 17:00:35 -03:00
dequis
a47f45b5b7 Rename /proxy command to /irssiproxy for clarity 2015-06-14 11:57:11 -03:00
dequis
29fb0d9802 Merge branch 'master' into irssiproxy
Conflicts:
	src/irc/proxy/listen.c
2015-06-14 10:42:41 -03:00
Geert Hauwaerts
4cc6fdaaab Add server check in irc_server_connect (#208)
Fail instead of crash, if irc_server_connect is called without object.
(#208)
2015-06-12 17:44:13 +02:00
LemonBoy
e480b9b165 Improve ischannel_func (#253)
The function now skips all the leading characters that are in the STATUSMSG. If
the server didn't send the STATUSMSG option then it's assumed to be "@+" for
compatibility with bahamut 2.4 (sic).
2015-05-31 15:30:21 +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
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
Hans Nielsen
7beffbdcc5 Add help files for proxy module 2015-02-24 19:53:23 -08:00
Hans Nielsen
bbf404b611 Fix whitespace 2015-02-24 19:53:23 -08:00
Hans Nielsen
6a28bad814 Add boolean toggle for irssiproxy being enabled 2015-02-24 19:52:17 -08:00
Hans Nielsen
aaa0f73eac Make proxy messages include more detail and add status command 2015-02-24 19:52:17 -08:00
Hans Nielsen
d27c54486f Change around connection signals in proxy module
Change "proxy client connected" to "proxy client connecting" to avoid being confused by clients that have connected but not necessarily authenticated. Emit "proxy client connected" once authenticated, keeping the name for backwards compatibility.
2015-02-24 19:52:17 -08: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
Alexandre Morignot
dee7825f05 handle an already used nick different from the one we send 2015-02-10 16:37:41 +01:00
mauke
b4b4ebfadf accept freenode extbans in /ban [#150] 2015-02-08 22:16:01 +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
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
3d6051a03e Merge pull request #140 from sebth/master
Make line splitting fail-safe
2014-10-01 21:55:56 +02:00
Alexander Færøy
a2121efed3 Merge pull request #142 from dequis/away-with-no-reason
irc_server_send_away: don't send empty param if there's no away reason
2014-10-01 21:54:00 +02:00
Michael Vetter
51239925ec source cleanup: remove trailing whitespaces 2014-09-11 19:10:33 +02:00
dequis
d68ee06aa4 irc_server_send_away: don't send empty param if there's no away reason 2014-09-09 21:14:07 -03:00
Sebastian Thorarensen
42a34a78e8 Make line splitting fail-safe
The userhost Irssi uses for line splitting can in some cases be wrong,
for instance when a proxy is used or when a server cloaks the hostname
without telling the client. Now Irssi always assumes the userhost is of
maximum length. 10 for username (common value) and 63 for hostname (in
RFC 2812).
2014-09-01 00:24:17 +02:00
Geert Hauwaerts
f0aa2d2049 Syntax rewrite of U-Z commands
Rewrote the syntax documentation of U-Z commands.
2014-08-05 22:00:30 +02:00
Geert Hauwaerts
4beebe3238 Removed the obsolete SQUERY and SERVLIST commands
Removed the obsolete SQUERY and SERVLIST commands.
2014-07-30 13:02:26 +02:00
Geert Hauwaerts
dde8540e3e Removed the obsolete RPING command
The RPING command is obsolete.
2014-07-14 20:38:01 +02:00
Geert Hauwaerts
938598e271 Removed the obsolete NOTE command
I removed the binding for the NOTE command that doesn't exist anymore on
any major network.
2014-07-09 18:33:10 +02:00
Sebastian Thorarensen
ff08b3b022 Replace a `goto out' with explicit freeing 2014-07-06 23:24:10 +02:00
Sebastian Thorarensen
7bfe3a8fa1 Introduce a MAX_USERHOST_LEN constant for IRC 2014-07-06 23:24:10 +02:00
Sebastian Thorarensen
29a49c4688 Move the definition of the `split_line' settings 2014-07-06 23:24:10 +02:00
Sebastian Thorarensen
bb7bafc93c Split long IRC `ACTION' messages
Add line splitting logic to commands `/me' and `/action'.
2014-07-06 23:24:10 +02:00
Sebastian Thorarensen
90f3dd612e Fix the userhostlen' fallback in split_message'
ferret, the author of `splitlong-safe.pl' pointed out that `userhostlen'
should not only contain the maximum length of the hostname, but also the
maximum length of the username. Now 10 is used as the maximum username
length as a fallback. (`splitlong-safe.pl' uses the same limit.)

The username limit isn't defined in the standard, but 10 is common on
many networks. The odds that something goes wrong here is low, as
 1) the fallback limit is only used when the user has not yet joined a
    channel
 2) the maximum hostname length (63) gives some error margin as the
    hostname usually is shorter
2014-07-06 23:24:09 +02:00
Sebastian Thorarensen
281c6d437d Avoid unnecessary splitting of lines
`split_line_end' could force lines to be unnecessarily split. This
commit fixes the problem by making sure that the last line isn't shorter
than `split_line_end'.
2014-07-06 23:24:09 +02:00
Sebastian Thorarensen
5c05c854dc Add configurable split line prefixes and suffixes
Add settings `split_line_start' and `split_line_end' analogous to
`splitlong_line_start' and `splitlong_line_end' in `splitlong.pl'. The
prefixes and suffixes are concatenated with a wrapper function to keep
`recode_split' and `strsplit_len' simple.
2014-07-06 23:24:09 +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
Alexander Færøy
2b6bba3fd2 Merge pull request #62 from dgl/prefix-nick-flags
Use PREFIX from 005 to decide if a nick flag is of op level
2014-06-29 14:32:15 +02:00
David Leadbeater
6accf50991 Use PREFIX from 005 to decide if a nick flag is of op level
Fixes #61.
2014-06-27 14:13:55 +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
Alexander Færøy
113f1724d7 Merge pull request #44 from dajohi/g_basename
Replace deprecated g_basename with g_path_get_basename.
2014-06-27 14:41:54 +02:00
David Leadbeater
051d1587b0 Add missing include
Silences:
  listen.c:320:3: warning: implicit declaration of function ‘ascii_strup’ [-Wimplicit-function-declaration]
2014-06-26 01:12:33 +01:00
David Leadbeater
b34ded063b Remove unused variables to silence compiler warnings 2014-06-26 00:47:49 +01:00
David Hill
9d6cd87b0f Replace deprecated g_basename with g_path_get_basename. 2014-06-22 20:39:35 -04:00
Alexander Færøy
dcbcb5f04d Merge pull request #50 from dajohi/cmd_null_deref
Avoid potential null dereferences.
2014-06-21 10:53:00 +02:00
David Hill
444f9e4836 Do not break strict-aliasing rules.
dcc-send.c:296:2: warning: dereferencing type-punned pointer
will break strict-aliasing rules
2014-06-20 12:43:24 -04:00
David Hill
70a55030d1 Avoid potential null dereferences. 2014-06-20 00:07:47 -04:00
David Leadbeater
908913b5de Revert "add d,q,f and J to CHANMODES default, to work a bit better with dancer and possibly others"
This is no longer relevant and most ircds now send a correct isupport
message.

This reverts commit b832f1f7b2.
2014-06-16 15:35:38 +00: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
9cc7ea504c Fix warning.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5210 dbcabf3a-b0e7-0310-adc4-f8d773084564
2011-11-21 21:28:28 +00:00
Jilles Tjoelker
cbd163aa5a Accept names replies with nick!user@host instead of nick
if they are somehow enabled (UHNAMES/userhost-in-names).

bug #805


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5205 dbcabf3a-b0e7-0310-adc4-f8d773084564
2011-05-15 21:13:12 +00:00
Jase Thew
444b42bf3e Ensure that expando_cumode_space() doesn't free unallocated memory when no
prefix exists by conditionally allocating and marking to-be-freed the cumode
string inside of expando_cumode(). (Bug #669)


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5203 dbcabf3a-b0e7-0310-adc4-f8d773084564
2011-02-10 06:45:51 +00:00
Wouter Coekaerts
350b346c84 Add prefixes to irc_nicklist_insert() so that nickrec.prefixes is accurate in the
"nicklist new" signal.

Fixes the nicklist sorting on xirssi.

Patch by nenolod.


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5184 dbcabf3a-b0e7-0310-adc4-f8d773084564
2010-07-24 14:36:55 +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
Wouter Coekaerts
4b751d9df6 Use servertag from the active DCC chat when not connected anymore to the IRC server that started it. This fixes a crash with handling the DCC queue. Reported by Aurelien Delaitre (SATE 2009)
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5122 dbcabf3a-b0e7-0310-adc4-f8d773084564
2010-02-27 18:52:41 +00:00
Jilles Tjoelker
48e87773f0 Accept 354 (WHOX reply) as a /who reply too (for redirection).
Ignore the parameters for matching because 354 does
not have a fixed format.

This helps irssi-proxy with clients that use WHOX,
such as xchat (away checking). WHOX works on ircu
and charybdis 3.1 servers.

Bug #671


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5064 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-05-13 19:27:20 +00:00
Emanuele Giaquinta
4ec53567a5 Remove leftover.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5059 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-04-05 19:04:25 +00:00
Wouter Coekaerts
dde30e63d6 Correct previous commit: fix away checking
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5040 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-03-15 16:25:42 +00:00
Wouter Coekaerts
d81ec45378 Fix /NOTIFY list when nick is seen joining (bug #642)
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5039 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-03-10 22:18:01 +00:00
Wouter Coekaerts
e5fee8869c Include hostmask in 001 event sent by proxy (bug #650)
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5038 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-03-10 21:36:35 +00:00
Jilles Tjoelker
afdb462c59 Remove unused variables.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5032 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-03-01 00:22:29 +00:00
Jilles Tjoelker
5f05c7ca7a Ensure variable is initialized.
Make sure not to set connection_lost if the server was
already disconnected.


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5030 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-02-28 22:48:41 +00:00
Jilles Tjoelker
8a6b0224b9 Add the command send/expire timeout only when needed.
This was the last always-on <1s timer.


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5026 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-02-28 18:15:14 +00:00
Jilles Tjoelker
2dd265ef39 Check for stale flood entries when lines come in, avoiding a 0.5 second timeout.
The timeout is now every 5 seconds and serves to
remove entries that do not send messages anymore.


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5024 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-02-28 12:43:00 +00:00
Jilles Tjoelker
946e7784b0 Make explicit how long the arrays for prefix_add and prefix_del are.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5020 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-02-21 17:55:12 +00:00
Alexander Færøy
2fffcf5a77 Code Cleanup:
Use g_string_printf() instead of g_string_sprintf() (which is considered deprecated.)



git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5004 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-02-08 17:57:19 +00:00
Alexander Færøy
c561ba35e6 Code Cleanup:
Use g_string_append_printf() instead of g_string_sprintfa() (which is considered deprecated.)


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5003 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-02-08 17:22:42 +00:00
Emanuele Giaquinta
725ccc249d Check server's connected flag rather than net-sendbuffer pointers in
sig_server_quit.


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4972 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-12-22 01:07:11 +00:00
Jilles Tjoelker
fe4c5abe28 Preserve op/halfop/voice when /upgrading from before the prefixes change
(r4922). This also restores them when /upgrading from
a revision between r4922 and this one.
Note that other prefixes are still lost when /upgrading
from pre-r4922 irssi.


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4968 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-12-13 21:42:42 +00:00
Jilles Tjoelker
251d956ddc prefix_add(): copy correct number of bytes
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4967 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-12-12 22:04:37 +00:00
Emanuele Giaquinta
a065f97f87 Recode outgoing irc quit messages.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4940 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-12-02 16:13:15 +00:00
Emanuele Giaquinta
997a25c522 Factor the code to send an irc action into a function.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4937 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-12-01 18:35:10 +00:00
Jilles Tjoelker
ee34525905 Revert r4924, the comment is correct after all.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4930 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-11-29 19:38:00 +00:00
Emanuele Giaquinta
184e4071c1 Remove obsolete part of comment.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4929 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-11-29 18:01:04 +00:00
Jilles Tjoelker
3ddd984bfc Allow /ban, /unban, /kickban, /knockout if channel is not synced.
Requesting ban lists from an unsynced channel will ask
them from the server, banning a user whose u@h irssi
does not know will ban nick!*@* and only bans irssi
knows about can be removed.


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4925 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-11-28 20:43:59 +00:00
Jilles Tjoelker
6fe433ca0b Remove obsolete/wrong part of comment (irc server cmdcount).
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4924 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-11-28 18:49:31 +00:00
Jilles Tjoelker
89cd47bf3a Allow storing multiple "other" prefixes such as +q and +a.
Original patch by JasonX, somewhat changed by exg and me.


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4922 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-11-28 00:16:51 +00:00