]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
8 years ago4.0.7 SQUID_4_0_7
Amos Jeffries [Tue, 23 Feb 2016 17:40:44 +0000 (06:40 +1300)] 
4.0.7

8 years agoPrep for 4.0.7 and 3.5.15
Amos Jeffries [Tue, 23 Feb 2016 16:16:32 +0000 (05:16 +1300)] 
Prep for 4.0.7 and 3.5.15

8 years agoauthor: "William Lima" <william.lima@hscbrasil.com.br>
Christos Tsantilas [Mon, 22 Feb 2016 18:01:23 +0000 (20:01 +0200)] 
author: "William Lima" <william.lima@hscbrasil.com.br>
Fix memory leak when the cache of sslcrtvalidator_program is disabled via ttl=0

8 years agoLog noise reduction: No eCAP debugging messages at DBG_IMPORTANT level.
Alex Rousskov [Sun, 21 Feb 2016 18:07:04 +0000 (11:07 -0700)] 
Log noise reduction: No eCAP debugging messages at DBG_IMPORTANT level.

8 years agoMacOS fix: shorten testRock store path to fit in shm segment filename size limitation...
Francesco Chemolli [Sun, 21 Feb 2016 08:53:50 +0000 (09:53 +0100)] 
MacOS fix: shorten testRock store path to fit in shm segment filename size limitations; change some tools.cc stubs into nops

8 years agoSourceFormat Enforcement
Source Maintenance [Sat, 20 Feb 2016 00:12:02 +0000 (00:12 +0000)] 
SourceFormat Enforcement

8 years agoFix propagation of response status line parsing error details.
Alex Rousskov [Fri, 19 Feb 2016 21:26:00 +0000 (14:26 -0700)] 
Fix propagation of response status line parsing error details.

This is a follow-up patch to trunk r14548 (Bug 4432). Now that the
calling code is using the right field to get the parsing error details
(parseStatusCode), we need to fix the code that sets those parsing error
details [in case of response status line parsing errors].

TODO: To minimize chances of similar "I forgot to set parseStatusCode"
bugs slipping through, hide that data member behind a method that
returns scInvalidHeader (or a new scInternalSquidError) if parseError_
is still zero. Rename parseStatusCode to parseError_ and stop confusing
it with the response status code.

8 years agoThrow instead of asserting on some String overflows.
Alex Rousskov [Fri, 19 Feb 2016 21:23:08 +0000 (14:23 -0700)] 
Throw instead of asserting on some String overflows.

Note that Client-caught exceptions result in HTTP 500 (Internal Server
Error) responses with X-Squid-Error set to "ERR_CANNOT_FORWARD 0".

Also avoid stuck Client jobs on exceptions. See trunk r8266 for a
similar fix with a detailed discussion. Here, I added doneWithFwd
instead of setting fwd to NULL because we dereference fwd (and store
pointers to things stored in fwd!) in many places. I think it is too
risky to just clear refcounted FwdState pointer (except in the
destructor where doing so is pointless).

Using doneWithFwd correctly is difficult because there are many ways we
can be "done" with FwdState, including:

    * calling fwd->complete(),
    * calling fwd->handleUnregisteredServerEnd(), and
    * closing the connection that FwdState monitors for closures.

The latter is especially tricky case because the closing is initiated in
many places, the process is asynchronous, and not all control
connections are monitored by FwdState.

For example, the updated control connection closure handler assumes that
it is being used for either external closures or internal closures
incorrectly used instead of mustStop()/abortAll(). In both cases, either
FwdState is still monitoring the connection (OK) or we forgot to call
one of its "done" methods listed above before closing. The latter would
be a bug, but I did not find any signs of it and fixing it would be
outside this change scope anyway.

Also unified String size limit checks [that I could find].

8 years agoexternal_acl parameters separated by %20 instead of space
Christos Tsantilas [Fri, 19 Feb 2016 17:19:25 +0000 (19:19 +0200)] 
external_acl parameters separated by %20 instead of space

If an external ACL is configured with more than one parameter as shown
in the example below, then Squid sends those parameters to the
external_acl helper separated by %20 characters instead of spaces:

  acl TEST external ACLTYPE param1=val1 param2=val2

This change fixes regression introduced in trunk r14351 (Support
logformat %macros in external_acl_type format) but more work may
be needed to make Squid behave as squid.conf.documented promises.

This is a Measurement Factory project.

8 years agoRevert r14303: Migrate StoreEntry to using MEMPROXY_CLASS
Amos Jeffries [Fri, 19 Feb 2016 15:06:42 +0000 (04:06 +1300)] 
Revert r14303: Migrate StoreEntry to using MEMPROXY_CLASS

This change has been identified as the trigger for several object caching
errors. The real cause is not yet known, but reverting this optimisation
avoids it, so is being done for stability.

This resolves bugs 4370 and maybe also 4354 and 4355

8 years agoBug 3870: assertion failed: String.cc: 'len_ + len <65536' in ESI::CustomParser
William Lima [Thu, 18 Feb 2016 12:48:08 +0000 (01:48 +1300)] 
Bug 3870: assertion failed: String.cc: 'len_ + len <65536' in ESI::CustomParser

The custom ESI parser used in absence of libxml2 or libexpat parsers was
restricted to handling 64KB buffers but under some conditions could expand
to over 64KB during the parse process. Hitting this assertion.

TODO: the parser can now be redesigned to make use of Tokenizer and
      CharacterSet parsing tools. But that is left for later work.

8 years agoBug 4432: assertion failed: store.cc:1919: "isEmpty()"
Alex Rousskov [Thu, 18 Feb 2016 04:11:36 +0000 (21:11 -0700)] 
Bug 4432: assertion failed: store.cc:1919: "isEmpty()"

When we failed to parse a response:

* Do not use parsing leftovers, such as HTTP response status code. Doing
  so screws up error detection logic in continueAfterParsingHeader() and
  leads to stuck transactions instead of error responses.

* Do not store the fake half-baked response (via replaceHttpReply).
  Doing so leads to assertions.  The fake response is only meant for
  continueAfterParsingHeader().

I also removed a misleading XXX about connection closure. Our
continueAfterParsingHeader() handles errors, not processReplyHeader().

TODO: The error detection/propagation code is ugly and should be
rewritten [using C++ exceptions].

8 years agoBug 4111: leave_suid() does not properly handle error codes returned by setuid
tangqinghao [Thu, 18 Feb 2016 02:48:41 +0000 (15:48 +1300)] 
Bug 4111: leave_suid() does not properly handle error codes returned by setuid

... this will cause privilege escalation in the rare case that setuid fails.
So far there are no known cases of this happening when downgrading from root.

Also fixes several incorrect uses of errno which may have been obscuring
error message details if it did happen.

8 years agoSourceLayout: Move the Runner which manages SSL SessionCache to libsecurity
Amos Jeffries [Wed, 17 Feb 2016 21:03:29 +0000 (10:03 +1300)] 
SourceLayout: Move the Runner which manages SSL SessionCache to libsecurity

Unfortunately the OpenSSL session cache callbacks cannot also be moved
due to circular dependency issues. However, when those are resolved by
later libsecurity API additions the callbacks will be much easier to
shift. For now the three symbols shared between the two libraries are
exposed by libsslsquid in the Ssl:: namespace.

Cache initialization is now moved into the Runner. Binding its state
initialization more tightly to the memory allocation and initialization.
Which also removes the need for explicit main.cc dependency.

One issue was uncovered during this:

* While ssl/support.h was defining a destruct_session_cache() function
that appeared to release the cache memory, it was not actually being
used anywhere. Which unless a fortuitous sequence of events is happening
means that the memory for the cache entries may not be released properly.
On the other hand the cache should only be erased on shutdown so the
effects of this are minor.

The unused function has been removed and the issue is now expicitly
noted in the Runner shutdown handling method for future investigation.

8 years ago4.0.6 SQUID_4_0_6
Amos Jeffries [Mon, 15 Feb 2016 15:53:15 +0000 (04:53 +1300)] 
4.0.6

8 years agoPrep for 4.0.6 and 3.5.14
Amos Jeffries [Mon, 15 Feb 2016 11:40:22 +0000 (00:40 +1300)] 
Prep for 4.0.6 and 3.5.14

8 years agoFix compile error in CPU affinity
Amos Jeffries [Mon, 15 Feb 2016 06:59:09 +0000 (19:59 +1300)] 
Fix compile error in CPU affinity

struct cpu_set_t may be defined (eg on Hurd) even if the CPU affinity API
is not fully existing, or a non-working stub.

8 years agoDocs: Fix many mentions of ssl_crtd
Amos Jeffries [Sat, 13 Feb 2016 16:10:26 +0000 (05:10 +1300)] 
Docs: Fix many mentions of ssl_crtd

8 years agoBug 4436: Fix DEFAULT_SSL_CRTD
Marcos Mello [Sat, 13 Feb 2016 16:09:01 +0000 (05:09 +1300)] 
Bug 4436: Fix DEFAULT_SSL_CRTD

8 years agoSourceFormat Enforcement
Source Maintenance [Sat, 13 Feb 2016 12:12:10 +0000 (12:12 +0000)] 
SourceFormat Enforcement

8 years agoCert Validation memory leaks
Christos Tsantilas [Sat, 13 Feb 2016 07:51:20 +0000 (09:51 +0200)] 
Cert Validation memory leaks

In the case SSL errors detected by certificate validator helper the objects
stored in Ssl::ServerBump::sslErrors  member and will never released.
This member normally points to an Ssl::CertErrors list attached to the related
SSL object which is responsible to release this list.
When the cert validator detects errors a new errors list created and attached
to the related Ssl::ServerBump::sslErrors member but the SSL objects still
hold the old one. The old list released but not the new one.

This patch also fixes the case the cbdata protected  Ssl::CertErrors list,
still is used through the related Ssl::ServerBump object but it is not valid
any more, because the SSL object which hold it gone.

This patch instead of storing the Ssl::CertErrors list to Ssl::ServerBump
object stores the SSL object and increases its reference to avoid be released

This is a Measurement Factory project

8 years agoBug 4437: Fix Segfault on Certain SSL Handshake Errors
Christos Tsantilas [Sat, 13 Feb 2016 05:44:58 +0000 (18:44 +1300)] 
Bug 4437: Fix Segfault on Certain SSL Handshake Errors

Squid after an unsuccesfull try to connect to the remote server may make two
concurrent retries to connect to the remote SSL server, calling twice the
FwdState::retryOrBail() method, which may result to unexpected behaviour.

Prevent this by just closing the connection to the remote SSL server inside
FwdState::connectedToPeer method on error and instead of calling the
FwdState::retryOrBail method, just allow comm_close handler to retry the
connection if required.

  This is a Measurement Factory project

8 years agoFix %un logging external ACL username
Amos Jeffries [Fri, 12 Feb 2016 16:24:48 +0000 (05:24 +1300)] 
Fix %un logging external ACL username

8 years agoFix "dial: Ssl::PeerConnector::sslCrtvdHandleReply threw exception: callback != NULL"
Christos Tsantilas [Fri, 12 Feb 2016 10:45:47 +0000 (12:45 +0200)] 
Fix "dial: Ssl::PeerConnector::sslCrtvdHandleReply threw exception: callback != NULL"

This bug investigated after the r14528 patch.
The (forgotten?) Ssl::PeekingPeerConnector::callback member is always NULL and
hides the callback member of the parent Ssl::PeerConnector class. This is has
as result the failure of "Must(callback != NULL)" clause inside the
Ssl::PeekingPeerConnector::tunnelInsteadOfNegotiating method investigated with
the r14528 patch.

This is a Measurement Factory project

8 years agoBug 4431: C code is not compiled with CFLAGS
Marcos Mello [Fri, 12 Feb 2016 04:49:39 +0000 (17:49 +1300)] 
Bug 4431: C code is not compiled with CFLAGS

8 years agoFix mgr:config report 'qos_flows mark' output
Yuriy M. Kaminskiy [Wed, 10 Feb 2016 10:57:30 +0000 (23:57 +1300)] 
Fix mgr:config report 'qos_flows mark' output

8 years agoCleanup: const correctness for SBuf iterators
Amos Jeffries [Wed, 10 Feb 2016 09:36:47 +0000 (22:36 +1300)] 
Cleanup: const correctness for SBuf iterators

The SBuf iterator has almost all properties of a const_iterator but the
begin/end methods producing it had the syntax for returning a non-const
iterator. This leads to several const related problems despite the
SBufIterator providing a const API:

 1) range-for loops cannot be used on const SBuf
 2) begin/end/rbegin/rend operators cannot be used on const SBuf

Also, the SBufIterator API for operator*() used a temporary char
which, wile const, allows the compiler to implicitly use move semantics
on the return value and allows some (thankfully unused) &*itr() syntax
to compile when it should not be possible.
To avoid even the potential of that causing hidden issues in future we
convert the operator*() to the API definition used widely within the STL
const_iterator's (const char &operator*() const).

8 years ago4.0.5 SQUID_4_0_5
Amos Jeffries [Wed, 10 Feb 2016 06:56:37 +0000 (19:56 +1300)] 
4.0.5

8 years agoBug 4429: http(s)_port options= error message missing characters
Amos Jeffries [Tue, 9 Feb 2016 13:35:45 +0000 (02:35 +1300)] 
Bug 4429: http(s)_port options= error message missing characters

8 years agoCleanup: convenience library renaming
Amos Jeffries [Tue, 9 Feb 2016 08:57:33 +0000 (21:57 +1300)] 
Cleanup: convenience library renaming

I have been trying to automate graphing of the Squid internal
dependencies. One of the major issues that has encountered is that some
of our convenience libraries use the '-' hyphen character which is a
reserved character in DOT graph format.

To make the scripts much simpler and the visual output reflect exactly
what the library names are this patch cleans up the libraries to follow
our pre-existing policy, and now also to remove punctuation from library
names. Which condition has been added to the guidelines documentation.

8 years agoSourceFormat Enforcement
Source Maintenance [Mon, 8 Feb 2016 18:12:05 +0000 (18:12 +0000)] 
SourceFormat Enforcement

8 years agoFixed step3 splicing.
Christos Tsantilas [Mon, 8 Feb 2016 17:44:43 +0000 (19:44 +0200)] 
Fixed step3 splicing.

The information about PeekingPeerConnector splicing the connections
was lost in some cases, resulting in two different bugs:

 - With a certificate validator, the PeekingPeerConnector class calls
   back FwdState, which calls the ConnStateData class, which then tries
   secure the connection with the already tunneled SSL client and
   closes the connection on negotiating errors.

 - Without a certificate validator, the PeekingPeerConnector class
   never calls FwdState class, and both PeekingPeerConnector and
   FwdState objects stall until finishing tunnelState closes server
   and client connections.

Now, PeerConnector always calls FwdState back, marking spliced
connections as such. This has the following positive side-effects:

 - When FwdState learns about spliced connections, it does not call
   ConnStateData back. Instead, it terminates and gets destroyed.
   The tunnel continues uninterrupted.

 - The PeekingPeerConnector job ends and is destroyed instead of
   waiting to call FwdState.

This is a Measurement Factory project.

8 years agoSwitch SBufIterator to const_iterator
Amos Jeffries [Mon, 8 Feb 2016 11:22:48 +0000 (00:22 +1300)] 
Switch SBufIterator to const_iterator

8 years agoDocs: fix incorrect ssl_bump example
Amos Jeffries [Sun, 7 Feb 2016 01:31:05 +0000 (14:31 +1300)] 
Docs: fix incorrect ssl_bump example

8 years agoCleanup: remove several C-style casts from libcompat
Amos Jeffries [Fri, 5 Feb 2016 10:53:29 +0000 (23:53 +1300)] 
Cleanup: remove several C-style casts from libcompat

8 years agoBug 4419: SIGSEGV crash in HierarchyLogEntry::note after r14505
Amos Jeffries [Tue, 2 Feb 2016 21:35:33 +0000 (10:35 +1300)] 
Bug 4419: SIGSEGV crash in HierarchyLogEntry::note after r14505

8 years agoFix external_acl problems after trunk r14351
Christos Tsantilas [Tue, 2 Feb 2016 15:39:23 +0000 (17:39 +0200)] 
Fix external_acl problems after trunk r14351
(Support logformat %macros in external_acl_type format).

The above changes created the following problems:
 - external_acl requires AccessLogEntry but ALE is not available
   in many cases such as ssl_bump ACLs.
 - The %<cert_subject stopped working because it was supported by
   external_acl code and not by logformat code.

This patch:
  - Passes AccessLogEntry in most cases.
    For example, PeerConnector-related classes are now covered.
  - Implements the %<cert_subject formating code for logformat.

This is a Measurement Factory project.

8 years agoAdd missed file rename for ssl_crtd.cc
Amos Jeffries [Tue, 2 Feb 2016 06:58:18 +0000 (19:58 +1300)] 
Add missed file rename for ssl_crtd.cc

8 years agoFix various build issues in security helpers
Amos Jeffries [Tue, 2 Feb 2016 06:35:09 +0000 (19:35 +1300)] 
Fix various build issues in security helpers

* Fix incorrect build of security_file_certgen helper when OpenSSL disabled

* Remove unnecessary '-helper' from --enable-security-cert-validator-helpers

8 years agoSourceLayout: rename ssl_crtd helper to security_file_certgen
Amos Jeffries [Mon, 1 Feb 2016 11:52:03 +0000 (00:52 +1300)] 
SourceLayout: rename ssl_crtd helper to security_file_certgen

* Add --enable-security-cert-generators="..." option to build
  sslcrtd_program helpers

* Separate --enable-ssl-crtd from helper build and install

* Shuffle ssl_crtd to src/security/cert_generators and rename
  to reflect its helper interface and filesystem backend.

Squid binary or helper binary logic changes in this. Just
./configure build system logic changes.

8 years agoSourceFormat Enforcement
Source Maintenance [Mon, 1 Feb 2016 06:11:54 +0000 (06:11 +0000)] 
SourceFormat Enforcement

8 years agoAdd missing include after rev.14518
Amos Jeffries [Mon, 1 Feb 2016 04:09:11 +0000 (17:09 +1300)] 
Add missing include after rev.14518

8 years agoSourceLayout: rename ClientSocketContext to Http::Stream
Amos Jeffries [Sun, 31 Jan 2016 12:05:30 +0000 (01:05 +1300)] 
SourceLayout: rename ClientSocketContext to Http::Stream

 ... and provided through http/libsquid-http.la.

The name is chosen to match the RFC7540 HTTP/2 "stream" terminology.
Which defines a stream as a bi-directional transaction, including request,
reply and all related 1xx informational and/or control messages.

That same word "stream" is also used in RFC7230 briefly to describe the
same "transaction" scope and details. But not formalized until RFC7540.

Http::Stream's may be initiated by a client HTTP request, Squid internally,
or in HTTP/2 a server PUSH_PROMISE frame.

There are no logic changes in this. Just symbol renaming and move.

8 years agoSourceFormat Enforcement
Source Maintenance [Sat, 30 Jan 2016 12:11:55 +0000 (12:11 +0000)] 
SourceFormat Enforcement

8 years agoSourceLayout: merge helpers/ into src/
Amos Jeffries [Sat, 30 Jan 2016 10:41:37 +0000 (23:41 +1300)] 
SourceLayout: merge helpers/ into src/

* Move helpers/basic_auth/ into src/auth/basic/

* Move helpers/digest_auth/ into src/auth/digest/

* Move helpers/external_acl/ into src/acl/external/

* Move helpers/log_daemon/ into src/log/

* Move helpers/negotiate_auth/ into src/auth/negotiate/

* Move helpers/ntlm_auth/ into src/auth/ntlm/

* Move helpers/storeid_rewrite/ into src/store/id_rewriters/

* Move helpers/url_rewrite/ into src/http/url_rewriters/

* Rename helpers/defines.h to src/helper/protocol_defines.h

8 years agoRemove helpers reference from top Makefile.am
Amos Jeffries [Sat, 30 Jan 2016 09:09:25 +0000 (22:09 +1300)] 
Remove helpers reference from top Makefile.am

8 years agoMove helpers/defines.h to src/helper/protocol_defines.h
Amos Jeffries [Sat, 30 Jan 2016 06:24:40 +0000 (19:24 +1300)] 
Move helpers/defines.h to src/helper/protocol_defines.h

8 years agoUpdate CREDITS filenames
Amos Jeffries [Sat, 30 Jan 2016 06:19:19 +0000 (19:19 +1300)] 
Update CREDITS filenames

8 years agoSourceLayout: move URL rewriters to src/http/url_rewriters/
Amos Jeffries [Sat, 30 Jan 2016 06:06:40 +0000 (19:06 +1300)] 
SourceLayout: move URL rewriters to src/http/url_rewriters/

8 years agoSourceLayout: move Store-ID helpers to src/store/id_rewriters/
Amos Jeffries [Sat, 30 Jan 2016 05:42:22 +0000 (18:42 +1300)] 
SourceLayout: move Store-ID helpers to src/store/id_rewriters/

8 years agoSourceLayout: move external ACL helpers to src/acl/external/
Amos Jeffries [Sat, 30 Jan 2016 05:13:24 +0000 (18:13 +1300)] 
SourceLayout: move external ACL helpers to src/acl/external/

8 years agoRemove .bzrignore entry for obsolete helper files
Amos Jeffries [Sat, 30 Jan 2016 04:43:50 +0000 (17:43 +1300)] 
Remove .bzrignore entry for obsolete helper files

8 years agoSourceLayout: move Basic auth helpers to src/auth/basic/
Amos Jeffries [Sat, 30 Jan 2016 04:34:57 +0000 (17:34 +1300)] 
SourceLayout: move Basic auth helpers to src/auth/basic/

8 years agoSourceLayout: move Digest auth helpers to src/auth/digest/
Amos Jeffries [Sat, 30 Jan 2016 03:27:53 +0000 (16:27 +1300)] 
SourceLayout: move Digest auth helpers to src/auth/digest/

8 years agoRemove obsolete helpers/ pieces
Amos Jeffries [Fri, 29 Jan 2016 18:46:38 +0000 (07:46 +1300)] 
Remove obsolete helpers/ pieces

8 years agoSourceLayout: move Negotiate auth helpers to src/auth/negotiate/
Amos Jeffries [Fri, 29 Jan 2016 18:42:25 +0000 (07:42 +1300)] 
SourceLayout: move Negotiate auth helpers to src/auth/negotiate/

8 years agoSourceLayout: move NTLM helpers to src/auth/ntlm/
Amos Jeffries [Fri, 29 Jan 2016 18:16:17 +0000 (07:16 +1300)] 
SourceLayout: move NTLM helpers to src/auth/ntlm/

8 years agoSourceLayout: move log daemon helpers to src/log/
Amos Jeffries [Fri, 29 Jan 2016 17:10:20 +0000 (06:10 +1300)] 
SourceLayout: move log daemon helpers to src/log/

8 years agoSync with trunk rev.14515
Amos Jeffries [Fri, 29 Jan 2016 12:51:27 +0000 (01:51 +1300)] 
Sync with trunk rev.14515

8 years agoSourceLayout: rename cert_valid.pl to security_fake_certverify
Amos Jeffries [Fri, 29 Jan 2016 12:49:28 +0000 (01:49 +1300)] 
SourceLayout: rename cert_valid.pl to security_fake_certverify

* creates src/security/cert_validators/ for certificate validation helpers.
  To distinguish from certificate generator helpers which would be in
  src/security/cert_generators/.

* renames cert_valid.pl to securiy_fake_certverify inline with the helper
  naming schema.

* moves helpers/ssl/ to src/security/cert_validators/fake/ as it is the fake
  helper.
 - building the man(8) documentation that was missing previously.

* adds a ./configure option --enable-security-cert-validator-helpers= to allow
  the bundled certverify helper(s) to be managed at build time just like any other.
 - this involves addition of the modules.m4, requires.m4 and Makefile.am
  infrastructire that helpers/ssl/ was previously lacking.

8 years agoUpdate docs
Amos Jeffries [Thu, 28 Jan 2016 17:14:47 +0000 (06:14 +1300)] 
Update docs

8 years agoRename ./certv to ./cert_validators and _certv to _certverify
Amos Jeffries [Thu, 28 Jan 2016 16:49:12 +0000 (05:49 +1300)] 
Rename ./certv to ./cert_validators and _certv to _certverify

8 years agoFix crtv / certv typos
Amos Jeffries [Thu, 28 Jan 2016 12:45:21 +0000 (01:45 +1300)] 
Fix crtv / certv typos

8 years agoSync CREDITS with cert_valid.pl changes
Amos Jeffries [Thu, 28 Jan 2016 11:19:35 +0000 (00:19 +1300)] 
Sync CREDITS with cert_valid.pl changes

8 years agoMissing configure.ac changes
Amos Jeffries [Thu, 28 Jan 2016 11:17:39 +0000 (00:17 +1300)] 
Missing configure.ac changes

8 years agoReleae notes update for --enable-security-certv-helpers and cert_valid.pl changes
Amos Jeffries [Thu, 28 Jan 2016 11:14:52 +0000 (00:14 +1300)] 
Releae notes update for --enable-security-certv-helpers and cert_valid.pl changes

8 years agoRename cert_valid.pl helper to security_fake_crtv
Amos Jeffries [Thu, 28 Jan 2016 11:02:42 +0000 (00:02 +1300)] 
Rename cert_valid.pl helper to security_fake_crtv

Also, shuffles the helper to the src/security/ area and creates necessary
infrastructure for bundling other certificate verifier helpers.

8 years agoBug 4418: FlexibleArray compile error with GCC 6
Alex Rousskov [Thu, 28 Jan 2016 10:20:28 +0000 (23:20 +1300)] 
Bug 4418: FlexibleArray compile error with GCC 6

8 years agoFixed cleanup of a shared memory segment in an unusual configuration.
Alex Rousskov [Thu, 28 Jan 2016 01:49:55 +0000 (18:49 -0700)] 
Fixed cleanup of a shared memory segment in an unusual configuration.

Squid was not removing squid-squid-page-pool.shm at exit when started
in non-daemon mode (-N). That segment is used in non-SMP mode if
memory_cache_shared is explicitly set to "on" (an unusual
configuration primarily useful for testing).

8 years agoFixed handling of shared memory left over by Squid crashes or bugs.
Markus Mayer [Thu, 28 Jan 2016 01:30:37 +0000 (18:30 -0700)] 
Fixed handling of shared memory left over by Squid crashes or bugs.

A Squid instance may inherit an old shared memory segment from the
previous instance as the result of either a Squid crash or an at-exit
cleanup bug. This change fixes two problems triggered by old segments:

1. After an earlier OS X fix (bug 3805; trunk r13947), Squid stopped
   initializing previously used shared memory. Uninitialzed memory
   resulted in subtle bugs and crashes.

2. When called for an old Squid shared memory segment, OS X
   ftruncate() fails with EINVAL, preventing Squid from starting when
   the old segment is still around.

   More specifically: Darwin ftruncate() calls pshm_truncate().
   pshm_truncate() checks if the PSHM_ALLOCATED flag is already set on
   the memory region. If the flag is set, the call fails with EINVAL.
   Otherwise, pshm_truncate() sets PSHM_ALLOCATED for the region.
   Since Squid must call ftruncate() to size every new segment, all
   old Squid segments have that flag set, preventing ftruncate() calls
   for old segments in newer Sqid instances from succeeding.

   [1] http://www.opensource.apple.com/source/xnu/xnu-3248.20.55/bsd/kern/posix_shm.c

To fix both problems, Squid now uses shm_open(O_EXCL) to detect the
existence of an old segment and remove/recreate it as needed.

8 years agoSourceFormat Enforcement
Source Maintenance [Wed, 27 Jan 2016 18:12:08 +0000 (18:12 +0000)] 
SourceFormat Enforcement

8 years agoSourceLayout: shuffle PeerConnector classes to separate units
Amos Jeffries [Wed, 27 Jan 2016 16:56:38 +0000 (05:56 +1300)] 
SourceLayout: shuffle PeerConnector classes to separate units

8 years agoCleanup: remove last SSL_CTX_Pointer uses
Amos Jeffries [Wed, 27 Jan 2016 04:41:56 +0000 (17:41 +1300)] 
Cleanup: remove last SSL_CTX_Pointer uses

8 years agoCleanup: update TLS session pointer types
Amos Jeffries [Tue, 26 Jan 2016 21:02:00 +0000 (10:02 +1300)] 
Cleanup: update TLS session pointer types

* rename SSL* pointer to Security::SessionPtr and SSL_Pointer to
  SessionPointer as the smart pointer variant. Matching the model
  designed for TLS context storage.

* update fd_table .ssl member to a SessionPointer for safer session
  pointer deallocation.

* migrate most uses of SSL* to Securit::SessionPtr or auto

8 years agoSourceFormat Enforcement
Source Maintenance [Mon, 25 Jan 2016 18:12:09 +0000 (18:12 +0000)] 
SourceFormat Enforcement

8 years agoInvalid FTP connection handling on blocked content.
Christos Tsantilas [Mon, 25 Jan 2016 17:54:50 +0000 (19:54 +0200)] 
Invalid FTP connection handling on blocked content.

FTP client gets stuck after the following chain of events:
 * Client requests a file that will be blocked by ICAP.
 * Squid starts downloading the file from the FTP server
   and sends "150 Opening..." to the FTP client.
 * Squid aborts the data connection with the FTP server
   as soon as the ICAP service blocks it.
 * Squid sends "451 Forbidden" to the FTP client.
 * The FTP server sends "500 OOPS: setsockopt: linger" to Squid.
 * Squid terminates the control connection to the FTP server.
 * Squid establishes a new control connection to the FTP server
   but does not authenticate itself.
 * Further commands from the FTP client do not work any more.

The above and many similar problems exist because Squid handles
FTP client-to-squid and squid-to-FTP server data connections
independently from each other. In many cases, one connection does
not get notified about the problems with the other connection.

This patch:
  - Add Ftp::MasterState::userDataDone to record received
    the FTP client final response status code to sent (or to be send)
    to the client.
  - The Ftp::MasterState::waitForOriginData flag to hold status of the
    squid-to-server side. If the squid-to-server side is not finishes
    yet this is true.
  - Send a control reply to the FTP client only after the data transfered
    on both server and client sides.
  - Split Client::abortTransaction to Client::abortOnData and to
    Client::abortAll()
  - Implement the Ftp::Relay::abortOnData() and Ftp::Relay::Abort()
    (i.e., StoreEntry abort handler) to avoid closing the control
    connection when the data connection is closed unexpectedly.

This is a Measurement Factory project.

8 years agoMake %<a and %<p details available to [eCAP] RESPMOD services
Eduard Bagdasaryan [Mon, 25 Jan 2016 08:26:32 +0000 (21:26 +1300)] 
Make %<a and %<p details available to [eCAP] RESPMOD services

... via adaptation_meta.

This patch fills access log entry with server connection
details as soon as possible. Previously, ALE was updated only
in prepareLogWithRequestDetails() when adaptation process has
already finished.

8 years agoRename Http::StreamContext to Http::Stream
Amos Jeffries [Sun, 24 Jan 2016 17:41:43 +0000 (06:41 +1300)] 
Rename Http::StreamContext to Http::Stream

8 years agoRevert Pipeline ID logic changes
Amos Jeffries [Sun, 24 Jan 2016 17:21:02 +0000 (06:21 +1300)] 
Revert Pipeline ID logic changes

8 years agoBug 4409: compile error when two Heimdal libraries are installed
Amos Jeffries [Sun, 24 Jan 2016 01:18:43 +0000 (14:18 +1300)] 
Bug 4409: compile error when two Heimdal libraries are installed

8 years agoBug 4410: 4.0.4 compile error in basic_ncsa_auth
Amos Jeffries [Sun, 24 Jan 2016 00:45:30 +0000 (13:45 +1300)] 
Bug 4410: 4.0.4 compile error in basic_ncsa_auth

8 years agoSourceFormat Enforcement
Source Maintenance [Fri, 22 Jan 2016 18:12:10 +0000 (18:12 +0000)] 
SourceFormat Enforcement

8 years agoName-only note ACL stopped matching after trunk r14465 (note -m).
Christos Tsantilas [Fri, 22 Jan 2016 14:57:46 +0000 (16:57 +0200)] 
Name-only note ACL stopped matching after trunk r14465 (note -m).

Despite this fix, empty ACLStringData values (also used for myportname,
peername, tag, and other ACLs) must [continue to] match nothing because
Squid ORs acl values. In math, empty disjunction is false.

The note ACL matches name:value entries, not bare values. A valueless
name has a different semantics than an empty list of bare values. It is

  (name and value1) or (name and value2)

rather than

  name and (value1 or value2)

where an empty value disjunction would have falsified the whole
condition.

This is a Measurement Factory project.

8 years agoTests: Add --action parameter for testing script
Amos Jeffries [Mon, 18 Jan 2016 13:40:42 +0000 (02:40 +1300)] 
Tests: Add --action parameter for testing script

This command line option allows automake target to be provided as an
override to the target specified in the test build scripts. With this a
partial test can be run for all specified layers rather than a full
distcheck which can be quite slow.

8 years agoAdd missing stubs after rev.14494
Amos Jeffries [Sat, 16 Jan 2016 14:35:28 +0000 (03:35 +1300)] 
Add missing stubs after rev.14494

8 years agoAdd missing tests/stub_libmem.cc
Amos Jeffries [Sat, 16 Jan 2016 10:57:37 +0000 (23:57 +1300)] 
Add missing tests/stub_libmem.cc

8 years agoAdd missing stub_debug.cc
Amos Jeffries [Sat, 16 Jan 2016 10:42:02 +0000 (23:42 +1300)] 
Add missing stub_debug.cc

8 years agoAdd missing library link after rev.14494
Amos Jeffries [Fri, 15 Jan 2016 19:55:40 +0000 (08:55 +1300)] 
Add missing library link after rev.14494

8 years agoCert validadator fix: Currently it is always disabled
Christos Tsantilas [Fri, 15 Jan 2016 18:34:09 +0000 (20:34 +0200)] 
Cert validadator fix: Currently it is always disabled

8 years agoSourceFormat Enforcement
Source Maintenance [Fri, 15 Jan 2016 12:12:15 +0000 (12:12 +0000)] 
SourceFormat Enforcement

8 years agoBug 4005: Dynamic certificate cache exceeds dynamic_cert_mem_cache_size
Amos Jeffries [Fri, 15 Jan 2016 06:57:17 +0000 (19:57 +1300)] 
Bug 4005: Dynamic certificate cache exceeds dynamic_cert_mem_cache_size

* disable the use of system CA by default to verify client connection
  certificates. Since the use of client certificates is rare.

* no change to verification of upstream server or peer certificates.
  Since the use of system CA to sign server certificates is common.

* the new "default-ca" configuration option and its documentation are
  updated to make the situation more obvious amongst the other TLS options
  changes in Squid-4.

* the action of the sslflags=NO_DEFAULT_CA is already deprecated, so no
  change when it is used. On port lines it now merely sets the default.

It may be a good idea to also disable system CA use for cache_peer and
ICAPS connections. For now they are left unchanged.

8 years agoSourceLayout: C++11 upgrade for class YesNoNone
Amos Jeffries [Fri, 15 Jan 2016 06:47:59 +0000 (19:47 +1300)] 
SourceLayout: C++11 upgrade for class YesNoNone

* shuffles YesNoNone file to src/base/

* converts C++03 hacked 'bool' converter to a proper bool()
  operator.

* adds support for implicit defaults as will as explicit
  squid.conf settings.

* adds unit tests for YesNoNone

8 years agoSource maintenance polish
Amos Jeffries [Thu, 14 Jan 2016 13:17:11 +0000 (02:17 +1300)] 
Source maintenance polish

8 years agoSourceFormat Enforcement
Source Maintenance [Wed, 13 Jan 2016 12:12:11 +0000 (12:12 +0000)] 
SourceFormat Enforcement

8 years agoAdd connections_encrypted ACL part3: fix compiling problems
Christos Tsantilas [Wed, 13 Jan 2016 11:23:50 +0000 (13:23 +0200)] 
Add connections_encrypted ACL part3: fix compiling problems

The new acl/ConnectionsEncrypted.[cc,h] files should compiled even if
the ssl is not enabled.

8 years agoBug 4378: assertion failed: DestinationIp.cc:60: 'checklist->conn() && checklist...
Eduard Bagdasaryan [Wed, 13 Jan 2016 10:29:32 +0000 (23:29 +1300)] 
Bug 4378: assertion failed: DestinationIp.cc:60: 'checklist->conn() && checklist->conn()->clientConnection != NULL'

8 years agoAdd connections_encrypted ACL part2: add missing files
Christos Tsantilas [Wed, 13 Jan 2016 10:15:33 +0000 (12:15 +0200)] 
Add connections_encrypted ACL part2: add missing files

The src/acl/ConnectionsEncrypted.[cc,h] files forgotten while the patch
applieded to trunk.

8 years agoAdd connections_encrypted ACL
Christos Tsantilas [Wed, 13 Jan 2016 10:10:20 +0000 (12:10 +0200)] 
Add connections_encrypted ACL

The new connections_encrypted ACL matches transactions where all HTTP
messages were received over TLS transport connections, including messages
received from ICAP servers.

Some ICAP/eCAP services receive data from unencrypted sources. Some ICAP/eCAP
services are "secure". By default we assume that all eCAP services and all
ICAP services on TLS transport connections  are "secure" unless the user
uses the "connection_encryption" option in service configuration line.

This is a Measurement Factory project.

8 years agoFix tls/ssl flags parsing
Christos Tsantilas [Tue, 12 Jan 2016 17:35:06 +0000 (19:35 +0200)] 
Fix tls/ssl flags parsing

Tls flags listed using the [tls-|tls|ssl]flags option are not configured
correctly. In practice always the SSL_FLAG_NO_DEFAULT_CA even if no
selected and all other flags are ingored

8 years agoBug 4403: helper compile errors after rev.14454
Eliezer Croitoru [Mon, 11 Jan 2016 09:23:06 +0000 (22:23 +1300)] 
Bug 4403: helper compile errors after rev.14454