This patch fixes the same bug as the last commit and also makes sure that
similar bugs can't happen again.
Thanks to cnu for finding and reporting this bug.
Thanks to kroimon for patch review.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1396 726aef4b-f618-498e-8847-2d620e286838
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
The old versions didn't do this either and thus we used two slashes.
While this doesn't hurt, it doesn't look good either.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1299 726aef4b-f618-498e-8847-2d620e286838
If the config dir (<datadir>/configs) didn't exist yet, ZNC didn't bother
creating it and thus failed to do write a config.
Thanks to m4v for testing a nightly and for reporting this bug.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1292 726aef4b-f618-498e-8847-2d620e286838
This adds AddVHost, RemVHost and ListVHosts.
If this vhost list (which is the same webadmin uses for displaying drop-down
lists) is none-empty, then users can only set one of these vhosts via SetVHost.
If the list is empty, everything is allowed.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1256 726aef4b-f618-498e-8847-2d620e286838
This should hopefully fix a couple of 'Excess flood' problems we were having.
Thanks to SilverLeo for finally writing this :P
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1177 726aef4b-f618-498e-8847-2d620e286838
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
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
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
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
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
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
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
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
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
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
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
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