]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
7 years agoTwo new ACLs implemented: annotate_transaction and annotate_client part3
Christos Tsantilas [Mon, 30 Jan 2017 18:10:15 +0000 (20:10 +0200)] 
Two new ACLs implemented: annotate_transaction and annotate_client part3

Fixes annotate_client and annotate_transaction acls documentation in
cf.data.pre

7 years agoTwo new ACLs implemented: annotate_transaction and annotate_client part2
Eduard Bagdasaryan [Mon, 30 Jan 2017 14:00:24 +0000 (16:00 +0200)] 
Two new ACLs implemented: annotate_transaction and annotate_client part2

Add forgotten new files:
 src/acl/AnnotateClient.cc
 src/acl/AnnotateClient.h
 src/acl/AnnotateTransaction.cc
 src/acl/AnnotateTransaction.h
 src/acl/AnnotationData.cc
 src/acl/AnnotationData.h

7 years agoFix Auth::UserRequest::denyMessage() misuse.
Eduard Bagdasaryan [Mon, 30 Jan 2017 13:01:33 +0000 (15:01 +0200)] 
Fix Auth::UserRequest::denyMessage() misuse.

This method was improperly used in contexts where actually
Auth::UserRequest::setDenyMessage() expected. Probably the reason was
that both denyMessage() and getDenyMessage() were not constant,
provoking such 'misuse'.

Also placed some common code into UserRequest::denyMessageFromHelper(),
eliminating code duplication. Though there are still many places
where code is duplicated inside auth/ntlm/UserRequest.cc and
auth/negotiate/UserRequest.cc.

7 years agoauthor: Eduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Christos Tsantilas [Mon, 30 Jan 2017 12:46:15 +0000 (14:46 +0200)] 
author: Eduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Two new ACLs implemented: annotate_transaction and annotate_client.

Both ACLs always match and are useful for their side effect, immediately
adding a key-value pair to the current transaction annotation
(annotate_transaction) or to the current client-to-Squid connection
annotation (annotate_client).  Connection annotations are propagated to
the current and all future master transactions on the annotated
connection. Before this patch only 'clt_conn_tag' annotation tag could
be used for a connection annotation.

To reuse the existing notes parsing code, I had to refactor Note, Notes
and NotePairs classes:

* Made data members private and adjusted to follow 'rule of three'.
  Having public assess to containers with pointers may cause memory
  problems: for example ExternalACLEntry::update() called directly
  notes.entries.clear() without deleting the pointers.
* None-fatal check for 'special' characters inside note name.
* Used SBufs instead of Strings and const char* where possible.
* Adjusted ACLNoteStrategy::matchNotes() to avoid 'expanding quoted values'
  code duplication inside

Also fixed acl quoted flag parameters syntax. The old code improperly
required quoting both flag and its parameter, e.g., "-m= ," whereas
only parameter should be quoted: -m=" ,".

Also moved UpdateRequestNotes() from Notes.cc to HttpRequest.cc to
resolve dependency problems while bulding unit tests.

TODO: transaction annotation matching code (ACLNoteData) performs
parsing in its own way, using ACLStringData::parse(), lacking special
characters/reserved keywords checks. Consider reusing the existing
Notes parsing code instead.

7 years agoBug 4661: compile error 'warning: _XPG4_2 redefined' with GCC on Solaris 10
Amos Jeffries [Sat, 28 Jan 2017 08:51:25 +0000 (21:51 +1300)] 
Bug 4661: compile error 'warning: _XPG4_2 redefined' with GCC on Solaris 10

7 years agoFix langpack generation after 'trunk' branch deprecated
Amos Jeffries [Sat, 28 Jan 2017 04:13:06 +0000 (17:13 +1300)] 
Fix langpack generation after 'trunk' branch deprecated

7 years agoPrep for 3.5.24
Amos Jeffries [Sat, 28 Jan 2017 03:35:32 +0000 (16:35 +1300)] 
Prep for 3.5.24

7 years agoSSLv2 records force SslBump bumping despite a matching step2 peek rule.
Christos Tsantilas [Thu, 26 Jan 2017 16:22:30 +0000 (18:22 +0200)] 
SSLv2 records force SslBump bumping despite a matching step2 peek rule.

If Squid receives a valid TLS Hello encapsulated into ancient SSLv2
records (observed on Solaris 10), the old code ignored the step2 peek
decision and bumped the transaction instead.
Now Squid peeks (or stares) at the origin server as configured, even
after detecting (and parsing) SSLv2 records.

This is a Measurement Factory project.

7 years agoComplain about malformed 64bit header values, not the valid ones.
Alex Rousskov [Wed, 25 Jan 2017 22:29:03 +0000 (15:29 -0700)] 
Complain about malformed 64bit header values, not the valid ones.

I added this regression in r14819, apparently confused by my own
unfortunate "bad is true" httpHeaderNoteParsedEntry(error) API.

7 years agoBug 4636: assertion failed: client_side.cc:1448: 'byteCount > 0 && byteCount <= inBuf...
Amos Jeffries [Wed, 25 Jan 2017 03:18:03 +0000 (16:18 +1300)] 
Bug 4636: assertion failed: client_side.cc:1448: 'byteCount > 0 && byteCount <= inBuf.length()'

7 years agor15014: fix more "make distcheck" issues
Christos Tsantilas [Tue, 24 Jan 2017 19:49:32 +0000 (21:49 +0200)] 
r15014: fix more "make distcheck" issues

7 years agor15014: fix build issue on fedora-22 and FreeBSD-10/clang
Christos Tsantilas [Tue, 24 Jan 2017 17:16:56 +0000 (19:16 +0200)] 
r15014: fix build issue on fedora-22 and FreeBSD-10/clang

7 years agoSourceFormat Enforcement
Source Maintenance [Tue, 24 Jan 2017 12:12:03 +0000 (12:12 +0000)] 
SourceFormat Enforcement

7 years agoMitigate DoS attacks that use client-initiated SSL/TLS renegotiation.
Christos Tsantilas [Tue, 24 Jan 2017 12:09:25 +0000 (14:09 +0200)] 
Mitigate DoS attacks that use client-initiated SSL/TLS renegotiation.

There is a well-known DoS attack using client-initiated SSL/TLS
renegotiation. The severety or uniqueness of this attack method
is disputed, but many believe it is serious/real.
There is even a (disputed) CVE 2011-1473:
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-1473

The old Squid code tried to disable client-initiated renegotiation, but
it did not work reliably (or at all), depending on Squid version, due
to OpenSSL API changes and conflicting SslBump callbacks. That
code is now removed and client-initiated renegotiations are allowed.

With this change, Squid aborts the TLS connection, with a level-1 ERROR
message if the rate of client-initiated renegotiate requests exceeds
5 requests in 10 seconds (approximately). This protection and the rate
limit are currently hard-coded but the rate is not expected to be
exceeded under normal circumstances.

This is a Measurement Factory project.

7 years agoFix some spelling mistakes
FredB [Tue, 24 Jan 2017 09:10:33 +0000 (22:10 +1300)] 
Fix some spelling mistakes

7 years agoCleanup: convert Delay Pool classes to MEMPROXY
Amos Jeffries [Tue, 24 Jan 2017 09:06:00 +0000 (22:06 +1300)] 
Cleanup: convert Delay Pool classes to MEMPROXY

7 years agoBug 4610: fix 'Assigning a negative value to an implicit unsigned bitfield' on Solaris 11
Stefan Kruger [Tue, 17 Jan 2017 19:29:06 +0000 (08:29 +1300)] 
Bug 4610: fix 'Assigning a negative value to an implicit unsigned bitfield' on Solaris 11

7 years agoFix "Source and destination overlap in memcpy" Valgrind errors
Eduard Bagdasaryan [Sun, 15 Jan 2017 17:35:43 +0000 (06:35 +1300)] 
Fix "Source and destination overlap in memcpy" Valgrind errors

Before this patch, source and destination arguments in
log_quoted_string() could point to the same static memory area, causing
multiple Valgrind-reported errors. Fixed by creating another buffer to
store quoted-processed output string.

7 years agosquidclient: link GnuTLS library debug to -v level display
Amos Jeffries [Sat, 14 Jan 2017 11:30:02 +0000 (00:30 +1300)] 
squidclient: link GnuTLS library debug to -v level display

7 years agoRemove USE_CHUNKEDMEMPOOLS compiler flag
Amos Jeffries [Fri, 13 Jan 2017 05:14:03 +0000 (18:14 +1300)] 
Remove USE_CHUNKEDMEMPOOLS compiler flag

The USE_CHUNKEDMEMPOOLS build-time setting is not very useful and adds
extra complexity to the build system. Even when set it does not always
enable chunked pools. The environment variable MEMPOOLS can easily be
used to enable or disable chunked pools as needed.

7 years agoFix missing helper.cc callback check
Amos Jeffries [Fri, 13 Jan 2017 04:41:10 +0000 (17:41 +1300)] 
Fix missing helper.cc callback check

Calls to cbdataReferenceValidDone() need to be checked for true result
before calling the callback. The pointer may be NULL.

 Detected by Coverity Scan. Issue 1398569.

7 years agoSourceFormat Enforcement
Source Maintenance [Thu, 12 Jan 2017 00:12:20 +0000 (00:12 +0000)] 
SourceFormat Enforcement

7 years agoExternal ACL helpers error handling & caching
Christos Tsantilas [Wed, 11 Jan 2017 19:06:57 +0000 (21:06 +0200)] 
External ACL helpers error handling & caching

The helper protocol for external ACLs [1] defines three possible return values:
   OK - Success. ACL test matches.
   ERR - Success. ACL test fails to match.
   BH - Failure. The helper encountered a problem.

The external acl helpers distributed with squid currently doesn't follow this
definition. For example, upon connection error, ERR is returned:

   $ ext_ldap_group_acl ... -d
   ext_ldap_group_acl: WARNING: could not bind to binddn 'Can't contact LDAP server'
   ERR

 This is does not allow to distinguish "no match" and "error" either and
therefore negative caches "ERR", also in the case of an error.

Moreover there are multiple problems inside squid when trying to handle BH
responses:
  - Squid-5 and squid-4 retries requests for BH responses but crashes after the
    maximum retry number (currently 2) is reached.
  - If an external acl helper return always BH (eg because the LDAP server is
    down) squid sends infinitely new request to the helper.

This is a Measurement Factory project

7 years agoReduce crashes due to unexpected ClientHttpRequest termination.
Christos Tsantilas [Wed, 11 Jan 2017 18:17:47 +0000 (20:17 +0200)] 
Reduce crashes due to unexpected ClientHttpRequest termination.

The underlying problem has been known since r13480: If a
ClientHttpRequest job ends without Http::Stream (and ConnStateData)
knowledge, then Squid is likely to segfault or assert. This patch does
not resolve the underlying issue (a proper fix would require
architectural changes in a consensus-lacking area) but makes an
unexpected ClientHttpRequest job destruction less likely.

BodyPipe and Adaptation-related exceptions are the major causes of
unexpected ClientHttpRequest job destruction. This patch handles them by
closing the client connection. Connection closure should trigger an
orderly top-down cleanup, including Http::Stream, ConnStateData, and
ClientHttpRequest destruction.

If there is no connection to close, then the exception is essentially
ignored with a level-1 error message disclosing the problem. The side
effects of ignoring such exceptions are unknown, but without a client
connection, it is our hope that they would be relatively benign.

This is a Measurement Factory project.

7 years agoDocs: update some memory API details
Amos Jeffries [Mon, 9 Jan 2017 08:59:21 +0000 (21:59 +1300)] 
Docs: update some memory API details

Using text from the ProgrammingGuide/MemPools wiki page (now removed in favour of doxygen)

7 years agoCleanup: remove --disable-inline and related macros
Amos Jeffries [Sun, 8 Jan 2017 05:14:34 +0000 (18:14 +1300)] 
Cleanup: remove --disable-inline and related macros

With the .cci files gone there is no longer any use of the SQUID_INLINE
macro. Which in turn removes the need for _USE_INLINE_ macro and then the
--disable-inline build option which sets that.

The relevant compiler specific *FLAGS option should be used instead to
disable compiler inlining functions without special macro usage.

7 years agoCleanup: remove client_side_request.cci file
Amos Jeffries [Sun, 8 Jan 2017 05:12:44 +0000 (18:12 +1300)] 
Cleanup: remove client_side_request.cci file

... moving the methods to  client_side_request.h/cc.

7 years agoCleanup: remove ip/Qos.cci file
Amos Jeffries [Sun, 8 Jan 2017 02:18:32 +0000 (15:18 +1300)] 
Cleanup: remove ip/Qos.cci file

... moving its content to ip/QosConfig.cc

Also, move the stub file to src/tests/stub_libip.cc and update to use
tests/STUB.h interface.

7 years agoCleanup: Remove HttpHdrCc.cci file
Amos Jeffries [Sat, 7 Jan 2017 03:10:12 +0000 (16:10 +1300)] 
Cleanup: Remove HttpHdrCc.cci file

Moving the simple methods inline to the HttpHdrCc.h and more complicated
setter to HttpHdrCc.cc.

7 years agoFix typo in rev.14997
Amos Jeffries [Sat, 7 Jan 2017 03:00:43 +0000 (16:00 +1300)] 
Fix typo in rev.14997

7 years agoMake CONNECT ACL a built-in default
Amos Jeffries [Fri, 6 Jan 2017 15:09:29 +0000 (04:09 +1300)] 
Make CONNECT ACL a built-in default

This really should have been done earlier when the other fixed-value ACLs were made built-in

7 years agoCleanup: remove String.cci file
Amos Jeffries [Fri, 6 Jan 2017 04:41:57 +0000 (17:41 +1300)] 
Cleanup: remove String.cci file

Moving the simple methods inline to the SquidString.h and more
complicated others to String.cc

7 years agoAdd several missing copyright blurbs
Amos Jeffries [Tue, 3 Jan 2017 14:00:45 +0000 (03:00 +1300)] 
Add several missing copyright blurbs

7 years agoFix missing library in rev.14993
Amos Jeffries [Tue, 3 Jan 2017 13:27:40 +0000 (02:27 +1300)] 
Fix missing library in rev.14993

7 years agoTests: shuffle libmem Pool unit test to src/
Amos Jeffries [Tue, 3 Jan 2017 03:29:53 +0000 (16:29 +1300)] 
Tests: shuffle libmem Pool unit test to src/

Refactor for cppunit framework instead of custom code.

Duplicate the basic create-free-realloc cycle test for both Pool and MemProxy
but do not add missing tests for other API calls at this time.

7 years agoCleanup: remove some unnecessary splay.h includes
Amos Jeffries [Mon, 2 Jan 2017 10:20:11 +0000 (23:20 +1300)] 
Cleanup: remove some unnecessary splay.h includes

7 years agoSourceFormat Enforcement
Source Maintenance [Sun, 1 Jan 2017 06:12:01 +0000 (06:12 +0000)] 
SourceFormat Enforcement

7 years agoSourceFormat Enforcement
Source Maintenance [Sun, 1 Jan 2017 00:12:22 +0000 (00:12 +0000)] 
SourceFormat Enforcement

7 years agoBug 4599 pt6: Restrict safe renegotiation disable to OpenSSL 1.0 and older
Christos Tsantilas [Fri, 30 Dec 2016 14:07:05 +0000 (03:07 +1300)] 
Bug 4599 pt6: Restrict safe renegotiation disable to OpenSSL 1.0 and older

From OpenSSL 1.1.0 documentation:
 "OpenSSL always attempts to use secure renegotiation as described in RFC5746.
  This counters the prefix attack described in CVE-2009-3555 and elsewhere."

7 years agoSourceFormat Enforcement
Source Maintenance [Fri, 30 Dec 2016 12:12:18 +0000 (12:12 +0000)] 
SourceFormat Enforcement

7 years agoBug 4599 pt5: various OpenSSL-1.x API compatibility fixes
Christos Tsantilas [Fri, 30 Dec 2016 08:55:40 +0000 (21:55 +1300)] 
Bug 4599 pt5: various OpenSSL-1.x API compatibility fixes

7 years agoBug 4599 pt4: Disable RSA weak ephemeral key exchange for OpenSSL-1.1
Christos Tsantilas [Fri, 30 Dec 2016 08:40:21 +0000 (21:40 +1300)] 
Bug 4599 pt4: Disable RSA weak ephemeral key exchange for OpenSSL-1.1

From OpenSSL  changeLog:
     Remove support for all 40 and 56 bit ciphers.  This includes all the export
     ciphers who are no longer supported and drops support the ephemeral RSA key
     exchange. The LOW ciphers currently doesn't have any ciphers in it.
     [Kurt Roeckx]

OpenSSL 1.1.0  drops EXPORT ciphers and ephemeral RSA. The ssl_temp_rsa_cb used
here. The OpenSSL manual for this function is:
  https://wiki.openssl.org/index.php/Manual:SSL_CTX_set_tmp_rsa_callback(3)

7 years agoDetect HTTP header ACL issues
Amos Jeffries [Fri, 30 Dec 2016 06:27:19 +0000 (19:27 +1300)] 
Detect HTTP header ACL issues

rep_header and req_header ACL types cannot match multiple different
headers in one test (unlike Squid-2 appears to have done). Produce
an ERROR and ignore the extra line(s) instead of silently changing
all the previous regex to match the second header name.

Also detect and ERROR when header name is missing entirely. Ignore
these lines instead of asserting.

7 years agoBug 3940 pt2: Make 'cache deny' do what is documented
Amos Jeffries [Thu, 22 Dec 2016 04:08:55 +0000 (17:08 +1300)] 
Bug 3940 pt2: Make 'cache deny' do what is documented

Instead of overriding whatever cacheability was previously set to
(including changing non-cacheables to be cacheable) actually
prevent both cache read and write.

7 years agoCleanup: Refactor libauth Config object(s)
Amos Jeffries [Wed, 21 Dec 2016 17:11:34 +0000 (06:11 +1300)] 
Cleanup: Refactor libauth Config object(s)

Refactoring the Auth::Config objects to get v5 building again.

The object storing auth_param settings is renamed to SchemeConfig.

A new Auth::Config object is added. The objects holding auth_param,
auth_schemes and other authenticate_* directives settings are stored
there instead of just auth_params.

Lots of outdated doxygen docs that have more up to date copies elsewhere
are removed. The "\ingroup AuthAPI" are left for now since some auth
things are not yet in the Auth:: namespace, but other auth related
groups are dropped completely.

Code parsing and dumping auth_param lines has been de-duplicated. Along
with the keep_alive and utf8 settings, which are shared by multiple
schemes. This allows dropping several virtual methods from NTLM and
Negotiate scheme objects.

An auth/forward.h file is added for predefines. Some initial Auth::
symbols are listed there. It is not complete, but others can be added as
needed later.

Some unnecessary includes have been removed. There are probably more. I
just did the obvious ones related to the new auth/forward.h and
auth/Config.h files at this time.

7 years agoUpdates after audit
Amos Jeffries [Wed, 21 Dec 2016 12:42:05 +0000 (01:42 +1300)] 
Updates after audit

7 years agoFix shadowing of member 'type' in SchemeConfig
Amos Jeffries [Tue, 20 Dec 2016 13:49:23 +0000 (02:49 +1300)] 
Fix shadowing of member 'type' in SchemeConfig

7 years agoDe-duplicate shared auth parameters keep_alive and utf8
Amos Jeffries [Tue, 20 Dec 2016 12:37:56 +0000 (01:37 +1300)] 
De-duplicate shared auth parameters keep_alive and utf8

7 years agoDe-duplicate parsing of 'auth_param ... program' lines
Amos Jeffries [Tue, 20 Dec 2016 10:55:45 +0000 (23:55 +1300)] 
De-duplicate parsing of 'auth_param ... program' lines

7 years agoMerged from 5.0.0-r14982
Amos Jeffries [Tue, 20 Dec 2016 10:46:00 +0000 (23:46 +1300)] 
Merged from 5.0.0-r14982

7 years agoFix GCC6: unused local variable 'weInitiatedThisClosure'
Amos Jeffries [Tue, 20 Dec 2016 10:45:25 +0000 (23:45 +1300)] 
Fix GCC6: unused local variable 'weInitiatedThisClosure'

7 years agoRemove some unnecessary nullptr on changed lines
Amos Jeffries [Tue, 20 Dec 2016 10:21:21 +0000 (23:21 +1300)] 
Remove some unnecessary nullptr on changed lines

7 years agoShuffle other auth config options to Auth::Config
Amos Jeffries [Tue, 20 Dec 2016 09:12:07 +0000 (22:12 +1300)] 
Shuffle other auth config options to Auth::Config

Also, remove some unnecessary includes

7 years agoMerge from 5.0.0 r14981
Amos Jeffries [Mon, 19 Dec 2016 14:10:52 +0000 (03:10 +1300)] 
Merge from 5.0.0 r14981

7 years agoRun source maintenance
Amos Jeffries [Mon, 19 Dec 2016 14:06:15 +0000 (03:06 +1300)] 
Run source maintenance

7 years agobasic_sasl_auth: Add copyright blurb to SASL config file
Amos Jeffries [Mon, 19 Dec 2016 14:05:04 +0000 (03:05 +1300)] 
basic_sasl_auth: Add copyright blurb to SASL config file

7 years agoRemove some extra includes, predefines and docs
Amos Jeffries [Mon, 19 Dec 2016 12:50:10 +0000 (01:50 +1300)] 
Remove some extra includes, predefines and docs

7 years agoDrop AuthNegotiateAPI and AuthNegotiateInternal doxygen groups
Amos Jeffries [Mon, 19 Dec 2016 10:53:42 +0000 (23:53 +1300)] 
Drop AuthNegotiateAPI and AuthNegotiateInternal doxygen groups

7 years agoDrop old Basic Authenticatio docs
Amos Jeffries [Mon, 19 Dec 2016 10:47:37 +0000 (23:47 +1300)] 
Drop old Basic Authenticatio docs

The wiki these days contains a more detailed and correct description of
how Basic auth helpers work in Squid. This old document does not even
describe how the code works, so is no longer useful.

7 years agoRemove doxygen 'ingroup AuthSchemeAPI'
Amos Jeffries [Mon, 19 Dec 2016 10:31:29 +0000 (23:31 +1300)] 
Remove doxygen 'ingroup AuthSchemeAPI'

7 years agoShuffle auth_schemes config objects into Auth::Config
Amos Jeffries [Mon, 19 Dec 2016 10:27:54 +0000 (23:27 +1300)] 
Shuffle auth_schemes config objects into Auth::Config

Also, move the directive definition down into "Access Controls" section
of squid.conf to avoid dependency issues with acl directive definitions
being done too late.

7 years agoFix error: unused variable 'weInitiatedThisClosure'
Amos Jeffries [Sun, 18 Dec 2016 11:34:47 +0000 (00:34 +1300)] 
Fix error: unused variable 'weInitiatedThisClosure'

7 years agoBump changelog dates
Amos Jeffries [Fri, 16 Dec 2016 04:05:17 +0000 (17:05 +1300)] 
Bump changelog dates

7 years agoDo not share private responses with collapsed client(s).
Eduard Bagdasaryan [Fri, 16 Dec 2016 02:02:43 +0000 (15:02 +1300)] 
Do not share private responses with collapsed client(s).

This excessive sharing problem with collapsed forwarding code has
several layers. In most cases, the core CF code does not share
uncachable or private response with collapsed clients because of the
refreshCheckHTTP() check. However, some responses might not be subject
to that (or equivalent) check. More importantly, collapsed revalidation
code does not check its responses at all and, hence, easily shares
private responses.

This short-term fix incorrectly assumes that an entry may become private
(KEY_PRIVATE) only when it cannot be shared among multiple clients
(e.g., because of a Cache-Control:private response header). However,
there are a few other cases when an entry becomes private. One of them
is a DISK_NO_SPACE_LEFT error inside storeSwapOutFileClosed() where
StoreEntry::releaseRequest() sets KEY_PRIVATE for a sharable entry [that
may still be perfectly preserved in the memory cache]. Consequently, the
short-term fix reduces CF effectiveness. The extent of this reduction is
probably environment-dependent.

Also: do not re-use SET_COOKIE headers for collapsed revalidation slaves,
i.e., adhere to the same requirement as for regular response HITs.

7 years agoDocs: add release notes for auth_schemes
Amos Jeffries [Thu, 15 Dec 2016 11:44:13 +0000 (00:44 +1300)] 
Docs: add release notes for auth_schemes

7 years agoPrep for 4.0.17 and 3.5.23
Amos Jeffries [Thu, 15 Dec 2016 11:06:18 +0000 (00:06 +1300)] 
Prep for 4.0.17 and 3.5.23

7 years agoAdd missing dependecies for squid.conf AuthSchemes objects
Amos Jeffries [Thu, 15 Dec 2016 06:50:53 +0000 (19:50 +1300)] 
Add missing dependecies for squid.conf AuthSchemes objects

7 years agoAdd new Auth::Config class for libauth directives
Amos Jeffries [Thu, 15 Dec 2016 06:25:06 +0000 (19:25 +1300)] 
Add new Auth::Config class for libauth directives

Also, reduce some for loops using C++11 range-for.

7 years agoRefactor libauth Config object(s)
Amos Jeffries [Wed, 14 Dec 2016 22:13:26 +0000 (11:13 +1300)] 
Refactor libauth Config object(s)

* Rename auth_param config object to Auth::SchemeConfig
 + update filename to match

* Add auth/forward.h file for predefines and namespace docs

* Move auth_schemes config object to Auth:: namespace

7 years agoBug 2258 pt2: bypassing cache but not destroying cache entry
Garri Djavadyan [Sun, 11 Dec 2016 06:15:03 +0000 (19:15 +1300)] 
Bug 2258 pt2: bypassing cache but not destroying cache entry

7 years agoauthor: Eduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Christos Tsantilas [Sat, 10 Dec 2016 16:27:09 +0000 (18:27 +0200)] 
author: Eduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
A typo fix for r14973 revealed by Jenkins.

Should use 'ConfigParser::LastTokenWasQuoted()' instead of
'ConfigParser::LastTokenWasQuoted'.

7 years agoSourceFormat Enforcement
Source Maintenance [Sat, 10 Dec 2016 06:12:06 +0000 (06:12 +0000)] 
SourceFormat Enforcement

7 years agoAdded auth_schemes to control schemes presence and order in 401s/407s.
Eduard Bagdasaryan [Sat, 10 Dec 2016 04:48:25 +0000 (21:48 -0700)] 
Added auth_schemes to control schemes presence and order in 401s/407s.

The new squid.conf directive may be used to customize authentication
schemes presence and order in Squid's HTTP 401 (Unauthorized) and 407
(Proxy Authentication Required) responses. The defaults remain the same.

7 years agoSourceFormat Enforcement
Source Maintenance [Fri, 9 Dec 2016 00:12:16 +0000 (00:12 +0000)] 
SourceFormat Enforcement

7 years agoCleanup: Refactor custom ACL-controlled actions configuration code.
Eduard Bagdasaryan [Thu, 8 Dec 2016 20:38:12 +0000 (09:38 +1300)] 
Cleanup: Refactor custom ACL-controlled actions configuration code.

* Reduced parsing code duplication by adding ParseAclWithAction().

* Used functors for generic action-to-string conversions. It is possible
  now to perform such conversions providing lambda expressions.

* Used vectors of strings instead of C-style arrays for storing
  conversion tables and check against bounds with vector::at().

7 years agoSourceFormat Enforcement
Source Maintenance [Thu, 8 Dec 2016 00:12:08 +0000 (00:12 +0000)] 
SourceFormat Enforcement

7 years agoBug 4169: HIT marked as MISS when If-None-Match does not match
Garri Djavadyan [Wed, 7 Dec 2016 19:39:21 +0000 (08:39 +1300)] 
Bug 4169: HIT marked as MISS when If-None-Match does not match

7 years agoHTTP/1.1: Add registered codes entry for new 103 (Early Hints) status code
Amos Jeffries [Wed, 7 Dec 2016 11:53:33 +0000 (00:53 +1300)] 
HTTP/1.1: Add registered codes entry for new 103 (Early Hints) status code

7 years agoBug 3940 (partial): hostHeaderVerify failures MISS when they should be HIT
Garri Djavadyan [Wed, 7 Dec 2016 00:05:07 +0000 (13:05 +1300)] 
Bug 3940 (partial): hostHeaderVerify failures MISS when they should be HIT

This fixes the critical condition leading to the HIT. However not all
code is correctly setting flags.noCache and flags.cacheable (see bugzilla).
So there may be other fixes needed after this.

7 years agoBug 2258: bypassing cache but not destroying cache entry
Garri Djavadyan [Tue, 6 Dec 2016 23:57:47 +0000 (12:57 +1300)] 
Bug 2258: bypassing cache but not destroying cache entry

7 years agoBug 4406: SIGSEV in TunnelStateData::handleConnectResponse() during reconfigure and...
Michael Buchau [Tue, 6 Dec 2016 23:42:35 +0000 (12:42 +1300)] 
Bug 4406: SIGSEV in TunnelStateData::handleConnectResponse() during reconfigure and restart

7 years agoSupport IPv6 NAT with PF for NetBSD and FreeBSD
Egervary Gergely [Sat, 3 Dec 2016 13:22:13 +0000 (02:22 +1300)] 
Support IPv6 NAT with PF for NetBSD and FreeBSD

7 years agoFix compile error after rev.14960
Amos Jeffries [Thu, 1 Dec 2016 02:22:25 +0000 (15:22 +1300)] 
Fix compile error after rev.14960

7 years agoCleanup: remove raw-pointer SSL* from ServerBump class API
Amos Jeffries [Thu, 1 Dec 2016 01:52:52 +0000 (14:52 +1300)] 
Cleanup: remove raw-pointer SSL* from ServerBump class API

7 years agoSourceFormat Enforcement
Source Maintenance [Thu, 1 Dec 2016 00:12:03 +0000 (00:12 +0000)] 
SourceFormat Enforcement

7 years agoMerge SBuf-based RegexData
Francesco Chemolli [Wed, 30 Nov 2016 23:52:56 +0000 (23:52 +0000)] 
Merge SBuf-based RegexData

7 years agoMerge from trunk
Francesco Chemolli [Wed, 30 Nov 2016 23:16:16 +0000 (23:16 +0000)] 
Merge from trunk

7 years agoRevert C++11 std::regex changes
Amos Jeffries [Wed, 30 Nov 2016 08:39:14 +0000 (21:39 +1300)] 
Revert C++11 std::regex changes

CentOS 7 (and thus probably also RHEL 7) still have difficulty using
GCC 5+ compiler necessary for this C++11 code to be used reliably.

see http://lists.squid-cache.org/pipermail/squid-dev/2015-July/002884.html

7 years agoBug 3290: authenticate_ttl not working for digest authentication
Garri Djavadyan [Sun, 27 Nov 2016 13:57:50 +0000 (02:57 +1300)] 
Bug 3290: authenticate_ttl not working for digest authentication

7 years agoBug 4007: Hang on DNS query with dead-end CNAME
Stephen Baynes [Sun, 27 Nov 2016 13:45:08 +0000 (02:45 +1300)] 
Bug 4007: Hang on DNS query with dead-end CNAME

DNS lookup recursion no longer occurs. ipcacheParse() return values are no
longer useful.

Also, cleanup the debugging output.

7 years agoCleanup: use return after self_destruct() to make Coverity happier
Amos Jeffries [Sun, 20 Nov 2016 16:44:03 +0000 (05:44 +1300)] 
Cleanup: use return after self_destruct() to make Coverity happier

 Detected by Coverity Scan. Issue 1154218.

7 years agoSourceFormat Enforcement
Source Maintenance [Sun, 20 Nov 2016 12:12:08 +0000 (12:12 +0000)] 
SourceFormat Enforcement

7 years agoC++11: Remove GnuRegex and all -lregex related code
Amos Jeffries [Sun, 20 Nov 2016 09:12:00 +0000 (22:12 +1300)] 
C++11: Remove GnuRegex and all -lregex related code

Squid is now exclusively using the STL std::regex API provided on all
operating systems in a portable manner.

We no longer have any need of detecting if the system is providing a
libregex, or user has configured one, or if it actually works, or how
to call it, or use the GnuRegex code as a backup when one of those
complex details goes wrong.

7 years agoBug 4599 pt3: use wrapper functions to access BIO object internals
Christos Tsantilas [Sat, 19 Nov 2016 13:25:15 +0000 (02:25 +1300)] 
Bug 4599 pt3: use wrapper functions to access BIO object internals

7 years agoCleanup: replace HTTP Request bitmap flags with boolean
Amos Jeffries [Sat, 19 Nov 2016 07:24:46 +0000 (20:24 +1300)] 
Cleanup: replace HTTP Request bitmap flags with boolean

7 years agoFix Null pointer dereferences after rev.14913
Amos Jeffries [Fri, 18 Nov 2016 18:08:30 +0000 (07:08 +1300)] 
Fix Null pointer dereferences after rev.14913

on_unsupported_protocol with non-HTTP requests occurs without
an HTTP request object. Some ACLs will not be possible to check
but that is not a reason to crash.

 Detected by Coverity Scan. Issue 1394291.

7 years agoTLS: Add ErrorString() function to libsecurity API
Amos Jeffries [Fri, 18 Nov 2016 08:42:13 +0000 (21:42 +1300)] 
TLS: Add ErrorString() function to libsecurity API

To convert library error codes to strings in a library agnostic way.

7 years agoFix ICAP Allow header containing only trailers option
Amos Jeffries [Fri, 18 Nov 2016 06:19:19 +0000 (19:19 +1300)] 
Fix ICAP Allow header containing only trailers option

r14941 added 'tailers' option to te Allow header but did not send it when
only that option was used, without the 204 or 206 features.

 Detected by Coverity Scan. Issue 1394381.

7 years agoFix r14945: Fixed Write.cc:41 "!ccb->active()" assertion.
Christos Tsantilas [Thu, 17 Nov 2016 10:13:41 +0000 (12:13 +0200)] 
Fix r14945:  Fixed Write.cc:41 "!ccb->active()" assertion.

The r14945 patch has a major bug:
 When the Http::One::Server::writeControlMsgAndCall fails to write the control
message, schedules a Comm::Write callback using just a ScheduleCallHere command.
The callback called withtout the CommIoCbParams details and squid is crashes.

This patch fixes the ConnStateData::writeControlMsgAndCall to return false if it
fails to write the control message and allow the caller to handle the failure.

This is a Measurement Factory project

7 years agoMerged previous wordlist work
Francesco Chemolli [Tue, 15 Nov 2016 16:27:55 +0000 (16:27 +0000)] 
Merged previous wordlist work