With cp -Rp, the files's permissions were just copied from source.
But 4c7808c5c broke that behaviour, so after copying we set permissions for new installed files.
Why "install" doesn't support installing directories? :(
Changing the user name for a CUser instance is a really, really bad idea. There
are lots of paths that depend on the user name and only few of them are fixed up
when the user name changes.
This fixes a problem where admin's "CloneUser from to" caused problems with
modules, because all modules where loaded under the old user name and thus they
read/write NV data from the wrong directory in ~/.znc/users.
Thanks to un1matr1x for reporting this.
Signed-off-by: Uli Schlachter <psychon@znc.in>
shell didn't compile since 6bc36d1708 because it used the
three-argument-version of CModule::PutModule(). This commit replaced that with a
call to CModule::PutUser().
Signed-off-by: Uli Schlachter <psychon@znc.in>
This module hook is called to generate messages for unknown commands. This hook
has a default implementation that actually does something!
Signed-off-by: Uli Schlachter <psychon@znc.in>
With this, modules can use AddCommand() to register commands. CModule will
dispatch all calls to OnModCommand() to the correct command handler.
If a module calls AddHelpCommand(), it will also generate help output.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This let's CFile expand relative-to-home paths. I "accidentally" broke
ISpoofFile with some recent commit and that is now fixed with this. This should
solve this problem for quite a lot of other places, too.
Idea (c) by DarthGandalf, thanks. :)
Signed-off-by: Uli Schlachter <psychon@znc.in>
This works correctly because only the config writing/reading accesses
CZNC::m_sSSLCertFile directly, everything else goes through this getter.
This ChangeDir() call will also "sanitize" the path. E.g. "/foo//..//home///"
will be turned into "/home/" and stuff like that.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This makes the code use GetISpoofFile() instead of accessing m_sISpoofFile
directly. Additonally, CFile::GetLongName() is used for printing the filepath.
(This also removes an useless if branch, because nothing here cares if
m_sISpoofFile is empty, we just need the lock file.)
Signed-off-by: Uli Schlachter <psychon@znc.in>
This way, we can write the original value back to the config. Also, this "fixes"
a bug because webadmin didn't do this step.
Signed-off-by: Uli Schlachter <psychon@znc.in>
"Don't force --foreground when compiled with --enable-debug"
Instead, this is now wrapped in an #ifdef ALWAYS_RUN_IN_FOREGROUND, so that I
can use ./configure CXXFLAGS="-DALWAYS_RUN_IN_FOREGROUND".
Signed-off-by: Uli Schlachter <psychon@znc.in>
This changes admin to assume that an "empty username" was specified if some
arguments is empty which shouldn't be empty. This empty username is then
interpreted as meaning the current user.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This function is the counterpart for CUser::AddCTCPReply(). Guess what? It
removes an entry from CUser::m_mssCTCPReplies again! It's magic!
Signed-off-by: Uli Schlachter <psychon@znc.in>
It shouldn't make any real difference (especially not for std::vector), but
"empty()" is better than using "size() == 0".
Signed-off-by: Uli Schlachter <psychon@znc.in>
CTCP requests can't contain spaces so it's useless to specify rules for those.
This doesn't affect any of the existing callers because those use Token(0) for
generating the first argument to this function.
Signed-off-by: Uli Schlachter <psychon@znc.in>
All the places that add entries to the CTCPReplies map use CString::Token(0) to
split the first token away. This means it is impossible for this to contain
spaces. Now this means that it is pointless to look up the full CTCP request in
the CTCPReplies map because it can't contain any matching item.
Signed-off-by: Uli Schlachter <psychon@znc.in>
We are using a vanilla version of Csocket again. Previously, our copy of
Csocket.h had a new '#include "zncconfig.h"'.
The other changes are mostly cleanup for various compiler warnings. The switch
from inet_ntoa() to inet_ntop() is for thread-safety reasons.
Signed-off-by: Uli Schlachter <psychon@znc.in>
If you did ./configure --enable-tcl, tcl wasn't actually enabled because
--enable-extra was missing, That's less than optimal.
Just moving modtcl out of modules/extra solves this problem.
Big thanks go to zynox/kylef for noticing this!
Signed-off-by: Uli Schlachter <psychon@znc.in>
When ChanServ ops someone in a channel without joining first, znc didn't call
modules for this event, because it couldn't figure out a CNick* instance to use
Instead, the module hooks are now executed with a temporary CNick instance which
is created by CIRCSock anyway.
Big thanks to Robby for reporting this and helping me test it!
Signed-off-by: Uli Schlachter <psychon@znc.in>