Commit Graph

244 Commits

Author SHA1 Message Date
Alexey Sokolov
f456b274b5 Warn users about port 6667 in --makeconf
This should decrease chance of web browsers failing to connect to ZNC
2014-01-18 12:28:38 +00:00
Alexey Sokolov
559abc3d8c Merge pull request #458 from ConorOG/issues_235a
fix #235, erroric console output, status message overwrite
2014-01-16 15:22:33 -08:00
Alexey Sokolov
e0fd211053 Merge pull request #441 from psychon/websocks-expire-oldest
WebModules: Discard sessions in LRU order
2014-01-16 15:21:27 -08:00
James Seward
07c1628d50 Trim servername in jump command
Fixes e.g. tab-completing servername in irssi
2014-01-16 20:04:53 +00:00
Conor O'Gorman
dd0ba1def4 define terminal control codes for messages, tidy, tweak ok message 2014-01-01 18:08:31 +00:00
Conor O'Gorman
2d1a632910 fix #235, erroric console output, status message overwrite
using alternative message style
otherwise ncurses/terminal codes for cursor position would seem necessary
2014-01-01 16:10:38 +00:00
Falk Seidel
f19b4caa43 Welcome to 2014 - year 10 with ZNC 2013-12-31 10:10:55 +01:00
Uli Schlachter
414fa40eb5 WebModules: Discard sessions in LRU order
Currently, znc has a limit of 5 web sessions per IP address. This limit exists
to defend against some obvious DoS attacks. When this limit is hit, some session
is discarded.

Previously, we would discard the session that std::multimap::find() would give
us. The multimap used mapped from IP addresses to sessions. Thus, we would
discard the oldest session.

This commit changes this into some least-recently-used logic. Whenever a session
is used, we record the timestamp of this. Then when a session has to be picked
for discarding, the one with the oldest timestamp is used.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-12-07 20:56:27 +01:00
dgw
2b3d40a501 tweak wording of "out of networks" errors 2013-11-21 13:07:17 +04:00
Alexey Sokolov
f6b8167e36 Merge pull request #341 from cork/master
Add irc command to allow disabling channel
2013-11-14 11:24:00 -08:00
Alexey Sokolov
3e56f093f2 X-Forwarded-For: verify the whole chain, from the end 2013-11-14 22:37:36 +04:00
Alexey Sokolov
ccbc469168 Merge commit 'refs/pull/349/head' of github.com:znc/znc 2013-11-14 08:27:50 +04:00
Alexey Sokolov
c74344f783 Fix error message for invalid network name 2013-10-20 17:51:43 +04:00
Alexey Sokolov
11efcee422 Merge commit 'refs/pull/422/head' of github.com:znc/znc 2013-10-20 17:42:45 +04:00
Ingmar Runge
7a1b725958 whitespace fix 2013-10-18 21:03:20 +02:00
Ingmar Runge
b5c898eaff modules: add OnAddNetwork, OnDeleteNetwork hooks. 2013-10-18 20:35:21 +02:00
Alexey Sokolov
d16ab96032 Fix saving config on cygwin
It failed always on some installations
2013-10-15 22:04:21 +04:00
Toon Schoenmakers
98ceafb1ba Replaced the GetNick().Equals() with NickEquals() where possible
Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>
2013-10-10 22:35:49 +02:00
Toon Schoenmakers
9166f5a250 Renamed IsNick to NickEquals
Also added a TODO to add proper IRC case comparing.

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>
2013-10-10 18:36:03 +02:00
Toon Schoenmakers
83b9a28e4c Implemented a nick compare function
As suggested by the todos in IRCSock, added IsNick(CString) method
so the ugly Nick.GetNick().Equals(GetNick()) could be simplified.

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>
2013-10-10 17:22:16 +02:00
KindOne
8c6b4b8d21 Correct two typos. 2013-09-18 00:26:37 +04:00
Kyle Fuller
e7ff40f785 Fix a crash when you delete a user with more than one attached client
Fixes #403
2013-09-17 18:55:22 +02:00
Alexey Sokolov
a09d644975 Fix error message for /znc addnetwork irc.network.net 2013-09-07 16:02:50 +04:00
Alexey Sokolov
894e0a2f18 Return old fakeonline module as modules_online
It was accidentally dropped in 0.207 because of the confusing name,
it looked too much like antiidle module.

Instead, this module tells broken clients like Colloquy that *status and
*module are "online". Otherwise those clients require user to always
prepend messages to *module with "/msg *module", even if the window of
*module's query is active.

Also fix the module to support network modules
2013-09-01 22:21:11 +04:00
Alexey Sokolov
d5e03cb736 Fix support for /msg @#chan :hi
005 STATUSMSG defines list of characters prependable to channel name,
but we used simple modes instead.

See
https://tools.ietf.org/html/draft-brocklesby-irc-isupport-03#section-3.16

Fix #272

Thanks to grawity for the link to 005 docs draft, and to carrot for
testing the patch.
2013-08-29 22:31:25 +04:00
Martin Nowack
eda4426085 Request secure cookie transmission for HTTPS
If cookies are not marked as secure, they can be sent
back by the client on unencrypted channels, disclosing
information. With this fix, clients are requested to
send cookies back on a secure channel in case HTTPS is
used.
2013-08-01 15:14:54 +02:00
Lunatrius
4368c189f7 Fixed double forward slashes and incorrect active module highlighting. 2013-07-01 17:30:32 +02:00
Alexey Sokolov
d0a3fddd6e Fix "Error: Success" message in Csocket
When SSL remote closes socket without handshake.
Patch is submitted to upstream Csocket too.
2013-06-16 11:03:37 +04:00
Alexey Sokolov
e10b9a1ef5 Don't make backup of znc.conf readable by everyone.
It doesn't really matter, since the whole ~/.znc/ is not readable, but
it's better to be safe.
2013-06-15 21:15:38 +04:00
Alexey Sokolov
b2dcad5fd4 Change ZNC license to Apache 2.0
The following people agreed with the change, in alphabetical order:
(people who approved in several ways are listed only once)
By email:
- Adam (from Anope)
- Austin Morton
- Brian Campbell
- Christian Walde
- Daniel Holbert
- Daniel Wallace
- Falk Seidel
- Heiko Hund
- Ingmar Runge
- Jim Hull
- Kyle Fuller
- Lee Aylward
- Martin Martimeo
- Matt Harper
- Michael J Edgar
- Michael Ziegler
- Nick Bebout
- Paul Driver
- Perry Nguyen
- Philippe (cycomate)
- Reuben Morais
- Roland Hieber
- Sebastian Ramacher
- Stefan Rado
- Stéphan Kochen
- Thomas Ward
- Toon Schoenmakers
- Veit Wahlich
- Wulf C. Krueger

By IRC:
- CNU
- Jonas Gorski
- Joshua M. Clulow
- Prozac/SHiZNO
- SilverLeo
- Uli Schlachter

At https://github.com/znc/znc/issues/311 :
- Alexey Sokolov
- Elizabeth Myers
- flakes
- Jens-Andre Koch
- Jyzee
- KindOne/ineedalifetoday
- Lee Williams
- Mantas Mikulėnas
- md-5
- Reed Loden

At the last few pull requests' comments:
- Allan Odgaard
- Jacob Baines
- Lluís Batlle i Rossell
- ravomavain
- protomouse

The following commits' authors didn't respond:
Trivial changes:
- f70f1086fd
- 4ca8b50e45

The changes which are not presented in master anymore:
- 5512ed2ea0
- 960a4498f7
- 0f739de2c0
- 7f53cc810b

Fix #311
Fix #218
2013-06-14 00:43:34 +04:00
Lluís Batlle i Rossell
0adf4876a4 makepem: create pem only rw for the user, on non-win32 2013-06-12 20:29:47 +00:00
Alexey Sokolov
a06b6495e8 Revert "Rewrite the JOIN channel logic, dropping MaxJoins"
This reverts commit db7c47f97d.

Too many joined channels at once started to cause disconnect because of
"Max SendQ Exceeded", which is not much better than previous Flood.

Now MaxJoins is 0 by default, which preserves the current behavior of
joining all channels at once. If someone experiences those disconnects
due to SendQ, they can tune MaxJoins.

Fix #329

Conflicts:
	include/znc/User.h
	modules/controlpanel.cpp
	modules/webadmin.cpp
	src/User.cpp
2013-06-09 23:39:10 +04:00
Alexey Sokolov
99895c77df Rewrite printing timestamps in znc -D
Previous commit doing it was 0f739de2c0
2013-06-04 23:13:17 +04:00
Ravomavain
10a982b6d3 Add CString::StripControls to strip controls (Colors, C0) from strings 2013-05-20 12:23:32 +02:00
Alexey Sokolov
8f0605f402 Fix #323 bug about GMT±N timezones 2013-05-19 19:43:28 +04:00
Alexey Sokolov
f96ea81899 Debug: escape also escape character 2013-05-18 09:30:54 +04:00
Alexey Sokolov
9d23158aab Merge commit 'refs/pull/356/head' of github.com:znc/znc 2013-05-18 09:10:28 +04:00
Alexey Sokolov
c3f421ba25 Merge branch 'master' of github.com:znc/znc 2013-05-17 00:22:23 +04:00
Alexey Sokolov
3f98754c16 Fix #299 2013-05-17 00:18:58 +04:00
Uli Schlachter
999cc085d2 Revert "Add 381 to the buffer (You are now an IRC Operator)"
This reverts commit 11e5f7636d.

Having this in the raw buffer multiple times is obviously wrong, because you can
use /oper more than once and would get a new 381 numeric each time. So this
would need to use UpdateRawBuffer() instead of AddRawBuffer() (=replace old
entries with the same text).

However, this is still wrong. If you -o yourself, you no longer have oper
status. ZNC wouldn't notice this and still deliver the 381 numeric to new
clients.

Clients which use raw 381 to detect oper status will have to switch to user mode
+o.

Thanks to Han` for reporting this problem.
2013-05-14 18:30:40 +02:00
Ravomavain
0c37fb1858 Add EDEBUG to CString::Escape function to escape debug output. 2013-05-12 12:22:26 +02:00
Alexey Sokolov
6569508522 Merge commit 'refs/pull/306/head' of github.com:znc/znc 2013-05-12 08:59:01 +04:00
Siyo
7ee853afaa Fixed redundant removal of trailing spaces 2013-05-10 15:02:21 +02:00
Siyo
3d5ba6af3e Whitelisted X-Forwarded-For header support 2013-05-10 14:19:58 +02:00
Uli Schlachter
9b23ee60b8 Debug: Only print queued lines if they are really just queued
Previously, every line that was forwarded to the IRCd was printed twice in debug
mode. Once when it got added to the send queue and a second time when it was
actually sent. However, most of the time this queue is empty and thus the two
events happened at approximately the same time.

Thus, this patch now changes the debug output. Lines are only printed extra if
they really have to wait in the queue for a while before they can be sent out.

This has the positive effect of making the debug output more readable, because
it is shorter and less repetitive and it makes it more obvious when znc actively
throttles the traffic that is sent out.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-05-07 20:59:38 +02:00
Cork
a3c6684d49 Add a Disablechan to match the Enablechan command 2013-05-02 18:16:50 +02:00
Uli Schlachter
58a34fa5ad Improve the way that VERSION_EXTRA is calculated
Instead of doing magic with the result from version.sh so that we can add a
preprocessor macro, the script now just writes src/version.cpp with the expected
content. This should fix all the various issues that we have with quoting the
arguments and things that go wrong when not building znc from a git clone.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-31 19:32:44 +02:00
Alexey Sokolov
8fdb530ee3 Fix use-after-free which may happen during shutdown
If a module, e.g. keepnick, tries to remove a timer in
OnIRCDisconnected.

Thanks to KindOne for the report.
2013-03-31 23:40:19 +07:00
Uli Schlachter
53c579b296 CJob: Add a way to do stuff on the main thread
This just moves the pipe from the socket code to the thread pool. However, now
all CJobs can use this and there is a single place for them to get deleted.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-15 11:58:27 +01:00
Uli Schlachter
75f2e3fa41 Add a generic threads abstraction
This should make it easier to work with threads. It provides classes for mutexes
and condition variables. Additionally, there is a special CMutexGuard that
automatically unlocks the mutex on destruction and a CThreadPool class.

This thread pool is used to replace the thread pool in the sockets code.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-15 11:58:22 +01:00