Skip to content

Commit 60ee688

Browse files
Merge branch 'v5.3.dev' into v5.3
Conflicts resolved: .gitlab-ci.yml ChangeLog
2 parents 75cf261 + 8f941f1 commit 60ee688

9 files changed

+163
-117
lines changed

.gitlab-ci.yml

+122-103
Large diffs are not rendered by default.

ChangeLog

+15
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
About "Bug" tags show "https://github.com/e2guardian/e2guardian/issues?q=is%3Aissue+is%3Aclosed"
22

3+
version 5.3.5
4+
5+
February 2020 to August 2020
6+
7+
- Fix bug #619 x-forwarded wrong IP in MITM requests
8+
- Fix #607 - exceptionmimetypes not working
9+
- Fix #592 - last line of config file(s) not being read
10+
- Fix #590 - Storyboard line not being parsed when trailing comment present
11+
- Fix #585 - based on bmuel suggestions on by-pass
12+
- Fix #520 - bypass cookie generation and checks do not match
13+
14+
- Add note re amending site.story for virus exceptions #577
15+
- Update configure.ac for raspbery pi
16+
317
version 5.3.4
418

519
January 2020
20+
621
- Increase example maxcontentcachesize to make filtering youtube work
722
- Fix #565 segfault when no write permission on generated certs directory
823
- Fix #493 referexception not working

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# [E2Guardian](http://e2guardian.org)
22

3-
This is the v5 production version - v5.3.4
3+
This is the final maintenance release for v5.3 production version - v5.3.5
44

55
Note that large sections of the code has been re-written and there are
66
significant changes to the configuration files in this release.
@@ -27,8 +27,8 @@ Read the INSTALL for installation instructions.
2727

2828
Github: https://github.com/e2guardian
2929

30-
* v5develop is used to develop new features
31-
* Bugfixes primarily occurs in the version branch
30+
* current development version i.e. v5.5.dev is used to develop new features
31+
* Bug fixes primarily occurs in the version '.dev' branch
3232

3333
## Bugs and Feature Requests
3434

configs/e2guardianf1.conf.in

+2-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ sitelist = 'name=localexception,messageno=662,path=@DGCONFDIR@/lists/localexcept
114114
# Uncomment the two lines below if want to only allow extentions/mime types in these lists
115115
# You will also need to uncomment the checkfiletype function in site.story to enable this
116116
#fileextlist = 'name=exceptionextension,path=@DGCONFDIR@/lists/exceptionextensionlist'
117-
#mimelist = 'name=exceptionmime,path=@DGCONFDIR@/lists/exceptionmimelist'
117+
#mimelist = 'name=exceptionmime,path=@DGCONFDIR@/lists/exceptionmimetypelist'
118118
#
119119
# Use the following lists to block specific kinds of file downloads.
120120
#
@@ -165,6 +165,7 @@ regexpboollist = 'name=exceptionheader,path=@DGCONFDIR@/lists/exceptionregexphea
165165
regexpreplacelist = 'name=addheader,path=@DGCONFDIR@/lists/addheaderregexplist'
166166

167167
#Virus checking exceptions - matched urls will not be virus checked
168+
#Note that you also need to amend site.story in order for this to work.
168169
#mimelist = 'name=exceptionvirus,path=@DGCONFDIR@/lists/contentscanners/exceptionvirusmimetypelist'
169170
#fileextlist = 'name=exceptionvirus,path=@DGCONFDIR@/lists/contentscanners/exceptionvirusextensionlist'
170171
#sitelist = 'name=exceptionvirus,path=@DGCONFDIR@/lists/contentscanners/exceptionvirussitelist'

configure.ac

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ AC_DEFINE([__SSLMITM],[""],[Define to enable SSL MITM])
55
AC_DEFINE([FD_SETSIZE_OVERIDE],[""],[Define to allow DANS_MAXFD to exceed FD_SETSIZE])
66

77
AC_PREREQ(2.57)
8-
AC_INIT(e2guardian, 5.3.4)
8+
AC_INIT(e2guardian, 5.3.5)
99
AM_INIT_AUTOMAKE
1010
AC_CONFIG_HEADERS([dgconfig.h])
1111
AC_CONFIG_MACRO_DIR([m4])
@@ -686,6 +686,7 @@ data/scripts/logrotation
686686
data/scripts/solaris-init
687687
data/scripts/systemv-init
688688
data/scripts/e2guardian.service
689+
data/scripts/e2guardianrasp.service
689690
doc/Makefile
690691
configs/e2guardian.conf
691692
configs/e2guardianf1.conf

notes/NEWIN_v5

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
This is the v5.3.1 stable version
1+
This is the v5.3.5 stable version
22

33
Note that large sections of the code has been re-written and there are
44
significant changes to the configuration files in v5.

src/ConnectionHandler.cpp

+15-7
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ String ConnectionHandler::hashedCookie(String *url, const char *magic, std::stri
206206
String timecode(bypasstimestamp);
207207
String data(magic);
208208
data += clientip->c_str();
209-
if(ldl->fg[filtergroup]->bypass_v2)
210-
data += clientuser;
209+
// if(ldl->fg[filtergroup]->bypass_v2)
210+
data += clientuser;
211211
data += timecode;
212212
#ifdef DGDEBUG
213213
std::cerr << thread_id << " -generate Bypass hashedCookie data " << clientip->c_str() << " " << *url << " " << clientuser << " " << timecode << std::endl;
@@ -882,7 +882,7 @@ int ConnectionHandler::handleConnection(Socket &peerconn, String &ip, bool ismit
882882

883883
// is this user banned?
884884
//isbanneduser = false;
885-
if (o.use_xforwardedfor) {
885+
if (o.use_xforwardedfor && !ismitm) { // don't do this for mitm
886886
bool use_xforwardedfor;
887887
if (o.xforwardedfor_filter_ip.size() > 0) {
888888
use_xforwardedfor = false;
@@ -899,6 +899,8 @@ int ConnectionHandler::handleConnection(Socket &peerconn, String &ip, bool ismit
899899
std::string xforwardip(header.getXForwardedForIP());
900900
if (xforwardip.length() > 6) {
901901
clientip = xforwardip;
902+
ip = clientip;
903+
header.setClientIP(ip);
902904
}
903905
#ifdef DGDEBUG
904906
std::cerr << thread_id << " -using x-forwardedfor:" << clientip << std::endl;
@@ -1162,7 +1164,9 @@ int ConnectionHandler::handleConnection(Socket &peerconn, String &ip, bool ismit
11621164
outhead += ud;
11631165
outhead += "\r\n";
11641166
outhead += "Location: ";
1165-
outhead += header.getUrl(true);
1167+
//outhead += header.getUrl(true);
1168+
outhead += checkme.logurl.before("GBYPASS=");
1169+
outhead.chop();
11661170
outhead += "\r\n";
11671171
outhead += "\r\n";
11681172
peerconn.writeString(outhead.c_str());
@@ -3084,10 +3088,10 @@ bool ConnectionHandler::checkByPass(NaughtyFilter &checkme, std::shared_ptr<LOpt
30843088
std::cerr << thread_id << " -About to check for bypass..." << std::endl;
30853089
#endif
30863090
if (ldl->fg[filtergroup]->bypass_mode != 0)
3087-
checkme.bypasstimestamp = isBypassURL(checkme.url, ldl->fg[filtergroup]->magic.c_str(),
3091+
checkme.bypasstimestamp = isBypassURL(checkme.logurl, ldl->fg[filtergroup]->magic.c_str(),
30883092
clientip.c_str(), NULL, clientuser);
30893093
if ((checkme.bypasstimestamp == 0) && (ldl->fg[filtergroup]->infection_bypass_mode != 0))
3090-
checkme.bypasstimestamp = isBypassURL(checkme.url, ldl->fg[filtergroup]->imagic.c_str(),
3094+
checkme.bypasstimestamp = isBypassURL(checkme.logurl, ldl->fg[filtergroup]->imagic.c_str(),
30913095
clientip.c_str(), &checkme.isvirusbypass,
30923096
clientuser);
30933097
if (checkme.bypasstimestamp > 0) {
@@ -3107,7 +3111,11 @@ bool ConnectionHandler::checkByPass(NaughtyFilter &checkme, std::shared_ptr<LOpt
31073111
checkme.log_message_no = 606;
31083112
}
31093113
} else if (ldl->fg[filtergroup]->bypass_mode != 0) {
3110-
if (header.isBypassCookie(checkme.urldomain, ldl->fg[filtergroup]->cookie_magic.c_str(),
3114+
String ud(checkme.urldomain);
3115+
if (ud.startsWith("www.")) {
3116+
ud = ud.after("www.");
3117+
}
3118+
if (header.isBypassCookie(ud, ldl->fg[filtergroup]->cookie_magic.c_str(),
31113119
clientip.c_str(), clientuser.c_str())) {
31123120
#ifdef DGDEBUG
31133121
std::cerr << thread_id << " -Bypass cookie match" << std::endl;

src/FOptionContainer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ bool FOptionContainer::readConfFile(const char *filename) {
156156
}
157157
while (!conffiles.eof()) {
158158
getline(conffiles, linebuffer);
159-
if (!conffiles.eof() && linebuffer.length() != 0) {
159+
if (!conffiles.fail() && linebuffer.length() != 0) {
160160
if (linebuffer[0] != '#') { // i.e. not commented out
161161
temp = (char *) linebuffer.c_str();
162162
if (temp.contains("#")) {

src/StoryBoard.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ bool StoryBoard::readFile(const char *filename, ListMeta &LM, bool is_top) {
119119
params = line.before(")").after("(");
120120
params.removeWhiteSpace();
121121
action = line.after(")");
122+
if (action.contains("#"))
123+
action = action.before("#"); // remove trailing comments
122124
action.removeWhiteSpace();
123125
if (command == "function") {
124126
if (in_function) { // already in another function definition & so assume end of previous function

0 commit comments

Comments
 (0)