]>
jfr.im git - irc/znc/znc.git/log
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
psychon [Mon, 26 May 2008 14:59:41 +0000 (14:59 +0000)]
Fix restarting of the connect user timer during rehashing
Rehashing didn't always properly restart the connect user timer.
This happened e.g. if rehashing fails because the config file doesn't exist.
To fix this, we restart this timer now in the CZNC::RehashConfig() where it
will *always* happen.
This commit fixes a crash bug! (using an invalid iterator)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1073
726aef4b -f618-498e-8847-
2d620e286838
psychon [Mon, 26 May 2008 14:56:23 +0000 (14:56 +0000)]
The instructions at the end of makeconf showed a wrong port
This was broken since r964 from Feb 2008.
Thanks to fred for finding this.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1072
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sat, 24 May 2008 21:13:36 +0000 (21:13 +0000)]
Simplify this a little by using the new-and-improved (tm) CZNC::Broadcast()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1071
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sat, 24 May 2008 21:12:53 +0000 (21:12 +0000)]
Add bAdminOnly and pSkipClient arguments to CZNC::Broadcast
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1070
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sat, 24 May 2008 17:16:29 +0000 (17:16 +0000)]
DCC bouncing: Throttle the receiving side if we can't bounce the data fast enough
It could happen that ZNC was killed by the OOM killer. This was caused by
DCC bouncing receiving as fast as possible and caching everything in memory.
This throttles the receiving side via PauseRead() and UnPauseRead().
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1069
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sat, 24 May 2008 17:12:55 +0000 (17:12 +0000)]
De-bashify znc-buildmod by removing colors
This commit should make someone at debian really happy...
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1068
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sat, 24 May 2008 17:09:25 +0000 (17:09 +0000)]
Disconnect unauthed connections after a timeout of 60 secs
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1067
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sat, 24 May 2008 17:08:23 +0000 (17:08 +0000)]
Don't disconnect unauthed clients which use something else than PASS, USER or NICK
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1066
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sat, 24 May 2008 17:05:07 +0000 (17:05 +0000)]
Replace CString::Token() with a rewritten version
In my testing this saves between 29% and 97% (!) of CPU usage. Biggest speedup
happens with long tokens being returned.
This is because the old version uses std::string::operator+(char) to construct
the returned string, while the new one uses std::string::substr() only once.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1065
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sat, 24 May 2008 17:02:14 +0000 (17:02 +0000)]
Cleanup autoop a little
This removes unused module hooks and some unused code.
It also gives some comments there own line.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1064
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sat, 24 May 2008 17:00:10 +0000 (17:00 +0000)]
Don't allow users with 'DenyLoadMod' set to use 'ListAvailableModules'
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1063
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sat, 24 May 2008 15:29:52 +0000 (15:29 +0000)]
Make it possible to add extra strings to the version number
This will be used for the nightly tarballs (perhabs).
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1062
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sat, 24 May 2008 15:23:01 +0000 (15:23 +0000)]
Increase the version number to 0.057
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1061
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sat, 24 May 2008 15:20:58 +0000 (15:20 +0000)]
Increase the version number to 0.056
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1059
726aef4b -f618-498e-8847-
2d620e286838
psychon [Wed, 21 May 2008 14:22:20 +0000 (14:22 +0000)]
Teach CUser::Clone() to also handle channel settings
Now rehashing can finally change channel settings, too.
One part of this patch worries me: Detaching / Attaching channels
via rehash. Let's see what happens...
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1058
726aef4b -f618-498e-8847-
2d620e286838
psychon [Fri, 16 May 2008 15:01:41 +0000 (15:01 +0000)]
configure: Fix dlopen() detection
The 'appendLib -ldl' is the important part, autoconf doesn't do that
automatically if you give it an argument.
This bug only triggered with --disable-debug (libssl pulled in libdl).
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1057
726aef4b -f618-498e-8847-
2d620e286838
psychon [Thu, 15 May 2008 10:51:58 +0000 (10:51 +0000)]
make distclean: Also remove znc-buildmod
configure now generates znc-buildmod, so distclean has to remove it.
Thanks to SilverLeo for pointing this out.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1056
726aef4b -f618-498e-8847-
2d620e286838
psychon [Wed, 14 May 2008 17:45:50 +0000 (17:45 +0000)]
Move znc-buildmod to znc-buildmod-in (See last commit)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1055
726aef4b -f618-498e-8847-
2d620e286838
psychon [Wed, 14 May 2008 17:44:52 +0000 (17:44 +0000)]
Make znc-buildmod work with znc-config not in path
We do that by adding the path we installed znc-config to, to our $PATH in
znc-buildmod.
This patch requires znc-buildmod to be moved to znc-buildmod.in, but svn
doesn't want me to do that :(
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1054
726aef4b -f618-498e-8847-
2d620e286838
psychon [Tue, 13 May 2008 18:18:51 +0000 (18:18 +0000)]
CUser: Save CIRCSock* instead of looking it up every time
Via profiling ZNC it was found that much CPU time was spent inside FindSockByName()
which in turn was called by CUser::GetIRCSock():
w00t volunteered to write a patch to save that pointer inside CUser and
here is the result. Thanks.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1053
726aef4b -f618-498e-8847-
2d620e286838
psychon [Mon, 12 May 2008 19:35:15 +0000 (19:35 +0000)]
Fix CString::RandomString() to not insert NULL bytes in its result
sizeof() also includes the trailing NULL byte and thus that character was
chosen sometimes, too.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1052
726aef4b -f618-498e-8847-
2d620e286838
psychon [Mon, 12 May 2008 15:38:12 +0000 (15:38 +0000)]
Cleanup CUtils::GetLongIP()
The new version should be faster (no malloc with pseudo-memset) and it
certainly is a lot more readable.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1051
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sun, 11 May 2008 18:32:17 +0000 (18:32 +0000)]
Never link the ZNC binary against libsasl2
Stupid autoconf...
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1050
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sat, 10 May 2008 15:09:46 +0000 (15:09 +0000)]
Remove some unneedef #ifdef's
MODULECALL doesn't need to be wrapped in #ifdef _MODULES, since main.h
already does this.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1049
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sat, 10 May 2008 11:32:34 +0000 (11:32 +0000)]
Use -Wno-unused-parameter instead of -Wno-unused
This one causes no extra warnings and -Wno-unused-parameter is exactly the
reason why we had -Wno-unused.
According to [1], this flag exists since GCC 3.
Thanks to pippijn for telling me about this flag.
[1] http://lists.auriga.wearlab.de/pipermail/dillo-dev/2003-December/001565.html
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1048
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sat, 10 May 2008 06:46:53 +0000 (06:46 +0000)]
Make CString::RandomString() produce something more random
Instead of A-Z we now use A-Z,a-z,0-9,!?.,:;/*-+()
This means our random strings are now 2.5 times more random :).
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1047
726aef4b -f618-498e-8847-
2d620e286838
psychon [Fri, 9 May 2008 14:48:06 +0000 (14:48 +0000)]
Remove OnRehashDone and add OnPre/PostRehash
This patch is from SilverLeo.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1046
726aef4b -f618-498e-8847-
2d620e286838
psychon [Thu, 8 May 2008 17:47:55 +0000 (17:47 +0000)]
Replace CDir::MakeDir() with a version that doesn't do chdir()
This means that ZNC now doesn't break with relative data dirs (for me)
any more!
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1045
726aef4b -f618-498e-8847-
2d620e286838
psychon [Thu, 8 May 2008 16:58:32 +0000 (16:58 +0000)]
Move ChangeDir() and MakeDir() from CUtils to CDir
Those function were not modified. Only change is the name.
Those *Dir() functions really made no sense in CUtils when there is FileUtils
stuff. They really fit much better into here. I'll bet they'll make new friends
fast. I mean, why shouldn't they?
Uhm... sorry ;)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1044
726aef4b -f618-498e-8847-
2d620e286838
psychon [Thu, 8 May 2008 13:45:16 +0000 (13:45 +0000)]
Webadmin: Remove the special rule for CVS and ignore .svn instead
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1043
726aef4b -f618-498e-8847-
2d620e286838
psychon [Thu, 8 May 2008 13:32:34 +0000 (13:32 +0000)]
Clean up FileUtils.h
This removes some commented out functions and it also
removes CFir::Exists() since CFile::IsDir() does exactly
the same job (and it uses fewer syscalls for that).
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1042
726aef4b -f618-498e-8847-
2d620e286838
psychon [Thu, 8 May 2008 13:23:47 +0000 (13:23 +0000)]
CString::Split(): Skip empty tokens at the beginning for bAllowEmpty = false
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1041
726aef4b -f618-498e-8847-
2d620e286838
psychon [Tue, 6 May 2008 14:47:13 +0000 (14:47 +0000)]
Update to latest Csocket
This breaks (& fixes again, as far as ZNC itself is concerened) API!
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1040
726aef4b -f618-498e-8847-
2d620e286838
psychon [Mon, 5 May 2008 21:39:09 +0000 (21:39 +0000)]
Remove CString::ToKBytes()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1039
726aef4b -f618-498e-8847-
2d620e286838
psychon [Mon, 5 May 2008 21:33:34 +0000 (21:33 +0000)]
Format traffic stats to not show bytes, but stuff like KiB and MiB etc
This adds CString::ToByteStr() for such jobs!
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1038
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sun, 4 May 2008 14:55:21 +0000 (14:55 +0000)]
*Always* forward our own nick changes to clients
Thanks to SilverLeo for finding and debugging this one.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1037
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sun, 4 May 2008 14:08:10 +0000 (14:08 +0000)]
Call setsid() after forking
This way we get rid of our controlling terminal.
Now ZNC won't stay in the session of the shell anymore...
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1036
726aef4b -f618-498e-8847-
2d620e286838
psychon [Wed, 30 Apr 2008 14:09:15 +0000 (14:09 +0000)]
watch: Remove the raw /watch command
There is actually a 'real' /watch command which was blocked by this.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1035
726aef4b -f618-498e-8847-
2d620e286838
psychon [Tue, 29 Apr 2008 18:29:59 +0000 (18:29 +0000)]
Make znc-buildmod report failures via exit code
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1034
726aef4b -f618-498e-8847-
2d620e286838
psychon [Tue, 29 Apr 2008 12:15:48 +0000 (12:15 +0000)]
Display a better error message if znc.conf cannot be opened
If znc.conf was a regular file which we just couldn't open (chmod 0), ZNC
reported that it was already running on this config.
This patch fixes this message.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1033
726aef4b -f618-498e-8847-
2d620e286838
psychon [Fri, 25 Apr 2008 16:30:11 +0000 (16:30 +0000)]
Print a warning if a msg / notice gets lost because we are not connected to IRC
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1032
726aef4b -f618-498e-8847-
2d620e286838
psychon [Fri, 25 Apr 2008 16:27:00 +0000 (16:27 +0000)]
Makefile.in: Use $(bindir) instead of $(prefix)/bin
Also this removes a double 'prefix :=' line.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1031
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sun, 20 Apr 2008 13:08:44 +0000 (13:08 +0000)]
Force a space between if, for, while and (
This was done via:
sed -ir 's/if(/if (/g; s/for(/for (/g; s/while(/while (/g' \
*.h *.cpp modules/*.cpp
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1030
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sun, 20 Apr 2008 13:00:19 +0000 (13:00 +0000)]
Remove useless spaces inside of braces "( stuff )"
This was generated via the following command:
cat <file> | \
tr "\n" "€"| \
sed -r 's/€[\t ]*\{€/ {€/g; s/\( */(/g; s/ *\)/)/g' | \
tr "€" "\n"
Thanks to SilverLeo for producing this mess :P
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1029
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sun, 20 Apr 2008 12:39:21 +0000 (12:39 +0000)]
schat: Use CString's features instead of strcasecmp and friends
This also breaks long lines (longest line is now 114 chars, was 180).
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1028
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sun, 20 Apr 2008 12:21:26 +0000 (12:21 +0000)]
Fix the Makefile's dependency tracking
Turns out that .depend's mtime changes when you modify files in there
and since every .cpp file depended on .depend, make regenerated everything.
Not good.
Fix this by inlining the mkdir for .depend.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1027
726aef4b -f618-498e-8847-
2d620e286838
psychon [Sun, 20 Apr 2008 07:00:40 +0000 (07:00 +0000)]
Makefile: Always do dependency tracking
If you now change znc.h, every file that '#include's znc.h is *always*
regenerated.
According to [1], these compiler flags were already around with GCC 3.2, so
this change shouldn't hurt anyone.
[1] http://lists.samba.org/archive/ccache/2002q4/000003.html
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1026
726aef4b -f618-498e-8847-
2d620e286838
psychon [Fri, 18 Apr 2008 09:25:28 +0000 (09:25 +0000)]
Break some way too long lines into way less long lines
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1025
726aef4b -f618-498e-8847-
2d620e286838
psychon [Thu, 17 Apr 2008 15:52:55 +0000 (15:52 +0000)]
Fix some stupid bug which even GCC found and warned on
Yeah, I *really* feel stupid for letting something like this slip :(
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1024
726aef4b -f618-498e-8847-
2d620e286838
psychon [Wed, 16 Apr 2008 19:46:26 +0000 (19:46 +0000)]
Display better error messages if we can't connect to IRC
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1023
726aef4b -f618-498e-8847-
2d620e286838
psychon [Tue, 15 Apr 2008 14:33:37 +0000 (14:33 +0000)]
Use unix EOLs (\n) instead of DOS ones (\r\n) for writing znc.conf
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1022
726aef4b -f618-498e-8847-
2d620e286838
psychon [Fri, 11 Apr 2008 12:25:41 +0000 (12:25 +0000)]
Shell: Don't send invalid nonsense like empty strings as ident
The shell module uses the current nick for that user as the ident for queries
from *shell. This makes no sense I once managed to get an empty ident, which
confused irssi badly.
Since there is no good reason to use this as ident, just use some
static string as ident instead.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1021
726aef4b -f618-498e-8847-
2d620e286838
psychon [Tue, 8 Apr 2008 18:53:05 +0000 (18:53 +0000)]
Reuse the FD for locking the config for reading it
This saves us one whole open() :P
Honestly, this fixes some (stupid) locking problems with cygwin and shouldn't
hurt much otherwise (And no, cygwin still isn't supported yet).
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1020
726aef4b -f618-498e-8847-
2d620e286838