Commit Graph

2500 Commits

Author SHA1 Message Date
Uli Schlachter 8f1027d646 CFile: Make sure errno is always set correctly
This fixes weird problems were strerror() made us print garbage.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-23 09:39:59 +00:00
Kyle Fuller 88c96801ba CTCP's with no values should not be passed to the client
Fixes #105
2012-03-23 09:39:44 +00:00
Alexey Sokolov 75ae156ba2 Identfile: don't crash when ZNC is shutting down.
Thanks to Domin for reporting this.

Conflicts:

	modules/identfile.cpp
2012-02-29 16:50:42 +00:00
Uli Schlachter 266382904e Increase the version number to 0.204
Signed-off-by: Uli Schlachter <psychon@znc.in>
znc-0.204
2012-01-22 18:13:31 +01:00
Alexey Sokolov 514834b277 autoreply: Honor RFC 2812.
There must not be autoreply for notices.

Thanks to nyuszika7h for noticing this.
2012-01-01 14:48:58 +01:00
Kyle Fuller 7391a5cc68 Remove notes on the GENERATE command in the cert module 2012-01-01 14:48:58 +01:00
Uli Schlachter aa9f2935b4 route_replies: Handle raw 482
lahwran reported the following message from *route_replies and also figured out
which message we failed to handle, thanks!

<*route_replies> This module hit a timeout which is possibly a bug.
<*route_replies> To disable this message, do "/msg *route_replies silent yes"
<*route_replies> Last request: MODE #somesecretchannel I

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-01 14:48:58 +01:00
Alexey Sokolov 946ff52dad Change the order of -I directives in Makefile.
If ZNC was already installed, it had its headers somewhere.
The chances are that something else can be installed at the same place,
including some ZNC's dependency	whose include dir would be included to
CXXFLAGS. Another possibility of including that dir is triggered when
using FreeBSD - ./configure explicitly adds -I/usr/local/include in that
case.

And so we get a directory with old ZNC headers included to CXXFLAGS
before our new shiny ./include.

With their order changed, the proper headers are included now.

Thanks to those who repored the issue, thanks to PsWii60 for helping to
track it down, thanks to my parents for creating me and therefore
enabling me to fix it, and to many other people.

Conflicts:

	Makefile.in
	modules/Makefile.in
2012-01-01 14:48:58 +01:00
Uli Schlachter 094d6f358a Don't use "mkdir" during install
lahwran just showed up on irc and told us that he installed znc, but znc failed
to find any modules. The reason for this was his umask 077 which means that
"make install" installed stuff so that only root can access it.

The solution is do use "install -d" since that makes sure to ignore the
currently set umask.

However, google finds results which say that "install -d" might mess with stuff
of pre-existing directories when it shouldn't, so we must first test if the
directory already exists before calling install. Obviously, this makes our
Makefile a lot more readable. :-(

I didn't have time to test this properly, so stuff might break.

Signed-off-by: Uli Schlachter <psychon@znc.in>

Conflicts:

	modules/Makefile.in
2012-01-01 14:48:58 +01:00
Alexey Sokolov d082c472e5 Check for /usr/bin/swig2.0 too.
SWIG 2 is named that way on Debian-based systems...
2012-01-01 14:48:58 +01:00
Kyle Fuller 6ed5040dd9 identfile: Improve the debug messages
The new debug messages allow us to see when the identfile is unlocked

Conflicts:

	modules/identfile.cpp
2012-01-01 14:48:58 +01:00
Alexey Sokolov 292f921cad Improve admin module description. 2012-01-01 14:44:56 +01:00
Alexey Sokolov d891b5489d Fscking perl... This fixes modperl's compilation. 2012-01-01 14:44:56 +01:00
Toon Schoenmakers a6e5225e8a This avoids your irc windows being filled with away stuff
Downside of antiidle is that because it messages yourself internally
the irc server will send messages to you when you're marked as away.
This can end up being really annoying, so those messages are blocked
with these changes.

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>
2012-01-01 14:44:55 +01:00
Uli Schlachter cf8db5e33d Send a MODE request when JOINing
This kind of reverts/fixes f1cb09bd9c.

Robby found a bug with evil ChanServ which goes like this:

- You join an empty, but registered channel and the IRCd applies its default
  modes (+nt), but ZNC didn't ask for MODE, so doesn't know this.
- ChanServ applies whatever channel modes it wants to apply. This causes ZNC to
  see a mode change (e.g. +s).

The result of this is that ZNC thinks that the channel has mode +s and it will
tell every client that connects to it about this.

The fix is to send a MODE request when JOINing. To make sure that we don't
confuse clients, we block the reply.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-01 14:20:16 +01:00
Uli Schlachter 6e558bbec0 SHA256.cpp: Include some ZNC header first
This is required to make sure that zncconfig.h is the very first header that is
being included.

This problem was noticed by someone reporting some "macro redefined" warnings.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-01 14:20:09 +01:00
Alexey Sokolov dd57c350f4 Move autocycle module to extra.
Modern/decent networks have services anyway, and for registered channels
this module is useless. Also it tends to fight ChanServ in case if
ChanServ joins/parts the channel to remove ops.

Users of deprecated ne^W^Wnetworks without services can use it from extra.
2012-01-01 14:18:47 +01:00
Uli Schlachter ed24d7fc89 Drop @DEFS@ from the build system
This will only ever be set to -DHAVE_CONFIG_H. However, we shouldn't give this
flag to other people's code (e.g. through znc-config). Since we don't need it,
it's best to just drop it completely.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-01 14:17:30 +01:00
Alexey Sokolov b51760646b Add a message sent to user in case of redirect. 2012-01-01 14:16:55 +01:00
Kyle Fuller 39f97a887d Let a user filter the result of help CModule::HandleHelpCommand 2012-01-01 14:16:48 +01:00
TorrentialStorm 7474c43902 Don't forward server redirects to client. 2012-01-01 14:16:42 +01:00
TorrentialStorm bc35c3ed37 Don't send server redirects to client [TorrentialStorm] 2012-01-01 14:16:34 +01:00
Alexey Sokolov b5043eb850 Unload modules in reverse order. 2012-01-01 14:16:27 +01:00
Uli Schlachter 927c1d3074 Increase the version number to 0.203
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-01 13:48:13 +01:00
Alexey Sokolov 11508aa72e Fix crash in bouncedcc module.
It happens when DCC RESUME is received.
Affected ZNC versions: 0.200, 0.202.

Thanks to howeyc for reporting this and providing the patch.
2012-01-01 00:47:01 +07:00
Uli Schlachter a3b9d8b13b Increase the version number to 0.202
Signed-off-by: Uli Schlachter <psychon@znc.in>
znc-0.202
2011-09-21 22:19:51 +02:00
Jim Hull 610bfe3eb9 fix formatting 2011-09-13 15:09:54 -07:00
Jim Hull 0e9f43fff8 rework SendBuffer fixing an issue where ClearBuffer() nuked the buffer after playing to the first client
(cherry picked from commit 793c34699a)

Conflicts:

	Chan.cpp
2011-09-13 15:03:09 -07:00
Alexey Sokolov dd3a2b3897 Install .py files along with .pyc
(cherry picked from commit 5e73af632a)
2011-09-13 22:13:17 +07:00
Jim Hull 244052f0de fixed a null reference to pClient in hooks 'OnChanBufferStarting,OnChanBufferStarting,OnChanBufferEnding,OnChanBufferEnding', such that when pClient is NULL the hooks are called on all clients associated to that user
Conflicts:

	Chan.cpp

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-13 09:52:41 +02:00
Kyle Fuller 7354564df3 Don't timeout bouncedcc connections, inactive bounced DCC chat's would be dropped otherwise 2011-09-13 09:38:18 +02:00
Uli Schlachter 13dbd6698c admin: Fix getchan {inconfig,keepbuffer,detached}
Instead of giving a useful result, they returned their result by sometimes
omitting the first character of the option name. Whoops.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-13 09:38:09 +02:00
Alexey Sokolov aa9ccbcbd7 Add -r parameter of ZNC to man.
It was missing.

Thanks to flaccid for noticing that.
2011-09-13 09:37:59 +02:00
Jonas Gorski a9f8e6550d fix build error when compiling against uclibc(++)
Fixes the following error:

In file included from ZNCString.cpp:10:0:
FileUtils.h: In static member function 'static CString CDir::GetCWD()':
FileUtils.h:246:36: error: 'getcwd' was not declared in this scope

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-13 09:37:46 +02:00
Uli Schlachter fe05574f24 autocycle: Only cycle once in 15 seconds
This should stop all fights against ChanServ. Please note that nothing will
happen if we are the only one in the channel after 15 secs since this module
only checks if it needs to do something when someone leaves a channel.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-13 09:36:59 +02:00
Uli Schlachter 891d7a3e3a route_replies: Improve the timeout message
Fixes #57.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-13 09:36:13 +02:00
Kyle Fuller ebab559931 Fix CChan::TrimBuffer() (#63)
CChan::TrimBuffer() was trying to do "m_vsBuffer.begin() + -<some number>" which would cause a segmentation fault

Fixes #63
2011-09-13 09:36:02 +02:00
Uli Schlachter b6903fd798 Increase the version number to 0.201
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-13 09:35:38 +02:00
Uli Schlachter d91803bf22 Increase the version number to 0.200
Signed-off-by: Uli Schlachter <psychon@znc.in>
znc-0.200
2011-08-20 22:33:15 +02:00
Kyle Fuller 6aa31689ac [cert module] Allow \r\n to be inside a certificate when uploading with the web interface.
Thanks to Robby for reporting
2011-08-16 22:19:43 +01:00
Kyle Fuller 74919a8759 Fix uploading a certificate in the web interface for the cert module 2011-08-16 20:38:51 +01:00
Uli Schlachter 8f53d3fbb0 Fix modp{erl,ython} installation
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-06 10:43:39 +02:00
Kyle Fuller e86ff3219d Fix module data for extra/ modules for real 2011-08-05 22:16:21 +01:00
Uli Schlachter da0ba75549 Fix CString::Escape_n() and add some tests for it
This bug was originally reported by someone on irc, but sadly I forgot who it
was. Sorry!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-05 16:09:22 +02:00
Uli Schlachter cb6798d36f Fix module data for extra/ modules
No module in extra/ comes with any data currently, so this was tested by moving
perform to extra/. The install is untested.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-05 15:19:09 +02:00
Uli Schlachter 8d17f50600 Include zncconfig.h in all headers
The rule is that zncconfig.h must be the very same thing that is included. We
cheat and only include it in headers (so that modules dont have to have be
changed). However, it looks like some modules where missed.

This commit fixes test/ConfigTest which crashed if _GLIBCXX_DEBUG was enabled
(--enable-debug) because it didn't see this define before including a c++
header.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-05 15:02:04 +02:00
Uli Schlachter dcf357b1f6 Stop asking for the host name in --makepem
Come on, it's a self-signed certificate, how much value does it have anyway?
Also, it gets rid of a question during --makeconf which confuses some people.

This should now use $HOSTNAME and fall back to "host.unknown" if that isn't set.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-03 22:05:21 +02:00
Kyle Fuller 90f741d2ca Make the CUser::IsIRCConnected method check if the IRC connection is authed because may of its callers expect this behaviour.
This fixes a bug reported by Robby where a channel could become disabled while a the user is connected to irc, but before they have authenticated.
2011-07-29 19:21:25 +01:00
Uli Schlachter 9685f16b96 Fix a memleak in CChan::AddNick()
This memleak existed since 5e070e788 from almost a year ago.

Thanks to Olipro for reporting this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-27 15:14:01 +02:00
Uli Schlachter f1cb09bd9c Don't send a MODE request when JOINing
Since commit 1a1cc4c756, we'd always send a "MODE #chan" to IRC when we
received a "JOIN #chan". It used to work before that commit, because the mode
reply which is automatically sent on join is sent before the "end of /names"
numeric.

This just removes that MODE request. Proper IRC server should always send a MODE
reply on channel join.

Thanks to nyuszika7h`` for the report.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-27 15:12:03 +02:00