Browse Source

znc: update to 1.6.1

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Jonas Gorski 9 years ago
parent
commit
a94f520bcd

+ 3
- 3
net/znc/Makefile View File

@@ -8,13 +8,13 @@
8 8
 include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=znc
11
-PKG_VERSION:=1.6.0
12
-PKG_RELEASE:=3
11
+PKG_VERSION:=1.6.1
12
+PKG_RELEASE:=1
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 15
 PKG_SOURCE_URL:=http://znc.in/releases \
16 16
 		http://znc.in/releases/archive
17
-PKG_MD5SUM:=674d8c1277752dcc627b96e33a63376e
17
+PKG_MD5SUM:=8e29289e6229b6d2473de202170745ab
18 18
 
19 19
 PKG_MAINTAINER:=Jonas Gorski <jogo@openwrt.org>
20 20
 PKG_LICENSE:=Apache-2.0

+ 0
- 28
net/znc/patches/001-fix-savebuff-timer-initialization.patch View File

@@ -1,28 +0,0 @@
1
-From d6feb6f574933753371687ee42fa19d0b0d8d777 Mon Sep 17 00:00:00 2001
2
-From: Thomas Kriechbaumer <kriechbaumer@gmail.com>
3
-Date: Tue, 17 Feb 2015 10:08:30 +0000
4
-Subject: [PATCH] fix savebuff timer initialization
5
-
6
-closes #868
7
----
8
- modules/savebuff.cpp | 4 ++--
9
- 1 file changed, 2 insertions(+), 2 deletions(-)
10
-
11
---- a/modules/savebuff.cpp
12
-+++ b/modules/savebuff.cpp
13
-@@ -93,13 +93,13 @@ public:
14
- 		else
15
- 			m_sPassword = CBlowfish::MD5(sArgs);
16
- 
17
-+		AddTimer(new CSaveBuffJob(this, 60, 0, "SaveBuff", "Saves the current buffer to disk every 1 minute"));
18
-+
19
- 		return( !m_bBootError );
20
- 	}
21
- 
22
- 	virtual bool OnBoot() override
23
- 	{
24
--		AddTimer(new CSaveBuffJob(this, 60, 0, "SaveBuff", "Saves the current buffer to disk every 1 minute"));
25
--
26
- 		CDir saveDir(GetSavePath());
27
- 		for (CFile* pFile : saveDir) {
28
- 			CString sName;

+ 0
- 33
net/znc/patches/002-CThreadPool-Handle-spurious-wakeups.patch View File

@@ -1,33 +0,0 @@
1
-From 2f4488c2a4f2d6b130ded560efa06680bfd8a185 Mon Sep 17 00:00:00 2001
2
-From: Uli Schlachter <psychon@znc.in>
3
-Date: Sat, 14 Feb 2015 19:41:26 +0100
4
-Subject: [PATCH] ~CThreadPool(): Handle spurious wakeups
5
-
6
-From pthread_cond_wait()'s man page:
7
-
8
-  When using condition variables there is always a boolean predicate involving
9
-  shared variables associated with each condition wait that is true if the
10
-  thread should proceed. Spurious wakeups from the pthread_cond_wait() or
11
-  pthread_cond_timedwait() functions may occur. Since the return from
12
-  pthread_cond_wait() or pthread_cond_timedwait() does not imply anything about
13
-  the value of this predicate, the predicate should be re-evaluated upon such
14
-  return.
15
-
16
-Fix ~CThreadPool() to account for this possibility.
17
-
18
-Signed-off-by: Uli Schlachter <psychon@znc.in>
19
----
20
- src/Threads.cpp | 2 +-
21
- 1 file changed, 1 insertion(+), 1 deletion(-)
22
-
23
---- a/src/Threads.cpp
24
-+++ b/src/Threads.cpp
25
-@@ -87,7 +87,7 @@ CThreadPool::~CThreadPool() {
26
- 	CMutexLocker guard(m_mutex);
27
- 	m_done = true;
28
- 
29
--	if (m_num_threads > 0) {
30
-+	while (m_num_threads > 0) {
31
- 		m_cond.broadcast();
32
- 		m_exit_cond.wait(m_mutex);
33
- 	}

+ 0
- 149
net/znc/patches/003-Fix-CIRCNetwork-FindChans-and-FindQueries-to-be-case.patch View File

@@ -1,149 +0,0 @@
1
-From e10b53b87bb7ce87d1a31473e03a02ccafa78787 Mon Sep 17 00:00:00 2001
2
-From: J-P Nurmi <jpnurmi@gmail.com>
3
-Date: Tue, 3 Feb 2015 10:11:47 +0100
4
-Subject: [PATCH] Fix CIRCNetwork::FindChans() and FindQueries() to be
5
- case-insensitive
6
-
7
-The playback module failed to clear a buffer, because it tried to
8
-clear "NickServ" whereas ZNC had internally stored it has "nickserv".
9
----
10
- Makefile.in          |  2 +-
11
- src/IRCNetwork.cpp   |  6 ++--
12
- test/NetworkTest.cpp | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++
13
- 3 files changed, 101 insertions(+), 3 deletions(-)
14
- create mode 100644 test/NetworkTest.cpp
15
-
16
---- a/Makefile.in
17
-+++ b/Makefile.in
18
-@@ -48,7 +48,7 @@ LIB_SRCS  := $(addprefix src/,$(LIB_SRCS
19
- BIN_SRCS  := src/main.cpp
20
- LIB_OBJS  := $(patsubst %cpp,%o,$(LIB_SRCS))
21
- BIN_OBJS  := $(patsubst %cpp,%o,$(BIN_SRCS))
22
--TESTS     := StringTest ConfigTest UtilsTest ThreadTest NickTest ClientTest
23
-+TESTS     := StringTest ConfigTest UtilsTest ThreadTest NickTest ClientTest NetworkTest
24
- TESTS     := $(addprefix test/,$(addsuffix .o,$(TESTS)))
25
- CLEAN     := znc src/*.o test/*.o core core.* .version_extra .depend modules/.depend unittest
26
- DISTCLEAN := Makefile config.log config.status znc-buildmod \
27
---- a/src/IRCNetwork.cpp
28
-+++ b/src/IRCNetwork.cpp
29
-@@ -787,8 +787,9 @@ CChan* CIRCNetwork::FindChan(CString sNa
30
- std::vector<CChan*> CIRCNetwork::FindChans(const CString& sWild) const {
31
- 	std::vector<CChan*> vChans;
32
- 	vChans.reserve(m_vChans.size());
33
-+	const CString sLower = sWild.AsLower();
34
- 	for (std::vector<CChan*>::const_iterator it = m_vChans.begin(); it != m_vChans.end(); ++it) {
35
--		if ((*it)->GetName().WildCmp(sWild))
36
-+		if ((*it)->GetName().AsLower().WildCmp(sLower))
37
- 			vChans.push_back(*it);
38
- 	}
39
- 	return vChans;
40
-@@ -946,8 +947,9 @@ CQuery* CIRCNetwork::FindQuery(const CSt
41
- std::vector<CQuery*> CIRCNetwork::FindQueries(const CString& sWild) const {
42
- 	std::vector<CQuery*> vQueries;
43
- 	vQueries.reserve(m_vQueries.size());
44
-+	const CString sLower = sWild.AsLower();
45
- 	for (std::vector<CQuery*>::const_iterator it = m_vQueries.begin(); it != m_vQueries.end(); ++it) {
46
--		if ((*it)->GetName().WildCmp(sWild))
47
-+		if ((*it)->GetName().AsLower().WildCmp(sLower))
48
- 			vQueries.push_back(*it);
49
- 	}
50
- 	return vQueries;
51
---- /dev/null
52
-+++ b/test/NetworkTest.cpp
53
-@@ -0,0 +1,96 @@
54
-+/*
55
-+ * Copyright (C) 2004-2015 ZNC, see the NOTICE file for details.
56
-+ *
57
-+ * Licensed under the Apache License, Version 2.0 (the "License");
58
-+ * you may not use this file except in compliance with the License.
59
-+ * You may obtain a copy of the License at
60
-+ *
61
-+ *     http://www.apache.org/licenses/LICENSE-2.0
62
-+ *
63
-+ * Unless required by applicable law or agreed to in writing, software
64
-+ * distributed under the License is distributed on an "AS IS" BASIS,
65
-+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
66
-+ * See the License for the specific language governing permissions and
67
-+ * limitations under the License.
68
-+ */
69
-+
70
-+#include <gtest/gtest.h>
71
-+#include <znc/IRCNetwork.h>
72
-+#include <znc/User.h>
73
-+#include <znc/znc.h>
74
-+
75
-+class NetworkTest : public ::testing::Test {
76
-+protected:
77
-+	void SetUp() { CZNC::CreateInstance(); }
78
-+	void TearDown() { CZNC::DestroyInstance(); }
79
-+};
80
-+
81
-+TEST_F(NetworkTest, FindChan) {
82
-+	CUser user("user");
83
-+	CIRCNetwork network(&user, "network");
84
-+
85
-+	EXPECT_TRUE(network.AddChan("#foo", false));
86
-+	EXPECT_TRUE(network.AddChan("#Bar", false));
87
-+	EXPECT_TRUE(network.AddChan("#BAZ", false));
88
-+
89
-+	EXPECT_TRUE(network.FindChan("#foo"));
90
-+	EXPECT_TRUE(network.FindChan("#Bar"));
91
-+	EXPECT_TRUE(network.FindChan("#BAZ"));
92
-+
93
-+	EXPECT_TRUE(network.FindChan("#Foo"));
94
-+	EXPECT_TRUE(network.FindChan("#BAR"));
95
-+	EXPECT_TRUE(network.FindChan("#baz"));
96
-+
97
-+	EXPECT_FALSE(network.FindChan("#f"));
98
-+	EXPECT_FALSE(network.FindChan("&foo"));
99
-+	EXPECT_FALSE(network.FindChan("##foo"));
100
-+}
101
-+
102
-+TEST_F(NetworkTest, FindChans) {
103
-+	CUser user("user");
104
-+	CIRCNetwork network(&user, "network");
105
-+
106
-+	EXPECT_TRUE(network.AddChan("#foo", false));
107
-+	EXPECT_TRUE(network.AddChan("#Bar", false));
108
-+	EXPECT_TRUE(network.AddChan("#BAZ", false));
109
-+
110
-+	EXPECT_EQ(network.FindChans("#f*").size(), 1);
111
-+	EXPECT_EQ(network.FindChans("#b*").size(), 2);
112
-+	EXPECT_EQ(network.FindChans("#?A*").size(), 2);
113
-+	EXPECT_EQ(network.FindChans("*z").size(), 1);
114
-+}
115
-+
116
-+TEST_F(NetworkTest, FindQuery) {
117
-+	CUser user("user");
118
-+	CIRCNetwork network(&user, "network");
119
-+
120
-+	EXPECT_TRUE(network.AddQuery("foo"));
121
-+	EXPECT_TRUE(network.AddQuery("Bar"));
122
-+	EXPECT_TRUE(network.AddQuery("BAZ"));
123
-+
124
-+	EXPECT_TRUE(network.FindQuery("foo"));
125
-+	EXPECT_TRUE(network.FindQuery("Bar"));
126
-+	EXPECT_TRUE(network.FindQuery("BAZ"));
127
-+
128
-+	EXPECT_TRUE(network.FindQuery("Foo"));
129
-+	EXPECT_TRUE(network.FindQuery("BAR"));
130
-+	EXPECT_TRUE(network.FindQuery("baz"));
131
-+
132
-+	EXPECT_FALSE(network.FindQuery("f"));
133
-+	EXPECT_FALSE(network.FindQuery("fo"));
134
-+	EXPECT_FALSE(network.FindQuery("FF"));
135
-+}
136
-+
137
-+TEST_F(NetworkTest, FindQueries) {
138
-+	CUser user("user");
139
-+	CIRCNetwork network(&user, "network");
140
-+
141
-+	EXPECT_TRUE(network.AddQuery("foo"));
142
-+	EXPECT_TRUE(network.AddQuery("Bar"));
143
-+	EXPECT_TRUE(network.AddQuery("BAZ"));
144
-+
145
-+	EXPECT_EQ(network.FindQueries("f*").size(), 1);
146
-+	EXPECT_EQ(network.FindQueries("b*").size(), 2);
147
-+	EXPECT_EQ(network.FindQueries("?A*").size(), 2);
148
-+	EXPECT_EQ(network.FindQueries("*z").size(), 1);
149
-+}

+ 0
- 38
net/znc/patches/004-Fix-chansaver-loading.patch View File

@@ -1,38 +0,0 @@
1
-From 7e75018ba60a9f50ea9e936eb1b6eb6b44dbc668 Mon Sep 17 00:00:00 2001
2
-From: J-P Nurmi <jpnurmi@gmail.com>
3
-Date: Sat, 28 Feb 2015 21:15:23 +0100
4
-Subject: [PATCH] Fix chansaver loading
5
-
6
-CModules::LoadModule() sets the module type _after_ construction.
7
-The constructor cannot therefore do actions based on the module
8
-type. Move loading to OnLoad().
9
----
10
- modules/chansaver.cpp | 10 +++++++---
11
- 1 file changed, 7 insertions(+), 3 deletions(-)
12
-
13
---- a/modules/chansaver.cpp
14
-+++ b/modules/chansaver.cpp
15
-@@ -21,6 +21,12 @@
16
- class CChanSaverMod : public CModule {
17
- public:
18
- 	MODCONSTRUCTOR(CChanSaverMod) {
19
-+	}
20
-+
21
-+	virtual ~CChanSaverMod() {
22
-+	}
23
-+
24
-+	bool OnLoad(const CString& sArgsi, CString& sMessage) override {
25
- 		switch (GetType()) {
26
- 			case CModInfo::GlobalModule:
27
- 				LoadUsers();
28
-@@ -32,9 +38,7 @@ public:
29
- 				LoadNetwork(GetNetwork());
30
- 				break;
31
- 		}
32
--	}
33
--
34
--	virtual ~CChanSaverMod() {
35
-+		return true;
36
- 	}
37
- 
38
- 	void LoadUsers() {

+ 0
- 36
net/znc/patches/005-Fix-rare-conflict-of-HTTP-Basic-auth-and-cookies.patch View File

@@ -1,36 +0,0 @@
1
-From 13c2dc126d8bb4c57273178fc455dab6f02e1efc Mon Sep 17 00:00:00 2001
2
-From: Alexey Sokolov <alexey+znc@asokolov.org>
3
-Date: Thu, 16 Apr 2015 01:21:57 +0100
4
-Subject: [PATCH] Fix rare conflict of HTTP-Basic auth and cookies.
5
-
6
-Fix #946
7
----
8
- src/HTTPSock.cpp | 10 +++++++++-
9
- 1 file changed, 9 insertions(+), 1 deletion(-)
10
-
11
---- a/src/HTTPSock.cpp
12
-+++ b/src/HTTPSock.cpp
13
-@@ -122,7 +122,7 @@ void CHTTPSock::ReadLine(const CString&
14
- 		sLine.Token(2).Base64Decode(sUnhashed);
15
- 		m_sUser = sUnhashed.Token(0, false, ":");
16
- 		m_sPass = sUnhashed.Token(1, true, ":");
17
--		m_bLoggedIn = OnLogin(m_sUser, m_sPass, true);
18
-+		// Postpone authorization attempt until end of headers, because cookies should be read before that, otherwise session id will be overwritten in GetSession()
19
- 	} else if (sName.Equals("Content-Length:")) {
20
- 		m_uPostLen = sLine.Token(1).ToULong();
21
- 		if (m_uPostLen > MAX_POST_SIZE)
22
-@@ -170,6 +170,14 @@ void CHTTPSock::ReadLine(const CString&
23
- 	} else if (sLine.empty()) {
24
- 		m_bGotHeader = true;
25
- 
26
-+		if (!m_sUser.empty()) {
27
-+			m_bLoggedIn = OnLogin(m_sUser, m_sPass, true);
28
-+			if (!m_bLoggedIn) {
29
-+				// Error message already was sent
30
-+				return;
31
-+			}
32
-+		}
33
-+
34
- 		if (m_bPost) {
35
- 			m_sPostData = GetInternalReadBuffer();
36
- 			CheckPost();

+ 0
- 24
net/znc/patches/006-Fix-954-Startup-failure-when-simple_away-is-loaded-a.patch View File

@@ -1,24 +0,0 @@
1
-From 703a244b9b8c1b4af02a6132c5c70a748d98e3f8 Mon Sep 17 00:00:00 2001
2
-From: J-P Nurmi <jpnurmi@gmail.com>
3
-Date: Tue, 28 Apr 2015 10:00:55 +0200
4
-Subject: [PATCH] Fix #954: Startup failure when simple_away is loaded
5
- after awaynick
6
-
7
----
8
- src/User.cpp | 5 +++++
9
- 1 file changed, 5 insertions(+)
10
-
11
---- a/src/User.cpp
12
-+++ b/src/User.cpp
13
-@@ -1101,6 +1101,11 @@ bool CUser::LoadModule(const CString& sM
14
- 		CFile fNVFile = CFile(GetUserPath() + "/moddata/" + sModName + "/.registry");
15
- 
16
- 		for (vector<CIRCNetwork*>::iterator it = m_vIRCNetworks.begin(); it != m_vIRCNetworks.end(); ++it) {
17
-+			// Check whether the network already has this module loaded (#954)
18
-+			if ((*it)->GetModules().FindModule(sModName)) {
19
-+				continue;
20
-+			}
21
-+
22
- 			if (fNVFile.Exists()) {
23
- 				CString sNetworkModPath = (*it)->GetNetworkPath() + "/moddata/" + sModName;
24
- 				if (!CFile::Exists(sNetworkModPath)) {

+ 2
- 2
net/znc/patches/100-move_rootcheck_after_config.patch View File

@@ -9,7 +9,7 @@ Subject: [PATCH] Move the root check to after config parsing
9 9
 
10 10
 --- a/src/main.cpp
11 11
 +++ b/src/main.cpp
12
-@@ -303,19 +303,6 @@ int main(int argc, char** argv) {
12
+@@ -304,19 +304,6 @@ int main(int argc, char** argv) {
13 13
  		CUtils::PrintStatus(true, "");
14 14
  	}
15 15
  
@@ -29,7 +29,7 @@ Subject: [PATCH] Move the root check to after config parsing
29 29
  	if (bMakeConf) {
30 30
  		if (!pZNC->WriteNewConfig(sConfig)) {
31 31
  			CZNC::DestroyInstance();
32
-@@ -337,6 +324,20 @@ int main(int argc, char** argv) {
32
+@@ -338,6 +325,20 @@ int main(int argc, char** argv) {
33 33
  		return 1;
34 34
  	}
35 35