]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
10 years agoext_ldap_group_acl: Version 2.18 documentation updates
Amos Jeffries [Wed, 17 Dec 2014 13:53:10 +0000 (02:53 +1300)] 
ext_ldap_group_acl: Version 2.18 documentation updates

Bump the helper version number to 2.18 as should have been done back in
2010 when previous redesign was made.

Also, add copyright notices to ChangeLog indicating MARA Systems
copyright to original 2.17 and older code, Squid Project on 2.18 and
newer additions.

10 years agobasic_ldap_auth: Drop unnecessary README
Amos Jeffries [Wed, 17 Dec 2014 13:45:28 +0000 (02:45 +1300)] 
basic_ldap_auth: Drop unnecessary README

10 years agoSupport http_access denials of SslBump "peeked" connections.
Christos Tsantilas [Tue, 16 Dec 2014 18:29:14 +0000 (20:29 +0200)] 
Support http_access denials of SslBump "peeked" connections.

If an SSL connection is "peeked", it is currently not possible to deny it
with http_access. For example, the following configuration denies all plain
HTTP requests as expected but allows all CONNECTs (and all subsequent
encrypted/spliced HTTPS requests inside the allowed CONNECT tunnels):

  http_access deny all
  ssl_bump peek all
  ssl_bump splice all

The bug results in insecure bumping configurations and/or forces admins to
abuse ssl_bump directive (during step1 of bumping) for access control (as a
partial workaround).

This change sends all SSL tunnels (CONNECT and transparent) through http_access
(and adaptation, etc.) checks during bumping step1. If (real or fake) CONNECT is
denied during step1, then Squid does not connect to the SSL server, but bumps
the client connection, and then delivers an error page (in response to the
first decrypted GET). The behavior is similar to what Squid has already been
doing for server certificate validation errors.

Technical notes
----------------

Before these changes:

  * When a transparent SSL connection is being bumped, if we decide to splice
    during step1, then we splice the connections without any http_access
    checks. The (spliced) connection is always established.

  * When a CONNECT tunnel is being bumped at step1, if peek/stare/server-first
    mode is selected, and our http_access check fails, then:
     1) We create an error page and proceeding with SSL bump, expecting
        to serve the error after the client SSL connection is negotiated.
     2) We start forwarding SSL Hello to the server, to peek/stare at (or
        server-first bump) the server connection.
     3) If we then decide to splice the connection during step2 or step3, then
        we splice, and the error page never gets served to the client!

After these changes:

  * During transparent SSL bumping, if we decide to splice at step1, do not
    splice the connection immediately, but create a fake CONNECT request first
    and send it through the callout code (http_access check, ICAP/ECAP, etc.).
    If that fake CONNECT is denied, the code path described below kicks in.

  * When an error page is generated during CONNECT or transparent bumping
    (e.g. because an http_access check has failed), we switch to the
    "client-first" bumping mode and then serve the error page to the client
    (upon receiving the first regular request on the bumped connection).

This is a Measurement Factory project.

10 years agoBug 4164: SEGFAULT when %W formating code used in errorpages
Christos Tsantilas [Tue, 16 Dec 2014 17:55:04 +0000 (19:55 +0200)] 
Bug 4164: SEGFAULT when %W formating code used in errorpages

Squid will crash inside ErrorState::Dump if not authentication configured for
squid. In this case ErrorState::auth_user_request is NULL and trying to access
a method of this object will cause segfault to squid.

10 years agoCleanup: remove unused OS detection of Sun, SysV, Ultrix, BSDi
Amos Jeffries [Tue, 16 Dec 2014 15:13:49 +0000 (04:13 +1300)] 
Cleanup: remove unused OS detection of Sun, SysV, Ultrix, BSDi

10 years agoBug 3826: pt 2: Provide a systemd .service file for Squid
Hussam Al-Tayeb [Tue, 16 Dec 2014 12:23:58 +0000 (01:23 +1300)] 
Bug 3826: pt 2: Provide a systemd .service file for Squid

Created with help from davidstrauss in #systemd channel and provided
as a working example for package distributors to use. It is not
installed by a 'make install' build of Squid.

For now SMP support is not available to Squid controlled by systemd.
That part of the bug 3826 issue has yet to be resolved.

10 years agoSourceLayout: shuffle Sys-V init script to tools/sysvinit/
Amos Jeffries [Tue, 16 Dec 2014 11:01:29 +0000 (00:01 +1300)] 
SourceLayout: shuffle Sys-V init script to tools/sysvinit/

10 years agoUpdate Http::ProtocolVersion() to initializer functions
Amos Jeffries [Thu, 11 Dec 2014 08:35:32 +0000 (00:35 -0800)] 
Update Http::ProtocolVersion() to initializer functions

The Http::ProtocolVersion(*) does not work sufficiently well as a class
hierarchy.

Convert Http::ProtocolVersion to two functions:

* Http::ProtocolVersion() providing the default Squid HTTP version
level, and

* Http::ProtocolVersion(unsigned, unsigned) providing the HTTP version
details for the given level.

NP: using two overloaded functions instead of one with default
parameter values because with HTTP/0.x and HTTP/2.x we cannot safely
default just the minor value. ie. using two functions prevents
mistakenly using HTTP/2.1, HTTP/0.1 or HTTP/1.0 if the second
parameter is omitted.

All variables must now be of type AnyP::ProtocolVersion, and should be
constructed from an appropriate Foo::ProtocolVersion() function.

10 years agoDeleting first fs left psstate->servers pointing to uninitialized memory
Christos Tsantilas [Tue, 9 Dec 2014 19:29:01 +0000 (21:29 +0200)] 
Deleting first fs left psstate->servers pointing to uninitialized memory
possibly causing infinite loops in peerAddFwdServer().

TODO: The condition itself is excessive. If fs is not nil, the previous check
already tells us that the Config.forward_max_tries limit is exceeded.

10 years agoMaintenance: check release notes on packaging
Amos Jeffries [Tue, 9 Dec 2014 16:40:40 +0000 (08:40 -0800)] 
Maintenance: check release notes on packaging

10 years agoPrep for 3.5.0.3 and 3.4.10
Amos Jeffries [Tue, 9 Dec 2014 14:03:14 +0000 (06:03 -0800)] 
Prep for 3.5.0.3 and 3.4.10

10 years agoUpdate localnet definition for RFC 6890
Amos Jeffries [Mon, 8 Dec 2014 11:25:58 +0000 (03:25 -0800)] 
Update localnet definition for RFC 6890

RFC 6890 details updated IP address reservations for Carrier-Grade NAT
and confirms registration of the "this" network range legitimacy amongst
other non-relevant ddress range allocations.

10 years agoTypo in rev.13747
Amos Jeffries [Sun, 7 Dec 2014 16:13:45 +0000 (08:13 -0800)] 
Typo in rev.13747

10 years agourl_lfs_rewrite: Update man(8) documentation
Amos Jeffries [Sun, 7 Dec 2014 15:21:44 +0000 (07:21 -0800)] 
url_lfs_rewrite: Update man(8) documentation

10 years agoext_wbinfo_group_acl: Update man(8) documentation
Amos Jeffries [Sun, 7 Dec 2014 15:06:43 +0000 (07:06 -0800)] 
ext_wbinfo_group_acl: Update man(8) documentation

10 years agoext_sql_session_acl: Update man(8) documentation
Amos Jeffries [Sun, 7 Dec 2014 14:55:08 +0000 (06:55 -0800)] 
ext_sql_session_acl: Update man(8) documentation

10 years agoext_delayer_acl: Update man(8) documentation
Amos Jeffries [Sun, 7 Dec 2014 14:47:32 +0000 (06:47 -0800)] 
ext_delayer_acl: Update man(8) documentation

10 years agobasic_pop3_auth: Add man(8) documentation
Amos Jeffries [Sun, 7 Dec 2014 14:40:00 +0000 (06:40 -0800)] 
basic_pop3_auth: Add man(8) documentation

10 years agobasic_msnt_multi_domain_auth: Add man(8) documentation
Amos Jeffries [Sun, 7 Dec 2014 14:26:56 +0000 (06:26 -0800)] 
basic_msnt_multi_domain_auth: Add man(8) documentation

Also, update helper to use command-line parameters instead of hard-coded
configuration for most options.

10 years agobasic_db_auth: update man(8) documentation
Amos Jeffries [Sun, 7 Dec 2014 14:22:16 +0000 (06:22 -0800)] 
basic_db_auth: update man(8) documentation

10 years agoFix bootstrap.sh dependency on SPONSORS.list
Amos Jeffries [Sun, 7 Dec 2014 11:13:37 +0000 (00:13 +1300)] 
Fix bootstrap.sh dependency on SPONSORS.list

bootstrap.sh is distributed in tarballs and may be used by packagers for
various reasons. It does not need to unconditionally replace SPONSORS.

10 years agoAdd URL-rewriter based on local file existence
Amos Jeffries [Sat, 6 Dec 2014 13:43:32 +0000 (05:43 -0800)] 
Add URL-rewriter based on local file existence

Not exactly new. The basic code for this has been bundled with Squid in
contrib/ since 1996.

* Shuffle the contrib/rredir.* helpers code into helpers/url_rewrite/LFS/

* Add missing copyright boilerplate, CONTRIBUTORS and CREDITS entries

* Add Makefile support to install the perl helper

Redesign perl helper:

* update for strict Perl syntax

* update to current (Squid-3.4+) helper protocol

* replace hard-coded rewriter config with flexible command-line
  parameters

* add debug support

* add concurrency support

* add helper documentation

10 years agoDocs: drop old README.wccpv2
Amos Jeffries [Sat, 6 Dec 2014 06:42:33 +0000 (22:42 -0800)] 
Docs: drop old README.wccpv2

10 years agoBoilerplate: add several missing copyright blurbs
Amos Jeffries [Sat, 6 Dec 2014 06:33:37 +0000 (22:33 -0800)] 
Boilerplate: add several missing copyright blurbs

10 years agoHTTP/2: Add method PRI registration
Amos Jeffries [Fri, 5 Dec 2014 13:07:30 +0000 (05:07 -0800)] 
HTTP/2: Add method PRI registration

10 years agoHTTP/2: handle 'PRI' method found in HTTP/1.x traffic
Amos Jeffries [Fri, 5 Dec 2014 13:02:46 +0000 (05:02 -0800)] 
HTTP/2: handle 'PRI' method found in HTTP/1.x traffic

draft-ietf-httpbis-http2-16 section 11.6 registers the method PRI.
"
  This method is never used by an actual client.
  This method will appear to be used when an HTTP/1.1 server or
  intermediary attempts to parse an HTTP/2 connection preface.
"

If seen with a non-2.0 version number it means some client or proxy has
mishandled an HTTP/2.0 connection preface and corrupted the traffic.

10 years agoSourceFormat Enforcement
squidadm@squid-cache.org [Thu, 4 Dec 2014 18:11:26 +0000 (18:11 +0000)] 
SourceFormat Enforcement

10 years agoFix handling of regex \ characters
Amos Jeffries [Thu, 4 Dec 2014 16:06:59 +0000 (08:06 -0800)] 
Fix handling of regex \ characters

10 years agourl_rewrite_timeout directive part2: fix to allow complie when adaptation is not
Christos Tsantilas [Thu, 4 Dec 2014 16:01:10 +0000 (18:01 +0200)] 
url_rewrite_timeout directive part2: fix to allow complie when adaptation is not
 enabled

10 years agourl_rewrite_timeout directive
Christos Tsantilas [Thu, 4 Dec 2014 14:00:17 +0000 (16:00 +0200)] 
url_rewrite_timeout directive

This patch adds the url_rewrite_timeout directive.

When configured, Squid keeps track of active requests and treats timed out
requests to redirector as failed requests.

url_rewrite_timeout format:

  url_rewrite_timeout timeout time-units on_timeout=<fail|bypass|retry|use_configured_response> [response=<quoted-string>]

The url_rewrite_timeout directive can accept the on_timeout argument to allow
user configure the action when the helper request times out.
The available actions are:

     fail: squid return a ERR_GATEWAY_FAILURE error page
     bypass: the url is not rewritten.
     retry: retry the request to helper
     use_configured_response: use a response which can be configured using the
         the response= option

Example usage:
    url_rewrite_timeout 30 seconds \
        on_timeout=use_configured_response \
        response="OK url=http://example.com/support"

This is a Measurement Factory project

10 years agoHTTP/2: Support 421 (Misdirected Request) status code
Amos Jeffries [Wed, 3 Dec 2014 15:13:08 +0000 (07:13 -0800)] 
HTTP/2: Support 421 (Misdirected Request) status code

Add support for status 421 responses. Squid is forbidden from generating
messages with this status in its role as proxy, however we expect to see
it being produced in responses by HTTP/2 servers in traffic from HTTP
2.0<->1.1 gateways.

We also MAY emit it on future reverse-proxy responses in the event of a
ERR_CANNOT_FORWARD message.

10 years agoBug 4135: Support \-escaped character in regex patterns
Amos Jeffries [Wed, 3 Dec 2014 14:12:12 +0000 (06:12 -0800)] 
Bug 4135: Support \-escaped character in regex patterns

Squid cannot parse regex patterns as quoted strings since the pattern may
itself contain quote characters as part of the syntax.

Since we updated the squid.conf ConfigParser it is now possible to
handle regex patterns containing quoted-pair (\-escaped) characters
properly.

Add support for escaping by detecting the '\' characters as token
delimiters, and explicitly skipping the following character regardless
of whether it is a SP or not.

Escape detection is only added during parsing of regex tokens or
files listing regex patterns.

10 years agoFTP FEAT error handling
Christos Tsantilas [Mon, 1 Dec 2014 17:22:07 +0000 (19:22 +0200)] 
FTP FEAT error handling

Some FTP severs respond to a FEAT command with 5xx status code. Squid sends
an invalid response in these cases which can confuse the client.

This patch fixes Squid to always send a valid 211 reply to client which
lists at least the EPSV and EPRT ftp commands which supported by Squid
regardless of the origin server support.

This patch also fixes a memory leak when FEAT replies processed.

This is a Measurement Factory project

10 years agoAdd statistics couting for missing mem_obj (bug 4131)
Amos Jeffries [Mon, 1 Dec 2014 12:48:38 +0000 (04:48 -0800)] 
Add statistics couting for missing mem_obj (bug 4131)

10 years agoBug 4131: SIGSEGV at store.cc:962 content_length > store_maxobjsize
Alex Rousskov [Mon, 1 Dec 2014 11:59:46 +0000 (03:59 -0800)] 
Bug 4131: SIGSEGV at store.cc:962 content_length > store_maxobjsize

10 years agoSourceFormat Enforcement
squidadm@squid-cache.org [Mon, 1 Dec 2014 06:11:47 +0000 (06:11 +0000)] 
SourceFormat Enforcement

10 years agoSourceLayout: shuffle memory pool allocators to mem/libmem.la
Amos Jeffries [Mon, 1 Dec 2014 04:05:48 +0000 (20:05 -0800)] 
SourceLayout: shuffle memory pool allocators to mem/libmem.la

There are no logic changes in this patch.

* Some code is using the 'old' or internal pool allocation APIs
  directly. These have been marked with XXX for future logic
  changes to update.

* The memory pools API and MEMPROXY_CLASS() definition are now
  available through the mem/forward.h header file.

* Mem:: namespace has been added for library contents.

* MemAllocatorProxy class has been moved into Mem:: namespace
  and extracted from mem.cc but should only be used via the
  MEMPROXY_CLASS() macro.

* Extended the memory STUB file to define all mem/forward.h
  symbols and a few others needed currently by code using the
  older deprecated memory APIs.

Also, some time API functions exported by util.h instead of
SquidTime.h have been marked as needing work.

10 years agoBug 4148: external_acl_type header format does not accept the new libformat syntax
Jorge Ivan Burgos Aguilar [Wed, 26 Nov 2014 10:23:03 +0000 (02:23 -0800)] 
Bug 4148: external_acl_type header format does not accept the new libformat syntax

10 years agoBug 4033: Rebuild corrupted ssl_db/size file
Christos Tsantilas [Tue, 25 Nov 2014 16:46:38 +0000 (18:46 +0200)] 
Bug 4033: Rebuild corrupted ssl_db/size file

The certificate db size file may become empty (for reasons beyond Squid
control such as server reboots, and possibly some unknown Squid bugs).
When it becomes empty, all ssl_crtd helpers (and then Squid) quit. This
change is required to make ssl_crtd more robust by recovering lost db
size information.

This patch:
 - Adds the "size" rebuild operation in CertificateDB and ssl_crtd
   daemon. Rebuild ssl_db/size file if it is empty:
     * Inside Ssl::CertificateDb::check method
     * When a CertificateDB operation try to read size from ssl_db/size file

 - If no fs_block_size parameter given for CertificateDB then consider a
   default value of 2048. Currently set to 0, which is may cause segfault to
   ssl_crtd daemon.

This is a Measurement Factory project

10 years agoRevert splay-specific pieces of rev.13720
Amos Jeffries [Sat, 22 Nov 2014 06:10:20 +0000 (22:10 -0800)] 
Revert splay-specific pieces of rev.13720

As suspected several important pieces of code depend on the SplayNode
this pointer being NUL at times.

10 years agoRevert r12298 workaround for Bug 3613
Amos Jeffries [Fri, 21 Nov 2014 18:26:17 +0000 (10:26 -0800)] 
Revert r12298 workaround for Bug 3613

Now that Squid is starting to utilize C++11 features we need to enable
them in all compilers. If the problem still exists then we need to find
a better solution to bug 3613.

10 years agoCleanup: remove invalid comparisons of 'this' with NULL
Amos Jeffries [Fri, 21 Nov 2014 18:14:10 +0000 (10:14 -0800)] 
Cleanup: remove invalid comparisons of 'this' with NULL

... which are invalid in C++ and always equate (this!=NULL) to true.

Clang 3.5 refuses to build code containing these invalid comparisons.

10 years agoHTCP: fix memory initialization errors
Amos Jeffries [Fri, 21 Nov 2014 18:09:06 +0000 (10:09 -0800)] 
HTCP: fix memory initialization errors

memset() used to initialize HTCP objects made sense when they were
structs. But now they are classes proper constructors need to be used
to avoid memset() erasing vtable and other important areas. It also
helps to reduce code and improve performance during init a tiny bit.

memset() errors found by Clang 3.5

10 years agoFix typo in rev.13711
Amos Jeffries [Fri, 21 Nov 2014 14:56:35 +0000 (06:56 -0800)] 
Fix typo in rev.13711

10 years agoBug 4146: workaround SSL Bump crash on Linux
Amos Jeffries [Fri, 21 Nov 2014 10:07:05 +0000 (02:07 -0800)] 
Bug 4146: workaround SSL Bump crash on Linux

10 years agoFix build errors on CentOS 7 in rev.13712
Amos Jeffries [Fri, 21 Nov 2014 04:33:21 +0000 (20:33 -0800)] 
Fix build errors on CentOS 7 in rev.13712

It turns out the RHEL and CentOS 7 STL definition does not quite match
up to official documentation of what their GCC version supports. In
particular the use of const_iterator on std::list containers.

Use auto instead of an explicit iterator. Allowing the compiler to select
whichever iterator is available and will work.

10 years agoBug 3902: Docs: external_acl_type cache hash key
Amos Jeffries [Thu, 20 Nov 2014 15:36:59 +0000 (07:36 -0800)] 
Bug 3902: Docs: external_acl_type cache hash key

10 years agoBug 4145: squid_endian.h compile errors with OpenBSD 5.6
Amos Jeffries [Thu, 20 Nov 2014 12:24:30 +0000 (04:24 -0800)] 
Bug 4145: squid_endian.h compile errors with OpenBSD 5.6

* Remove unused big-endian macros.

* Stop making assumptions about little-endian symbols existence. Test
  each one explicitly and define only as necessary.

* Add support for systems with endian.h available.

* Move Endian hacks to libntlmauth which is the only code using them.
  Also, build only if NTLM is required.

10 years agoLogging fast things part 2: fixes to allow make check work again
Christos Tsantilas [Thu, 20 Nov 2014 11:16:35 +0000 (13:16 +0200)] 
Logging fast things part 2: fixes to allow make check work again

Add tvSub and tvAssignAdd stubs to src/tests/stub_time.cc

10 years agoCleanup: repalce several CbDataLIst uses with std::list
Amos Jeffries [Thu, 20 Nov 2014 09:34:09 +0000 (01:34 -0800)] 
Cleanup: repalce several CbDataLIst uses with std::list

Most of the uses of CbDataList appear to be abusing it for regular
list storage without any real need for CBDATA to be involved at all.

Also includes some documentation and syntax polishing cleanup.

10 years agoLogging fast things
Christos Tsantilas [Thu, 20 Nov 2014 08:57:14 +0000 (10:57 +0200)] 
Logging fast things

In many cases HITs logged with zero response times. The logging entries are
correct, those transaction took less than a millisecond. However, to better
monitor Squid performance and to optimize things further, a user may want to
see more precise response time measurements logged.

Squid already computes response times with microsecond resolution
(timeval::tv_usec), which would be enough for any modern measurement, but
Squid loses that precision due to tvSubMs conversion.

This patch add configurable "precision" for time-related fields such as %tr,
using a .n syntax similar to the syntax used by the well-known printf(3) API
to mean "maximum field width".

Examples:
  %tr   -- 0 -- millisecond precision (no change compared to today)
  %.3tr -- 0.123 -- microsecond precision (after this project)
  %.6tr -- 0.123456 -- nanosecond precision (year 2050 trading platform??)

This is a Measurement Factory project

10 years agoParserNG: fix typo in rev.13688
Amos Jeffries [Wed, 19 Nov 2014 22:29:50 +0000 (14:29 -0800)] 
ParserNG: fix typo in rev.13688

Squid xstrncpy() assumes \0-termination and enforces it by overwriting
the last byte of the output. Un-terminated strings must have +1 length
delivered or they will be truncated.

10 years agoFix missing stub changes in rev.13693
Amos Jeffries [Wed, 19 Nov 2014 12:09:05 +0000 (04:09 -0800)] 
Fix missing stub changes in rev.13693

  Detected by Coverity Scan. CID 12550451255046

10 years agoDrop dead code in Http::One::Parser::getHeaderField()
Amos Jeffries [Wed, 19 Nov 2014 12:02:36 +0000 (04:02 -0800)] 
Drop dead code in Http::One::Parser::getHeaderField()

  Detected by Coverity Scan. CID 1255044.

10 years agoC++11: limit unit-tests using C++11 features to only build when able
Amos Jeffries [Tue, 18 Nov 2014 12:39:31 +0000 (04:39 -0800)] 
C++11: limit unit-tests using C++11 features to only build when able

10 years agoAlternate-Protocol is a hop-by-hop header
Amos Jeffries [Tue, 18 Nov 2014 10:13:39 +0000 (02:13 -0800)] 
Alternate-Protocol is a hop-by-hop header

Google are pushing Alternate-Protocol header to arbitrarily move clients
from HTTP to their experimental and proprietary protocols.

When relayed through a proxy this can cause traffic bifurcation with
side effects ranging from client visible failures, to traffic increase
on the network as proxy caching is bypassed, to security vulnerabilities
or privacy information leaks over the experimental protocol.

Treating the Alternate-Protocol header as a hop-by-hop header only
relevant on client->origin connections we can both prevent the above
issues occuring on networks utilizing a proxy, and also participate in
the protocol exprimentation process ourselves.

10 years agoMove the AnyP::ProtocolVersion stream operator into AnyP:: namespace
Amos Jeffries [Tue, 18 Nov 2014 06:38:51 +0000 (22:38 -0800)] 
Move the AnyP::ProtocolVersion stream operator into AnyP:: namespace

Clang compiler detects an issue determining which of multiple overloaded
operator<<() at global scope apply to the display of
AnyP::ProtocolVersion.

Moving the operator into the class itself is not possible due to similar
scoping issues with GCC failing to detect it as an inline member from
inside expanded templates.

To resolve both issues we can move the operator only to the AnyP::
namespace but no deeper.

10 years agoFix output from squid.conf parser
Amos Jeffries [Mon, 17 Nov 2014 10:04:18 +0000 (02:04 -0800)] 
Fix output from squid.conf parser

DBG_CRITICAL level messages before self_destruct() require a FATAL: tag
to highlight the reason for the crash and obscure  "BUNGLED" text which
is about to follow.

10 years agoRelease Notes update for 3.6
Amos Jeffries [Sat, 15 Nov 2014 07:42:32 +0000 (23:42 -0800)] 
Release Notes update for 3.6

10 years agoAdd squid.conf regression tests for 3.5
Amos Jeffries [Thu, 13 Nov 2014 11:05:52 +0000 (03:05 -0800)] 
Add squid.conf regression tests for 3.5

10 years agoFix delay_parameters parsing
Amos Jeffries [Thu, 13 Nov 2014 07:45:12 +0000 (23:45 -0800)] 
Fix delay_parameters parsing

Squid-3.4 parser changes resulted in always getting a BUNGLED error when
parsing delay_parameters. Convert to the new ConfigParser engine.

Add ability to specify 'none' for no-limit instead of -n/*

10 years agoCygwin: FOPEN may be defined
Amos Jeffries [Wed, 12 Nov 2014 12:15:31 +0000 (04:15 -0800)] 
Cygwin: FOPEN may be defined

10 years agoFix segmentation fault in ACLUrlPathStrategy::match
Amos Jeffries [Tue, 11 Nov 2014 04:55:56 +0000 (20:55 -0800)] 
Fix segmentation fault in ACLUrlPathStrategy::match

CONNECT requests do not contain a path segment. If tested with a
urlpath_regex ACL will crash Squid via xstrdup() NULL protection.

10 years agoSourceFormat Enforcement
squidadm@squid-cache.org [Mon, 10 Nov 2014 12:11:20 +0000 (12:11 +0000)] 
SourceFormat Enforcement

10 years agoAdapting 100-continue
Christos Tsantilas [Mon, 10 Nov 2014 11:45:36 +0000 (13:45 +0200)] 
Adapting 100-continue

Currently squid fails to handle correctly "100 Continue" requests/responses
when ICAP is used. The problems discussed in squid bugzilla:
     http://bugs.squid-cache.org/show_bug.cgi?id=4067

A short discussion of the problem:
  When a data upload request enters squid (eg a PUT request with
"Expect: 100-continue" header), squid sends ICAP headers and HTTP headers to
ICAP server and stucks waiting for ever  the request body data.

This patch implements the "force_request_body_continuation" access list
directive which controls how Squid handles data upload requests from HTTP and
send the request body to Squid.
An allow match tells Squid to respond with the HTTP 100 or FTP 150
(Please Continue) control message on its own, before forwarding the
request to an adaptation service or peer. Such a response usually forces
the request sender to proceed with sending the body. A deny match tells
Squid to delay that control response until the origin server confirms
that the request body is needed. Delaying is the default behavior.

This is a Measurement Factory project

10 years agoC++11: cleanup compiler flag detection logics
Amos Jeffries [Mon, 10 Nov 2014 08:42:54 +0000 (00:42 -0800)] 
C++11: cleanup compiler flag detection logics

Annotate what GCC version is required to pass the -std=c++11 and
-std=c++0x feature detection tests.

Disable the tests for features we do not use that require GCC 4.5+.
This should allow Squid to continue building on older OS and compilers
at least until we start using those features.

10 years agoRFC 6176 compliance
Amos Jeffries [Mon, 10 Nov 2014 07:47:13 +0000 (23:47 -0800)] 
RFC 6176 compliance

... prohibits use of SSLv2.
https://tools.ietf.org/html/rfc6176

Remove the documentation and support for configuring Squid with
SSLv2-only.

Explicitly enable the SSL_NO_SSLv2 option when provided by the library
to prevent implicit fallback.

Remove support for ssloptions= values which are for SSLv2-specific bugs.

Due to the way they are implemented with atoi() sslversion=N
configuration will still accept the values for SSLv2-only. But the
context creation will now unconditionally produce "SSLv2 not
supported" errors if the now undocumented values are attempted.

10 years agoMake helper queue size configurable patch: default queue size for external_acl fix
Christos Tsantilas [Mon, 10 Nov 2014 06:38:37 +0000 (08:38 +0200)] 
Make helper queue size configurable patch: default queue size for external_acl fix

The default queue size value is never set for external_acl helpers.

10 years agoMake helper queue size configurable, with consistent defaults and better overflow...
Christos Tsantilas [Sun, 9 Nov 2014 21:21:15 +0000 (23:21 +0200)] 
Make helper queue size configurable, with consistent defaults and better overflow handling.

This patch adds a queue-size=N option to helpers configuration. This
option allows users to configure the maximum number of queued requests
to busy helpers. We also adjusted the default queue size limits to be
more consistent across all helpers and made Squid more robust on some
queue overflows:

- external_acl helpers
    Make the maximum queue size configurable via queue-size.
    Default to 2*maximum-number-of-children.
    If the queue overflows, then the ACL returns ACCESS_DUNNO.

    Unpatched code uses the number of running children as the maximum
    queue size. If the queue is overloaded, then the ACL returns ACCESS_DUNNO.

-redirector/storeID helpers
    Make the maximum queue size configurable via queue-size.
    Default to 2*maximum-number-of-children.
    If the queue overflows and redirector_bypass configuration option
    is set, then redirector is bypassed. Otherwise, if overloading
    persists for more than 3 minutes squid quits with a FATAL message.
    If the redirector_bypass/storeID_bypass is set then the default queue_size
    is set to 0 for backward compatibility.

    Unpatched code uses 2*number-of-running-children as the maximum queue size.
    If the redirector_bypass/storeID_bypass is set then helper bypassed if all
    of the children are busy.
    If the queue is overloaded and redirector_bypass/storeID_bypass is not set
    then squid quits with a FATAL message.

- ssl_crtd/ssl_crtd_validator helpers.
    Make the maximum queue size configurable via queue-size.
    Default to 2*maximum-number-of-children.
    If the queue overflows, then helpers are bypassed. If overloading persists
    for more than 3 minutes squid quits with a FATAL message.

    The default size limit and overflow behavior has not changed.

- Authentication helpers
    Make the maximum queue size configurable via queue-size.
    Default to 2*maximum-number-of-children.
    If the queue overflows and overloading persists for more than 3 minutes,
    then squid quits with a FATAL message.

    The default size limit and overflow behavior has not changed.

This is a Measurement Factory project

10 years agoparserNG: add missing unit test for HTTP/0.9 case
Amos Jeffries [Sun, 9 Nov 2014 14:57:25 +0000 (06:57 -0800)] 
parserNG: add missing unit test for HTTP/0.9 case

10 years agoParser-NG: fixes to allow ecap and ssl subsystems build
Christos Tsantilas [Sun, 9 Nov 2014 12:45:46 +0000 (14:45 +0200)] 
Parser-NG: fixes to allow ecap and ssl subsystems build

10 years agoParser-NG: adjust unit tests for new RFC compliance behaviour
Amos Jeffries [Fri, 7 Nov 2014 16:26:41 +0000 (08:26 -0800)] 
Parser-NG: adjust unit tests for new RFC compliance behaviour

Current parser in strict mode is complying with RFC 7230 removal of
completely empty lines (but not whitespace) before the request-line.

10 years agoSourceFormat Enforcement
squidadm@squid-cache.org [Fri, 7 Nov 2014 12:11:21 +0000 (12:11 +0000)] 
SourceFormat Enforcement

10 years agoParser-NG: HTTP Parser structural redesign
Amos Jeffries [Fri, 7 Nov 2014 08:41:47 +0000 (00:41 -0800)] 
Parser-NG: HTTP Parser structural redesign

This update is to lay the groundwork for several planned future projects
implementing protocol specific parsers, seperating the currently
intertwinned client connection management and HTTP protocol parsing
logics, and for zero-copy processing of transactions using SBuf.

This patch renames the HttpParser class as RequestParser and moves it
into the Http::One:: namespace as child of an Http::Parser class with
generic API accessors for shared use by other HTTP message parsers.

The class API
 - is updated to process both the request-line and HTTP mime headers,
returning an incomplete parse result until the entire headers parts of
the message have been received.
 - now contains accessor methods for retrieving the method, URI,
protocol, mime headers block (as an SBuf) and some metrics about those.
 - the old request_offsets structure and similar offset details are no
longer exposed.
 - now emits 414 and 431 HTTP status codes as appropriate.

The parser is made partially incremental and some use of Tokenizer is
added for faster parsing. There is more that can be done to further
speed up parsing of slow or very large requests.

Much of the code from client_side.cc parseHttpRequest() and also the
header-field code from mime_headers.cc has been moved into the parser
class. The client_side.cc code now simply runs the main
Http1::RequestParser::parse() method then uses accessors to retrieve
and process the parse results.

A unit test for incremental parsing has been added to testHttpParser.

Also, the HttpRequestMethod class is moved into the Http:: namespace and
library to reduce dependencies on the parser class outside the library.

The gains made so far from incremental parse, reducing parser passes and
zero-copy SBuf are offset by several temporary performance regressions
added converting SBuf for legacy code use. These are marked for later
removal.

10 years agoFix two build errors in ufsdump
Amos Jeffries [Fri, 7 Nov 2014 08:37:45 +0000 (00:37 -0800)] 
Fix two build errors in ufsdump

10 years agoMerge from trunk rev.13687
Amos Jeffries [Wed, 5 Nov 2014 10:18:15 +0000 (02:18 -0800)] 
Merge from trunk rev.13687

10 years agoFix missed Peer Digest update in rev.13684
Amos Jeffries [Wed, 5 Nov 2014 04:09:20 +0000 (20:09 -0800)] 
Fix missed Peer Digest update in rev.13684

10 years agosquidclient: Fix display errors in man(1) page
Amos Jeffries [Tue, 4 Nov 2014 14:39:14 +0000 (06:39 -0800)] 
squidclient: Fix display errors in man(1) page

10 years agoRelease Notes: URI updates for 3.5
Amos Jeffries [Tue, 4 Nov 2014 14:23:42 +0000 (06:23 -0800)] 
Release Notes: URI updates for 3.5

10 years agoBug 1961 part 2: redesign of URL handling.
Amos Jeffries [Tue, 4 Nov 2014 08:47:03 +0000 (00:47 -0800)] 
Bug 1961 part 2: redesign of URL handling.

Move the HttpRequest::login detail into class URL. Renaming to userInfo
as per the RFC 3986 defined name for this URI piece.

Convert the details to SBuf gaining several minor str*() removals in
the process and a simpler FTP login parser based on SBuf capabilities.

Also, updated the base64 encoder API used for converting between URI
userInfo and Basic authentication header token. Gaining better control
over the length of maximum token size and a small speedup from pre-known
input length.

10 years agoFix rev.13668 strdup uses and removes the safe_free
Markus Moeller [Mon, 3 Nov 2014 03:42:31 +0000 (19:42 -0800)] 
Fix rev.13668 strdup uses and removes the safe_free

* use xstrdup() instead of strdup()

* replace safe_free() which should be just a setting to NULL.

10 years agoFix stub changes missed in rev.13680
Amos Jeffries [Mon, 3 Nov 2014 01:10:23 +0000 (17:10 -0800)] 
Fix stub changes missed in rev.13680

10 years agoSourceLayout: shuffle CbDataList to libbase
Amos Jeffries [Sun, 2 Nov 2014 05:51:22 +0000 (22:51 -0700)] 
SourceLayout: shuffle CbDataList to libbase

Fixing a layering violation between include/ and src/cbdata.h

10 years agoCleanup: Simplify CBDATA API and rename CBDATA_CLASS
Amos Jeffries [Sun, 2 Nov 2014 00:10:01 +0000 (17:10 -0700)] 
Cleanup: Simplify CBDATA API and rename CBDATA_CLASS

There are no logic changes here.

* Rename CBDATA_CLASS2() to CBDATA_CLASS()

* Remove cbdata*Dbg() duplicate interface for CBDATA.
  Inline it with the CBDATA_CLASS() API

* update public:/private: class section handling in CBDATA_CLASS() and
  place all uses at the top of class definition as with MEMPROXY_CLASS()
  and typedef coding style.
 - this highlights TunnelStateData API as previously broken in regards
   to private members. Leave it public: for now with TODO on fixing.

10 years agoDocs: Add man(8) page for helper-mux tool
Amos Jeffries [Sat, 1 Nov 2014 05:04:05 +0000 (22:04 -0700)] 
Docs: Add man(8) page for helper-mux tool

Convert the helper-mux.pl.README to inlineperl docs and generate a man(8)
page using pod2man when possible.

Also, shuffle the tool into a sub-directory of its own for easier build
management.

Also, add a automake conditional ENABLE_POD2MAN_DOC to allow optional
build of perl tools or helpers without depending on pod2man which is
only necessary for the documentation.

10 years agoDocs: convert purge tool README to man.1 page
antiago Garcia Mantinan [Sat, 1 Nov 2014 00:43:23 +0000 (17:43 -0700)] 
Docs: convert purge tool README to man.1 page

Initial conversion performed by Santiago Garcia Mantinan of Debian.

With po4a adjustments by Amos Jeffries.

10 years agoPrep for 3.5.0.2 and 3.4.9
Amos Jeffries [Fri, 31 Oct 2014 08:19:44 +0000 (01:19 -0700)] 
Prep for 3.5.0.2 and 3.4.9

10 years agoFix man(8)/man(1) page syntax
Amos Jeffries [Fri, 31 Oct 2014 08:02:57 +0000 (01:02 -0700)] 
Fix man(8)/man(1) page syntax

It seems automated tools such as lroff are not able to parse the groff
syntax accurately for automated indexing of our man pages.

The if-conditional syntax was only used to simplify translators lives
so we can live with the tools preferred 1-liner syntax for the NAME
section.

10 years agoSource Maintenance: bump astyle version to 2.03
Amos Jeffries [Thu, 30 Oct 2014 15:32:34 +0000 (08:32 -0700)] 
Source Maintenance: bump astyle version to 2.03

10 years agoSourceFormat Enforcement
squidadm@squid-cache.org [Thu, 30 Oct 2014 15:27:19 +0000 (15:27 +0000)] 
SourceFormat Enforcement

10 years agoFix: Unable to open FTP socket during reconfigure
Christos Tsantilas [Thu, 30 Oct 2014 15:18:20 +0000 (17:18 +0200)] 
Fix: Unable to open FTP socket during reconfigure

Squid does not close FTP listening ports on reconfigure.

10 years agoBoilerplate: add copyright blurb to auto-generated files and release notes
Amos Jeffries [Thu, 30 Oct 2014 11:48:18 +0000 (04:48 -0700)] 
Boilerplate: add copyright blurb to auto-generated files and release notes

10 years agoSource Maintenance: Add checks for copyright blurbs
Amos Jeffries [Thu, 30 Oct 2014 11:32:29 +0000 (04:32 -0700)] 
Source Maintenance: Add checks for copyright blurbs

* Check for copyright blurbs in repository files.

* Allow skipping of third-party and binary files.

* Add copyright blurb to auto-generated files created by maintenance
  script.

10 years agoFix typo in 3.4 release notes
Amos Jeffries [Thu, 30 Oct 2014 04:39:02 +0000 (21:39 -0700)] 
Fix typo in 3.4 release notes

10 years agoBoilerplate: add copyright blurbs on more files
Amos Jeffries [Thu, 30 Oct 2014 03:23:47 +0000 (20:23 -0700)] 
Boilerplate: add copyright blurbs on more files

10 years agoext_kerberos_ldap_group_acl: -n option to disable automated SASL/GSSAPI
Markus Moeller [Wed, 29 Oct 2014 04:47:53 +0000 (21:47 -0700)] 
ext_kerberos_ldap_group_acl: -n option to disable automated SASL/GSSAPI

The -n option disables the automated Kerberos authentication
(SASL/GSSAPI) to AD and requires username/password (SASL/SIMPLE)
instead.

Also, improvements in caching Kerberos credentials for setup with low
Squid cache TTL.

10 years agonegotiate_kerberos_auth: output group= kv-pair
Markus Moeller [Wed, 29 Oct 2014 04:26:36 +0000 (21:26 -0700)] 
negotiate_kerberos_auth: output group= kv-pair

Output group= if negotiate_kerberos_auth can retrieve AD groups from
Kerberos ticket for further processing by squid to external helpers.

10 years agoBoilerplate: add copyright blurb to error page templates
Amos Jeffries [Tue, 28 Oct 2014 05:21:28 +0000 (22:21 -0700)] 
Boilerplate: add copyright blurb to error page templates

10 years agoSource Maintenance
Amos Jeffries [Tue, 28 Oct 2014 02:47:36 +0000 (19:47 -0700)] 
Source Maintenance

10 years agoBoilerplate: add copyright blurb to misc files
Amos Jeffries [Tue, 28 Oct 2014 01:36:54 +0000 (18:36 -0700)] 
Boilerplate: add copyright blurb to misc files