Commit Graph

2248 Commits

Author SHA1 Message Date
psychon
dd87a7e56d Add "-ggdb" with --enable-debug again
This is accidentally broken since r2248.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2278 726aef4b-f618-498e-8847-2d620e286838
2011-02-13 08:05:20 +00:00
silverleo
1e35eafbb3 psychon would say there's nothing to see here
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2277 726aef4b-f618-498e-8847-2d620e286838
2011-02-05 15:51:07 +00:00
silverleo
ad9667dd3e Fix the IsAdmin checks for the SetBufferCount
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2276 726aef4b-f618-498e-8847-2d620e286838
2011-02-02 13:14:22 +00:00
psychon
e66b244f35 Accept wildcards for DetachChan, EnableChan, ClearBuffer and SetBuffer
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2275 726aef4b-f618-498e-8847-2d620e286838
2011-01-26 16:58:17 +00:00
darthgandalf
a284e0260a Fix a mistake in code, which unloads perl modules.
Perl API should be used properly.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2274 726aef4b-f618-498e-8847-2d620e286838
2011-01-24 18:22:43 +00:00
darthgandalf
ae82eec1ac Fix warnings "variable 'ax' set but not used [-Wunused-but-set-variable]" of modperl.
http://perldoc.perl.org/perlcall.html wants us to declare and set this variable,
but it seems that not every perl actually uses it.
So let me introduce you this small workaround which uses ax's value.

Thanks to nb for reporting this.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2273 726aef4b-f618-498e-8847-2d620e286838
2011-01-24 18:18:42 +00:00
cflakes
ddd302fbf5 clearbuffersonmsg module in znc-extra: removed OnUserJoin and OnClientLogin hooks. This means that those events will no longer clear the buffer and thereby make the module more useful. You can now e.g. use it to get all the benefits of KeepBuffer = true, but still have the buffer cleared whenever you do something (we assume that doing something means you have read all previous messages).
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2272 726aef4b-f618-498e-8847-2d620e286838
2011-01-23 21:12:12 +00:00
darthgandalf
85a270661b A cleanup in configure.ac on how to find library with dlopen.
This shouldn't break anything.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2271 726aef4b-f618-498e-8847-2d620e286838
2011-01-22 13:30:07 +00:00
silverleo
58aaf7592c Fix a compile warning on 32bit systems.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2270 726aef4b-f618-498e-8847-2d620e286838
2011-01-18 14:21:17 +00:00
darthgandalf
6b396fca7f Fix for last commit.
Also remove perl magic from modperl/Makefile.inc which was used to suppress a warning.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2269 726aef4b-f618-498e-8847-2d620e286838
2011-01-15 21:04:25 +00:00
darthgandalf
f76f1e7a25 Modpython and modperl bindings should have proper dependencies on headers in makefiles.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2268 726aef4b-f618-498e-8847-2d620e286838
2011-01-15 20:28:25 +00:00
darthgandalf
3422d95780 Add copyright header for some files of modpython which were forgotten before.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2267 726aef4b-f618-498e-8847-2d620e286838
2011-01-15 19:01:14 +00:00
darthgandalf
81c864d025 Only admins should be able to load email module.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2266 726aef4b-f618-498e-8847-2d620e286838
2011-01-15 17:08:57 +00:00
darthgandalf
37b70a2949 Fix build on cygwin.
All shared objects produced a warning, and ZNC couldn't start after make install.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2265 726aef4b-f618-498e-8847-2d620e286838
2011-01-15 05:10:43 +00:00
psychon
bf6dc459db WebModules: Fix a crash during shutdown
During shutdown, the global list of sessions is destroyed. The new multimap
which counts sessions per address is also destroyed. However, they are destroyed
in unspecified order. This is not what we want because destructing the session
map also destroyed all the sessions which then has to access the sessions-per-ip
multimap. This obviously crashes if the multimap was already destroyed.

The fix here is to introduce a new class that contains both of those maps and
makes sure all the sessions are destroyed before the maps are destroyed
themselves. I hope this description makes some sense...


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2264 726aef4b-f618-498e-8847-2d620e286838
2011-01-14 22:03:33 +00:00
psychon
913a3c8ded Limit the number of web sessions per IP to 5
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2263 726aef4b-f618-498e-8847-2d620e286838
2011-01-14 20:22:43 +00:00
psychon
4556cc7c9b WebMods: Verify a session belongs to the remote IP address
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2262 726aef4b-f618-498e-8847-2d620e286838
2011-01-14 20:22:23 +00:00
psychon
577a097e32 Keep a list of web sessions per IP address
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2261 726aef4b-f618-498e-8847-2d620e286838
2011-01-14 20:22:02 +00:00
psychon
b9b0fd4c87 Oh, shiny... NOT
(Yes, it's that time of the year again)

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

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2260 726aef4b-f618-498e-8847-2d620e286838
2011-01-14 17:03:24 +00:00
psychon
5ff2fce9d9 Remove some code duplication in TCacheMap
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2259 726aef4b-f618-498e-8847-2d620e286838
2011-01-08 22:07:36 +00:00
psychon
142eebcf9b Protect ZNC against CTCP floods
Ingredients:
- A couple of bots (3 are plenty)
- Boredom
- A target you want to annoy

Recipe:
Connect your bots to the same IRC network that your target is on. Then let each
of your bot flood him with CTCP VERSION request. If the target is gentle enough
to reply to each of those request, he will be disconnected from the network due
to excess flood.

This commit makes ZNC only reply to 5 CTCPs within 5 seconds. If more are sent,
they aren't replied to. This does NOT protect clients that are connected to ZNC.
They will still get the chance to reply to the flood.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2258 726aef4b-f618-498e-8847-2d620e286838
2011-01-08 18:26:31 +00:00
psychon
5a6a7b7e93 Add some message to the end of autogen.sh
The last thing autogen.sh is calling automake which is supposed to fail.
Obviously, this doesn't look good to users so we should print some message that
says everything worked as expected.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2257 726aef4b-f618-498e-8847-2d620e286838
2011-01-08 11:33:06 +00:00
psychon
d9b4ba18f6 configure: Stop using AC_CHECK_FILE
We need the file we check for only to figure out some compiler flags, so
AC_CHECK_FILE's behavior of aborting cross compilation is just wrong.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2256 726aef4b-f618-498e-8847-2d620e286838
2011-01-08 11:32:50 +00:00
darthgandalf
b6c8e10633 Include zncconfig.h before any system headers in modpython and modperl bindings.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2255 726aef4b-f618-498e-8847-2d620e286838
2011-01-07 18:01:26 +00:00
darthgandalf
e2ce2cfed9 Removed configure. This is fix for the commit before the previous one.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2254 726aef4b-f618-498e-8847-2d620e286838
2011-01-07 18:00:58 +00:00
darthgandalf
9574d6c379 Change behaviour of autogen.sh
It doesn't run configure anymore.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2253 726aef4b-f618-498e-8847-2d620e286838
2011-01-07 18:00:33 +00:00
psychon
fde73c60fa Remove all generated/copied scripts from SVN
This commits removes all files which are generated by aclocal or autoconf or
copied from automake (yes, autoconf requires config.{guess,sub}, yet they are
part of automake!).

Instead, we now have a shell script autogen.sh which calls all the needed parts
in the right order (aclocal ; autoheader ; autoconf ; automake).

Additionally, configure.in is renamed to configure.ac because that seems to be
the more proper name for it. Let's see if anyone notices me sneaking this in. ;)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2252 726aef4b-f618-498e-8847-2d620e286838
2011-01-07 16:34:13 +00:00
psychon
87037f4856 Fix a forgotten svn add (zncconfig.h.in)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2251 726aef4b-f618-498e-8847-2d620e286838
2011-01-07 15:02:57 +00:00
psychon
3ecbf13390 Use autoheader
This commit adds a zncconfig.h to ZNC that is automatically generated by
configure. This is done because the -DPACKAGE_STRING=\"znc\ 0.097\" that
configure adds to CXXFLAGS breaks znc-buildmod.

This means that we have to include zncconfig.h as the very first header in every
C++ file that is compiled. This commit kinda cheats and instead adds this
include as the very first thing to all header files we have. This should
hopefully mean that modules don't have to include this.

Because Csocket includes defines.h too late, this commit causes znc to divert
from upstream Csocket once again. :(


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2250 726aef4b-f618-498e-8847-2d620e286838
2011-01-07 15:01:08 +00:00
psychon
40a1bbacdf Fix for autoheader
autoheader wants a description for all definitions, so we have to provide one.
Meh.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2249 726aef4b-f618-498e-8847-2d620e286838
2011-01-05 19:54:20 +00:00
psychon
f4927709f9 Use AC_DEFINE for -D-style definitions
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2248 726aef4b-f618-498e-8847-2d620e286838
2011-01-05 19:40:54 +00:00
psychon
aeeb1eb35b Move some -D flags to Makefile
Doing it like this is the only supported way with autoconf and works around
quite some messy mess.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2247 726aef4b-f618-498e-8847-2d620e286838
2011-01-05 19:08:07 +00:00
psychon
4e5f9e8602 HTTPSock: Send Last-Modified headers for static files
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2246 726aef4b-f618-498e-8847-2d620e286838
2011-01-03 15:21:30 +00:00
psychon
9ef41ae6ad Make CHTTPSock generate a properly formated "Date:" header
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2245 726aef4b-f618-498e-8847-2d620e286838
2011-01-03 15:21:09 +00:00
darthgandalf
9fec8f726d Make modpython compiler to fail make on fail of compilation of a python file.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2244 726aef4b-f618-498e-8847-2d620e286838
2011-01-03 05:09:42 +00:00
darthgandalf
452e3f1824 Modpython compiler should depend on Makefile.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2243 726aef4b-f618-498e-8847-2d620e286838
2011-01-03 05:09:18 +00:00
psychon
8a1c2a4711 Include @DEFS@ into our compiler call
On most systems, this should only result in some useless defines being added to
the compiler's command line:

-DPACKAGE_NAME=\"znc\" -DPACKAGE_TARNAME=\"znc\" -DPACKAGE_VERSION=\"0.097\"
-DPACKAGE_STRING=\"znc\ 0.097\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\"

However, on some weird arches like e.g. x86, this will make AC_SYS_LARGEFILE
actually work, because that macro adds "-D_FILE_OFFSET_BITS=64" to @DEPS@.

This was found by SilverLeo because modpython didn't compile for him, thanks. :)
(python has "#define _FILE_OFFSET_BITS 64" in pyconfig.h)

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2242 726aef4b-f618-498e-8847-2d620e286838
2011-01-02 17:15:21 +00:00
psychon
44d2816379 Remove some more pointless checks for sPageName.empty()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2241 726aef4b-f618-498e-8847-2d620e286838
2011-01-02 16:33:42 +00:00
psychon
eb730d72d7 notes: Remove a pointless "if"
When you load /mods/notes/ in your browser, OnWebRequest will be called with
sPageName == "index". So that variable can never actually be empty.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2240 726aef4b-f618-498e-8847-2d620e286838
2011-01-02 10:46:46 +00:00
psychon
fa5b3acc8f webmods: Remove some more useless code
We don't actually have a "modlist" template, so this code would cause a 404.
Going through the "find module with empty name" codepath here has the same
result, so this can be safely removed.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2239 726aef4b-f618-498e-8847-2d620e286838
2011-01-01 22:59:41 +00:00
psychon
0ca689f2eb webmods: Fix
One of my recent commits made webmods only find user modules instead of global
modules. This worked before because m_sForcedUser was an empty string which made
the code look for global modules. This commit adds an explicit check for global
modules which hopefully fixes all problems.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2238 726aef4b-f618-498e-8847-2d620e286838
2011-01-01 22:57:54 +00:00
cflakes
8cadb672f0 Add some more infos to the recently introduced znc.conf warning header.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2237 726aef4b-f618-498e-8847-2d620e286838
2010-12-31 16:45:29 +00:00
psychon
5050b93658 WebMods: Clean some stuff up
This removes two unused methods (ResolveModule() and FillErrorPage()) and marks
some other methods const/static/protected.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2236 726aef4b-f618-498e-8847-2d620e286838
2010-12-31 16:15:53 +00:00
psychon
3f62466751 WebMods: Remove some dead code
Using some module as another user didn't actually work. For user modules, the
following code stops you:

 else if (!pModule->IsGlobal() && pModule->GetUser() != GetSession()->GetUser()) {
     PrintErrorPage(403, "Forbidden", "You must login as " + pModule->GetUser()->GetUserName() + " in order to view this page");

For global modules this didn't work either. Once a "forced" user name was
specified, OnPageRequestInternal() stopped looking at global modules:

 CModule* pModule = CZNC::Get().FindModule(m_sModName, m_sForceUser);
 if (!pModule && m_sForceUser.empty()) {
 [snip]
 if (!pModule) {
     return PAGE_NOTFOUND;

So, whatever m_sForceUser was supposed to do, it never did that.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2235 726aef4b-f618-498e-8847-2d620e286838
2010-12-31 15:52:54 +00:00
cflakes
40d39f222b Don't use a readonly <input> in lastseen's WebadminUser stub template.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2234 726aef4b-f618-498e-8847-2d620e286838
2010-12-31 15:22:47 +00:00
cflakes
7bb4ed34bd Some grammar and capitalization fixes.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2233 726aef4b-f618-498e-8847-2d620e286838
2010-12-31 15:20:40 +00:00
cflakes
ba183e461f Perform module:
* Be more const.
* Be more correct: only accept requests to /mods/perform/, not to all URLs starting with that.
* Be more considerate: Use "IRC server" instead of "IRCd".



git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2232 726aef4b-f618-498e-8847-2d620e286838
2010-12-31 15:09:07 +00:00
psychon
89edf703f6 Perform: Also parse stuff like "/msg foo bar" via webmods
Signed-off-by: Uli Schlachter <psychon@znc.in>

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2231 726aef4b-f618-498e-8847-2d620e286838
2010-12-31 14:42:43 +00:00
psychon
c8910c4856 Perform: Provide a webinterface
Signed-off-by: Uli Schlachter <psychon@znc.in>

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2230 726aef4b-f618-498e-8847-2d620e286838
2010-12-31 14:42:28 +00:00
psychon
1e0585c485 webadmin: Add all currently missing global settings
These were MaxBufferSize, ConnectDelay, ServerThrottle and AnonIPLimit.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2229 726aef4b-f618-498e-8847-2d620e286838
2010-12-31 09:14:21 +00:00