Ever since r1505 our error messages when loading modules all were the same:
"Unable to find modinfo"
Improve this by giving the user all the information we offered before again. The
most useful one here is most likely the result from dlerror(). This is done by
adding a helper function CModules::OpenModule(). Most of its code is from
CModules::LoadModule() and this function and CModules::GetModInfo() now both use
this helper function for generating error messages.
This commit adds a "#warning", don't worry I'm working on it.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1596 726aef4b-f618-498e-8847-2d620e286838
A common pattern for checking directories in ZNC is the following:
sAbsolutePath = CDir::ChangeDir(sAllowedPath, sFile);
if (sAbsolutePath.Left(sAllowedPath.length()) != sAllowedPath)
Error;
But there is a problem: If sAllowedPath doesn't end with a slash, we are
vulnerable to an attack. If e.g. sAllowedPath = "/foo/bar", then
sFile = "../bartender" would result in sAbsolutePath = "/foo/bartender". Since
this path does begin with sAllowedPath, the code allowed it.
There shouldn't be any places where this can be exploited currently, but it is
still a security bug (path traversal).
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1569 726aef4b-f618-498e-8847-2d620e286838
The last commit broke the order in which the traffic stats used to be displayed
and it turns out that KiNgMaR cannot live with that, so now we are back to the
old order.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1523 726aef4b-f618-498e-8847-2d620e286838
We now have a central function CZNC::GetTrafficStats() which does all the ugly
stuff and just returns the data which the caller can then display. We now also
include all unknown sockets (e.g. imapauth or webadmin sockets) in the traffic
stats in the "<ZNC>" section.
The only downside to all this gloriousness is that this breaks the ordering of
/msg *status traffic which is now sorted alphabetically which means that <ZNC>
<Users> and <Total> aren't anymore in the places in which they used to be.
I hope one can live with that...
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1521 726aef4b-f618-498e-8847-2d620e286838
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
This is mostly done by removing unused members, but there is also removes a
cache which saved how many opped, voiced etc users are on a channel.
This shouldn't result in a big slowdown, since this data is only ever used
for /msg *status listchans.
Also, this replaces the API to access this data with a version which should
be faster especially for big channels.
On amd64 the size of CChan was 600 bytes before and is 400 bytes now.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1301 726aef4b-f618-498e-8847-2d620e286838
This also moves the check for multiple servers
from CClient to CUser::AddServer().
The idea for this is from cnu, thanks.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1295 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
Before this commit, if a connection attempt was still going on, that attempt
wasn't aborted. This is now fixed.
This was reported by Kuja, thanks!
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1194 726aef4b-f618-498e-8847-2d620e286838
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