Skip to content

Commit

Permalink
* wdctl_thread.c: Fix #324, again. Credit goes to Medea, I misunders…
Browse files Browse the repository at this point in the history
…tood his instructons.

	* From David Bird <[email protected]> libhttpd/: Fix #266 - don't process query string parameters and keep them in that request.path.
  • Loading branch information
benoitg committed May 24, 2007
1 parent c13e3e7 commit e9fa46e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# $Id$
2007-05-24 Benoit Gr�goire <[email protected]>
* wdctl_thread.c: Fix #324, again. Credit goes to Medea, I misunderstood his instructons.
* From David Bird <[email protected]> libhttpd/: Fix #266 - don't process query string parameters and keep them in that request.path.

2007-05-18 Benoit Gr�goire <[email protected]>
* wdctl_thread.c: Fix #324

Expand Down
10 changes: 8 additions & 2 deletions libhttpd/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,18 +571,22 @@ int httpdReadRequest(httpd *server, request *r)
}
}


#if 0
/* XXX: For WifiDog, we do not need to process any of the
post or query string parameters. So, lets keep the GET variables
in the request.path too!
*/
/*
** Process and POST data
*/
#if 0
if (r->request.contentLength > 0)
{
bzero(buf, HTTP_MAX_LEN);
_httpd_readBuf(r, buf, r->request.contentLength);
_httpd_storeData(r, buf);

}
#endif

/*
** Process any URL data
Expand All @@ -594,6 +598,8 @@ int httpdReadRequest(httpd *server, request *r)
cp++;
_httpd_storeData(r, cp);
}
#endif

return(0);
}

Expand Down
6 changes: 4 additions & 2 deletions libhttpd/httpd.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,16 @@ typedef struct {
contentLength,
authLength;
char path[HTTP_MAX_URL],
host[HTTP_MAX_URL], /* [email protected]/wifidog: Added decoding
host[HTTP_MAX_URL], /* [email protected]/wifidog: Added decoding
of host: header if present. */
ifModified[HTTP_MAX_URL];
#if(0)
userAgent[HTTP_MAX_URL],
referer[HTTP_MAX_URL],
ifModified[HTTP_MAX_URL],
contentType[HTTP_MAX_URL],
authUser[HTTP_MAX_AUTH],
authPassword[HTTP_MAX_AUTH];
#endif
} httpReq;


Expand Down
7 changes: 6 additions & 1 deletion src/fw_iptables.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,12 @@ iptables_fw_init(void)

/* TCPMSS rule for PPPoE */
iptables_do_command("-t filter -A " TABLE_WIFIDOG_WIFI_TO_INTERNET " -m state --state INVALID -j DROP");
iptables_do_command("-t filter -A " TABLE_WIFIDOG_WIFI_TO_INTERNET " -m state --state RELATED,ESTABLISHED -j ACCEPT");

/* XXX: Why this? it means that connections setup after authentication
stay open even after the connection is done...
iptables_do_command("-t filter -A " TABLE_WIFIDOG_WIFI_TO_INTERNET " -m state --state RELATED,ESTABLISHED -j ACCEPT");*/


if (ext_interface != NULL) {
iptables_do_command("-t filter -A " TABLE_WIFIDOG_WIFI_TO_INTERNET " -i %s -m state --state NEW,INVALID -j DROP", ext_interface);
iptables_do_command("-t filter -A " TABLE_WIFIDOG_WIFI_TO_INTERNET " -o %s -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu", ext_interface);
Expand Down
3 changes: 2 additions & 1 deletion src/wdctl_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ thread_wdctl(void *arg)
}

while (1) {
memset(&sa_un, 0, sizeof(sa_un));
len = sizeof(sa_un);
memset(&sa_un, 0, len);
if ((fd = accept(sock, (struct sockaddr *)&sa_un, &len)) == -1){
debug(LOG_ERR, "Accept failed on control socket: %s",
strerror(errno));
Expand Down

0 comments on commit e9fa46e

Please sign in to comment.