1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-13 05:03:45 -04:00
Commit Graph

4405 Commits

Author SHA1 Message Date
ailin-nemui
1656dc1e54 Merge pull request #653 from ailin-nemui/regexex
Enable UTF8 in GRegex
2017-07-03 09:53:09 +02:00
Nei
29ebac987d Check return value of localtime
Fixes #10
2017-06-29 13:48:44 +00:00
ailin-nemui
2b209348bd Merge pull request #722 from dequis/back-to-the-future
parse_time_interval: Allow negative time in settings
2017-06-23 18:00:51 +02:00
ailin-nemui
28d82c8f63 Merge pull request #709 from osm/master
Escape nicks during nick completion when expand_escapes is enabled
2017-06-23 18:00:04 +02:00
ailin-nemui
9d32636ebe Merge pull request #703 from vague666/server_modify_port
Allow -port <num> or irc.host.tld <num> in /server add
2017-06-23 17:59:02 +02:00
ailin-nemui
c56919768e Merge pull request #721 from dequis/unexpected-exits
term-terminfo: Avoid switching out of alt screen on unexpected exits
2017-06-23 17:58:40 +02:00
ailin-nemui
bbf8b86074 remove const 2017-06-22 09:33:33 +02:00
Oscar Linderholm
12d671a056 Escape nicks during nick completion when expand_escapes is enabled
Fixes #693
2017-06-21 10:40:47 +02:00
ailin-nemui
02a5d1a00b fix weird n-fold unescaping 2017-06-19 14:09:02 +02:00
ailin-nemui
1fc170ee11 Merge branch 'master' into regexex 2017-06-19 11:06:24 +02:00
dequis
7354a74c65 parse_time_interval: Allow negative time in settings
This splits sign parsing out of parse_time_interval_uint() so that the
negative sign is applied outside of the unsigned context where the
number parsing is done, and after all the checks that it's lower than
(1 << 31)

This fixes issues with settings like `server_reconnect_time`,
`server_connect_timeout` and `lag_max_before_disconnect`, which accepted
-1 as a valid value.
2017-06-17 15:34:36 -03:00
dequis
4b1c60b2ec term-terminfo: Avoid switching out of alt screen on unexpected exits
Perl sucks and kills the whole process when there's a version mismatch
in Perl_xs_handshake(). Our atexit handler catches the exit and
deinitializes the terminal, removing the error.

This commit uses the 'quitting' global variable which is set when irssi
is voluntarily quitting, and avoids sending TI_rmcup, which restores the
original screen and makes the error invisible.
2017-06-17 13:47:13 -03:00
ailin-nemui
3246001fb4 Merge pull request #715 from dequis/lastlog-glist-performance
Performance improvements for /lastlog
2017-06-07 00:15:45 +02:00
ailin-nemui
5e9a3ad80c Merge pull request #714 from dequis/dcc-fname-gcc-warnings
fe-dcc-(get|send): Fix some -Wpointer-compare with newer gcc
2017-06-07 00:15:05 +02:00
dequis
e498265328 Performance improvements for /lastlog -before
This avoids the use of g_list_find() to find if a match was already
added to the list of results, by checking the last two added matches
instead.

Checking just the last match isn't enough because a NULL match is added
as a separator (shown as -- in the UI)
2017-06-05 18:11:47 -03:00
dequis
0e44ea8916 Performance improvements for /lastlog with big result sets
This applies to "/lastlog" with no filters (or with filters that don't
filter a lot) and with large amounts of text in the scrollback.

Test case:

    /exec seq 1 500000
    /lastlog -file log.txt

Thanks to morning for reporting this.
2017-06-05 18:10:27 -03:00
dequis
52bb06ccd9 fe-dcc-(get|send): Fix some -Wpointer-compare with newer gcc
The warning itself:

>warning: comparison between pointer and zero character constant [-Wpointer-compare]

Harmless stuff as far as I can tell.

The fix adds a null check that probably isn't needed. The old code that
compared against '\0' worked a lot like a null check so it makes sense
to keep that, while also adding the intended check for empty string.

This was visible with "/dcc close send a" showing an empty filename.
The equivalent for get didn't show the filename in the format string.
2017-06-05 15:58:43 -03:00
Ailin Nemui
fb08fc7f1a Merge remote-tracking branch 'gitlab/security' 2017-06-05 15:12:16 +02:00
ailin-nemui
4edfccfce7 get rid of new_text 2017-06-05 13:46:43 +02:00
ailin-nemui
48899a123d Update iregex-gregex.c
add 2 comments about new_string
2017-06-05 10:23:16 +02:00
ailin-nemui
00354c3651 Update iregex-gregex.c
make helper functions static
2017-06-05 10:10:38 +02:00
Jari Matilainen
f28c64a3dc Make backward compatible with ssl flags 2017-06-04 19:47:30 +02:00
ailin-nemui
78a390f479 abi up 2017-06-04 19:03:40 +02:00
Jari Matilainen
e84adeca15 change ternary operator to if/else statements, add default ssl port support 2017-06-04 17:41:38 +02:00
ailin-nemui
79bbca4644 Refactor regex and implement UTF8 mode for GRegex
- with non-unicode byte to Private Use Area A mapping
- move all ifdefs to iregex.h file only
2017-06-04 00:52:53 +02:00
ailin-nemui
31b9d115b0 Merge pull request #706 from dequis/parse-uint
Add parse_uint function to improve integer overflow handling
2017-06-02 14:47:38 +02:00
Joseph Bisch
1ce9e07be0
Use CXX for fe-fuzz linking 2017-06-01 23:59:19 -04: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
d61c54c32b do not reset true colour bit on colour reset
fixes #710
2017-05-27 00:12:54 +02:00
dequis
632b0ce5e6 Add parse_uint function to improve integer overflow handling
Originally found by oss-fuzz (issue 525) in get_ansi_color using ubsan.
After a lot of analysis I'm 99% sure this isn't security relevant so
it's fine to handle this publicly.

The fix is mainly adding a function that does it right and use it
everywhere. This is harder than it seems because the strtol() family of
functions doesn't have the friendliest of interfaces.

Aside from get_ansi_color(), there were other pieces of code that used
the same (out*10+(*in-'0')) pattern, like the parse_size() and
parse_time_interval() functions, which are mostly used for settings.
Those are interesting cases, since they multiply the parsed number
(resulting in more overflows) and they write to a signed integer
parameter (which can accidentally make the uints negative without UB)

Thanks to Pascal Cuoq for enlightening me about the undefined behavior
of parse_size (and, in particular, the implementation-defined behavior
of one of the WIP versions of this commit, where something like signed
integer overflow happened, but it was legal). Also for writing
tis-interpreter, which is better than ubsan to verify these things.
2017-05-18 00:21:11 -03:00
Jari Matilainen
0c26aeb9fc Make sure port is only set on /server modify if specified 2017-05-15 23:07:01 +02:00
ailin-nemui
10cea61696 Merge pull request #702 from vague666/server_modify_notls
Added support for -notls and -notls_verify
2017-05-14 09:44:26 +02:00
ailin-nemui
81cf8d8813 Update fe-server.c 2017-05-14 09:43:38 +02:00
Jari Matilainen
4a6fbdbe78 Spaces to tabs 2017-05-14 03:01:01 +02:00
ailin-nemui
371eb7f505 expand macro 2017-05-12 16:27:33 +02:00
ailin-nemui
787e192567 improve nicklist performance 2017-05-12 13:36:48 +02:00
Jari Matilainen
783458e9ba Added code comments 2017-05-11 14:08:45 +02:00
Jari Matilainen
25f9c71f69 Allow -port <num> or irc.host.tld <port num> in /server add and /server modify 2017-05-11 14:02:23 +02:00
Jari Matilainen
f060292a9c Added braces 2017-05-11 11:17:14 +02:00
Jari Matilainen
dbde9f0fe3 Added support for -notls and -notls_verify 2017-05-11 10:57:24 +02:00
LemonBoy
c890ecafa0 Merge pull request #686 from josephbisch/remove-history-wrap
Don't allow command history to wrap around
2017-04-11 15:19:19 +02:00
Joseph Bisch
3297fafcd9
Add syntax info for completion
Allows syntax info to be picked up and displayed by help command.

Fixes #687
2017-04-07 12:56:46 -04:00
Joseph Bisch
405136440c
Remove over_counter
We are no longer using over_counter for any functional purpose, so
remove it.
2017-04-07 08:20:28 -04:00
Joseph Bisch
7c86575b02
Don't allow command history to wrap around
This changes the behavior of the command history to avoid wrapping back
to the bottom once the top of the history is reached.
2017-04-06 20:27:39 -04:00
Joseph Bisch
41776d71f7
Fix strange history behavior when history is empty
If text is being entered and then the user presses the up arrow
followed by the down arrow, the expected behavior is to return to the
text being entered. Prior to this commit that was not the case.

Fixes #462
2017-04-05 11:00:25 -04:00
Joseph Bisch
a4cc4e0ad7
Fix off by one error with char_expandos 2017-03-31 15:37:48 -04:00
Stephen Oberholtzer
2b9be6e2ed Intentation/whitespace fixes
Change several instances of space-indentation to tabs, matching the
surrounding code.
2017-03-21 10:27:39 -04:00
Stephen Oberholtzer
70f9db3cbd Fix delay at startup when running against glib 2.49.3+
In glib v2.49.3, an optimization was made to eliminate certain
unnecessary wakeups.  (The specific change was made in
e4ee3079c5afc3c1c3d2415f20c3e8605728f074). Before this change, the
first call to g_main_iteration would always complete immediately.
In Irssi, this effectively reversed the order of the main loop, causing
the reload_config check and the dirty_check to run *before* the first
blocking call to g_main_iteration.

With the new logic, the first g_main_iteration call now blocks,
preventing the screen from being refreshed until the user starts typing
or a timer goes off.  (It also delays processing of SIGHUP, but I
expect that is not a common situation.)

This commit reorders the main loop to wait at the end of the loop,
rather than the beginning, addressing the problem.

(This closes Debian bug #856201.)
2017-03-21 09:37:23 -04:00
ailin-nemui
966efced3c up abi ver 2017-03-14 09:54:28 +01:00
ailin-nemui
e2e02160cd Merge pull request #645 from LemonBoy/keyboard-misc
Timeout feature for keys
2017-03-11 23:11:43 +01:00
Ailin Nemui
77b2631c78 Merge branch 'netjoin-timeout' into 'master'
fe-netjoin: remove irc servers on "server disconnected" signal

Closes #7

See merge request !10
2017-03-10 17:18:18 +01:00
dequis
93c158d815 expand_escape: expand double backslash as a backslash 2017-03-08 20:01:05 -03:00
ailin-nemui
d57c64adeb Merge pull request #667 from ailin-nemui/fix-dcc-get
fix dcc get

fixes #656
2017-03-08 09:45:40 +01:00
ailin-nemui
ddba68ad77 Merge pull request #659 from ailin-nemui/foreach_dontspam
make foreach send commands
2017-03-07 23:37:23 +01: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
dc99f8d7a5 Properly check the command arguments in tail place.
A command requiring an argument and given in tail position would not
raise an error but silently set the value to the empty string ''.
2017-03-04 21:37:13 +01:00
Nei
7ef22687f9 Merge branch 'd-minor' into 'master'
Prevent some potential null-pointer deferences.

See merge request !9
2017-03-04 20:35:17 +00:00
Stephen Oberholtzer
5c4e6304ce Don't emit the script destroyed signal before script is actually destroyed
The script unloading code originally worked like this:

1. Destroy package
2. Emit 'script destroyed' signal
3. Unhook script's signal handlers

If a script added a 'script destroyed' signal handler, unloading
that script would cause the 'script destroyed' signal to be sent to the
(already destroyed) package.  This would cause a script error, which would
trigger a script unload, which would start the whole process over again,
until we run out of heap or stack space and segfault.

This commit simply reorders the operations so that the 'script destroyed'
signal is sent *after* the script is fully destroyed.
2017-02-28 23:48:56 -05:00
dequis
7c09b72848 fe-netjoin: remove irc servers on "server disconnected" signal 2017-02-27 23:43:37 -03:00
ailin-nemui
fa1a056291 Merge pull request #647 from dequis/fix-early-ison-take-2
notify-ison: Don't send ison before the connection is done
2017-02-27 14:45:41 +01:00
ailin-nemui
9aaa6449a0 make foreach send commands 2017-02-27 13:43:58 +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
LemonBoy
9cae98e642 Execute what's left in the input queue when the timeout expires.
Similar to how vim behaves.
2017-02-18 15:57:55 +01:00
ailin-nemui
540639e0fa Merge pull request #627 from LemonBoy/ssl-expiry
Check whether the client certificate is expired.
2017-02-15 15:49:00 +01:00
LemonBoy
c067f8e99b Do not alias /server <hostname> to /server connect <hostname>
Closes #559.
2017-02-14 23:02:05 +01:00
LemonBoy
98ead50b4e Prevent some potential null-pointer deferences.
Spotted by our friend scan-build.
2017-02-14 14:46:14 +01:00
dequis
15736ba5ab notify-ison: Don't send ison before the connection is done 2017-02-11 00:07:03 -03:00
ailin-nemui
653c7fb05a Merge pull request #622 from ailin-nemui/starttls
provide net_start_ssl api
2017-02-06 12:38:20 +01:00
ailin-nemui
28df637055 provide net_start_ssl api
fixes #615
2017-02-05 23:08:42 +01:00
ailin-nemui
ff5dd3673e Merge pull request #628 from LemonBoy/openssl-compat
Support OpenSSL 1.1.0.
2017-02-05 22:20:31 +01:00
LemonBoy
73e8a065bd Support OpenSSL 1.1.0.
- X509_get_notBefore becomes X509_get0_notBefore
- X509_get_notAfter becomes X509_get0_notAfter
- ASN1_STRING_data becomes ASN1_STRING_get0_data (and drops the const)
- The whole library is now initialized by OPENSSL_init_ssl

Closes #597
2017-02-03 13:29:19 +01:00
Nei
aab24cf4a4 Merge branch 'dub-the-wub' into 'master'
Prevent a memory leak during the processing of the SASL response.

See merge request !8
2017-02-03 11:49:16 +00:00
ailin-nemui
1ee25d2286 Merge pull request #590 from LemonBoy/hi-minor
Minor cleanup in the highlighting signal.
2017-01-31 14:18:48 +01:00
ailin-nemui
4031b92b9b Merge pull request #626 from ailin-nemui/textbuffer_monospace
support storing and replaying the monospace attribute in textbuffer
2017-01-31 14:17:44 +01: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
LemonBoy
697dd19d88 Check whether the client certificate is expired.
Right now we only warn the user, the connection keeps going.
Fixes #211
2017-01-22 21:58:55 +01:00
ailin-nemui
876c1dd93e implement break_wide
for more pleasant east asian mixed display
2017-01-20 10:32:23 +01:00
Joseph Bisch
c8dafe2a76
Add SUPPRESS_PRINTF_FALLBACK
There are some cases (such as fuzzing with fe-fuzz) where suppressing
printf output may be desirable.
2017-01-16 12:56:33 -05:00
Hanno
677fb1f55c
perl_parse needs NULL terminated parameter list. 2017-01-15 22:20:23 +01:00
LemonBoy
305b02fc63 Merge pull request #613 from ailin-nemui/fix_completion
fix regression in completion
2017-01-13 22:36:44 +01:00
Alexander Færøy
7732bbed5e Merge pull request #610 from josephbisch/fe-fuzz
Add frontend for fuzzing
2017-01-13 00:16:30 +01:00
Joseph Bisch
fe1ea4b80a
Fix fe-fuzz nits 2017-01-12 18:11:09 -05:00
dx
b15c27cc63 Revert "Don't reset wait_cmd during connection registration (fixes early ISON)" 2017-01-10 03:09:36 -03:00
Joseph Bisch
abdae2d5fc
Don't duplicate module-formats.* in fe-fuzz 2017-01-09 08:19:01 -05:00
ailin-nemui
17fc77565e fix regression in completion
fixes #609
2017-01-09 13:19:37 +01: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
Joseph Bisch
cf46907256
Add frontend for fuzzing
Use the following configure command:

$ ./configure --with-fuzzer --with-fuzzer-lib=/path/to/libFuzzer.a \
      CC=clang CXX=clang++

Places an irssi-fuzz in src/fe-fuzz/ after build.

Also can specify SANFLAGS to override the chosen sanitizer flags
(defaults to "-g -fsanitize=address -fsanitize-coverage=trace-pc-guard").
2017-01-07 20:01:07 -05: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
dequis
752f484c6c Add OPENSSL_NO_EC for solaris 11.3, see issue #598
Original patch by 'Slarky'

According to that ticket, the next major version of solaris won't need
this. Consider reverting this when solaris 11.3 stops being relevant.
2017-01-06 11:47:24 -03:00
Martijn Dekker
c9c45e4f89 make irssi --with-perl build with separate object directory
irssi 1.0.0 will not build if Perl is enabled and a separate
object code directory is used. The problem was a relative path
to an internal Perl dependency in four Makefile.PL.in files.
2017-01-06 12:24:36 +01:00
ailin-nemui
33107be748 fix GRegex GError problem 2017-01-05 13:06:55 +01:00
Nei
7a112e0217 Merge branch 'master' into 'security'
Sync to master

See merge request !6
2017-01-03 13:30:39 +01:00
ailin-nemui
01163710e7 Merge pull request #585 from ailin-nemui/win_seq
g_sequence backing for window list
2017-01-03 12:45:50 +01:00
Ailin Nemui
1f72b8e66a up abi version 2017-01-03 12:29:52 +01:00
Ailin Nemui
f5cbbebc2e switch for gregex and regex.h 2017-01-03 12:29:11 +01:00
Nei
1b99299ed2 Merge branch 'percent_flag' into 'security'
fix %[

See merge request !5
2017-01-02 17:01:47 +00: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
Nei
c3cca5ecf3 Merge branch '1-null-pointer-dereference-in-irc_nickcmp_rfc1459' into 'security'
bail out if nick is NULL

See merge request !3
2017-01-02 17:01:05 +00:00
Nei
24d2d039b5 Merge branch '3-out-of-bounds-read-with-invalid-utf8-in-term_addstr' into 'security'
Fix oob read on invalid utf8 in term_addstr

See merge request !2
2017-01-02 17:00:44 +00:00
Nei
7daa7a6aa9 Merge branch '2-out-of-bounds-read-of-one-byte-with-x1b-48-in-truecolor-builds' into 'security'
check for end of string in ansi 48

See merge request !1
2017-01-02 17:00:15 +00:00
LemonBoy
5dcf291f21 Use the RAW flag when building the regexps.
Also, plugged a memory leak when retrieving the match position.
2017-01-02 17:50:14 +01:00
LemonBoy
5eaead761f Rebase against master. 2017-01-02 17:50:14 +01:00
LemonBoy
3fcd3cd2b9 Remove the regexp_compiled field.
It was made redundant by the introduction of the pointer to the GRegex
structure.
Silence the compiler warning in textbuffer.c about preg being
initialized by setting it to NULL.
2017-01-02 17:50:14 +01:00
LemonBoy
8e5db471e4 Use GLib's regexp interface (backed by PCRE) 2017-01-02 17:50:14 +01: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
LemonBoy
7e22d051ae Make sure SASL was actually requested before failing. 2017-01-01 23:08:38 +01:00
ailin-nemui
77ff8f5b74 Merge pull request #514 from LemonBoy/sasl_fail
Add an option to stop the connection when SASL fails.
2016-12-21 15:29:26 +01:00
ailin-nemui
07050e2a3c Merge pull request #587 from ailin-nemui/sbar_crash
add assertion to statusbar_read_group
2016-12-21 15:28:17 +01:00
ailin-nemui
9151f87145 remove some for loops 2016-12-20 21:40:18 +01:00
ailin-nemui
9a018a782c sort windows_seq helpers to top 2016-12-20 21:36:56 +01:00
ailin-nemui
03f5dc63fe nits 2016-12-20 21:33:51 +01:00
ailin-nemui
9004265e54 clean up window_refnum_{prev,next} 2016-12-20 21:01:16 +01:00
ailin-nemui
7dc2f832c1 fix %[ 2016-12-20 16:41:57 +01:00
ailin-nemui
2f59fe2062 add some sequence helper functions 2016-12-19 22:03:46 +01:00
Joseph Bisch
8007e9e61d
Fix oob read on invalid utf8 in term_addstr 2016-12-19 15:52:05 -05: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
a39e210ea8 Minor cleanup in the highlighting signal. 2016-12-18 15:46:48 +01:00
LemonBoy
7a7f6abc16 Prevent a UaF by calling server_disconnect in a signal handler. 2016-12-15 22:41:57 +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
ailin-nemui
7b856d628b check for end of string in ansi 48 2016-12-15 18:01:26 +01:00
ailin-nemui
17e42649bb reset background for mirc colour 99
fix #571
2016-12-15 17:06:40 +01:00
ailin-nemui
59242cb595 add assertion to statusbar_read_group
fix #564
2016-12-15 16:59:38 +01:00
ailin-nemui
365097319f manually redraw the activity list on expose only
might speed up /foreach query /unquery
2016-12-13 03:19:00 +01:00
ailin-nemui
560283ba4e g_sequence backing for window list 2016-12-13 01:04:26 +01:00
LemonBoy
4ccffd85ff Expose 'sasl_success' to the perl side. 2016-12-12 21:41:07 +01:00
LemonBoy
91c9e871c7 Add an option to stop the connection when SASL fails. 2016-12-12 21:41:06 +01:00
ailin-nemui
618c8bd10e Merge pull request #581 from LemonBoy/set-contract
Enforce the is_node_list contract in lib-config setters.
2016-12-08 12:29:52 +01:00
ailin-nemui
964f423fed Merge pull request #570 from josephbisch/fix-issue-563
enforce check that chatnets are nodelists to handle invalid config
2016-12-08 12:11:59 +01:00
LemonBoy
7fb84b5b7d Enforce the is_node_list contract in lib-config setters.
An assertion failure is better than a segfault.
2016-11-29 23:08:45 +01:00
LemonBoy
5efb3077d5 Merge pull request #565 from ahf/bug/524
Kill bell_beeps.
2016-11-29 22:13:53 +01:00
LemonBoy
22ce6637c7 Merge pull request #577 from LemonBoy/flagz
Minor corrections to the netsplit code.
2016-11-25 21:52:42 +01:00
LemonBoy
5f0e755a00 Don't shadow the 'channel' variable when printing the netjoins.
This is the root cause of #567
2016-11-23 22:22:37 +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
LemonBoy
7574bed26c Minor corrections to the netsplit code. 2016-11-23 16:11:38 +01:00
Lauri Tirkkonen
4cbf279d88 add completion_empty_line setting 2016-11-08 16:27:38 +02:00
ailin-nemui
43934ae9ad add missing inheritance to Exec item from 3532fc46 2016-11-01 17:08:28 +01:00
Joseph Bisch
c98f5f23ea
enforce check that chatnets are nodelists to handle invalid config 2016-10-27 11:18:37 -04:00
Alexander Færøy
6a6196eebe
Kill bell_beeps.
Fixes #524
2016-10-23 21:24:12 +02:00
Alexander Færøy
bc4e2c9ade
Shorten the certificate chain output. 2016-10-23 02:51:08 +02:00
Alexander Færøy
322625b548
Only do checks for SSL_get_server_tmp_key in network-openssl.c. 2016-10-22 22:04:33 +02:00
Alexander Færøy
0a6e66f8b7
Kill do { ... } while (0); and replace it with goto's. 2016-10-22 22:04:33 +02:00
Alexander Færøy
d501a54f4f
Emit the TLS handshake finished signal before we do verification.
This patch moves the emitted "tls handshake finished" signal to before
we do validation of the given TLS certificate. This ensures that we
display certificate information before we possibly error out and
disconnects from the server.
2016-10-22 22:04:33 +02:00
Alexander Færøy
5a04430998
Kill support for DANE.
This patch removes support for DANE validation of TLS certificates.

There wasn't enough support in the IRC community to push for this on the
majority of bigger IRC networks. If you believe this should be
reintroduced into irssi, then please come up with an implementation that
does not rely on the libval library. It is causing a lot of troubles for
our downstream maintainers.
2016-10-22 22:04:33 +02:00
Alexander Færøy
f533baa191
Lift EC_KEY declaration onto the entry of the function. 2016-10-22 22:04:32 +02:00
Alexander Færøy
25824e2d3f
Lift ASN1_STRING declaration onto the entry of the function. 2016-10-22 22:04:32 +02:00
Alexander Færøy
4e170c5233
Declare variables in the beginning of the function. 2016-10-22 22:04:32 +02:00
Alexander Færøy
53d772e48b
Make sure we clean-up after ourself upon failure. 2016-10-22 22:04:31 +02:00
Alexander Færøy
5146ce9631
Add x509 certificate and public key pinning support.
This patch adds two new options to /CONNECT and /SERVER to let the user
pin either an x509 certificate and/or the public key of a given server.

It is possible to fetch the certificate outside of Irssi itself to
verify the checksum. To fetch the certificate call:

    $ openssl s_client -connect chat.freenode.net:6697 < /dev/null 2>/dev/null | \
      openssl x509 > freenode.cert

This will download chat.freenode.net:6697's TLS certificate and put it into the
file freenode.cert.

-tls_pinned_cert
----------------

This option allows you to specify the SHA-256 hash of the x509
certificate. When succesfully connected to the server, irssi will verify
that the given server certificate matches the pin set by the user.

The SHA-256 hash of a given certificate can be verified outside of irssi
using the OpenSSL command line tool:

    $ openssl x509 -in freenode.cert -fingerprint -sha256 -noout

-tls_pinned_pubkey
------------------

This option allows you to specify the SHA-256 hash of the subject public key
information section of the server certificate. This section contains both the
cryptographic parameters for the public key, but also information about the
algorithm used together with the public key parameters.

When succesfully connected to the server, irssi will verify that the
given public key matches the pin set by the user.

The SHA-256 hash of a public key can be verified outside of irssi using
the OpenSSL command line tool:

    $ openssl x509 -in freenode.cert -pubkey -noout | \
      openssl pkey -pubin -outform der | \
      openssl dgst -sha256 -c | \
      tr a-z A-Z

It is possible to specify both -tls_pinned_cert and -tls_pinned_pubkey
together.
2016-10-22 22:01:50 +02:00
Alexander Færøy
c6c2e79537
Display TLS connection information when connected to a TLS enabled server. 2016-10-22 21:58:50 +02:00
Alexander Færøy
1d101afe0d
s/SSL/TLS/ for warning strings. 2016-10-22 21:58:49 +02:00
Alexander Færøy
13f75d49e0
Simplify TLS verification error handling. 2016-10-22 21:58:49 +02:00
Alexander Færøy
b630fd1703
Populate and emit TLS_REC after TLS handshake have completed. 2016-10-22 21:58:49 +02:00
Alexander Færøy
99d017720d
Add TLS_REC.
This patch adds the TLS_REC structure. This structure is used to emit
information about the TLS handshake from the core of irssi to the
front-end layers such that we can display connection information to the
user.
2016-10-22 20:37:33 +02: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
Alexander Færøy
da67d3e8e6
Add function to convert a buffer to a colon-delimited hex string.
This patch adds binary_to_hex(), which can take an input buffer and
convert it to colon-delimited hex strings suitable for printing for
fingerprints.
2016-10-22 20:36:50 +02:00
Alexander Færøy
6300dfec71
Always build irssi with TLS support.
This patch removes the optional checks for whether to build irssi with
TLS support or not. This will allow us to ship a default configuration
file where we connect to TLS enabled IRC servers out of the box.
2016-10-16 14:55:48 +02:00
ailin-nemui
61590f31df Merge pull request #465 from LemonBoy/netsplit-print
Some small adjustments to the netsplit code.
2016-10-11 16:12:35 +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
ailin-nemui
f9fd50a357 nullptr when doing module backward compat on invalid config 2016-09-25 23:17:20 +02:00
ailin-nemui
31044ec004 Merge pull request #542 from LemonBoy/xs-add
Expose the CAP fields to the perl scripts.
2016-09-22 17:10:33 +02:00
ailin-nemui
295a4b77f0 Patches for heap corruption and missing bounds check
By Gabriel Campana and Adrien Guinet from Quarkslab.
2016-09-20 19:56:06 +02:00
ailin-nemui
b3c6cdbb91 Merge pull request #540 from LemonBoy/reset-autorun
/script reset can now also run the autorun scripts
2016-09-19 22:14:57 +02:00
LemonBoy
0e0d99587a Expose 'cap_toggle' to the perl scripts. 2016-09-15 20:38:04 +02:00
ailin-nemui
b58be939d2 Merge pull request #516 from LemonBoy/comp-file
Fix the tab completion for paths starting with ./
2016-09-13 23:29:09 +02:00
LemonBoy
21539019dd Make sure to make a copy of ERRSV content.
Otherwise we might end up showing an empty message.
Fixes #522.
2016-09-13 17:11:05 +02:00
LemonBoy
9591afcb4b Expose the CAP fields to the perl scripts. 2016-09-13 16:07:48 +02:00
LemonBoy
b2424f3193 Add a '-autorun' switch to /script reset
This way we reload all the scripts in the autorun folder.
2016-09-11 16:59:21 +02:00
LemonBoy
e4f8abc973 Merge pull request #533 from dequis/statusmess
Set the default STATUSMSG to @ instead of @+ if it's missing
2016-09-04 12:11:02 +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
ailin-nemui
c8630acbaf Merge pull request #529 from ailin-nemui/issue500
fix nick->host == NULL crash
2016-08-25 04:24:07 +02: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
LemonBoy
251d8a686a Fix an OOB access in the cutbuffer implementation. 2016-08-24 22:29:52 +02:00
ailin-nemui
681caf2b58 fix nick->host == NULL crash 2016-08-22 12:27:10 +02:00
ailin-nemui
17f4bd2060 Merge pull request #526 from ailin-nemui/ax-dummy
remove broken dummy mode
2016-08-14 23:35:41 +02:00
ailin-nemui
de11e0f4f2 remove broken dummy mode 2016-08-12 19:33:56 +02:00
ailin-nemui
b411f943a0 fix use after free in expando error 2016-08-12 18:24:58 +02:00
ailin-nemui
9ee4803770 remove curses terminal and ncurses macro 2016-08-04 10:02:28 +02:00
ailin-nemui
8b47196745 Merge pull request #517 from LemonBoy/unignore
Minor cosmetic fix in /unignore error message.
2016-07-13 15:26:37 +02:00
LemonBoy
bd4189907e Minor cosmetic fix in /unignore error message.
Reported here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=577202
2016-07-12 17:38:05 +02:00
LemonBoy
dab3246db9 Fix the tab completion for paths starting with ./ 2016-07-12 16:35:43 +02:00
Tom Feist
9559a8ead9 Allow Irssi::signal_remove to work properly with coderefs 2016-07-12 12:42:15 +02:00
LemonBoy
c0f66c95ff Such draft. Very wow. 2016-06-26 21:45:03 +02:00
LemonBoy
8f5e200551 Avoid entering an endless loop while traversing the channel list 2016-06-26 21:45:03 +02:00
LemonBoy
ed06e43ec8 Some small adjustments to the netsplit code.
By making the signal handler hooked to the "print starting" event
smarter we can avoid dumping the whole netsplit stats for every
server/channel when a message arrives.

Issue #420
2016-06-26 21:45:03 +02:00
ailin-nemui
c2c32e3955 check for NULL in statusbar_more_updated
fixes crash due to invalid access of active_win members when the more
indicator is triggered without an active window
2016-06-25 21:33:50 +02:00
ailin-nemui
f264a78947 Merge pull request #496 from ailin-nemui/comp
completion fixes
2016-06-24 10:05:15 +02:00
LemonBoy
798ce006c2 Merge pull request #498 from vague666/add_modify_functions
Add modify to /channel, /server and /network
2016-06-21 22:46:52 +02:00
Jari Matilainen
a4223a3b2e use TRUE/FALSE in if statements for gboolean 2016-06-21 22:05:21 +02:00
Jari Matilainen
2bb913f0c1 Fix minor nits 2016-06-19 16:35:13 +02:00
Jari Matilainen
4292dbd202 Add command_set_options for modify commands to allow completion 2016-06-18 18:47:11 +02:00
Jari Matilainen
79e30405e6 Let ADD still work as modify 2016-06-18 18:02:04 +02:00
Jari Matilainen
1d2113a638 Add /server modify SYNTAX 2016-06-18 17:53:35 +02:00
Jari Matilainen
421288cf50 Add /network modify 2016-06-18 17:52:47 +02:00
Jari Matilainen
1dd1dde1d4 Add /server modify 2016-06-18 17:52:26 +02:00
Jari Matilainen
92a2384ab0 Add /channel modify 2016-06-18 17:51:58 +02:00
ailin-nemui
77ad62fadb completion fixes 2016-06-16 21:30:46 +02: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
2da49e3ca6 Don't crash when the key isn't found. 2016-06-13 22:14:08 +02:00
LemonBoy
862729d7a3 Add a completion_match_case setting. 2016-06-13 22:13:43 +02:00
LemonBoy
78c1c1518a Be smart about case-matching the nicks.
If the prefix contains an uppercase letter then don't use the
case-insensitive search functions.
2016-06-13 21:55:20 +02:00
ailin-nemui
52ced0728b Merge pull request #492 from LemonBoy/enum
Enum setting implementation
2016-06-13 21:47:39 +02:00
LemonBoy
5c8423a08c Add a space after the comma when listing the options. 2016-06-13 20:27:37 +02:00
LemonBoy
439e21f127 Use ; as separator instead of , 2016-06-13 14:07:04 +02:00
LemonBoy
9a30ab53df Move the validation of the CHOICE setting value
Also, use a FORMAT to show the error message.
2016-06-13 14:03:00 +02:00
dequis
9ea155f8df servers-reconnect: pass unix_socket attribute to new connection
Trying to /reconnect unix sockets turned them into inet.
2016-06-12 20:28:06 -03:00
LemonBoy
6f795f020d Strip the surrounding whitespace. 2016-06-12 23:39:22 +02:00
LemonBoy
7307b48bd6 Sort the completion results
Make sure the current option is shown first.
2016-06-12 22:58:35 +02:00
LemonBoy
31f12c10df Use strarray_find instead of g_strv_contains 2016-06-12 16:38:34 +02:00
LemonBoy
86c5e56ef4 Make rejoin_channels_mode of type CHOICE 2016-06-12 16:26:18 +02:00
LemonBoy
bf9d9494db Add a CHOICE type to the settings system.
This is useful to let the user choose an option between a finite set of
valid alternatives.
2016-06-12 16:18:33 +02:00
ailin-nemui
0fad2cd842 Merge pull request #352 from ailin-nemui/silent_perl
silent make perl
2016-06-09 22:02:22 +02:00
ailin-nemui
d6d74c0da9 Do not crash on OPTCHAN when item has no server
May fix bugs.debian.org#826525
2016-06-06 16:58:40 +02:00
LemonBoy
9fd286fed8 Bump the ABI 2016-06-05 22:47:29 +02:00
LemonBoy
98fce5f807 Deprecate net_connect() 2016-06-05 22:47:04 +02:00
LemonBoy
0060f682c2 Factor out some redundant code and remove hashtable_get_keys 2016-06-05 17:24:27 +02:00
LemonBoy
2e8744319d str_to_uofft is a tiny wrapper over strtoul{,l} 2016-06-05 16:54:20 +02:00
LemonBoy
cc70e8c581 Clean up some GTimeVal juggling 2016-06-05 16:48:27 +02:00
LemonBoy
e0b290c34f Update the g_istr_hash function to use the djb hash 2016-06-05 16:24:55 +02:00
LemonBoy
0f9d2b3570 Remove unused regexp_match 2016-06-05 16:24:55 +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
8289f36075 Check the return value of open() in rawlog.c 2016-06-05 16:24:55 +02:00
LemonBoy
bb190be0bf Replace mkpath with g_mkdir_with_parents 2016-06-05 16:24:55 +02:00
ailin-nemui
e0c8a9f398 perl 5.10 fix 2016-06-05 11:36:13 +02:00
ailin-nemui
03aec7d3b3 silent make perl 2016-06-03 13:55:13 +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
ailin-nemui
02221eae37 fix dist compilation failure
remove illegal wcwidth.c include and compile wcwidth.c
correct #include in wcwidth.c
fallout from #480
2016-05-18 16:50:41 +02:00
ailin-nemui
5995c0619d abi increase for #480 2016-05-18 14:39:52 +02:00
ailin-nemui
74d38683bf Merge pull request #480 from xavierog/handle-utf8-nicks-with-mk_wcwidth
Handle utf8 nicks with mk_wcwidth()
2016-05-18 09:18:21 +02:00
Xavier G
5d69b4c4a7 Convert string policies from #define to enum. 2016-05-13 17:35:47 +02:00
Xavier G
a26a387545 Adjust some conditions. 2016-05-13 17:31:11 +02:00
Xavier G
72064de9fe Simplify scrlen_str() using string_width(). 2016-05-13 04:19:38 +02:00
Xavier G
29beafcf6f Improve UTF-8 handling in display_sorted_nicks(). 2016-05-13 04:08:15 +02:00
Xavier G
f1b5b515b9 Make get_alignment() available outside special-vars.c 2016-05-13 03:51:48 +02:00
Xavier G
97a4ee78fd get_alignment: handle UTF-8 strings.
get_alignment now works with columns (width), not bytes, although it is liable
to work with bytes if the given text is not a valid UTF-8 string.
2016-05-13 03:42:56 +02:00
Xavier G
09ca3ad48f Fix indentation of display_sorted_nicks().
This was done assuming an "indent with tab, align with spaces" approach.
get_alignment also benefited from a minor indentation fix.
2016-05-13 03:31:23 +02:00
Xavier G
719efc44a3 Introduce string_chars_for_width(). 2016-05-13 03:04:08 +02:00
Xavier G
35b3ccc6a4 Introduce string_length() and string_width(). 2016-05-13 02:47:26 +02:00
Xavier G
21c07c0060 Leverage string_policy(). 2016-05-13 02:27:19 +02:00
Xavier G
2c8648a9c8 Introduce string_policy(). 2016-05-13 02:10:02 +02:00
Xavier G
b0afcc96db Rename advance() into string_advance(). 2016-05-13 01:52:37 +02:00
Xavier G
5c74a3bb88 Move advance() from fe-common/core to core. 2016-05-13 01:39:14 +02:00
Xavier G
5538578820 Move utf8.{h,c} from fe-common/core to core. 2016-05-13 01:26:33 +02:00
pisculichi
47e792da05 Fix some ANSI C issues. 2016-05-03 15:28:20 +00:00
isundil
b63339af89 Increased ABI version 2016-04-30 18:26:26 +00:00
isundil
e7a18759ec Added case-sensitive regexp matching for hilights 2016-04-29 22:17:51 +00:00
B Thibault
ddd5416430 changed command-line -case to -matchcase 2016-04-29 11:00:34 +02:00
B Thibault
d8a6e66699 Ref #421 (Add an option to make /hilight case sensitive)
Allow use of /hilight -case exAMPle (compatible with other options)
Added matchcase to hilight config file (exemple: { text = exAMPle; matchcase = yes; } )
2016-04-29 01:01:34 +02:00
B Thibault
9fa3869a97 retab 2016-04-29 00:12:28 +02:00
dequis
2ba4b9d26a net_gethosterror: Handle EAI_SYSTEM ("System error") properly
That error code means "check errno". A few users got it and we never
figured out what happened - it usually fixed itself after restarting
something - so hopefully with this we'll have more information the next
time.
2016-04-07 07:26:19 -03: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
26f875263a Merge pull request #455 from ailin-nemui/cutbuffer
improved cutbuffer handling
2016-03-31 19:13:53 +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
ailin-nemui
aec2466e36 Improve cutbuffer handling
* Adds two new keys which you can bind in /bind:
  yank_next_cutbuffer: Revert to the previous last deleted text
  append_next_kill: Append next deletion
* Consecutive kills are now appended to the current cutbuffer
2016-03-29 15:20:45 +02:00
ailin-nemui
b9914abbf3 Make use of terminal application keys configurable
adds a new setting term_appkey_mode which can enable or disable the use
of keyboard transmit (application keys) mode. Fixes #430
2016-03-22 23:58:34 +01:00
ailin-nemui
b1ffd5f647 Merge pull request #452 from LemonBoy/terminfo-cup
Don't call terminfo_cont() twice on resume
2016-03-22 23:05:27 +01:00
ailin-nemui
9cb0419435 Merge pull request #443 from LemonBoy/chatnet
Throw an error when a chatnet has no available url
2016-03-22 23:00:01 +01:00
ailin-nemui
29e160f0bf Merge pull request #457 from ailin-nemui/fix_450
fix race condition in terminal init
2016-03-22 22:57:28 +01:00
ailin-nemui
3bc8afa740 Merge pull request #458 from ailin-nemui/fix_449
Properly toggle bracketed paste mode on stop/cont
2016-03-22 22:54:43 +01:00
LemonBoy
897016131e Don't call terminfo_cont() twice on resume
Fixes some weirdness when using ^Z with zsh.
2016-03-22 22:50:24 +01:00
ailin-nemui
d36d34fe04 Merge pull request #456 from ailin-nemui/fix_454
cutbuffer: do not unconditionally use replace when noop was requested
2016-03-22 22:47:42 +01:00
ailin-nemui
35d255fc8c Properly toggle bracketed paste mode on stop/cont
Fixes #449
2016-03-22 16:36:30 +01:00
LemonBoy
8b54366d95 Support quoted filenames in some /DCC commands 2016-03-22 16:00:00 +01:00
LemonBoy
e5ee243ab6 Simplify some logic in server_create_conn 2016-03-22 15:45:08 +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
938d0071c6 fix race condition in terminal init
remove the tcgetattr call to a single time on irssi load instead of
querying it each time. Fixes #450
2016-03-22 15:21:20 +01:00
ailin-nemui
117c890d98 cutbuffer: do not unconditionally use replace when noop was requested 2016-03-22 14:43:31 +01:00
ailin-nemui
f7658640fb Merge pull request #437 from vague666/glob_matching
Use glob matching for activity_hide_targets
2016-03-21 11:21:01 +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
8394973d5a Bump the ABI version
Since a new format has been added.
2016-03-20 12:16:48 +01:00
LemonBoy
6745dd6159 Throw an error when a chatnet has no available url
If you type /connect <CN> and the chatnet <CN> has no url available
let's just throw an error instead of trying to process <CN> as a url.
2016-03-19 14:04:53 +01:00
LemonBoy
f31d37a852 Make ischannel_func return false for empty strings 2016-03-19 12:11:53 +01:00
Jari Matilainen
857e27aef6 Don't use glob matching, just regular string comparisons 2016-03-17 23:58:46 +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
TheLemonMan
795b7de808 Merge pull request #439 from horgh/ssl-errors
Clear error queue before SSL I/O operations
2016-03-17 22:07:57 +01:00
ailin-nemui
49bdd179b2 Merge pull request #438 from dequis/sasl-timeout-disconnect
Remove sasl timeout source when the server disconnects
2016-03-17 16:14:34 +01:00
KindOne
bcebed5a72 Replace spaces with tabs 2016-03-14 21:23:37 -04:00
Jari Matilainen
94b823c3cd Use glob matching for activity_hide_targets
spaces vs tabs!

strarray_find* needs to return -1 if no index found
2016-03-14 22:29:36 +01:00
Jari Matilainen
27c37cb3f3 Return -1 from null-test to comply with the rest of strarray_find 2016-03-14 22:17:17 +01:00
Will Storey
8ab6bdf2ce Add clear error calls to irssi_ssl_get_iochannel 2016-03-13 15:09:52 -07:00
Will Storey
be733d2482 Clear error queue before SSL I/O operations
Otherwise we can see errors that are not related to the operation
we check for. SSL_get_error() inspects the thread's error queue.
See https://www.openssl.org/docs/manmaster/ssl/SSL_get_error.html for
more information.
2016-03-13 13:28:04 -07:00
dequis
e853392f43 Remove sasl timeout source when the server disconnects 2016-03-11 14:55:31 -03:00
Giuseppe
66e9c4bb39 Merge pull request #432 from grawity/fix-external
fix SASL EXTERNAL
2016-03-08 22:49:05 +01:00
ailin-nemui
8f1f1d879f Merge pull request #426 from Manishearth/paste-split
Make pasting warning appear when long pastes are going to be split into many lines
2016-03-08 22:17:06 +01: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
Manish Goregaokar
ef0c7d3e7a Make pasting warning appear when long pastes are going to be split into many lines 2016-02-24 00:51:11 +05:30
Manish Goregaokar
9f0e5da208 use a #define'd LINE_SPLIT_LIMIT instead of hardcoding 400 2016-02-24 00:42:35 +05:30
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
Todd A. Pratt
8723c0fb33 fix whitespace 2016-02-10 09:47:10 -05:00
Todd A. Pratt
0ca534c345 Merge branch 'master' of github.com:irssi/irssi 2016-02-10 09:42:42 -05:00
ailin-nemui
0860469900 Merge pull request #413 from dequis/completion-list-crash-fix
completion: Fix crash when the complist provided by a script has nulls
2016-02-05 21:39:20 +01:00
Todd A. Pratt
431863852c Merge branch 'master' of github.com:irssi/irssi 2016-02-04 21:48:41 -05:00
ailin-nemui
af229a8bb7 Merge pull request #410 from LemonBoy/getaddrinfo-v6-flag
Getaddrinfo v6 flag
2016-02-03 11:45:11 +01:00
Todd A. Pratt
966d002b55 remove memory allocation check, spaces to tabs 2016-01-30 11:32:08 -05:00
Todd A. Pratt
876609901a add an append operation to cut buffer handling 2016-01-30 09:34:46 -05:00
dequis
7674fd5936 completion: Fix crash when the complist provided by a script has nulls
Can be reproduced with aspell_complete.pl 1.00 by setting an invalid
dictionary with "/set spell_dict a"
2016-01-29 10:40:18 -03:00
LemonBoy
0cc8276e89 Add AI_ADDRCONFIG to the getaddrinfo hints.
A first step to untangle the ipv4 vs ipv6 mess.
At the time of writing Linux, OpenBSD and FreeBSD all support the
AI_ADDRCONFIG flag.
2016-01-27 16:16:27 +01:00
LemonBoy
118eb0a68c Call getnameinfo with NI_NAMEREQD flag.
This way net_gethostbyaddr will fail when the system is unable to
resolve the address to a valid host name.
Without this flag in case of failure the function would return the ip
address instead of failing.
2016-01-27 15:54:29 +01:00
LemonBoy
f31b2026b4 Minor style fix in net_ip2host. 2016-01-27 15:04:07 +01:00
LemonBoy
87c0827471 Delete the HAVE_IPV6 ifdef.
Welcome to the future.
2016-01-27 14:31:55 +01:00
ailin-nemui
dc03baa0d3 Merge pull request #353 from toddpratt/master
Allow for prepending to the cutbuffer in addition to replacing it.
2016-01-26 09:02:38 +01:00
ailin-nemui
c7a3d2822c Merge pull request #399 from LemonBoy/bots
Change when the autocmds are sent.
2016-01-26 09:00:29 +01:00
LemonBoy
d964950e5d Serialize the 'name' attribute of the CHANNEL_REC.
This way the code doing the serialization in 'sig_layout_save_item' is
now symmetric with the loading code loading the data in
'sig_layout_restore'.
2016-01-25 20:48:13 +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
bd2c549064 Merge pull request #394 from ailin-nemui/reset-history
option to clear the history
2016-01-11 21:04:48 +01:00
ailin-nemui
8f37095969 Merge pull request #389 from ailin-nemui/hilight2-up
keep track of address in text_dest for hilight purposes
2016-01-11 21:04:43 +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
ailin-nemui
ad842ea8a6 reorder history add and fixes 2016-01-08 15:42:59 +01:00
ailin-nemui
4659cea65a option to clear the history 2016-01-08 15:19:13 +01:00
ailin-nemui
cfb6123a7a forward ABI to perl modules 2016-01-07 09:26:02 +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
7cc85b9427 keep track of address in text_dest for hilight purposes 2015-12-28 01:08:35 +01:00
ailin-nemui
5fbad764df clean up after #303 2015-12-15 00:08:44 +01:00
ailin-nemui
074af68578 Merge pull request #303 from vague666/fs275
Applied patch from fs#275 to make /hilight -mask -line work properly
2015-12-15 00:07:18 +01:00
ailin-nemui
38720e0ecb Merge pull request #306 from dequis/bracketed-paste
Implement paste detection via the bracketed paste mode 2: bracket pasterer
2015-12-15 00:06:48 +01:00
dequis
ce77842a98 Bracketed paste: fix nitpick from ahf's review
Thanks ahf
2015-12-13 13:56:09 -03:00
ailin-nemui
6e01a23134 ensure staticlib perl works on 5.22 (for now) 2015-12-13 01:09:13 +01:00
dequis
e6fa311590 Bracketed paste: Adjust paste line count if there's text after newlines
With bracketed paste, "a\nb" will result in two lines being pasted,
because it's a single thing, with an end marker which the timeout based
pastes don't have.

Due to the way term_gets() counts lines, that input will have
paste_line_count == 1. This can be misleading.

This code adjusts it by looking at the last character, and increasing
the count if it finds anything that isn't a newline.
2015-12-12 01:49:32 -03:00
dequis
38d372eccb Disable timeout-based paste detection if paste_use_bracketed_mode is on 2015-12-12 01:19:36 -03:00
ailin-nemui
9dd2b7c616 deinit perl on staticperl builds 2015-12-10 14:02:59 +01:00
Todd A. Pratt
5d99a3d59a Merge branch 'master' of github.com:irssi/irssi 2015-12-09 20:48:21 -05: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
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
ailin-nemui
20fe5d0c7f add missing file to Makefile 2015-12-09 14:23:15 +01:00
Ailin Nemui
3532fc4671 Add bindings for exec-type window items to Perl
These bindings were missing and resulted in non-hash non-undef active
entries when an interactive process is executing.
2015-12-09 12:05:48 +01:00
ailin-nemui
229c600e99 Merge pull request #174 from ailin-nemui/entry-prompt-colours
reimplement format and length logic for the entry prompt
2015-12-09 12:01:00 +01:00
ailin-nemui
57576bb75f Merge pull request #65 from ailin-nemui/perl-irc-poly
forward alternate_nick to Irc::Server attributes
2015-12-09 12:00:30 +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
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
dx
99193e9971 Merge pull request #357 from LemonBoy/fix-99+1
Correctly alias 'channel' to '#channel'
2015-11-26 19:25:16 -03:00
ailin-nemui
11ad4da0e3 more perl inheritance warning fixes 2015-11-25 12:16:42 +01:00
dx
80141622ed Merge pull request #365 from ailin-nemui/perl_nick
fix nick class hierarchy
2015-11-23 21:02:48 -03:00
ailin-nemui
a941329b41 fix nick class hierarchy 2015-11-24 00:40:19 +01:00
ailin-nemui
877ff075bd stop cap_sasl 2015-11-24 00:30:12 +01:00
dx
0ca0c882a5 Merge pull request #360 from LemonBoy/backport-patch
Save a patch from the Flyspray oblivion, plus a nice unrelated commit to make everyone (un)happy
2015-11-23 13:08:13 -03:00
ailin-nemui
f9654a7e0c Merge pull request #359 from LemonBoy/dcc-assert
Let ignore_check do its work when server is NULL
2015-11-23 10:05:05 +01:00
LemonBoy
0171b1a634 Use the expanded filename when picking the awaylog
This fixes a long-standing bug where 'fname' was being feed to cat
instead of 'real_fname', causing it to quit with a 'No such file or directory'
error.

FS#377
2015-11-22 21:59:28 +01:00
LemonBoy
50fae4212e Use 'isblank()' instead of a custom macro 2015-11-22 21:33:44 +01:00
Fabian Kurz
011eda7d9e Correct a wrong use of the 'paste_buffer' variable
The function "static void paste_buffer_join_lines(GArray *buf)" in
"src/fe-text/gui-readline.c" is supposed to join lines from the GArray
pointed to by *buf under certain circumstances.

In the code of the function "buf" is actually used for getting the length
of the GArray, but to get a pointer to the data, "paste_buffer->data" is
used; paste_buffer is defined in the scope of the whole file.

This delivers the desired result, because this function is only called
once, with "paste_buffer" as the argument. If paste_buffer_join_lines()
will ever be used with a different argument, it will fail.
2015-11-22 21:24:05 +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
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
ailin-nemui
fbb838b3b0 Merge pull request #350 from LemonBoy/fix-99
Strip trailing whitespace from commands
2015-11-18 22:01:29 +01:00
Todd A. Pratt
15dfb27f80 use the enum name which was the original intended change 2015-11-14 09:07:35 -05:00
Todd A. Pratt
bb8c0bbf4c fix indentation, undelete line not meant to be deleted. 2015-11-13 20:33:57 -05:00
Todd A. Pratt
f90e10c5d2 remove more cruft from previous implementation 2015-11-13 14:01:25 -05:00
Todd A. Pratt
7768f3e520 remove cruft from previous implementation 2015-11-13 13:51:56 -05:00
Todd A. Pratt
1199ecc62f a facility for prepending or replacing the cutbuffer 2015-11-13 13:42:28 -05:00
Todd A. Pratt
0b2b3a0b85 Merge branch 'master' of github.com:toddpratt/irssi 2015-11-13 10:59:21 -05:00
ailin-nemui
ac04fa7413 Merge pull request #351 from vague666/hilight_default_behaviour
Fix /hilight list output behaviour depending on enabled flags
2015-11-10 11:07:16 +01:00
Jari Matilainen
b333d10364 /hilight list print output with enabled flags, except when -word and -nick are used 2015-11-09 23:06:56 +01:00
LemonBoy
d4676c9855 Use the PARAM_FLAG_STRIP_TRAILING_WS flag wherever possible. 2015-11-09 23:02:41 +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
dequis
8c98e07eab Merge remote-tracking branch 'origin/master' into bracketed-paste 2015-11-08 14:28:18 -03:00
Todd A. Pratt
4f8974f66e Merge branch 'master' of github.com:toddpratt/irssi 2015-11-02 08:08:38 -05:00
Todd A. Pratt
3c95f6aae9 Make C-w and M-backspace work right. 2015-11-02 08:00:52 -05:00
ailin-nemui
50775e92e6 Merge pull request #330 from dequis/xterm-keypad-enter
Add xterm's keypad enter, meta-O-M to "key return" bindings
2015-11-02 00:15:58 +01:00
dx
8d1f667100 Merge pull request #320 from irssi/ahf/add-setting-type-any
Fix warnings
2015-11-01 13:40:54 -03:00
LemonBoy
8094e87cdf Preserve the sasl_ options across reconnects. 2015-10-28 21:56:35 +01: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
dequis
58a166484a Add xterm's keypad enter, meta-O-M to "key return" bindings
From the 'kent' terminfo entry. Also applies to putty.

Fixes #327
2015-10-06 06:15:47 -03:00
ailin-nemui
79fa2fcb59 Merge pull request #318 from LemonBoy/fix-utf8-elements
Fix the display of utf8 sequences in the gui
2015-10-04 20:22:36 +02:00
LemonBoy
0140e7c6b2 Fix the indentation. 2015-10-04 20:23:51 +02: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
5f35fbc57a
Remove check for >= 0 for unsigned unichar. 2015-10-03 19:01:16 +02: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
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
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
Geert Hauwaerts
bd696a096e Merge pull request #319 from LemonBoy/awaylog-flush
Flush the dirty buffer to disk
2015-10-02 09:33:03 -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
48ab298a67 Kill an unneeded declaration 2015-10-02 15:08:48 +02:00
LemonBoy
c7646dc58d Even simpler logic 2015-10-02 15:07:59 +02:00
LemonBoy
c351c448b8 Rework the logic to avoid allocating memory 2015-10-02 15:02:43 +02:00
LemonBoy
2e860abd2b Fix the display of utf8 sequences in the gui
term_addstr() had a long-standing fixme that suggested it didn't
take into account the string encoding when calculating the string
length.
The BIG5 code path is untested.
2015-10-02 14:44:35 +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
dx
c3e4664870 Merge pull request #294 from dequis/key-states-rescan-recursion-limit
Limit recursion depth of key/combo expansion in key_states_scan()
2015-10-02 07:22:48 -03: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
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
b04b5f0f1d Make sure sasl settings are defined before printing them out 2015-09-29 11:44:11 +02:00
Jari Matilainen
cff536ab70 Add sasl info to /network list output if available 2015-09-29 10:39:49 +02:00
dequis
7866d2bcd6 Handle empty bracketed pastes (or sequences of those)
Both cases were off-by-one mistakes erring on the side of being too
conservative. This fixes these two harmless issues:

- For a single empty paste, it required another keystroke before
  processing it
- For a sequence of themcase, a single '~' was left in the input
2015-09-27 16:08:07 -03:00
dequis
c721d57688 Handle a paste start marker right after an end one (ignore both)
This actually workarounds a bug with the "st" terminal, for which i've
already submitted a patch, but irssi needs to be able to handle it
decently too.
2015-09-27 16:08:07 -03:00
dequis
7d062a313a Create paste_bracketed_middle() function to handle small pastes
"Small" as in ending in the same sig_input() call where they started
2015-09-27 16:08:07 -03:00
dequis
83f9772e21 Fix some minor style issues 2015-09-27 16:08:07 -03:00
dequis
79987d87f3 Send last line of bracketed paste together with the rest 2015-09-27 16:08:07 -03:00
dequis
3b01198f03 paste_bracketed_end: Fix rest length calculation 2015-09-27 16:08:07 -03:00
dequis
52729ca3da Save the part of the paste buffer after the bp_end marker for later
Also move relevant code to a paste_bracketed_end() function
2015-09-27 16:08:07 -03:00
dequis
9a6b2dedcc Improve bracketed paste start/end detection
- Use a keybinding to detect the start of a bracketed paste
- Iterate over the paste buffer looking for the end marker
2015-09-27 16:08:07 -03:00
LemonBoy
6888fc5fc7 Get rid of the non-portable memmem
The sequences we're after are found at the beginning or at the end of the
buffer, there's no need to scan the whole thing.
2015-09-27 16:08:06 -03:00
LemonBoy
4764b102ff Enable the bracketed paste mode on demand 2015-09-27 16:08:06 -03:00
LemonBoy
15dad291c7 Replace some hairy logic with g_array_remove_range
In the hope it'll do the same under the hood.
2015-09-27 16:08:06 -03:00
LemonBoy
f1eead7b4a Toggles 2015-09-27 16:08:06 -03:00
LemonBoy
72ac27e5a0 Implement the bracketed paste mode
As an alternative method of paste detection, more reliable but might not be
supported by all the VTs.
2015-09-27 16:08:06 -03: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
Jari Matilainen
deb6ca1b1a Applied patch from fs#275 to make /hilight -mask -line work properly 2015-09-24 13:03:02 +02:00
Jari Matilainen
a2277e84bd Added functionality to create dir if dir specified in rawlog filename 2015-09-24 11:59:18 +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
Geert Hauwaerts
3daadfa4a2 Merge pull request #298 from dequis/multi-prefix
Add multi-prefix to list of capabilities to request
2015-09-23 20:13:25 +02:00
dequis
9da445ab86 Drop some glib version checks that are not needed anymore
The g_strcmp0 fallback in particular was broken since it was used in a
few places as a GCompareFunc, and macros don't work that way.

Yes, that one was my fault, but nobody complained :D
2015-09-23 13:58:22 -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
dequis
f247a43b97 sig_message_irc_op_public: fix nickmode lookup, use cleantarget instead 2015-09-22 19:35:10 -03: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
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
dequis
99f074b0db fe_channel_skip_prefix: fix return value (FALSE/NULL isn't valid)
The return value is a char*, and here it was false which is 0 which is
more or less the same as null.

That could have been a crash somewhere, the functions that call this
don't expect null ever.
2015-09-22 01:17:15 -03:00
dequis
bf36f71b99 Fix #291, "/msg +#channel incorrectly shows up as Nick:@#channel"
Just passing the full target to the "message irc op_public" signal
handler and letting it do the cleanup.

The fe_channel_skip_prefix() call in event_privmsg() is kept because
recode_in() needs a real channel name, but

There was similar code in sig_message_own_wall(), but that one is
correct - the /wall command always sends NOTICE @#chan, so I added a
comment down there to make it clear.
2015-09-22 00:01:04 -03:00
dequis
0823289fd9 Limit recursion depth of key/combo expansion in key_states_scan()
Fixes FS#817 - "SegFault when executing bind command", which provides
the test case "/bind cleft key meta", which is stupid but now it doesn't
break things.

The limit of 100 is arbitrary, it means roughly 140 stack frames total.
The flyspray ticket mentions it crashes at 512, in my system it goes all
the way to 149677 stack frames.

http://bugs.irssi.org/index.php?do=details&task_id=817
2015-09-21 22:59:24 -03:00
dequis
f39723f651 Fix FS#905, mangled text when pasted line length exceeds 400
http://bugs.irssi.org/index.php?do=details&task_id=905

Not using the patch from that ticket, the issue turned out to be that
(dest - last_lf_pos) returned number of unichr, not bytes, so that's 4
times less than what the size parameter of memmove() should be.
2015-09-21 17:53:46 -03:00
ailin-nemui
211e84c1e9 Merge pull request #267 from kyak/master
Add expandos for hostname
2015-09-21 18:47:09 +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
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
dx
9cf4dfd23d Merge pull request #288 from irssi/ahf/kill-gc
Remove Garbage Collection support.
2015-09-20 16:49:48 -03:00
Alexander Færøy
519955ebe4
Fix warning.
Add comment on the use of ??) in C, since that string isn't entirely
obvious to people who are reading the code.
2015-09-20 21:45:33 +02:00
Alexander Færøy
29cf546ee4
Remove Garbage Collection support.
GC support was never enabled by default and nobody in the current
development team seems to care about it.
2015-09-20 21:28:14 +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
efc8f5f187 Merge pull request #283 from LemonBoy/unset-crnl
Clear the ICRNL flag
2015-09-19 23:09:29 +02:00
LemonBoy
061fb34750 Modify the terminal initialization sequence
We disable the ICRNL flag to make Enter independent from ^J from the
keybinding point of view since the former will now send ^M, leaving the
user free to remap ^J without trapping itself into the irssi session
because of a broken Enter key.
Also disable the software flow control because we don't expect anyone to
run irssi over a serial console; we gain some more freedom by having ^Q
and ^S freely mappable by the user.
2015-09-19 12:22:58 +02:00
dequis
f37f6ac0ed Add two missing #include "fe-irc-channels.h"
Fixes #285
2015-09-18 23:56:17 -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
4346c2a6d4 Move the function prototypes in a separate header 2015-09-09 23:55:00 +02:00
Alexander Færøy
762c1d7f2c Merge pull request #276 from LemonBoy/terminfo-application-mode
Send smkx/rmkx sequence at terminal init
2015-09-09 22:55:24 +02:00
LemonBoy
b5b73cb471 Send smkx/rmkx sequence at terminal init
Enter the "application" mode when setting up the terminal, this improves the
compatiblity with the standards; as a side effect now DEL key works ootb when
irssi is run in the suckless's st terminal.
2015-09-06 15:47: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
57d645f246 Introduce some more chantypes awareness 2015-09-02 21:50:40 +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
6fcafc5993 1k+ windows are now the default formatting (#223)
1k+ windows are now the default formatting (#223)
2015-06-12 21:13:45 +02: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