Commit Graph

773 Commits

Author SHA1 Message Date
Alexey Sokolov
b4b085dc2d Partially fix type of function pointer.
Found using UBSan.
Full fix would require adding visibility attribute to CUser,
CIRCNetwork, CModule, CModuleEntry, CModInfo *and* make sure these
attributes are visible to enough code.
The second statement is more difficult to fulfill, because forward
declaration of CUser is not enough, because the attribute is on class
definition. So Modules.h would need to include many other includes.

Probably it should be changed at some point.

See http://stackoverflow.com/questions/27976687/clangs-ubsan-function-pointer-is-this-illegal
2016-12-26 20:09:13 +00:00
Alexey Sokolov
2fcde9f2e1 Fix a couple of issues pointed out by https://scan.coverity.com/ 2016-12-26 17:22:09 +00:00
Alexey Sokolov
b666931883 Add an option to change ping timeout time.
Fix #979
2016-12-26 15:49:26 +00:00
Alexey Sokolov
d9c1da8a68 Make it possible to translate arguments in help text of module commands
Ref #1354
2016-12-25 21:11:02 +00:00
Alexey Sokolov
a1e1591ba5 Add another layer of indirection for translation
To make supporting old modules easier

Ref #1354
2016-12-25 20:31:17 +00:00
Alexey Sokolov
c803a85e13 Rename new On...Message modules callbacks to be more consistent.
OnPrivMessage -> OnPrivTextMessage
OnChanMessage -> OnChanTextMessage

Fix #1191
2016-12-25 15:48:29 +00:00
Alexey Sokolov
30cd0584a1 Fix build on FreeBSD for the latest CIDR commits 2016-12-25 13:53:17 +00:00
Alexey Sokolov
b445ad30e3 Modernize CIDR code. 2016-12-25 13:52:54 +00:00
Alexey Sokolov
6fbab7b44c Add CIDR support to TrustedProxy setting
Fix #1219
2016-12-25 13:00:02 +00:00
Alexey Sokolov
bd1a71cb29 Add Ru translation for existing strings in core.
It's not very big so far.

See #1354
2016-12-24 18:53:25 +00:00
Alexey Sokolov
13049e5fc3 Refactor the way how modules are loaded.
Make version checks more strict.

This finishes attempt to preserve ABI between patch versions. That
didn't work well, and the people who could make it work, left the
project already.

Close #1255
Close #1274
Close #172
2016-12-22 20:49:01 +00:00
Alexey Sokolov
6cde8b3950 Fix #1347 for 1.7 branch.
Commit 51fb6f09f4b8065b82f9a0ab1d1702ad8998f389 in 1.6.x branch has more
details.
2016-12-01 23:34:55 +00:00
Alexey Sokolov
5c524df298 Merge branch '1.6.x' 2016-11-20 18:09:55 +00:00
Alexey Sokolov
6366430870 Fix deletion of users which are connecting.
Close #1342
2016-11-20 17:56:26 +00:00
Alexey Sokolov
0ac3cfc8d5 Fix regression of 1.6.0
Cloning a user caused a non-immediate segfault.
This was fixed already in 1.7 branch (by refactoring).
Fix #1340
2016-11-19 23:35:12 +00:00
Alexey Sokolov
676d105347 Workaround gitter for 1.6
It's fixed properly for 1.7 already.
Fix #1321
2016-11-17 23:45:25 +00:00
lol768
f387dc56c0 More relevant comments for CSRF behaviour 2016-10-05 09:29:40 +01:00
Latchezar Tzvetkoff
a9a7f17910 Allow modules to override CSRF protection.
Useful for Web APIs and all other kinds of things.

API changes:
	- Added public CHTTPSock::GetURI() method
	- Added public CModule::ValidateWebRequestCSRFCheck() method
	- Made CWebSock::GetCSRFCheck() method public so it can be accessed
	  from CModule
	- Added public CWebSock::ValidateCSRFCheck() method

Other changes:
	- Added a Sample Web API module (modules/samplewebapi.cpp) and a
	  simple web form with no CSRF check.

Implements feature request #1180.
2016-10-05 09:29:40 +01:00
Alexey Sokolov
ac0048cc01 Make ZNC faster in the integration test.
This is not appropriate for normal usage.
2016-10-04 01:19:34 +01:00
arza
7c53d2106f Hide passwords in listservers output 2016-09-23 18:13:07 +03:00
Alexey Sokolov
3846813512 Merge branch '1.6.x'
Conflicts:
	modules/schat.cpp
	src/SSLVerifyHost.cpp
	src/Utils.cpp
2016-09-13 22:45:10 +01:00
William Elwood
853dcc211d Fix use of a feature deprecated in OpenSSL 1.1
If OpenSSL 1.1 is configured in such a way that features deprecated in 1.1.0 are not built, then compile errors would result here.
2016-09-13 11:51:13 +01:00
William Elwood
6a5c2c649d Fix use of a feature deprecated in OpenSSL 0.9.8
If OpenSSL 1.1 is configured in such a way that features deprecated in 0.9.8 are not built, then compile errors would result here.
I also noticed a potential memory leak where pRSA was not always freed before early return from this function - fixed by using C++11 unique_ptr.
2016-09-13 11:50:40 +01:00
William Elwood
03775fcdc5 Fix compile errors caused by OpenSSL 1.1 2016-09-12 23:39:19 +01:00
Alexey Sokolov
3f1c27250c Fix warning in Utils.cpp 2016-09-12 00:07:29 +01:00
Alexey Sokolov
cc653efb6b Rename translation methods to be not one letter.
It fixes several warnings, when the name was shadowed by a local "p".
2016-09-12 00:01:45 +01:00
Alexey Sokolov
187f617bbc Merge branch '1.6.x'
Close #1313
2016-09-09 21:14:00 +01:00
Alexey Sokolov
debfdf6c02 Fix build on OS X after fixing build on Cygwin 2016-09-09 00:17:20 +01:00
Alexey Sokolov
1480177458 Merge branch '1.6.x' 2016-09-08 22:26:51 +01:00
Alexey Sokolov
85984ee4be Merge pull request #1277 from xnrand/master
Add network-specific settings for cert validation
2016-08-20 12:08:41 +01:00
KindOne
3f48d0a01a Remove reference for attaching queries.
This was added in commit 85b84078f8 from pull request 1072.

Pull request 1014 would of made this command possible, but it was never pulled.
2016-08-14 21:12:14 -04:00
Alexey Sokolov
aff7e25043 Fix cygwin build
(cherry picked from commit f1ef8c79db)
2016-08-13 09:55:00 +01:00
Alexey Sokolov
847f2baf24 Fix a null pointer dereference.
It sometimes happened when user attaches to a channel.

No released version is affected.

Thanks to Zoddo for the report!
2016-07-29 23:13:02 +01:00
Alexey Sokolov
f1ef8c79db Fix cygwin build 2016-07-20 00:19:19 +01:00
Tor Arne Vestbø
4d5724eb0a Add OnPrivBufferStarting/Ending signals, similar to Chan buffers
Allows hooking into query buffer playback before and after all the
lines of the query buffer are replayed. The EModRet return value
has no effect at the moment, but may be used in the future to e.g.
prevent playback. The Chan version of these signals use EModRet to
skip emitting the status message, but not the whole playback.
2016-07-13 15:15:56 +02:00
Alexey Sokolov
b7fc670a39 Merge pull request #1290 from torarnv/fix-gettimeofday-ret
Fix inverted gettimeofday() return value handling
2016-07-08 10:28:23 +01:00
Tor Arne Vestbø
02bfb9eaf5 Centralize logic to get current server time
A few different implementations of computing the current time were
spread out through the code base, most of them using gettimeofday().

This centralizes the logic in CUtil::GetTime() for easier maintenance,
and also allows all call sites to get the benefit of the clock_gettime()
code path on systems that support it.
2016-07-06 01:16:15 +02:00
Alexey Sokolov
5dd209369d Merge pull request #1289 from torarnv/echo-message-time
Don't strip timestamp when sending echo-messages
2016-07-05 21:41:01 +01:00
Tor Arne Vestbø
852c9832a0 Fix inverted gettimeofday() return value handling
The gettimeofday function returns 0 for success, not for failure. As a
result of the inverted logic we were losing millisecond precision when
parsing incoming messages on non-HAVE_CLOCK_GETTIME systems (macOS).
2016-07-05 18:39:53 +02:00
Tor Arne Vestbø
60e88fc19d Don't strip timestamp when sending echo-messages
We preserve the time of the original message by making a copy of it,
and just changing the nick, which we then pass on to the CMessage
overload of PutClient, which converts the timestamp into a @time tag.
2016-07-05 16:24:32 +02:00
Alexey Sokolov
ff2d1e47b2 Merge pull request #1282 from Zarthus/always-send-nick-in-notice
Always send the users name in NOTICE when logging in.
2016-06-26 20:55:02 +01:00
Jos Ahrens
3ed914aa81 Always send the users name in NOTICE when logging in. 2016-06-20 08:06:00 +01:00
Thomas Ward
f76ab76c4a Update default SSL ciphers
Use an updated list of Default Ciphers, pulled from the same Mozilla recommendations.

This was pulled by me on June 3, 2016, thought we should update the cipherlist since it's been 5 months since it was last updated.
2016-06-03 11:40:37 -04:00
xnrand
409ed4b6bc Add network-specific config for cert validation
Added the following two network-specific configuration options that can
be changed via controlpanel or webadmin:

* TrustAllCerts: Will trust ALL certificates when enabled, effectively
  disabling TLS certificate validation.
  Default value: false
* TrustPKI: Whether or not to trust PKI-valid certificates. Setting this
  to false will make znc trust only trusted certificates added by the
  user.
  Default value: true

With default values, behavior is exactly the same as before.

This is based on the work of Roelf Wichertjes. See YourBNC/znc@5c747598.

See znc/znc#866.
2016-05-20 01:17:26 +02:00
Kyle Fuller
032f00732a [CString.StripControls] Srip bg colours when we reset fg 2016-04-11 22:09:40 +01:00
staticfox
249e43047d template: Iterate over size_type 2016-03-31 10:32:57 -04:00
staticfox
22e58205fc template: Don't re-declare sEnglishes 2016-03-31 10:20:04 -04:00
Adam
2494bd722a Change Channel SetInConfig/SetKey to use ECONFIG_DELAYED_WRITE 2016-03-26 13:34:02 -04:00
Adam
6bde0fc270 Add config write delay setting 2016-03-26 13:34:02 -04:00
Alexey Sokolov
711e835c93 Translateable webadmin to Russian. 2016-02-24 21:34:23 +00:00