Commit Graph

2492 Commits

Author SHA1 Message Date
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
Uli Schlachter dd56a3c2ba Broadcast an error on EMFILE
When we hit the "maximum open files" limit, we close the listener that hit this
error. Previously we did so silently which means no one could figure out what
happened.

This commits adds a broadcast message giving a hint, but this should never
happen in a real-world situation anyway (unless you have 1000 users).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-25 16:58:11 +02:00
Alexey Sokolov 795126031b Fix verifying listener in --makeconf.
If ZNC is compiled with IPv6, ZNC tried to verify the listener using
IPv6 regardless of what user said.

Thanks to wodim for reporting this.
2011-07-19 08:48:57 +07:00
Alexey Sokolov ea58912093 Hide every symbol except ZNCModInfo from modules.
This means that now it's possible to have the same class names in
different modules, which reduces chances of weird errors.

Thanks to mclc for noticing this.
2011-07-15 22:56:47 +07:00
Alexey Sokolov efda366d44 Fix znc-buildmod if znc was compiled out of tree. 2011-07-15 21:44:15 +07:00
Uli Schlachter 789f1ff7b5 Update to latest Csocket
This fixes the "busy loop waiting for an SSL handshake to finish" which the last
"Update to latest Csocket" was already supposed to fix. However, that fix had a
bug if poll() is used instead of select().

poll()'s timeout argument is in milliseconds while select also allows
microseconds. Since Csocket originally used select(), it expects the
microseconds-approach. This means it has to divide by 1000 to get the timeout
argument for poll().

However, the iQuickReset which was used to "fix" (rather: hide) the busy loop
was less than 1ms so this still resulted in a timeout of 0 (= busy loop) because
integer division truncates the result.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-13 20:47:56 +02:00
Uli Schlachter 4fbca80705 WebMods: Set another cookie if the IP check fails
This means that they will get a new cookie on the next request. This will make
sure that you will be able to use webadmin again if your IP changed (which seems
to happen to quite a number of people).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-13 20:40:55 +02:00
Uli Schlachter 00024b1b3a znc-buildmod: Print znc's version number
This helps people figuring out that they are still building their modules for
the wrong znc version since they have more than one installation on their box.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-13 19:56:48 +02:00
Alexey Sokolov 63e8d42e3d Don't fail to load if can't find fixfreenode. 2011-07-10 19:46:34 +07:00