Commit Graph

1119 Commits

Author SHA1 Message Date
psychon
4a62fca388 Fix CUser::Clone() to work with salted passwords
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1128 726aef4b-f618-498e-8847-2d620e286838
2008-07-13 16:25:53 +00:00
psychon
bf2bd39769 Add supports for salted hashes to znc.conf
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
2008-07-13 15:32:27 +00:00
psychon
ac2caa0f22 znc-config: Don't link in any libraries
Any library the znc binary links to is automatically available to modules.
So there is no point in linking modules to @LIBS@ as znc is linked against
those already. modules/Makefile.in already does it this way, not also
znc-config does it


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1126 726aef4b-f618-498e-8847-2d620e286838
2008-07-12 21:43:47 +00:00
psychon
a35af71121 __GNU_LIBRARY__ doesn't seem to be needed on FreeBSD
This defines was added in rev 586 saying it's needed for 'older BSD boxes'.
I don't know how old 'old' is in this context, but since we don't compile
on FreeBSD 4 anyway (which really is old), because getopt_long is missing
(added in FreeBSD 5), we should give this a try.

I have no FreeBSD 5 box for testing if znc compiled/compiles there, so
suprise me!


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1125 726aef4b-f618-498e-8847-2d620e286838
2008-07-12 07:26:56 +00:00
psychon
3b0a4dc4b5 Config reading: Apply a small (unnoticeable) optimization
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
2008-07-11 09:58:04 +00:00
psychon
b1cdf48d12 Increase the version number to 0.058
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1122 726aef4b-f618-498e-8847-2d620e286838
2008-07-10 13:14:14 +00:00
psychon
1903bf0e3d Increase the version number to 0.058
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1120 726aef4b-f618-498e-8847-2d620e286838
znc-0.058
2008-07-10 13:11:50 +00:00
psychon
e2cb9b41e0 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
2008-07-08 10:24:48 +00:00
psychon
b141ef44b6 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
2008-07-08 10:00:42 +00:00
psychon
9e5ec2d563 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
2008-07-08 09:38:50 +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
31feec2c9f Use CZNC::Auth() to authenticate IRC clients
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1115 726aef4b-f618-498e-8847-2d620e286838
2008-07-07 18:35:41 +00:00
psychon
0bd4927d2c 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
2008-07-07 18:34:32 +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
5c7b586b2d 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
2008-07-03 10:16:49 +00:00
psychon
34e62cd86a 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
2008-07-01 09:50:47 +00:00
psychon
e3683f204b 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
2008-06-28 10:26:41 +00:00
psychon
fb0ccc3cf0 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
2008-06-28 06:23:21 +00:00
psychon
b2512e55ea 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
2008-06-27 09:55:55 +00:00
psychon
9e6d05a0bd Remove some unneeded includes from DCCBounce.h
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1106 726aef4b-f618-498e-8847-2d620e286838
2008-06-27 09:27:34 +00:00
psychon
2f495e1fd3 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
2008-06-27 09:26:16 +00:00
psychon
8293e346b7 Indent is tabs, not spaces
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1104 726aef4b-f618-498e-8847-2d620e286838
2008-06-26 08:59:45 +00:00
psychon
29c26643e3 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
2008-06-24 08:43:51 +00:00
psychon
1a7895cbd4 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
2008-06-23 17:59:57 +00:00
psychon
b6d03b6c36 Add some ExpandString() 'vars'
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1101 726aef4b-f618-498e-8847-2d620e286838
2008-06-22 14:41:51 +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
f88c7384b6 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
2008-06-21 11:20:30 +00:00
psychon
bcf59c56ea 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
2008-06-19 08:39:10 +00:00
psychon
d397cb8ad2 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
2008-06-17 08:25:04 +00:00
psychon
0f3f305a87 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
2008-06-17 08:22:27 +00:00
psychon
78f8cce2c6 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
2008-06-17 07:52:56 +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
b475f5d69e 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
2008-06-14 16:17:46 +00:00
psychon
0a7b69080a 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
2008-06-11 10:06:17 +00:00
psychon
f59b712293 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
2008-06-08 17:09:58 +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
91eefcf87b 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
2008-06-08 09:43:21 +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
imaginos
4059f8c3ed missing paren in test
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1087 726aef4b-f618-498e-8847-2d620e286838
2008-06-07 23:35:43 +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
d701809ac1 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
2008-06-06 14:26:04 +00:00
psychon
8e3f1ef77d 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
2008-06-03 12:07:49 +00:00
psychon
291d498bf8 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
2008-06-03 09:15:11 +00:00
psychon
2583b7e9ff 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
2008-06-03 07:15:52 +00:00
psychon
e08cb72646 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
2008-06-03 06:32:18 +00:00
psychon
5e5842333f 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
2008-06-03 06:24:40 +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