Commit Graph

381 Commits

Author SHA1 Message Date
psychon
3106f3b90e 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
2008-07-24 10:16:52 +00:00
psychon
cc3d99515d 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
2008-07-22 08:39:18 +00:00
psychon
1f6abb6468 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
2008-07-21 13:58:24 +00:00
psychon
1c2c52651a Make webadmin generate salted passwords, too
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1139 726aef4b-f618-498e-8847-2d620e286838
2008-07-20 15:06:33 +00:00
psychon
10210e4619 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
2008-07-17 12:01:44 +00:00
psychon
27c1a76cf8 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
2008-07-17 10:30:32 +00:00
psychon
0003c28f7b 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
2008-07-17 10:16:40 +00:00
psychon
a5dcb3ff77 webadmin: Use the new CZNC::AuthUser() API
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1116 726aef4b-f618-498e-8847-2d620e286838
2008-07-07 18:36:26 +00:00
psychon
7965a12bd0 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
2008-07-07 18:30:35 +00:00
psychon
5e0c652b9a 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
2008-07-07 18:24:38 +00:00
psychon
bea3d85e8c 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
2008-06-22 14:06:01 +00:00
psychon
acc39c9351 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
2008-06-16 19:17:05 +00:00
psychon
d2aa281735 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
2008-06-08 09:50:50 +00:00
psychon
80a947100a 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
2008-06-08 09:34:21 +00:00
psychon
442ef47c56 Add OnUserTopic module call
Patch by SilverLeo


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1086 726aef4b-f618-498e-8847-2d620e286838
2008-06-06 14:27:57 +00:00
psychon
1bb1206472 Webadmin: Add support for timezone offset
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1079 726aef4b-f618-498e-8847-2d620e286838
2008-05-30 14:09:41 +00:00
psychon
0df0e9c234 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
2008-05-30 14:07:29 +00:00
psychon
709d822157 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
2008-05-30 13:59:01 +00:00
psychon
8aa85fd12e 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
2008-05-30 10:54:44 +00:00
psychon
13ddd325f9 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
2008-05-26 15:02:09 +00:00
psychon
ce5dae0f2b 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
2008-05-24 17:02:14 +00:00
psychon
01bc68b1cb 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
2008-05-08 16:58:32 +00:00
psychon
8c24ebb641 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
2008-05-08 13:45:16 +00:00
psychon
8cf12e8931 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
2008-05-08 13:32:34 +00:00
psychon
5665fd872d 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
2008-05-06 14:47:13 +00:00
psychon
3775748270 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
2008-04-30 14:09:15 +00:00
psychon
c64d7bc108 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
2008-04-20 13:08:44 +00:00
psychon
b0a1714b86 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
2008-04-20 13:00:19 +00:00
psychon
0470977497 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
2008-04-20 12:39:21 +00:00
psychon
5822a2de75 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
2008-04-20 12:21:26 +00:00
psychon
5c5cde9c34 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
2008-04-20 07:00:40 +00:00
psychon
5a34291455 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
2008-04-11 12:25:41 +00:00
psychon
5590307909 chansaver: Add all channels to the config when this module is loaded
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1018 726aef4b-f618-498e-8847-2d620e286838
2008-04-07 20:19:17 +00:00
psychon
6d957ed93c Use MODFLAGS instead of CXXFLAGS for the modules
This also removes the duplicate check for dlopen() in configure.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1012 726aef4b-f618-498e-8847-2d620e286838
2008-04-01 09:09:23 +00:00
psychon
0a5d3013d2 Add OnTopic() module call
Thanks to SilverLeo, again.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1011 726aef4b-f618-498e-8847-2d620e286838
2008-04-01 09:03:17 +00:00
psychon
ffe31fccd2 Shell module: Also read incomplete lines (no trailing newline) and display them
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1008 726aef4b-f618-498e-8847-2d620e286838
2008-04-01 08:59:13 +00:00
psychon
617e732f66 Only allow admins to load the shell module
The exception to this is if ZNC is compiled with -DMOD_SHELL_ALLOW_EVERYONE
x-x wanted this.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1007 726aef4b-f618-498e-8847-2d620e286838
2008-04-01 08:57:21 +00:00
imaginos
9c88a6aedf bug when trying to track down the right chat session
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@989 726aef4b-f618-498e-8847-2d620e286838
2008-03-18 15:14:23 +00:00
imaginos
2578384277 documented how to debug with valgrind
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@988 726aef4b-f618-498e-8847-2d620e286838
2008-03-18 03:00:03 +00:00
imaginos
20a970ae3d make sure these scalars are declared as mortals as to avoid a memleak
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@987 726aef4b-f618-498e-8847-2d620e286838
2008-03-18 02:30:42 +00:00
imaginos
ed15b68684 possible memleak during onload bu pZNCSpace not being mortal
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@986 726aef4b-f618-498e-8847-2d620e286838
2008-03-17 19:51:58 +00:00
imaginos
8873fbefa1 dont require .pm being in the mod name
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@982 726aef4b-f618-498e-8847-2d620e286838
2008-03-17 14:59:06 +00:00
imaginos
a0b2a8fc2b changed (un|re)?loadmod to (un|re)?loadperlmodule
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@981 726aef4b-f618-498e-8847-2d620e286838
2008-03-17 04:22:49 +00:00
imaginos
d53fa7b85d throw an warning if package definition is not found
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@977 726aef4b-f618-498e-8847-2d620e286838
2008-03-17 02:40:38 +00:00
psychon
7572c8e6a6 autoop: Add a define for the challenge length
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@973 726aef4b-f618-498e-8847-2d620e286838
2008-03-01 09:44:09 +00:00
psychon
973b41a99c Fix compilling modperl
Modperl was broken for quite some time and no one noticed...

The modperlFLAGS include the path to some static lib which will be linked in.
For this to work, we need to already have used one of its symbols.

Now, if the linker first sees this DynaLoader.a and then our object file,
there are no references to any symbol from it yet and thus he drops it.

The fix is easy: The modperlFLAGS need to be after modperl.cpp on the
command line.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@970 726aef4b-f618-498e-8847-2d620e286838
2008-03-01 09:29:26 +00:00
psychon
8f22dcc60d Fix all those warnings from -Wshadow
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@964 726aef4b-f618-498e-8847-2d620e286838
2008-02-19 20:25:21 +00:00
psychon
3f45131e58 autoop: Don't answer on too short challenges
Thanks to SilverLeo for this patch.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@960 726aef4b-f618-498e-8847-2d620e286838
2008-02-17 12:23:26 +00:00
psychon
f74ab87e19 And fix a shitload of trailing whitespaces and space / tab mixups in ZNC
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@959 726aef4b-f618-498e-8847-2d620e286838
2008-02-16 12:52:11 +00:00
psychon
bcb0306393 Don't allow users to change their user name through spoofed webadmin requests
Since adding and editing users is handled pretty much the same way in webadmin,
you could change your user name when you sent a POST requests with some
arbitrary user field:

 echo "user=newuser&submitted=1" | \
 lynx -post_data -auth=user:pass http://localhost:55455/edituser

This was spotted by SilverLeo who seems to spend quite some time trying to make
ZNC break, which is a good thing. Thanks!

Oh and btw, the last commit (delete the pid file) is from SilverLeo.
I forgot to mention him in the commit msg. Sorry.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@949 726aef4b-f618-498e-8847-2d620e286838
2008-02-10 10:18:54 +00:00