Commit Graph

762 Commits

Author SHA1 Message Date
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
Alexey Sokolov 8893b90e3a Modules web subpages should have translateable titles 2016-02-24 21:31:38 +00:00
Alexey Sokolov f01076cc6e Fix couple of bugs in i18n when source string contains non-ASCII characters. 2016-02-24 21:31:38 +00:00
Alexey Sokolov 07cabc3c00 Treat real name similarly to quit message, except that the number isn't shown.
See #818 and #1244
2016-02-23 22:36:45 +00:00
Alexey Sokolov dfba82fc9a Merge branch '1.6.x' 2016-02-23 22:23:39 +00:00
Alexey Sokolov 71cdb81fe8 Don't save ZNC version to config as part of quit message.
Introduce one more string for ExpandString.

Fix #1244
2016-02-18 22:18:08 +00:00
Alexey Sokolov d09a0a0966 Make some strings in core translateable. 2016-01-31 20:09:19 +00:00
Alexey Sokolov 8eeeaf71a0 Add framework for translating ZNC to different languages 2016-01-31 20:09:19 +00:00
Alexey Sokolov ae3eb5c219 Revert "Revert "Fix delay between receiving signal in separate thread and handling it""
This reverts commit 615d936b6c.

I forgot the condition before...
2016-01-23 11:57:48 +00:00
Alexey Sokolov 615d936b6c Revert "Fix delay between receiving signal in separate thread and handling it"
This reverts commit e14e3586e1.

Until I find what's wrong with it...
2016-01-23 11:40:43 +00:00
Alexey Sokolov e14e3586e1 Fix delay between receiving signal in separate thread and handling it
Also this allows increasing maximum wait time in poll(), though it
doesn't matter much
2016-01-23 11:05:30 +00:00
Alexey Sokolov 82b30ced5e Bump CMake requirement to 3.1 and fix code which requires 3.2+
CMake supports CXX_STANDARD target property (and therefore
automatic -std=c++11) since 3.1

Thanks to noteness for the report
2016-01-17 16:49:29 +00:00