]> jfr.im git - irc/rizon/znc.git/log
irc/rizon/znc.git
15 years agoAdd a 'ShowMOTD' command to *status and reorder 'HELP' output
psychon [Thu, 28 Aug 2008 10:47:01 +0000 (10:47 +0000)] 
Add a 'ShowMOTD' command to *status and reorder 'HELP' output

ShowMOTD is now close to the other MOTD commands which only admins can access.
The old 'MOTD' is still available, but the help doesn't mention it anymore in
favor of 'MOTD'.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1175 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdd '/msg *status restart'
psychon [Wed, 27 Aug 2008 14:44:04 +0000 (14:44 +0000)] 
Add '/msg *status restart'

Thanks to kroimon for the patch.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1174 726aef4b-f618-498e-8847-2d620e286838

15 years agoSome changes to CZNC::WriteNewConfig (znc --makeconf)
psychon [Tue, 26 Aug 2008 13:54:17 +0000 (13:54 +0000)] 
Some changes to CZNC::WriteNewConfig (znc --makeconf)

I think this is intended to make this more user-friendly. If it is not, well
I think this patch does exactly this, so what?

Thanks to kroimon for the patch.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1173 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdd some proper cleanup to some places in main()
psychon [Mon, 25 Aug 2008 14:46:22 +0000 (14:46 +0000)] 
Add some proper cleanup to some places in main()

This adds a bunch of 'delete pZNC', turns some exit()s into returns
and does some whitespace fun.

kroimon (partly) gets the kudos for this, too.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1172 726aef4b-f618-498e-8847-2d620e286838

15 years agoDon't start a new process for starting znc after --makeconf
psychon [Mon, 25 Aug 2008 14:42:11 +0000 (14:42 +0000)] 
Don't start a new process for starting znc after --makeconf

The code now just falls through to the normal bootup code.

Thanks to kroimon for this idea and also for writing this patch.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1171 726aef4b-f618-498e-8847-2d620e286838

15 years agoMove some code around
psychon [Mon, 25 Aug 2008 14:39:06 +0000 (14:39 +0000)] 
Move some code around

No actual changes in here, just some preparation.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1170 726aef4b-f618-498e-8847-2d620e286838

15 years agoUse the new CModule::PutModule(const CTable&) in various modules
psychon [Sun, 24 Aug 2008 12:51:04 +0000 (12:51 +0000)] 
Use the new CModule::PutModule(const CTable&) in various modules

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1169 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdd a new function CModule::PutModule(const CTable&)
psychon [Sun, 24 Aug 2008 12:49:40 +0000 (12:49 +0000)] 
Add a new function CModule::PutModule(const CTable&)

This function displays a CTable via PutModule(), something that is often
needed. The function returns the number of lines displayed.

The idea for this function is from the user-contributed admin module
by Sebastian Ramacher. Thanks.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1168 726aef4b-f618-498e-8847-2d620e286838

15 years agoMove some common code in main() in front of all those if()s
psychon [Sun, 24 Aug 2008 10:41:01 +0000 (10:41 +0000)] 
Move some common code in main() in front of all those if()s

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1167 726aef4b-f618-498e-8847-2d620e286838

15 years agoUnify some of the preprocessor macros in Modules.cpp
psychon [Sun, 24 Aug 2008 06:25:11 +0000 (06:25 +0000)] 
Unify some of the preprocessor macros in Modules.cpp

The only difference between MODUNLOADCHK and GLOBALMODCALL and between
MODHALTCHK and GLOBALMODHALTCHK was that the one used CModule while the other
one used CGlobalModule.

Create two new macros that expects the class name as an extra parameter and
make all those other macros just call these two.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1166 726aef4b-f618-498e-8847-2d620e286838

15 years agoDon't check if perl is enabled in modperl
psychon [Sun, 24 Aug 2008 06:19:14 +0000 (06:19 +0000)] 
Don't check if perl is enabled in modperl

The Makefile only compiles this module if it is enabled.
I think it's better to error out if for some reason this doesn't work instead
of silently producing an empty modperl.so.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1165 726aef4b-f618-498e-8847-2d620e286838

15 years agoHandle a theoretically possible 'throw UNLOAD' in CModule::OnLoad()
psychon [Sat, 23 Aug 2008 20:20:36 +0000 (20:20 +0000)] 
Handle a theoretically possible 'throw UNLOAD' in CModule::OnLoad()

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1164 726aef4b-f618-498e-8847-2d620e286838

15 years agoFix FTBFS with CTable on g++ 3
psychon [Sat, 23 Aug 2008 13:24:28 +0000 (13:24 +0000)] 
Fix FTBFS with CTable on g++ 3

g++ 3 doesnt like map<>.at().

This changes how CTable stores its data internally.
This *might* be faster than the older system.

Thanks to kroimon for finding this.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1163 726aef4b-f618-498e-8847-2d620e286838

15 years agoFix some of the direct module calls in Client.cpp
psychon [Fri, 22 Aug 2008 12:48:56 +0000 (12:48 +0000)] 
Fix some of the direct module calls in Client.cpp

OnModCTCP(), OnModCommand() and OnModNotice() are now called through a
preprocessor macro that does all the magic. This fixes a couple of bugs:
- the m_pUser member of global modules for OnModNotice() was wrong
- OnModCTCP() wasn't called for global modules
- Finally handle 'throw UNLOAD' for all of this three module calls

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1162 726aef4b-f618-498e-8847-2d620e286838

15 years agoConnect and reconnect faster to IRC
psychon [Thu, 21 Aug 2008 10:47:09 +0000 (10:47 +0000)] 
Connect and reconnect faster to IRC

The first reconnect now happens when the timer is created which is
possibly thanks to latest Csocket.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1161 726aef4b-f618-498e-8847-2d620e286838

15 years agoSome cleanup and optimizations to CTable
psychon [Wed, 20 Aug 2008 08:13:23 +0000 (08:13 +0000)] 
Some cleanup and optimizations to CTable

CTable now caches the width of each column instead of recalculating it
each time it is needed. The code for this was there before, but it was not
used. Now the widths are calculated when the table is filled, not when the
width is needed the first time.

This caching leads to a huge speedup (3-4 times faster) if there are many rows
in the table.

This also cleans up the interface by making it possible to mark
GetColumnWidth and GetLine as const.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1160 726aef4b-f618-498e-8847-2d620e286838

15 years agoUpdate to latest Csocket
psychon [Mon, 18 Aug 2008 11:10:27 +0000 (11:10 +0000)] 
Update to latest Csocket

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1159 726aef4b-f618-498e-8847-2d620e286838

15 years agochanging data types back to proper notation, and down cast the array passed in
imaginos [Sun, 17 Aug 2008 18:46:43 +0000 (18:46 +0000)] 
changing data types back to proper notation, and down cast the array passed in

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1158 726aef4b-f618-498e-8847-2d620e286838

15 years agoremove const keywords for perl's sake
imaginos [Sun, 17 Aug 2008 18:02:09 +0000 (18:02 +0000)] 
remove const keywords for perl's sake

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1157 726aef4b-f618-498e-8847-2d620e286838

15 years agofix arg to PERL_SYS_INIT3
imaginos [Sun, 17 Aug 2008 17:48:18 +0000 (17:48 +0000)] 
fix arg to PERL_SYS_INIT3

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1156 726aef4b-f618-498e-8847-2d620e286838

15 years agobug fix as reported by http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=495076, still...
imaginos [Sun, 17 Aug 2008 14:53:18 +0000 (14:53 +0000)] 
bug fix as reported by http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=495076, still needs to be tested

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1155 726aef4b-f618-498e-8847-2d620e286838

15 years agoFix a bug where ZNC always thought all channels where empty
psychon [Thu, 24 Jul 2008 18:49:52 +0000 (18:49 +0000)] 
Fix a bug where ZNC always thought all channels where empty

Due to the recent change that ZNC calls SetIsOn(true) when we receive the JOIN,
not the 'end of names' reply, the nick list of a channel was always ignored.
This fixes this bug.

Thanks to cnu for using a svn version and reporting this bug. :)

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1154 726aef4b-f618-498e-8847-2d620e286838

15 years agoFix the keepnick module
psychon [Thu, 24 Jul 2008 11:54:26 +0000 (11:54 +0000)] 
Fix the keepnick module

- Properly initialize that pointer-beast.
- Actually compile.

Yeah, I know, I fail...

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1153 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdd a new module that implements KeepNick
psychon [Thu, 24 Jul 2008 11:36:30 +0000 (11:36 +0000)] 
Add a new module that implements KeepNick

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1152 726aef4b-f618-498e-8847-2d620e286838

15 years agoRemove KeepNick
psychon [Thu, 24 Jul 2008 11:34:11 +0000 (11:34 +0000)] 
Remove KeepNick

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1151 726aef4b-f618-498e-8847-2d620e286838

15 years agoMove CClient's UserCommand() and HelpUser() into a new file ClientCommand.cpp
psychon [Thu, 24 Jul 2008 10:38:24 +0000 (10:38 +0000)] 
Move CClient's UserCommand() and HelpUser() into a new file ClientCommand.cpp

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1150 726aef4b-f618-498e-8847-2d620e286838

15 years agoHandle the on-connect 433 in an own function
psychon [Thu, 24 Jul 2008 10:34:15 +0000 (10:34 +0000)] 
Handle the on-connect 433 in an own function

When our primary nick is already taken, we try a couple of different nicks in
order to be able to connect to the IRC server. This code is now in an
own function.

BTW: CIRCSock::Readline() is still waaay too long.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1149 726aef4b-f618-498e-8847-2d620e286838

15 years agoMove the forwarding of raw 353 into an own function
psychon [Thu, 24 Jul 2008 10:22:17 +0000 (10:22 +0000)] 
Move the forwarding of raw 353 into an own function

This also contains some minor changes to the code. One of those is that we now
also handle namesx and uhnames for channels we don't know.
BTW: CIRCSock::ReadLine() is waaay too long.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1148 726aef4b-f618-498e-8847-2d620e286838

15 years agomodperl: Fail if modperl.pm can not be loaded
psychon [Thu, 24 Jul 2008 10:16:52 +0000 (10:16 +0000)] 
modperl: Fail if modperl.pm can not be loaded

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1147 726aef4b-f618-498e-8847-2d620e286838

15 years agoRemove some unused arguments and unimplemented functions
psychon [Thu, 24 Jul 2008 10:14:41 +0000 (10:14 +0000)] 
Remove some unused arguments and unimplemented functions

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1146 726aef4b-f618-498e-8847-2d620e286838

15 years agoEven more weird and broken clients sending even more and broken stuff
psychon [Wed, 23 Jul 2008 15:05:35 +0000 (15:05 +0000)] 
Even more weird and broken clients sending even more and broken stuff

PART :#channel... Why do IRCds even parse this correctly? :(
Oh and yeah, it's eggdrop.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1145 726aef4b-f618-498e-8847-2d620e286838

15 years agoSome weird clients might send a nickmask prefix, handle this correctly
psychon [Wed, 23 Jul 2008 13:36:04 +0000 (13:36 +0000)] 
Some weird clients might send a nickmask prefix, handle this correctly

*cough* eggdrop is evil *cough*

Thanks to dare for debugging this.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1144 726aef4b-f618-498e-8847-2d620e286838

15 years agoSimplify the connect user code a little
psychon [Tue, 22 Jul 2008 11:34:38 +0000 (11:34 +0000)] 
Simplify the connect user code a little

The old code used a timer. That timer needed to be restarted if the user list
was changed (adding / removing of users), because it saved an iterator into
that map between runs, which would become invalid.

The new code in CConnectUserTimer::RunJob() is actually more complicated now,
but the iterator is gone. This also means no need to restart that timer
more or less always. ;) (This also means one theoretical source of bugs less)

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1143 726aef4b-f618-498e-8847-2d620e286838

15 years agoawaynick: Disable KeepNick on load instead of failing to load
psychon [Tue, 22 Jul 2008 08:39:18 +0000 (08:39 +0000)] 
awaynick: Disable KeepNick on load instead of failing to load

This should make someone in #znc really happy. :P
This is based on a patch from SilverLeo.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1142 726aef4b-f618-498e-8847-2d620e286838

15 years agopartyline: Some fixes for users who are not connected to IRC
psychon [Mon, 21 Jul 2008 13:58:24 +0000 (13:58 +0000)] 
partyline: Some fixes for users who are not connected to IRC

This was found via default channels (LoadModule = partyline ~#chan).

- Always use a valid (=non-empty) server name
- If a user is not connected to IRC, all clients might have a different idea of
  the current nick. Handle this for SendNickList() via a new function
  PutUserIRCNick() that uses the irc nick if we are connected to IRC and else
  correctly uses the nick that clients thinks it curretnly has.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1141 726aef4b-f618-498e-8847-2d620e286838

15 years agoWe are in a channel when we received the JOIN for it, not it's "end of /names"
psychon [Mon, 21 Jul 2008 10:15:16 +0000 (10:15 +0000)] 
We are in a channel when we received the JOIN for it, not it's "end of /names"

This moves some calls from the raw 366 handler to the JOIN handler and it might
even fix a bug (well, which no one would ever have triggered).

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1140 726aef4b-f618-498e-8847-2d620e286838

15 years agoMake webadmin generate salted passwords, too
psychon [Sun, 20 Jul 2008 15:06:33 +0000 (15:06 +0000)] 
Make webadmin generate salted passwords, too

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1139 726aef4b-f618-498e-8847-2d620e286838

15 years agoEnable some more debug flags with --enable-debug
psychon [Fri, 18 Jul 2008 09:37:11 +0000 (09:37 +0000)] 
Enable some more debug flags with --enable-debug

See these links for info on these defines:
 http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch29.html
 http://gcc.gnu.org/onlinedocs/libstdc++/manual/debug_mode.html

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1138 726aef4b-f618-498e-8847-2d620e286838

15 years agoDon't throw any exceptions in CModules::LoadModule() on version mismatch
psychon [Thu, 17 Jul 2008 12:01:44 +0000 (12:01 +0000)] 
Don't throw any exceptions in CModules::LoadModule() on version mismatch

This also removes all the code catching those exceptions. There was nothing
which justified these exceptions and removing them doesn't hurt.

ByeBye CException::EX_BadModVersion

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1137 726aef4b-f618-498e-8847-2d620e286838

15 years agoShell module: Don't give any stdin to executed apps
psychon [Thu, 17 Jul 2008 10:30:32 +0000 (10:30 +0000)] 
Shell module: Don't give any stdin to executed apps

We now close the write end of the pipe that serves as stdin for the apps
we run. This means that any read attempts will return EOD (read() returns 0)
which should hopefully tell our apps that we don't have stdin for them.
Sadly vim doesn't care... (Only thing I tested that still broke)

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1136 726aef4b-f618-498e-8847-2d620e286838

15 years agoShell module: Small cleanup
psychon [Thu, 17 Jul 2008 10:16:40 +0000 (10:16 +0000)] 
Shell module: Small cleanup

We already have a special function for stripping of special chars, so
why does the shell module still do it 'by hand'?

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1135 726aef4b-f618-498e-8847-2d620e286838

15 years agoMake CClient::GetNickMask() always return a valid nickmask
psychon [Mon, 14 Jul 2008 10:44:37 +0000 (10:44 +0000)] 
Make CClient::GetNickMask() always return a valid nickmask

The recent removal of CUser::m_bIRCConnected lead to a bug here which is now
fixed.
In addition to this, this function now also works properly for users without
a vhost.

Oh and in User.cpp: Make sure CUser::GetIRCServer() returns an empty string
when we are no longer connected to an IRCd.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1134 726aef4b-f618-498e-8847-2d620e286838

15 years agoFix a potential crash bug on channel part (CChan::RemNick())
psychon [Mon, 14 Jul 2008 10:42:27 +0000 (10:42 +0000)] 
Fix a potential crash bug on channel part (CChan::RemNick())

This function didn't properly check it had a valid iterator *before* using
this iterator (.begin()->second).

Now we first check if that iterator is valid (size() is *not* zero) before we
run this. No behaviour is changed, but the bug is gone. Yay. ;)

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1133 726aef4b-f618-498e-8847-2d620e286838

15 years agoReplace usage of getresuid() with getuid() and geteuid()
psychon [Mon, 14 Jul 2008 08:58:54 +0000 (08:58 +0000)] 
Replace usage of getresuid() with getuid() and geteuid()

getresuid() is a non-standard extension and is actually not defined on
some (older) boxes. Since we gain nothing with also checking the saved user id,
we can use this instead and, voila, znc compiles again.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1132 726aef4b-f618-498e-8847-2d620e286838

15 years agoRemove CUser::m_bIRCConnected
psychon [Mon, 14 Jul 2008 08:19:57 +0000 (08:19 +0000)] 
Remove CUser::m_bIRCConnected

CUser::GetIRCSock() != NULL is the replacement. This is a small chance in
sematics. Before this, a user only counted as connected to IRC when the 001
numeric was received. Now it already counts as connected when the connection
was established. This change doesn't hurt any of the current users of
CUser::IsIRCConnected() and so this change should be fine.

Yay, one var less ;)

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1131 726aef4b-f618-498e-8847-2d620e286838

15 years agoCUser::GetIRCSock() only returns a member var, so it can be moved to the header
psychon [Mon, 14 Jul 2008 08:16:43 +0000 (08:16 +0000)] 
CUser::GetIRCSock() only returns a member var, so it can be moved to the header

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1130 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdd some 'const' attributes to various functions
psychon [Mon, 14 Jul 2008 08:13:06 +0000 (08:13 +0000)] 
Add some 'const' attributes to various functions

No real changes in here, only way more constness...

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1129 726aef4b-f618-498e-8847-2d620e286838

15 years agoFix CUser::Clone() to work with salted passwords
psychon [Sun, 13 Jul 2008 16:25:53 +0000 (16:25 +0000)] 
Fix CUser::Clone() to work with salted passwords

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1128 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdd supports for salted hashes to znc.conf
psychon [Sun, 13 Jul 2008 15:32:27 +0000 (15:32 +0000)] 
Add supports for salted hashes to znc.conf

These changes the format of the 'Pass' config option. The old format is
still accepted. The new format is:

  Pass = plain#<plain text password>
  Pass = md5#<password hash>
  Pass = md5#<hash of password with salt appended>#<salt>#

This also makes ZNC only write configs in the new format.

znc --makeconf and znc --makepass now always generate salted hashes.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1127 726aef4b-f618-498e-8847-2d620e286838

15 years agoznc-config: Don't link in any libraries
psychon [Sat, 12 Jul 2008 21:43:47 +0000 (21:43 +0000)] 
znc-config: Don't link in any libraries

Any library the znc binary links to is automatically available to modules.
So there is no point in linking modules to @LIBS@ as znc is linked against
those already. modules/Makefile.in already does it this way, not also
znc-config does it

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1126 726aef4b-f618-498e-8847-2d620e286838

15 years ago__GNU_LIBRARY__ doesn't seem to be needed on FreeBSD
psychon [Sat, 12 Jul 2008 07:26:56 +0000 (07:26 +0000)] 
__GNU_LIBRARY__ doesn't seem to be needed on FreeBSD

This defines was added in rev 586 saying it's needed for 'older BSD boxes'.
I don't know how old 'old' is in this context, but since we don't compile
on FreeBSD 4 anyway (which really is old), because getopt_long is missing
(added in FreeBSD 5), we should give this a try.

I have no FreeBSD 5 box for testing if znc compiled/compiles there, so
suprise me!

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1125 726aef4b-f618-498e-8847-2d620e286838

15 years agoConfig reading: Apply a small (unnoticeable) optimization
psychon [Fri, 11 Jul 2008 09:58:04 +0000 (09:58 +0000)] 
Config reading: Apply a small (unnoticeable) optimization

Trim() always removes all trailing and leading spaces and line endings from
that string, so there is no point in this main loop. It will always run once,
anyway.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1124 726aef4b-f618-498e-8847-2d620e286838

15 years agoIncrease the version number to 0.058
psychon [Thu, 10 Jul 2008 13:14:14 +0000 (13:14 +0000)] 
Increase the version number to 0.058

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1122 726aef4b-f618-498e-8847-2d620e286838

15 years agoIncrease the version number to 0.058 znc-0.058
psychon [Thu, 10 Jul 2008 13:11:50 +0000 (13:11 +0000)] 
Increase the version number to 0.058

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1120 726aef4b-f618-498e-8847-2d620e286838

15 years agoPlease just ignore this commit and pretend the previous commit already did this
psychon [Tue, 8 Jul 2008 10:24:48 +0000 (10:24 +0000)] 
Please just ignore this commit and pretend the previous commit already did this

I'm ashamed...

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1119 726aef4b-f618-498e-8847-2d620e286838

15 years agoFix a crash with NAMESX
psychon [Tue, 8 Jul 2008 10:00:42 +0000 (10:00 +0000)] 
Fix a crash with NAMESX

If we were joining a channel on a server with NAMESX support while a client was
connected that didn't know NAMESX and we received a raw 353 with a trailing
whitespace (UnrealIRCd does this), we were calling std::string::at(0) for an
empty string, which caused some assert to fail and ZNC to die.

This patch fixes this crash bug.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1118 726aef4b-f618-498e-8847-2d620e286838

15 years agoCIRCSock: Only say we are reconnecting if there is a server to connect to
psychon [Tue, 8 Jul 2008 09:38:50 +0000 (09:38 +0000)] 
CIRCSock: Only say we are reconnecting if there is a server to connect to

If you '/msg *status delserver'd your last server, you would get a message
saying ZNC will reconnect, but it didn't. Now those messages look much better.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1117 726aef4b-f618-498e-8847-2d620e286838

15 years agowebadmin: Use the new CZNC::AuthUser() API
psychon [Mon, 7 Jul 2008 18:36:26 +0000 (18:36 +0000)] 
webadmin: Use the new CZNC::AuthUser() API

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1116 726aef4b-f618-498e-8847-2d620e286838

15 years agoUse CZNC::Auth() to authenticate IRC clients
psychon [Mon, 7 Jul 2008 18:35:41 +0000 (18:35 +0000)] 
Use CZNC::Auth() to authenticate IRC clients

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1115 726aef4b-f618-498e-8847-2d620e286838

15 years agoUnify some of the webadmin and client authentication code in CZNC::AuthUser()
psychon [Mon, 7 Jul 2008 18:34:32 +0000 (18:34 +0000)] 
Unify some of the webadmin and client authentication code in CZNC::AuthUser()

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1114 726aef4b-f618-498e-8847-2d620e286838

15 years agoFix a privilege escalation bug in webadmin if auth modules are used
psychon [Mon, 7 Jul 2008 18:30:35 +0000 (18:30 +0000)] 
Fix a privilege escalation bug in webadmin if auth modules are used

auth modules = imapauth and saslauth

Some code in CWebAdminSock::OnLogin() is skipped if a module handles auth
and thus m_pUser stays NULL. Most checks for admin rights only check for
m_pUser being NULL and thus any user WHO ALREADY HAS A VALID LOGIN can edit
other users if they know their user name.
(=Change the password of an admin and log in using this info)

One of the major excpeptions are the templates which use m_bAdmin instead of
m_pUser for checking the privieleges, thus users still see the normal pages
and this bug stayed unnoticed for a while.

This patch now moves the code that sets m_pUser to some code which is executed
in both cases, when an auth module is in effect and when one isn't.
(Well, technically this isn't a move, but code duplication, but executing this
 twice won't hurt and one of the follow-up patches cleans this up.)

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1113 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdd the remote ip to the info CAuthBase got
psychon [Mon, 7 Jul 2008 18:24:38 +0000 (18:24 +0000)] 
Add the remote ip to the info CAuthBase got

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1112 726aef4b-f618-498e-8847-2d620e286838

15 years agoMake it more clear where the 'IRCConnectEnabled'-flag is checked
psychon [Thu, 3 Jul 2008 10:16:49 +0000 (10:16 +0000)] 
Make it more clear where the 'IRCConnectEnabled'-flag is checked

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1111 726aef4b-f618-498e-8847-2d620e286838

15 years agoRemove -D_GNU_SOURCE from our CXXFLAGS
psychon [Tue, 1 Jul 2008 09:50:47 +0000 (09:50 +0000)] 
Remove -D_GNU_SOURCE from our CXXFLAGS

This flag was there since the very first version of ZNC and it doesn't
seem to be needed.

Thanks to sohalt (Alexander Graf) for testing this.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1110 726aef4b-f618-498e-8847-2d620e286838

15 years agoCUtils::GetInput(): Kill ZNC if reading from stdin fails
psychon [Sat, 28 Jun 2008 10:26:41 +0000 (10:26 +0000)] 
CUtils::GetInput(): Kill ZNC if reading from stdin fails

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1109 726aef4b-f618-498e-8847-2d620e286838

15 years agoGet PATH_MAX from limits.h
psychon [Sat, 28 Jun 2008 06:23:21 +0000 (06:23 +0000)] 
Get PATH_MAX from limits.h

Up to this point we have assumed that iostream.h gets us PATH_MAX or something.
Really, I dunno, but the assumption was broken...

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1108 726aef4b-f618-498e-8847-2d620e286838

15 years agoDisplay the uptime in a more readable way
psychon [Fri, 27 Jun 2008 09:55:55 +0000 (09:55 +0000)] 
Display the uptime in a more readable way

This adds CString::ToTimeStr() which converts a number of seconds into
a human readable time string.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1107 726aef4b-f618-498e-8847-2d620e286838

15 years agoRemove some unneeded includes from DCCBounce.h
psychon [Fri, 27 Jun 2008 09:27:34 +0000 (09:27 +0000)] 
Remove some unneeded includes from DCCBounce.h

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1106 726aef4b-f618-498e-8847-2d620e286838

15 years agoFix some Doxygen comments
psychon [Fri, 27 Jun 2008 09:26:16 +0000 (09:26 +0000)] 
Fix some Doxygen comments

We don't have much comments and even fewer doxygen comments, but those that
we have should at least be correct.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1105 726aef4b-f618-498e-8847-2d620e286838

15 years agoIndent is tabs, not spaces
psychon [Thu, 26 Jun 2008 08:59:45 +0000 (08:59 +0000)] 
Indent is tabs, not spaces

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1104 726aef4b-f618-498e-8847-2d620e286838

15 years agoThe last commit broke with --disable-openssl *fix*
psychon [Tue, 24 Jun 2008 08:43:51 +0000 (08:43 +0000)] 
The last commit broke with --disable-openssl *fix*

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1103 726aef4b-f618-498e-8847-2d620e286838

15 years agoDon't allow running ZNC as root
psychon [Mon, 23 Jun 2008 17:59:57 +0000 (17:59 +0000)] 
Don't allow running ZNC as root

That is, unless --allow-root is given. In this case we print a big fat warning.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1102 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdd some ExpandString() 'vars'
psychon [Sun, 22 Jun 2008 14:41:51 +0000 (14:41 +0000)] 
Add some ExpandString() 'vars'

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1101 726aef4b-f618-498e-8847-2d620e286838

15 years agoautoattach: Don't allow adding the same entry twice
psychon [Sun, 22 Jun 2008 14:06:01 +0000 (14:06 +0000)] 
autoattach: Don't allow adding the same entry twice

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1100 726aef4b-f618-498e-8847-2d620e286838

15 years agoClean up some includes
psychon [Sat, 21 Jun 2008 11:20:30 +0000 (11:20 +0000)] 
Clean up some includes

We no longer include Csocket.h in main.h because only few files actually need
it. (Only HTTPSock.h and Timers.h)

We also clean up some includes in Timers.h. It didn't actually include
the file it needed.

Oh and this also adds a warning to main.h if PATH_MAX is undefined. If this
happens, it is most likely a bug that needs to be addressed. (some missing
includes, I'd guess)

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1099 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdd and use CZNC::GetUptime() for getting the current uptime in human readable
psychon [Thu, 19 Jun 2008 08:39:10 +0000 (08:39 +0000)] 
Add and use CZNC::GetUptime() for getting the current uptime in human readable

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1098 726aef4b-f618-498e-8847-2d620e286838

16 years agoAdd CZNC::GetVersion()
psychon [Tue, 17 Jun 2008 08:25:04 +0000 (08:25 +0000)] 
Add CZNC::GetVersion()

CZNC::GetVersion() returns something like '0.057-r1234'.

This also cleans up CZNC::GetTag() a little. A theoretical buffer overflow
less and some higher speed is the result.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1097 726aef4b-f618-498e-8847-2d620e286838

16 years agoUse ExpandString() for CTCPReply
psychon [Tue, 17 Jun 2008 08:22:27 +0000 (08:22 +0000)] 
Use ExpandString() for CTCPReply

You can now use 'wildcards' like %nick%, %user%, etc in CTCPReply

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1096 726aef4b-f618-498e-8847-2d620e286838

16 years agoAdd 'Uptime' command to *znc
psychon [Tue, 17 Jun 2008 07:52:56 +0000 (07:52 +0000)] 
Add 'Uptime' command to *znc

ToDo: Use some readable format for displaying the uptime. Seconds just
don't make it.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1095 726aef4b-f618-498e-8847-2d620e286838

16 years agomodules/Makefile.in: $LIBS is unused and should not be used
psychon [Mon, 16 Jun 2008 19:17:05 +0000 (19:17 +0000)] 
modules/Makefile.in: $LIBS is unused and should not be used

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1094 726aef4b-f618-498e-8847-2d620e286838

16 years agoMake --makeconf more clear
psychon [Sat, 14 Jun 2008 16:17:46 +0000 (16:17 +0000)] 
Make --makeconf more clear

This rephrases one of the questions asked and adds a section to the README that
explains two unclear questions.

This patch is based on a patch from Patrick Matthaei from debian.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1093 726aef4b-f618-498e-8847-2d620e286838

16 years agoRemove an unneeded call to CString::Token()
psychon [Wed, 11 Jun 2008 10:06:17 +0000 (10:06 +0000)] 
Remove an unneeded call to CString::Token()

Thanks to x-x for this patch.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1092 726aef4b-f618-498e-8847-2d620e286838

16 years agoAdd man pages for everything installed to <prefix>/bin
psychon [Sun, 8 Jun 2008 17:09:58 +0000 (17:09 +0000)] 
Add man pages for everything installed to <prefix>/bin

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1091 726aef4b-f618-498e-8847-2d620e286838

16 years agoFix the chmod of the perl modules
psychon [Sun, 8 Jun 2008 09:50:50 +0000 (09:50 +0000)] 
Fix the chmod of the perl modules

perl modules (.pm) don't need executable bits...

Thanks to Patrick Mathhaei from debian for this.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1090 726aef4b-f618-498e-8847-2d620e286838

16 years agoFix a bug introduced by SilverLeo :P
psychon [Sun, 8 Jun 2008 09:43:21 +0000 (09:43 +0000)] 
Fix a bug introduced by SilverLeo :P

If a topic was unset, this wasn't forwarded to the client the way it should be.

Thanks to SilverLeo for the patch.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1089 726aef4b-f618-498e-8847-2d620e286838

16 years agocrypt: Fix bug where a usermsg was not forwarded to other clients
psychon [Sun, 8 Jun 2008 09:34:21 +0000 (09:34 +0000)] 
crypt: Fix bug where a usermsg was not forwarded to other clients

Thanks to SilverLeo for this patch.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1088 726aef4b-f618-498e-8847-2d620e286838

16 years agomissing paren in test
imaginos [Sat, 7 Jun 2008 23:35:43 +0000 (23:35 +0000)] 
missing paren in test

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1087 726aef4b-f618-498e-8847-2d620e286838

16 years agoAdd OnUserTopic module call
psychon [Fri, 6 Jun 2008 14:27:57 +0000 (14:27 +0000)] 
Add OnUserTopic module call

Patch by SilverLeo

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1086 726aef4b-f618-498e-8847-2d620e286838

16 years agoAllow the OnTopic module call to modify the topic
psychon [Fri, 6 Jun 2008 14:26:04 +0000 (14:26 +0000)] 
Allow the OnTopic module call to modify the topic

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1085 726aef4b-f618-498e-8847-2d620e286838

16 years agoModule query (like *shell) now uses the module name as prefix, not 'znc'
psychon [Tue, 3 Jun 2008 12:07:49 +0000 (12:07 +0000)] 
Module query (like *shell) now uses the module name as prefix, not 'znc'

This hopefully avoids some ugly stuff. Namely, irssi pretending *status changed
its nick to *shell etc because they have the same ident and host and are in no
common channel.

This patch is based on a patch from SilverLeo. If this breaks it's his fault!

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1084 726aef4b-f618-498e-8847-2d620e286838

16 years agoUse the SA_RESETHAND flag to sigaction()
psychon [Tue, 3 Jun 2008 09:15:11 +0000 (09:15 +0000)] 
Use the SA_RESETHAND flag to sigaction()

Instead of resetting the signal handler back to SIG_DFL on our own, this is
now done automatically for us by the kernel!

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1083 726aef4b-f618-498e-8847-2d620e286838

16 years agoHandle channel CTCP the same way we do for private CTCPs
psychon [Tue, 3 Jun 2008 07:15:52 +0000 (07:15 +0000)] 
Handle channel CTCP the same way we do for private CTCPs

This patch doesn't actually change anything for private CTCPs, it's
only the indentation level that changes! (Well, and that this code gets
its own function...)

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1082 726aef4b-f618-498e-8847-2d620e286838

16 years agoAlso use /etc/passwd if $HOME is set but empty
psychon [Tue, 3 Jun 2008 06:32:18 +0000 (06:32 +0000)] 
Also use /etc/passwd if $HOME is set but empty

Before this, we used ./.znc as datadir in this case. Not good.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1081 726aef4b-f618-498e-8847-2d620e286838

16 years agoRemove the 'znc-static' make target
psychon [Tue, 3 Jun 2008 06:24:40 +0000 (06:24 +0000)] 
Remove the 'znc-static' make target

Statically linking ZNC doesn't work anyway here and only leads
to problems...

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1080 726aef4b-f618-498e-8847-2d620e286838

16 years agoWebadmin: Add support for timezone offset
psychon [Fri, 30 May 2008 14:09:41 +0000 (14:09 +0000)] 
Webadmin: Add support for timezone offset

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1079 726aef4b-f618-498e-8847-2d620e286838

16 years agoRemove the *.de webadmin skins
psychon [Fri, 30 May 2008 14:07:29 +0000 (14:07 +0000)] 
Remove the *.de webadmin skins

I bet many people will kill me for this...

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1078 726aef4b-f618-498e-8847-2d620e286838

16 years agoPerform: Require an argument for the 'add' command
psychon [Fri, 30 May 2008 13:59:01 +0000 (13:59 +0000)] 
Perform: Require an argument for the 'add' command

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1077 726aef4b-f618-498e-8847-2d620e286838

16 years agoNickserv: Work on freenode (which uses lower case 'identify' notice)
psychon [Fri, 30 May 2008 10:54:44 +0000 (10:54 +0000)] 
Nickserv: Work on freenode (which uses lower case 'identify' notice)

Thanks to SilverLeo for the patch

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1076 726aef4b-f618-498e-8847-2d620e286838

16 years agoShow the version number on startup because JamesOff wants it
psychon [Wed, 28 May 2008 14:48:31 +0000 (14:48 +0000)] 
Show the version number on startup because JamesOff wants it

This patch is from SilverLeo. (The commit msg is basically, too)

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1075 726aef4b-f618-498e-8847-2d620e286838

16 years agoWebadmin: Don't reset all channel settings submitting a user page
psychon [Mon, 26 May 2008 15:02:09 +0000 (15:02 +0000)] 
Webadmin: Don't reset all channel settings submitting a user page

In r1058 the behaviour of CUser::Clone() was changed. It now also handles the
channel settings. This change breaks webadmin, because it doesn't properly
set up the channels it feeds to CUser::Clone()

This commit 'fixes' this by adding an extra parameter to CUser::Clone() which
makes it revert to the old behaviour. Webadmin uses this parameter.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1074 726aef4b-f618-498e-8847-2d620e286838