Commit Graph

2391 Commits

Author SHA1 Message Date
Un1matr1x 9aa1df15e4 Wiki-Links changed, ModPython added, small optical changes 2011-05-01 11:34:22 +02:00
Uli Schlachter 6e48f3535c Update to latest Csocket
This fixes a problem where Csocket detected socket timeouts (as configured with
SetTimeout()) too late if there was few activity. See csocket's git commit
message for more info, I'm lazy. :-P

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-30 12:29:12 +02:00
Alexey Sokolov 5ece00f168 Don't confuse people with away module. 2011-04-25 09:44:52 +07:00
Alexey Sokolov e127d44170 Show error for --makepem if compiled without SSL. 2011-04-25 09:42:50 +07:00
Alexey Sokolov 37e6bbd6ae Allow log module to get no arguments.
This was broken since znc-0.098-17-g64e565c (563bce5987)
which introduced possibility of log module to specify wanted path as argument.

Thanks to turnor for reporting this.
2011-04-21 10:02:15 +07:00
Uli Schlachter e0c5c3b93c Csocket: Compile when SSLv2 is disabled in openssl
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-15 18:03:38 +02:00
Alexey Sokolov b8b6563ebd Make ProtectWebSessions to be checkbox in webadmin. 2011-04-14 10:04:27 +07:00
Michael Edgar 5560b795d1 Added myself to authors, in case this lands. 2011-04-13 21:21:46 -04:00
Michael Edgar a9ba4020db Added a global config option for IP-based session protection.
The new setting defaults to true, and is settable in the web admin panel. When
set to false, IP address checks are ignored. For users behind proxies (students,
large corporate networks) that don't guarantee a consistent IP, this makes the
web admin panel much more usable.
2011-04-13 20:24:26 -04:00
Paul Driver 2c6a54b617 passwords >8chars on Solaris, nitpicky solaris LIBS 2011-04-04 21:01:49 +01:00
Kyle Fuller 5cf5775bbc Fix ConfigTest.cpp and cert.cpp so they compile
This was broken since ZNCDebug.cpp was introduced
2011-04-04 19:19:29 +01:00
Kyle Fuller ea5ec8496c Remove a pointless status command provided by the shell module 2011-04-04 16:57:44 +01:00
Kyle Fuller 8ad2d907b5 Add the cert module which allows you to use a SSL certificate on outgoing IRC connections 2011-04-04 16:52:28 +01:00
Kyle Fuller 322c63cd05 Include signal.h to make znc compile again 2011-04-03 20:03:37 +01:00
Uli Schlachter 72c1fa0c90 Don't use poll() on Mac OS
Congratulations, Apple. Your OS is really great. In some versions (according to
google, it used to work in older releases), poll() can only handle sockets. If
you give it a pipe (as e.g. the shell module does), it will fail with POLLNVAL
which Csocket handles by going into an endless loop.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-03 18:04:14 +02:00
Alexey Sokolov e51b7daedc Merge branch 'py' of https://github.com/kylef/znc into kylef-py
Conflicts:
	modules/modpython/znc.py
2011-04-03 20:13:17 +07:00
Alexey Sokolov 299e1f1b4c Rearrange compiler/linker flags for modpython.
This should fix some issues with --as-needed.

Thanks to wired for reporting this.
2011-04-03 19:28:17 +07:00
Alexey Sokolov e746438022 Parse new ExecSock.h and ZNCDebug.h with SWIG.
That functionality was accessible by perl and python modules before.
Now that stuff is in own headers, so let's parse them too,
to have them still be able to use this.
2011-04-03 19:13:47 +07:00
Alexey Sokolov 3b671f0af1 Fix compilation error introduced in 3f24f28736.
psychon uses --enable-run-from-source and therefore missed this use of CFile.
2011-04-03 19:12:38 +07:00
Uli Schlachter 3f24f28736 Stop including FileUtils.h in any header
This causes every piece of code which wants to use CFile or CDir to have to
include FileUtils.h. This causes quite some noise.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-03 11:50:44 +02:00
Uli Schlachter 1761fe71e4 Move CExecSock to ExecSock.h
As a result, Utils.h no longer has to include Socket.h and lots of stuff breaks.

Due to a severe case of lazyness, some of the code for CExecSock is still in
Utils.cpp. Feel free to fix if you really have to.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-03 11:50:41 +02:00
Uli Schlachter ac5c021c93 Move DEBUG() from Utils.h into new ZNCDebug.h
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-03 10:41:27 +02:00
Uli Schlachter 0e0ab34773 defines.h doesn't need main.h
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-03 10:24:15 +02:00
Uli Schlachter 8e59f75125 Don't include FileUtils.h in znc.h or Modules.h
Both these headers only really need CFile* which can be handled with a forward
declaration.

To make this possible, some methods are moved from the header file into the
corresponding implementation file, because they used CFile or CDir static
members.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-03 10:21:59 +02:00
Uli Schlachter ad442f4f10 Include less headers in WebModules.h
From Client.h, only CAuthBase is needed. This is solved by moving the whole
CWebAuth class to WebModules.cpp.

The include of FileUtils.h is avoided by changing the API. GetAvailSkins() now
returns the skin names instead of a CFile for the skin's path.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-03 10:06:16 +02:00
Uli Schlachter 3fa04f8c0a Handle Listeners after SSLCertFile
Else, the Listeners will ignore the SSLCertFile config option.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-03 09:27:08 +02:00
Uli Schlachter ca36887ddf Don't include znc.h in Listener.h
znc.h pulls in most headers, Socket.h pulls in way less headers. This should
speed up compiles by 0.0000000314%.

The rest of this is compile fixes for stuff which assumed that Listener.h
includes znc.h for them. :-)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-02 23:28:32 +02:00
Uli Schlachter d2f3b8c508 Raise our IRC connection timeouts
ZNC will now send a PING if the connection was idle for 270 to 300 seconds.
After 540 seconds (that is, about 270 to 240 seconds later) the timeout is
triggered and ZNC reconnects.

These values are "inspired" by the values eggdrop uses.

The old timeouts were 180 to 210 secs for the PING and 240 secs for the timeout.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-02 23:03:33 +02:00
Uli Schlachter f0bf7134ec Improve the handling of module load messages
Instead of doing ugly stuff to shorten the "Loaded Module [foo]" message, we now
just always generate the shorter version of that message. The code paths which
didn't do this shortening now prepend that message themselves.

The result is that every message looks the same as it did before, but the code
for generating these is a little nicer.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-02 16:52:52 +02:00
Uli Schlachter 2003465489 Config: Fix some errors in the comment handling
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-01 21:46:14 +02:00
Uli Schlachter 90fb9e8c29 Re-add the ISpoof{File,Format} handling which was lost
Whoops, someone here failed at rebasing stuff.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-01 21:46:14 +02:00
Uli Schlachter 70c7745899 Overhaul the config parsing
This moves stuff to a two-step model. First, the new class CConfig reads the
config file, parses it and creates a in-memory model of stuff. Only then do we
actually go forward and apply the stuff.

The upside of this is that some config errors are caught before we change
anything on the running upside.

Let's see how much stuff this broke...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-01 21:43:05 +02:00
Kyle Fuller 233566edb6 Cleanup znc.py 2011-04-01 18:23:36 +01:00
Kyle Fuller 14452a1cb5 Make znc.py follow pep8 2011-04-01 18:23:24 +01:00
Kyle Fuller 1fc9aeefec Add __repr__ methods to CUser, CChan, CNick in modpython 2011-04-01 17:13:17 +01:00
Kyle Fuller 9db98d7cee Add __str__ methods to CModule, CUser, CChan, and CNick in modpython 2011-04-01 01:19:57 +01:00
Uli Schlachter ee9686e422 Fix a stupid memleak
Where's my brown paper back...?

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-31 19:18:11 +02:00
Uli Schlachter a4d388b56d Improve lock file error handling
When we have an error during rehashing / config writing, we continue keeping the
old lock around since we haven't gotten rid of that one yet.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-31 19:07:36 +02:00
Uli Schlachter 7f3e55e72f Check for errors while writing the config
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-31 18:21:36 +02:00
Uli Schlachter bff969f404 CZNC::WriteNewConfig() check for errors
This code now errors out if there is any error while writing the config. I
tested this with a full file system (full tmpfs of size 4k).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-31 18:15:49 +02:00
Uli Schlachter cc2d84d4a6 CFile::TryExLock(): Use O_RDWR by default
Getting an exclusive lock on a file with TryExLock() requires write access,
therefor O_RDONLY is wrong here.

This worked back when we were using flock() for file locking, because flock()
doesn't need write access for an exclusive locks.

This fixes a bug where "--makeconf" claims that there is already a znc instance
running on the config file. This happened because it mis-interpreted the -EBADF
error from fcntl() as "something else already has a lock".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-31 18:10:02 +02:00
Uli Schlachter 70358cabdd CFile: Add an error flag
Whenever an error happens with some file operation, the error flag is now set.
This is especially interesting for tracking errors from Write().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-31 18:00:07 +02:00
Uli Schlachter 23fb4df67a Remove config-related module hooks
This removes the following module hooks:

OnConfigLine()
OnWriteConfig()
OnWriteUserConfig()
OnWriteChanConfig()

Modules could use these hooks for writing/reading their own stuff to/from
znc.conf. However, no module (ever?) did this and IMHO no module should ever do
this either. Modules can save stuff via SetNV(), module arguments (SetArgs())
and in their GetSavePath().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-31 17:29:49 +02:00
Alexey Sokolov 45209eca33 modpython: Make strings to be stringable.
Now you can use str() on objects of znc.String.
The same is true for arguments which represent CString&.
2011-03-31 20:41:59 +07:00
Alexey Sokolov 63250c2b47 Fix recent commit of moving python to pkg-config. 2011-03-31 20:27:23 +07:00
Alexey Sokolov b8043c3aac modpython: move CPyRetString to own header.
It was defined twice: in modpython.cpp, and in modpython.i
And there is a fake CPyRetString in modpython.i

Now both places which use real CPyRetString include the file instead.
Fake CPyRetString is still in modpython.i
2011-03-31 20:13:19 +07:00
Alexey Sokolov ba915eb9c4 Use pkg-config for modpython.
python3-config fails when python is installed not system-wide.
It doesn't return -L/path/to/libs.
pkg-config resurns it.

Note that this changes meaning of optional argument to ./configure --enable-python=...
2011-03-31 20:13:19 +07:00
Kyle Fuller 64b89a7f49 Update old znc config to work with the new identfile module 2011-03-30 19:48:26 +01:00
Kyle Fuller 51ac51a252 Create a identfile module, this replaces the old ident spoofing built into znc 2011-03-30 19:48:12 +01:00
Kyle Fuller 703f2cd5bb Remove ident spoof from znc core 2011-03-30 19:16:53 +01:00