Commit Graph

1349 Commits

Author SHA1 Message Date
psychon aba7ae9973 Remove CNick::Concat which isn't used anywhere
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1360 726aef4b-f618-498e-8847-2d620e286838
2009-02-02 14:55:45 +00:00
psychon 3f00b9ef60 Just. Do. Not. Ask.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1359 726aef4b-f618-498e-8847-2d620e286838
2009-01-29 19:59:02 +00:00
psychon ed43e95216 Change the names of all the module entry points to be more ZNC specific
Some of them (eg. GetVersion) where so generic that we even had symbol
clashes (well, on no real worls OS (only windows), but still that's not nice).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1358 726aef4b-f618-498e-8847-2d620e286838
2009-01-29 19:39:21 +00:00
psychon 0f0463510c Some fixes to modperl, most notable no with time increasing memory usage
Because some ENTER/LEAVE pair was missing, the stack perl uses for passing
arguments grew and grew.
Besides adding those calls this also fixes some more of the callback calling
code to look a little closer to the examples from perldoc.
This also fixes some warnings perl threw at us when unloading by not
making ZNC::{CONTINUE,HALT{,MODS,CORE}} mortal.

Thanks to tomaw and AnMaster for reporting and helping me debug this mem issue.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1357 726aef4b-f618-498e-8847-2d620e286838
2009-01-29 19:11:53 +00:00
psychon 9a8fbdb6e0 Just ignore this
This commit never happened.
You must be dreaming.
Really, there is nothing to see here.
Still here? Go away!
Ok, I suck, feeling better now?


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1356 726aef4b-f618-498e-8847-2d620e286838
2009-01-29 15:41:38 +00:00
psychon f7825e0016 Make CFile::IsDir() work on those weird OS that don't like trailing slashes
Yeah, I'm talking windows here.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1355 726aef4b-f618-498e-8847-2d620e286838
2009-01-29 15:39:26 +00:00
psychon e6ede6decb Use O_BINARY when opening files if it is available
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1354 726aef4b-f618-498e-8847-2d620e286838
2009-01-28 09:55:32 +00:00
psychon 3ed2b755a3 CFile::TryExLock(): Add O_CREAT to the default parameters
The old code in CLockFile automatically created the file too.
(Well, it also removed in in this case latter, but meh, so what?)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1353 726aef4b-f618-498e-8847-2d620e286838
2009-01-27 19:56:05 +00:00
psychon 7ef9f76bb0 Open the ISpoofFile with mode 'O_RDWR|O_CREAT' instead of '(int)true'
This fixes a bug from r1337


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1352 726aef4b-f618-498e-8847-2d620e286838
2009-01-27 19:54:38 +00:00
psychon 432a04e545 Add the necessary makefile magic for compiling on cygwin
This also works with make install (thanks to rpath).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1351 726aef4b-f618-498e-8847-2d620e286838
2009-01-26 19:57:34 +00:00
psychon 177a5d24db Include Utils.h in less headers and move some code out of the header
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1350 726aef4b-f618-498e-8847-2d620e286838
2009-01-25 20:07:14 +00:00
psychon 235b10c200 Use that new define everywhere
Now there are no uses of DEBUG_ONLY() left :(


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1349 726aef4b-f618-498e-8847-2d620e286838
2009-01-25 16:51:54 +00:00
psychon 8d8bbb0920 Add a DEBUG() define which can be used for outputting debug info
DEBUG_ONLY() is only ever used for debug output, so adding a separate define
for this sounds like a good idea.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1348 726aef4b-f618-498e-8847-2d620e286838
2009-01-25 16:50:40 +00:00
psychon 136a62707b savebuff: substr() could throw an exception, use Left() instead
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1347 726aef4b-f618-498e-8847-2d620e286838
2009-01-25 15:33:47 +00:00
psychon 48ee5c71c5 Check in CZNC::AddUser() if the username is still available
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1346 726aef4b-f618-498e-8847-2d620e286838
2009-01-25 11:12:36 +00:00
psychon 74f9f3e864 Savebuff: Don't reload old channel buffers
Channel buffers are loaded from disk when we join a channel (OnJoin) and when
the module is loaded (OnBoot(), called from OnLoad()) and only if KeepBuffer
for that channel is turned on. So every case is handled.
If we now also load channel buffers in SaveBufferToDisk() we will only reload
old channel buffers which were deleted since then
(e.g. /msg *status clearallchannelbuffers).

Thanks to Julian for finding this bug and helping me debug.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1345 726aef4b-f618-498e-8847-2d620e286838
2009-01-24 19:10:05 +00:00
psychon 620c72a2ac Add a ModHandle typedef instead of using void* directly
This makes it clearer what this variable is and it makes porting to windows
easier, because we can just change the typedef to HMODULE.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1344 726aef4b-f618-498e-8847-2d620e286838
2009-01-24 09:11:50 +00:00
psychon 7ab0b8d959 Make GetPass() return a CString instead of a char*
In theory this could lead to extra copies of the password in memory, but since
no caller actually makes sure that those passwords are forgotten as fast as
possible, I don't see why this should be done the Old Way(tm).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1343 726aef4b-f618-498e-8847-2d620e286838
2009-01-23 18:46:39 +00:00
psychon a92694c471 Use unsigned int instead of uint in the one place where it is currently used
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1342 726aef4b-f618-498e-8847-2d620e286838
2009-01-23 14:20:24 +00:00
psychon fb54bc2fc4 Cleanup: Remove an unnecessary scope operator
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1341 726aef4b-f618-498e-8847-2d620e286838
2009-01-23 13:50:53 +00:00
psychon f4618594b6 Fix a bug where ZNC would fail to send out its own ip for DCC bouncing
CUtils::GetLongIP() had a bug where it would overflow an integer for IPs
which started which a number higher than 127.
This is now fixed by using unsigned integers and doing that shift on a long.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1340 726aef4b-f618-498e-8847-2d620e286838
2009-01-22 17:52:35 +00:00
psychon accb2e46c9 Check if lstat() is available and use stat() instead if it isn't
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1339 726aef4b-f618-498e-8847-2d620e286838
2009-01-22 11:19:42 +00:00
psychon 34337d7b76 Don't build the znc binary with position independent code
This is only needed for code that ends up in a shared object which is the
module code for us.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1338 726aef4b-f618-498e-8847-2d620e286838
2009-01-21 13:30:07 +00:00
psychon 127347825e Remove CLockFile and let CFile do its job
This shouldn't contain any major behaviour change, but there are some minor
ones. Also, the API for a shared lock wasn't used and thus is dropped.

Thanks to cnu for this idea.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1337 726aef4b-f618-498e-8847-2d620e286838
2009-01-20 13:21:29 +00:00
psychon 6345ce12fa Make O_RDONLY the default mode when opening files through CFile
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1336 726aef4b-f618-498e-8847-2d620e286838
2009-01-19 15:55:41 +00:00
psychon 9210bdc97e Update to latest Csocket
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1335 726aef4b-f618-498e-8847-2d620e286838
2009-01-18 10:32:16 +00:00
psychon 3a2772eafa MD5: Dunno if this makes the code better or worse...
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1334 726aef4b-f618-498e-8847-2d620e286838
2009-01-17 10:25:09 +00:00
psychon 55fcaa9489 Watch: Add timestamps to the cached messages
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1333 726aef4b-f618-498e-8847-2d620e286838
2009-01-16 11:36:27 +00:00
psychon c44d3f1751 Use RTLD_NOW instead of RTLD_LAZY when dlopen()ing modules
Now a module with unresolved symbols will fail to load instead of
potentially getting ZNC killed when an undefined symbol was used.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1332 726aef4b-f618-498e-8847-2d620e286838
2009-01-15 18:56:36 +00:00
psychon 2efea2157a webadmin: reload global modules whose settings were changed
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1331 726aef4b-f618-498e-8847-2d620e286838
2009-01-14 15:17:30 +00:00
psychon 6e880c5930 Remove maxlength="16" from the password input boxes in webadmin
This lead to silently truncated passwords which made logins a no-go.

Thanks to Julian for finding this one.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1330 726aef4b-f618-498e-8847-2d620e286838
2009-01-13 17:10:05 +00:00
silverleo 45ae051e58 Move SetArgs above the OnLoad module calls so a module can reset the args.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1329 726aef4b-f618-498e-8847-2d620e286838
2009-01-12 16:15:29 +00:00
psychon a5f6bc3668 Makefile: Use @includedir@ instead of @prefix@/include
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1328 726aef4b-f618-498e-8847-2d620e286838
2009-01-12 16:02:20 +00:00
psychon abc0cf82c5 Handle JOIN redirects due to +L
Without this, ZNC would keep trying to join the channel which is full
and which caused the redirect.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1327 726aef4b-f618-498e-8847-2d620e286838
2009-01-11 08:47:27 +00:00
psychon 7cb4c3fcc3 Some updates to the README file
The biggest change is that it now knows that rehashing is possible
and that we have a module data directory.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1326 726aef4b-f618-498e-8847-2d620e286838
2009-01-10 10:12:10 +00:00
psychon 9a3ff5f851 Update channel buffers for detached channels
Now ZNC produces a normal buffer playback if you re-attach a detached channel.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1325 726aef4b-f618-498e-8847-2d620e286838
2009-01-09 17:22:15 +00:00
psychon a3169af5bd Add CUtils::SaltedHash() for doing salted hashes and do some cleanup
The stuff in CUtils::GetHashPass() and CUtils::GetSaltedHashPass() shouldn't
hurt, since we don't do such stuff in other places for passwords either.

This should improve the readability of the code a lot.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1324 726aef4b-f618-498e-8847-2d620e286838
2009-01-08 15:57:32 +00:00
psychon efcbf7884f Always allow /msg *status setbuffer <chan>, even if we are not in <chan>
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1323 726aef4b-f618-498e-8847-2d620e286838
2009-01-07 17:38:49 +00:00
psychon f5eff8196f Make CString::Trim*() faster
Before, they would remove one character at a time.
Now they do everything at once.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1322 726aef4b-f618-498e-8847-2d620e286838
2009-01-06 09:43:18 +00:00
psychon 9933ba9c3e Use CString::TrimRight() to make this code more readable
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1321 726aef4b-f618-498e-8847-2d620e286838
2009-01-05 11:45:12 +00:00
psychon 607a7f1c16 Get rid of most strtoul() and atoi() calls and use CString's features instead
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1320 726aef4b-f618-498e-8847-2d620e286838
2009-01-04 10:48:02 +00:00
psychon cae48ab256 Add back substitute for @VERSION@ to configure
znc-config.in wants @VERSION@ and should also get it.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1319 726aef4b-f618-498e-8847-2d620e286838
2009-01-03 09:55:21 +00:00
psychon 36505a8d29 access() is evil and we never want a controlling TTY
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1318 726aef4b-f618-498e-8847-2d620e286838
2009-01-02 17:48:20 +00:00
psychon 08ad0291ea Happy New Year 2009 everyone!
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1317 726aef4b-f618-498e-8847-2d620e286838
2009-01-01 12:22:21 +00:00
psychon 69279c516e Use fchmod() instead of chmod() if the file is already open
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1316 726aef4b-f618-498e-8847-2d620e286838
2008-12-31 14:34:55 +00:00
silverleo 3538290068 Show client IP in debug when username is not available.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1315 726aef4b-f618-498e-8847-2d620e286838
2008-12-31 13:49:29 +00:00
silverleo d84b9c6e9e Add OnUnknownUserRaw() global module call.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1314 726aef4b-f618-498e-8847-2d620e286838
2008-12-31 12:22:38 +00:00
silverleo d6525a8efe Fixed awaynick so it doesnt evaluate the awaynick multiple times. Also fixed a timer problem if the client disconnected before the backnicktimer fired.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1313 726aef4b-f618-498e-8847-2d620e286838
2008-12-30 23:17:50 +00:00
silverleo e16f744ed8 Allow custom compiler flags for znc-buildmod via environment variables. Patch from flakes.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1312 726aef4b-f618-498e-8847-2d620e286838
2008-12-30 18:49:47 +00:00
psychon b7f38c4d4a Remove some code duplications and move functions into classes
This removes ReadFile(), WriteFile(), ReadLine(), Lower() and Upper() from
Utils.h and adds CFile::ReadFile().

The biggest part of this patch fixes modules to use CFile and CString instead
of these global functions.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1311 726aef4b-f618-498e-8847-2d620e286838
2008-12-30 13:05:04 +00:00