Commit Graph

1444 Commits

Author SHA1 Message Date
psychon
4e767b3ea7 Make CFile::Seek() take an off_t as param, not an unsigned long
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1458 726aef4b-f618-498e-8847-2d620e286838
2009-03-31 07:34:42 +00:00
psychon
eb0d9d439e Some changes to the code rewriting znc.conf
Added some error checking and fixes a bug where the exclusive lock we use on
the config file was removed. This was because we made the kernel allocate a
new inode for the config while our lock was still on the old version of the
config file. This should now be fixed.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1457 726aef4b-f618-498e-8847-2d620e286838
2009-03-30 18:28:09 +00:00
psychon
a6300e37fa Some more const_iterator instead of iterator
Thanks KiNgMaR again.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1456 726aef4b-f618-498e-8847-2d620e286838
2009-03-30 14:42:03 +00:00
psychon
57341209cb The "isSSL" param to some CSockManager functions should be a boolean
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1455 726aef4b-f618-498e-8847-2d620e286838
2009-03-30 09:36:26 +00:00
psychon
fa285b7cf9 Switch some more CFile members to more appropriate return types
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1454 726aef4b-f618-498e-8847-2d620e286838
2009-03-30 09:03:54 +00:00
psychon
5eed1f43b8 Change the return type of CFile::Get*Time() to time_t, which is more correct
Thanks to KiNgMaR for the patch.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1453 726aef4b-f618-498e-8847-2d620e286838
2009-03-30 08:27:23 +00:00
psychon
cfdf299ae4 Remove some unneeded stuff from the --makeconf code
The ".so" suffix was already stripped in GetAvailableMods().


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1452 726aef4b-f618-498e-8847-2d620e286838
2009-03-29 16:25:17 +00:00
psychon
8429f1274f autoop: Use const_iterator instead of iterator where it makes sense
Thanks to KiNgMaR for the patch.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1451 726aef4b-f618-498e-8847-2d620e286838
2009-03-29 12:23:59 +00:00
psychon
931701d19c Remove some unneeded "using" directives from Template.h
Template.h directly includes Utils.h which already does these


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1450 726aef4b-f618-498e-8847-2d620e286838
2009-03-29 12:17:29 +00:00
psychon
fef58e6ebe Move the iostream stuff and some "using" from main.h into Utils.h
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1449 726aef4b-f618-498e-8847-2d620e286838
2009-03-29 12:12:34 +00:00
psychon
621046287b Increase the version number to 0.069
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1448 726aef4b-f618-498e-8847-2d620e286838
2009-03-29 11:43:35 +00:00
psychon
725170ac46 Increase the version number to 0.068
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1446 726aef4b-f618-498e-8847-2d620e286838
znc-0.068
2009-03-29 11:41:27 +00:00
psychon
0f52550e09 Add defines.h for Csocket and make Csocket use ZNC's DEBUG()
This adds a new file defines.h and moves all the Csocket specific stuff from
main.h into this new file.

Then this makes Csocket use ZNC's DEBUG() macro for its debug output which
means this can now also be enabled by running znc --debug.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1445 726aef4b-f618-498e-8847-2d620e286838
2009-03-25 17:56:29 +00:00
psychon
9a2e17c657 Update to latest Csocket
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1444 726aef4b-f618-498e-8847-2d620e286838
2009-03-25 15:38:11 +00:00
psychon
230a556dc9 Use -D instead of -g as a short form for --debug
This also cleans up some minor #ifdef for the initial value for bForeground.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1443 726aef4b-f618-498e-8847-2d620e286838
2009-03-24 18:50:11 +00:00
psychon
d31c7dcd86 Add znc --debug / znc -g
This enables the debug output you get with --enable-debug on --disable-debug
builds. The behaviour if znc was compiled with --disable-debug isn't changed.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1442 726aef4b-f618-498e-8847-2d620e286838
2009-03-24 18:45:03 +00:00
psychon
42e67be22e Add znc -f / --foreground
This argument makes znc not fork into the background. It has no effect if
configure is called with --enable-debug, znc will always stay in the foreground
in this case.

The hunk at the end of main.cpp is just whitespace stuff. The only difference
in there is that #ifdef _DEBUG #else #endif is changed into
if (bForeground) { } else { } (which makes this whitespace stuff necessary).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1441 726aef4b-f618-498e-8847-2d620e286838
2009-03-24 12:03:51 +00:00
sebastinas
dcc49f9c6f Admin module: some cosmetic fixes
Use ToUInt to convert the string, since we're actually using an
unsigned integer. And use ToBool for consistency.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1440 726aef4b-f618-498e-8847-2d620e286838
2009-03-23 20:43:11 +00:00
psychon
5475361404 Fix some compiler warnings with -Wmissing-declarations
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1439 726aef4b-f618-498e-8847-2d620e286838
2009-03-23 15:26:26 +00:00
psychon
f991274789 Fix a crash bug with recursion in module calls
This was found via partyline and notify_connect. notify_connect calls
CZNC::Broadcast() in OnClientLogin() which calls the OnBroadcast() module call.
When returning from this module calls, m_pUser and m_pClient was reset to NULL
and all the following modules got their OnClientLogin() called with m_pUser and
m_pClient set to NULL.

This patch fixes this by resetting those vars to their old values instead to
NULL when returning from a module call.

This patch also fixes the bug that m_pUser and m_pClient in modules were reset
to NULL after they caused a module call which called back into the current
module. The fix looks similar to the other one (this one is the Modules.h part).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1438 726aef4b-f618-498e-8847-2d620e286838
2009-03-22 19:05:34 +00:00
silverleo
766d775f43 Remove some useless tags from a non-tty output.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1437 726aef4b-f618-498e-8847-2d620e286838
2009-03-22 14:41:04 +00:00
psychon
27a51fcec7 Some minor stuff, again found via icc's "remarks"
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1436 726aef4b-f618-498e-8847-2d620e286838
2009-03-21 09:32:50 +00:00
psychon
860ccb7dec Remove/fix some dead code
All of this was found via warnings ("remarks") from icc.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1435 726aef4b-f618-498e-8847-2d620e286838
2009-03-20 10:00:31 +00:00
psychon
e64b2549f5 Change CZNC::Loop()'s return type to void
CZNC::Loop() never returns a value, the only way it can return is through
some throws (e.g. for restart or shutdown).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1434 726aef4b-f618-498e-8847-2d620e286838
2009-03-19 16:25:33 +00:00
imaginos
27169de501 fixed bug in wrong iterator increment that causes infinite loop
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1433 726aef4b-f618-498e-8847-2d620e286838
2009-03-18 23:55:56 +00:00
psychon
e51189ea43 Get rid of znc.conf-backup
The old code created a copy of the config file before writing a new version.
This backup is now gone.

With this patch the config is written to a temporary file znc.conf~ and then
fsync()d to make sure the data safely is on the disk. Then the real config file
znc.conf is overwritten with this temporary file via a rename() call.

This should be safer than the old way, plus it gets rid of a unneeded file.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1432 726aef4b-f618-498e-8847-2d620e286838
2009-03-18 15:45:43 +00:00
psychon
f618ce2a8d Add CFile::Sync()
This adds a simple wrapper for fsync() to CFileUtils.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1431 726aef4b-f618-498e-8847-2d620e286838
2009-03-18 15:40:05 +00:00
psychon
32ffc2b3d5 Move the saslauth copyright notice back into saslauth.cpp
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1430 726aef4b-f618-498e-8847-2d620e286838
2009-03-16 11:59:36 +00:00
psychon
48cb1b6cc6 Remove a pretty much useless usleep() on shutdown
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1429 726aef4b-f618-498e-8847-2d620e286838
2009-03-15 07:44:07 +00:00
psychon
5346cb5dd4 Fix an implicit (CFile *) false (this should have been NULL for sure)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1428 726aef4b-f618-498e-8847-2d620e286838
2009-03-14 18:17:42 +00:00
psychon
a743dd248e Makefile: Add -Wno-redundant-decls to modperlFLAGS
While experimenting with some warning flags I found another one which breaks
the perl headers. This warning is triggered by code like this:

 void bla();
 void bla();

Sadly, the perl headers do this for some weird reason :(


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1427 726aef4b-f618-498e-8847-2d620e286838
2009-03-14 14:48:26 +00:00
psychon
599aba7428 Regenerate configure with the newer autoconf 2.63 (was 2.61 before)
This removes svn:eol-style from configure since it now contains
this in line 4122 (\r is a literal mac line ending):
 ac_cr='\r'
This confused subversion. Bad svn, bad!


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1426 726aef4b-f618-498e-8847-2d620e286838
2009-03-14 11:12:18 +00:00
silverleo
28b23955b4 Added raw 432 processing for illegal and erroneous nicks and changed the condition to trigger SendAltNick() since ircds like to interpret the standards.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1425 726aef4b-f618-498e-8847-2d620e286838
2009-03-13 17:24:36 +00:00
sebastinas
accd7b26cc My bad. Fixed the build error.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1424 726aef4b-f618-498e-8847-2d620e286838
2009-03-11 21:11:58 +00:00
sebastinas
b170c83808 Admin module: added 'Set Password'
The admin module is now able to set a user's password. Furthermore
fixed a bug if now username was specified for the 'Get' or 'Set'
command.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1423 726aef4b-f618-498e-8847-2d620e286838
2009-03-11 19:24:30 +00:00
sebastinas
166d98c05e Fix for CSmartPtr::GetCount
Since CSmartPtr::GetCount returns a pointer to unsigned int it's
possible to manually change the reference count from outside.
Increasing the reference count will result in a memory leak and
decreasing will produce undefined behaviour.

GetCount now returns a pointer to const unsigned int to fix this.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1422 726aef4b-f618-498e-8847-2d620e286838
2009-03-11 14:32:12 +00:00
prozacx
0a96b3d223 Pulled in changes for CSmartPtr which include GetClientCount(), operator bool(), and ability to Attach() to NULL pointers
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1421 726aef4b-f618-498e-8847-2d620e286838
2009-03-10 19:36:24 +00:00
psychon
bcf072e3cc Check if the version of a module matches when querying info about it
When the module was compiled for a wrong ZNC version it's description will
say so. Everything which displays a list of available modules together with
their description will display this (--makeconf, /msg *status listavailmods,
webadmin).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1420 726aef4b-f618-498e-8847-2d620e286838
2009-03-10 19:15:08 +00:00
psychon
c30b9a240f Meh. Today is not a good day -.-
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1419 726aef4b-f618-498e-8847-2d620e286838
2009-03-09 17:42:12 +00:00
psychon
c3e4a7a1e7 Add /msg *status UpdateMod[ule] which reloads an user module on all users
This command allows admins to really reload a module when they have updated it.
Because the dynamic linker does not really reload a shared object until all
handles to this object where dlclose()'d, this new command is necessary.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1418 726aef4b-f618-498e-8847-2d620e286838
2009-03-09 17:37:35 +00:00
psychon
994da49638 Remove a mostly unused flag from CModInfo
Nobody cares if a module is found in ~/.znc/modules or in /usr/lib/znc/, right?


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1417 726aef4b-f618-498e-8847-2d620e286838
2009-03-09 17:21:01 +00:00
psychon
d66698e993 Fix my previous commit and also display the remote IP for the failed login
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1416 726aef4b-f618-498e-8847-2d620e286838
2009-03-07 12:44:11 +00:00
psychon
0015098ab3 Always notify the user when someone else tried to login but was rejected
Before this, you only got a message from *status when someone tried to login
with a bad password and no auth module (imapauth/saslauth) was loaded.
With this patch every failed login will generate a message.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1415 726aef4b-f618-498e-8847-2d620e286838
2009-03-07 12:37:38 +00:00
silverleo
f52f4b2746 watch: Removed a bit too much in r1413.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1414 726aef4b-f618-498e-8847-2d620e286838
2009-03-07 11:24:34 +00:00
silverleo
036a140290 watch: Save the module settings as soon as they are changed.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1413 726aef4b-f618-498e-8847-2d620e286838
2009-03-07 11:16:28 +00:00
psychon
e21afe5346 webadmin: Restrict skins to be located inside the skins dir
One needs to be admin to change the current skin dir, but it still sounds
like a good idea to be careful...
Plus, this wont deny symlinks anyway!


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1412 726aef4b-f618-498e-8847-2d620e286838
2009-03-06 14:24:47 +00:00
silverleo
824afde47b Change the default Join Tries from unlimited to 10 to prevent join floods when a user can't join a channel.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1411 726aef4b-f618-498e-8847-2d620e286838
2009-03-06 13:30:09 +00:00
sebastinas
20bbdee968 Fix some weird behavior in CString::Base64Decode and wrapped strings
With the current implementation of CString::Base64Decode the following
code would fail (meaning b would be false):

    CString t = "some very long string ...";
    bool b = (t == t.Base64Encode_n(true).Base64Decode_n());

The same code without wrapping the base64 output would give b = true
as expected.

The new implementation removes all new lines before decoding so
decoding a wrapped base64 text gives the expected result.

Furthermore replaced malloc and free with new and delete and removed
the check for p in CString::Base64Encode since new will throw if it
failed.

The changes don't affect any existing code.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1410 726aef4b-f618-498e-8847-2d620e286838
2009-03-04 18:20:08 +00:00
sebastinas
812526278a Swap some lines in CHTTPSock::ReadLine
Copying sData and trimming it can be omitted if the function is left
because m_bGotHeader is true.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1409 726aef4b-f618-498e-8847-2d620e286838
2009-03-04 18:19:29 +00:00
psychon
a938666602 HTTPSock: Remove some code which makes no sense
Thanks to sebastinas


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1408 726aef4b-f618-498e-8847-2d620e286838
2009-03-03 17:10:52 +00:00