Commit Graph

1667 Commits

Author SHA1 Message Date
psychon 416cd2cfe8 Query buffer: Include /me's
Before, the query buffer did include regular channel messages, but CTCP ACTIONs
were just discarded. This is now fixed.

Thanks to jarryd for finding and reporting this.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1687 726aef4b-f618-498e-8847-2d620e286838
2010-01-02 13:02:33 +00:00
psychon a373ad10c0 User: Have correct save and dl path after Clone()
Without this, after you cloned a user via e.g. the admin modul, it would still
write to the datadir of the old user.

Patch by flakes, thanks a lot.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1686 726aef4b-f618-498e-8847-2d620e286838
2009-12-31 12:28:59 +00:00
silverleo 2de77971c4 Always null the interp var on load to prevent a possible crash on unload.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1685 726aef4b-f618-498e-8847-2d620e286838
2009-12-19 21:43:33 +00:00
silverleo d55e5acbca Only allow admins to load the modtcl module
The exception to this is if ZNC is compiled with -DMOD_MODTCL_ALLOW_EVERYONE
DGandalf wanted this.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1684 726aef4b-f618-498e-8847-2d620e286838
2009-12-19 19:15:07 +00:00
psychon 2a053a3ee3 Update to latest Csocket
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1683 726aef4b-f618-498e-8847-2d620e286838
2009-12-19 16:29:26 +00:00
psychon 434ddb9f35 Minor spelling fix in partyline
Thanks to the-me for noticing this and sending a patch.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1682 726aef4b-f618-498e-8847-2d620e286838
2009-12-19 16:18:27 +00:00
psychon ca3a1f2da5 Before restarting ZNC, do a clean shutdown
That way e.g. the ISpoofFile's content is restored and the pid file deleted.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1681 726aef4b-f618-498e-8847-2d620e286838
2009-12-18 17:06:47 +00:00
psychon c5e7913ed6 Don't try to catch SIGILL, SIGBUS or SIGSEGV
The signal handler didn't really do anything useful for these signals and if znc
gets one of these signals, something is really fishy and we shouldn't even try
to do a clean shutdown.

The default behavior for these signals is now used instead which means you can
get core dumps.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1680 726aef4b-f618-498e-8847-2d620e286838
2009-12-18 17:04:50 +00:00
psychon ecbb1c57dd Restart the CConnectUserTimer after a rehash
That way new ConnectDelay settings are applied immediately, not after the timer
is restart next due to sth else.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1679 726aef4b-f618-498e-8847-2d620e286838
2009-12-18 16:59:28 +00:00
psychon 9e0ea22efe Increase the version number to 0.079
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1678 726aef4b-f618-498e-8847-2d620e286838
2009-12-18 16:09:35 +00:00
psychon ed4c836934 Increase the version number to to 0.078
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1676 726aef4b-f618-498e-8847-2d620e286838
znc-0.078
2009-12-18 16:06:15 +00:00
silverleo ad9bcdfbf9 Don't accept only spaces for a quitmsg. Otherwise we would end in an unrecoverable config error on startup.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1675 726aef4b-f618-498e-8847-2d620e286838
2009-12-15 18:50:47 +00:00
psychon 7ad7f2df14 Regenerate configure with newer autoconf
The small change to configure.in seems to be necessary to still get the output
we want. No idea what happened so that this changed.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1674 726aef4b-f618-498e-8847-2d620e286838
2009-12-11 15:18:00 +00:00
psychon 63d4456f59 Always use blocking DNS for resolving bind hosts
This fixes a bug where ZNC failed to bind to domain names if they weren't
mentioned in /etc/hosts.

Thanks to alturiak for finding and reporting this.
Thanks to Imaginos for finding a quick workaround.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1673 726aef4b-f618-498e-8847-2d620e286838
2009-12-10 21:29:47 +00:00
psychon 540f867f9b Always prepend 'away :' to *all* away messages, not just the autoaway message.
Consequence of *not* doing this - The following command will unexpectedly cause
ZNC to disconnect from your IRC server:
 /query *away away quit

Thanks to Jim Ramsay <i.am@jimramsay.com> for finding this and providing a patch.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1672 726aef4b-f618-498e-8847-2d620e286838
2009-12-02 18:16:19 +00:00
psychon 5a08b7b7d6 Really check the return value of strftime()
If strftime() returns 0, the buffer we passed to it shouldn't be touched at
all, because it's not guaranteed to be null-terminated.

Someone (*cough*) already tried to fix this in r1394, but failed badly.

Thanks to DarthGandalf for spotting this and providing a patch.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1671 726aef4b-f618-498e-8847-2d620e286838
2009-11-30 18:16:16 +00:00
psychon 0cde028bfb ISpoofFormat: Go through ExpandString()
ISpoofFormat now can be used with e.g. %user% which allows some kind of
poor-man's DenySetIdent (force ident to be user name).

For backward compatibility, if ExpandString() doesn't change the string we just
replace all "%" with the user's ident.

Thanks to DarthGandalf for the idea and the patch.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1670 726aef4b-f618-498e-8847-2d620e286838
2009-11-29 15:17:39 +00:00
psychon 8114f27a5d Fix a crash bug with auth modules
If a module like imapauth needs some time to process a login, it's possible that
the client already disconnected by the time the lookup finished. This would then
cause a stale pointer in CAuthBase to be dereferenced.

Fix this remotely exploitable crash bug by adding a new function
CAuthBase::Invalidate(). After this was called, the CAuthBase instance doesn't
do anything at all anymore, especially not dereferencing the (possibly stale)
m_pSock pointer.

This also makes sure that one can only call AcceptLogin() or RefuseLogin() once.

Thanks to Sm0ke0ut for providing backtraces and reporting this bug.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1669 726aef4b-f618-498e-8847-2d620e286838
2009-11-28 18:53:20 +00:00
silverleo e2aba7587b Revert a commit from r1527 that made some PONG replies pass through to the client.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1668 726aef4b-f618-498e-8847-2d620e286838
2009-11-24 13:06:25 +00:00
psychon e8c64c0df6 Document the signals
This adds the new SIGUSR1 handling to README and adds a section on SIGINT,
SIGHUP and SIGUSR1 to znc's man page.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1667 726aef4b-f618-498e-8847-2d620e286838
2009-11-20 16:42:44 +00:00
psychon caf295f07f Rewrite znc.conf on SIGUSR1
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1666 726aef4b-f618-498e-8847-2d620e286838
2009-11-20 15:38:21 +00:00
psychon 85d96cdaf5 SHA256.h: Include inttypes.h instead of stdint.h
Both of these headers were added in C99 and this standard says that inttypes.h
should #include stdint.h. But Solaris 9 (and others?) doesn't have any stdint.h
header and thus the compiler shoots at us. So we just get our uint32_t from
inttypes.h instead and everyone should be happy...


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1665 726aef4b-f618-498e-8847-2d620e286838
2009-11-19 20:59:40 +00:00
psychon b4ba1d866c MODCONSTRUCTOR: Move some stuff to MODCOMMONDEFS
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1664 726aef4b-f618-498e-8847-2d620e286838
2009-11-16 18:13:09 +00:00
psychon 7c7f49ec78 CModules::OpenModule(): Check the version number first
At the time that OpenModule() verified that the module's version number matched
the version of the currently running ZNC, it had already called two of the
functions exported from the module.

Reorder this so that we don't do *any* other calls if we get a version mismatch.

Thanks to KiNgMaR for noticing this.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1663 726aef4b-f618-498e-8847-2d620e286838
2009-11-16 18:11:53 +00:00
psychon 3ffa684ebf Bug fix for my last commit
(aka: Brown Paper Bag commit)

When I tested it, it did work. I swear!

Thanks to everyone who pointed out that I broke his znc.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1662 726aef4b-f618-498e-8847-2d620e286838
2009-11-15 18:47:28 +00:00
psychon 6774696960 Module ABI: Use a string pointer
Returning a const char* is way easier, makes way more sense and is way
friendlier for an extern "C" function.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1661 726aef4b-f618-498e-8847-2d620e286838
2009-11-15 13:29:17 +00:00
psychon f2df100cc9 route_replies: Improve the timeout handling
One can now disable the timeout messages with '/msg *route_replies silent yes'
and the message shown on timeout sounds less grave.

It would be best if we could fix all of the timeout bugs, but most of the
reports we got lately sound like they were caused by cosmic rays or something...


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1660 726aef4b-f618-498e-8847-2d620e286838
2009-11-15 13:03:48 +00:00
psychon eec57eb81e Bug fix for CUser::DelServer()
DelServer() didn't always update m_uServerIdx correctly which means
GetCurServer() started to return the wrong server. This should now be fixed.

This log shows the bug. ZNC starts to think it's connected to irc.efnet.nl:

<znc_psy> listservers
<*status> +-------------------+------+-----+------+
<*status> | Host              | Port | SSL | Pass |
<*status> +-------------------+------+-----+------+
<*status> | irc.efnet.pl      | 6667 |     |      |
<*status> | irc.spotchat.org* | 6667 |     |      |
<*status> | irc.efnet.nl      | 6667 |     |      |
<*status> | irc.freenode.org  | 6667 |     |      |
<*status> +-------------------+------+-----+------+
<znc_psy> delserver irc.efnet.pl
<*status> Server removed
<znc_psy> listservers
<*status> +------------------+------+-----+------+
<*status> | Host             | Port | SSL | Pass |
<*status> +------------------+------+-----+------+
<*status> | irc.spotchat.org | 6667 |     |      |
<*status> | irc.efnet.nl*    | 6667 |     |      |
<*status> | irc.freenode.org | 6667 |     |      |
<*status> +------------------+------+-----+------+

Thanks to tomaw for reporting this bug.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1659 726aef4b-f618-498e-8847-2d620e286838
2009-11-14 12:03:03 +00:00
psychon 52ee8a11ef Some small cleanup to CUser::Clone()
This shouldn't change anything except the readers ability to understand this
snippet (hopefully).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1658 726aef4b-f618-498e-8847-2d620e286838
2009-11-14 11:36:19 +00:00
psychon 91962e32fc route_replies: Increase the timeout
Instead of generating a "this module hit a BUG" after 20s this module now waits
60s for a reply. This should cause less "wrong" bug reports for us.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1657 726aef4b-f618-498e-8847-2d620e286838
2009-11-13 21:35:24 +00:00
psychon cf98214587 Reorder the numerics in IRCSock.cpp
They are now sorted (where possible).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1656 726aef4b-f618-498e-8847-2d620e286838
2009-11-07 15:08:27 +00:00
psychon 6426ce107e Send correct away status on client login
If some client now sets "us" away via /away, new clients will be sent a 306
numeric after login to inform them that they are set /away.

Thanks to nobswolf for the suggestion.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1655 726aef4b-f618-498e-8847-2d620e286838
2009-11-07 14:54:45 +00:00
psychon 4930c24f95 Remove sample znc.conf
This file is only ever out-of-date and --makeconf makes this pretty much
obsolete anyway. Oh and too many users are confused by this file.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1654 726aef4b-f618-498e-8847-2d620e286838
2009-10-24 07:50:04 +00:00
psychon 007754cf6d admin: Disable ConnectEnabled() for cloned users
If you know clone a user through admin's clone command, that user won't connect
to irc. When the new user first logs in he will be told to use '/msg *status
connect'.

Thanks to BLG and KiNgMaR for the idea and the 'patch'.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1653 726aef4b-f618-498e-8847-2d620e286838
2009-10-20 16:59:40 +00:00
psychon d55d959554 OnIRCConnecting(): Log abort-by-module
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1652 726aef4b-f618-498e-8847-2d620e286838
2009-10-20 16:53:22 +00:00
psychon 5e0070765b Micro-optimization: Use existing functions in CModule::RemTimer()
CModule::RemTimer(const CString& sLabel) now uses FindTimer() and
RemTimer(CTimer *) to do the work instead of doing all of this by itself.

Thanks to KiNgMaR again.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1651 726aef4b-f618-498e-8847-2d620e286838
2009-10-17 15:50:58 +00:00
psychon 4142762b1d Fix a memory leak/crash in CModule
CModule::RemTimer(CTimer* pTimer) only removed the timer from CModule's own list
of timers but didn't actually destroy the timer. This meant that the timer could
continue to run after it was supposed to be deleted.

Because CModule's destructor used this function this means that all timers
active when a module is unloaded where leaked. When these timers where then
later destroyed this caused a crash because their vtable points inside the
module which was already unloaded (not good!).

Thanks to KiNgMaR for finding and reporting this crash bug.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1650 726aef4b-f618-498e-8847-2d620e286838
2009-10-17 15:44:51 +00:00
psychon e0e935cd93 Remove connect_throttle module from extra
fail2ban does the job much better (and is based on connect_throttle btw).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1649 726aef4b-f618-498e-8847-2d620e286838
2009-10-15 14:38:02 +00:00
psychon eb935da142 blockuser: Add a missing admin check
Non-admin users should not be able to block any users. Really, they shouldn't.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1648 726aef4b-f618-498e-8847-2d620e286838
2009-10-11 12:58:48 +00:00
psychon cda8e7c0ba Add a new DCCVHost config option
If this option is set to an ip address, this one is used as the local address
for DCC connections. This can e.g. be used to "fix" DCC bouncing with ipv6
connections. Without it, this just more or less fails badly.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1647 726aef4b-f618-498e-8847-2d620e286838
2009-10-10 12:45:25 +00:00
psychon 94667c1e90 Comment out some weird code from Client.cpp
Suggestions for what this was good for?


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1646 726aef4b-f618-498e-8847-2d620e286838
2009-10-10 12:29:40 +00:00
psychon 4fffdac655 Regenerate configure
No idea why, but autoconf failed badly on that last commit. :(


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1645 726aef4b-f618-498e-8847-2d620e286838
2009-10-09 17:11:49 +00:00
psychon 528aa72df3 configure: Automatically disable c-ares if it is not found
With this patch configure no longer fails if either pkg-config or c-ares are
unavailable. Instead, c-ares is just disabled.

If one uses ./configure --enable-c-ares, configure will fail if c-ares is not
found.

./configure --disable-c-ares obviously won't care about c-ares. ;)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1644 726aef4b-f618-498e-8847-2d620e286838
2009-10-09 17:07:22 +00:00
psychon 9dd3883164 Use a set instead of a vector in CModule
CModule has two vectors: A list of timers and a list of sockets for this
module. Since one shouldn't be able to add items multiple times it makes sense
to use a set here instead.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1643 726aef4b-f618-498e-8847-2d620e286838
2009-10-05 20:44:54 +00:00
psychon 3328e549d1 Remove the old, unused function CUtils::GetHashPass()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1642 726aef4b-f618-498e-8847-2d620e286838
2009-10-05 20:03:20 +00:00
psychon 7339f1f1fd Write the config file on restart and shutdown
ZNC now writes its config file just before it shuts down. If this fails it
aborts the shutdown. One can then either fix whatever went wrong or force a
shutdown.

This also cleans the code up a little by unifying shutdown and restart.

Patch by flakes, thanks!


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1641 726aef4b-f618-498e-8847-2d620e286838
2009-10-04 17:15:05 +00:00
psychon fa054942e9 delserver: Allow selecting the server more exactly
Before this you could only give the hostname of a server and delserver would
delete the first server with that hostname. Now you can also specify port and
password to select the server to remove more exactly.

One can't specify the ssl flag for delserver since this would be a little ugly,
but since you can't do ssl/plain-text on the same port anyway this shouldn't be
a big problem.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1640 726aef4b-f618-498e-8847-2d620e286838
2009-09-26 18:41:24 +00:00
psychon f2cf1165f1 Micro-Optimizations
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1639 726aef4b-f618-498e-8847-2d620e286838
2009-09-26 15:04:08 +00:00
psychon 5ccbd002c0 Add a new module hook OnIRCConnecting
This hook is called just before some user tries to connect() to an IRC server.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1638 726aef4b-f618-498e-8847-2d620e286838
2009-09-26 14:49:15 +00:00
psychon 6cdc7fb527 configure.in: Don't explicitly set default prefix
configure automatically sets the prefix to /usr/local if the user didn't set one
explicitly with --prefix, but it does so later than our own code. This must have
been a problem in the past, but now everything works fine without this hack.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1637 726aef4b-f618-498e-8847-2d620e286838
2009-09-24 19:38:36 +00:00