]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
11 years agoBug 3887: tcp_outgoing_tos not working for IPv6
Amos Jeffries [Sun, 3 Nov 2013 08:35:21 +0000 (01:35 -0700)] 
Bug 3887: tcp_outgoing_tos not working for IPv6

11 years agoFix cbdata 'error: expression result unused' errors
Amos Jeffries [Sun, 3 Nov 2013 08:32:24 +0000 (01:32 -0700)] 
Fix cbdata 'error: expression result unused' errors

Detected by Clang.

11 years agoHave testRock use cachemgr stubs
Francesco Chemolli [Thu, 24 Oct 2013 15:45:36 +0000 (09:45 -0600)] 
Have testRock use cachemgr stubs

11 years agoBug 3836: Fix issues with automake 1.13 and later and make check (extra)
Francesco Chemolli [Thu, 24 Oct 2013 15:45:01 +0000 (09:45 -0600)] 
Bug 3836: Fix issues with automake 1.13 and later and make check (extra)

11 years agoBug 3836: Fix issues with automake 1.13 and later and make check
Francesco Chemolli [Thu, 24 Oct 2013 15:39:19 +0000 (09:39 -0600)] 
Bug 3836: Fix issues with automake 1.13 and later and make check

11 years agoAppend Connection:close to OPTIONS requests when icap_persistent_connections is off.
Nathan Hoad [Thu, 24 Oct 2013 15:36:23 +0000 (09:36 -0600)] 
Append Connection:close to OPTIONS requests when icap_persistent_connections is off.

This brings OPTIONS requests behavior inline with REQMOD and RESPMOD.

11 years agoAdd cache_miss_revalidate
Amos Jeffries [Thu, 24 Oct 2013 15:35:08 +0000 (09:35 -0600)] 
Add cache_miss_revalidate

Port of 2.7 ignore_ims_on_miss directive by Henrik Nordstrom.

This on/off switch enables Squid to convert conditional requests from
clients to non-conditional fetches that can fill the cache faster under
cold-start conditions.

11 years agoBug 3480: StoreEntry::kickProducer() segfaults in store_client::copy()
Alex Rousskov [Thu, 24 Oct 2013 15:27:49 +0000 (09:27 -0600)] 
Bug 3480: StoreEntry::kickProducer() segfaults in store_client::copy()
context

Short-term fix: Lock StoreEntry object so that it is not freed by
storeClientCopy2() callbacks. Also lock StoreEntry in storeUnregister()
context because an aborting entry may be deleted there unless it is
double-locked.

See bug 3480 comment #27 for detailed call stack analysis. Additional
cases
include rejected copied HIT due to Var mismatch and hits blocked by
reply_from_cache directive (under development; see bug 3937).

Long-term, we need to make store copying asynchronous and revise
StoreEntry
locking approach.

11 years agoFix CBDATA_CLASS2 macro definition
Amos Jeffries [Thu, 24 Oct 2013 15:26:21 +0000 (09:26 -0600)] 
Fix CBDATA_CLASS2 macro definition

CBDATA_UNKNOWN was being used in place of a void no-op statement.
This was incorrect and useless. Now that the value definition is fixed
it is being picked up by the stricter compilers.
Replace the trinary conditional with an if-statement.

11 years agolibntlmauth: Fix string field truncation
Elmar Vonlanthen [Thu, 24 Oct 2013 15:25:27 +0000 (09:25 -0600)] 
libntlmauth: Fix string field truncation

Count of field bytes must begin at 0. Otherwise the decoder truncates
1 byte from the string due to lstring initial state values.

Also drop the lstring_zero(s) macro. It is only used in one place and
calling it 'zero' obscures that length is non-zero for invalid state.

11 years agontlm_fake_auth: pass DOMAIN data to Squid in original case
Elmar Vonlanthen [Thu, 24 Oct 2013 15:24:01 +0000 (09:24 -0600)] 
ntlm_fake_auth: pass DOMAIN data to Squid in original case

Lower-casing the domain field can cause base ACL match results if the
ACL is checking for case-sensitive or upper-case domain label.

The helper should be emitting the standard UPPER case domain and many
administrators will be expecting that when they write ACLs.

11 years agoFix SQUID_CC_CHECK_ARGUMENT autoconf macro
Francesco Chemolli [Thu, 24 Oct 2013 15:23:14 +0000 (09:23 -0600)] 
Fix SQUID_CC_CHECK_ARGUMENT autoconf macro

11 years agoPolish: better WARNING when workers directive is ignore on reconfigure.
Amos Jeffries [Thu, 3 Oct 2013 11:18:10 +0000 (05:18 -0600)] 
Polish: better WARNING when workers directive is ignore on reconfigure.

Changing the workers directive requires a proxy restart, not just a
reconfigure. State this clearly in the warning message.

11 years agoUse IPv6 localhost nameserver on DNS configuration errors
Amos Jeffries [Thu, 3 Oct 2013 11:17:30 +0000 (05:17 -0600)] 
Use IPv6 localhost nameserver on DNS configuration errors

When DNS configuration fails to locate a set of nameservers "localhost"
is used as the default but has previously only been setting 127.0.0.1
IPv4 address for localhost. This enables the failover to work as
designed on IPv6-only networks.

11 years agoBug 3923: cbdata and undefined behavior due to dynamic runtime enumeration
'noloader' [Sun, 29 Sep 2013 18:13:17 +0000 (12:13 -0600)] 
Bug 3923: cbdata and undefined behavior due to dynamic runtime enumeration

11 years agoPolish: report bytes received when bad content-length detected by quick-abort
Amos Jeffries [Sun, 29 Sep 2013 18:12:26 +0000 (12:12 -0600)] 
Polish: report bytes received when bad content-length detected by quick-abort

11 years agoBug 3918: Squid 3.3.9 Self Test Failures on Mac OS X 10.8
Alex Rousskov [Sun, 29 Sep 2013 17:54:51 +0000 (11:54 -0600)] 
Bug 3918: Squid 3.3.9 Self Test Failures on Mac OS X 10.8

11 years agoBug 3929: request_header_add not working for tunnel requests
libit [Sun, 29 Sep 2013 17:50:16 +0000 (11:50 -0600)] 
Bug 3929: request_header_add not working for tunnel requests

11 years agoFix pinning hierarchy log information
Amos Jeffries [Sun, 29 Sep 2013 17:47:16 +0000 (11:47 -0600)] 
Fix pinning hierarchy log information

11 years agoClose idle client connections associated with closed idle pinned connections.
Alex Rousskov [Sun, 29 Sep 2013 17:28:00 +0000 (11:28 -0600)] 
Close idle client connections associated with closed idle pinned connections.

Squid was not monitoring idle persistent connections pinned to servers. Squid
would discover that the pinned server connection is closed only after
receiving a new request on the idle client connection and trying to write that
request to the server. In such cases, Squid propagates the pinned connection
closure to the client (as it should).

Chrome and, to a lesser extent, Firefox handle such races by opening a new
connection and resending the failed [idempotent] request transparently to the
user. However, IE usually displays an error page to the user.

While some pconn races cannot be avoided, without monitoring idle pconns,
Squid virtually guaranteed such a race in environments where origin server
idle connection timeout is smaller than client/Squid timeouts and users
are revisiting pages in the window between those two timeouts.

Squid now monitors idle pinned connections similar to idle connections in the
pconn pool and closes the corresponding idle client connection to keep the two
sides in sync (to the extent possible).

It is theoretically possible that this change will break servers that send
whitespace on an idle persistent connection or perhaps send some SSL keepalive
traffic. No such cases are known to exist though.

11 years agoRevert r12609 due to compile errors on stable branch
Amos Jeffries [Wed, 11 Sep 2013 01:53:34 +0000 (19:53 -0600)] 
Revert r12609 due to compile errors on stable branch

src/ssl/support.cc:302: error: expected type-specifier
src/ssl/support.cc:302: error: cannot convert 'int*' to 'Ssl::Errors*' in assignment
src/ssl/support.cc:302: error: expected `;'
src/ssl/support.cc:303: error: 'class ACLFilledChecklist' has no member named 'serverCert'
src/ssl/support.cc:312: error: 'class ACLFilledChecklist' has no member named 'serverCert'
src/ssl/support.cc:316: error: 'TheConfig' is not a member of 'Ssl'
src/ssl/support.cc:319: error: 'ssl_ex_index_ssl_cert_chain' was not declared in this scope
src/ssl/support.cc:495: error: a function-definition is not allowed here before '{' token
src/ssl/support.cc:1595: error: expected `}' at end of input

11 years ago3.3.9
Amos Jeffries [Wed, 11 Sep 2013 01:39:13 +0000 (19:39 -0600)] 
3.3.9

11 years agoWindows: locate CMSG definitions in WinSock2.h when present
Amos Jeffries [Wed, 11 Sep 2013 01:12:44 +0000 (19:12 -0600)] 
Windows: locate CMSG definitions in WinSock2.h when present

Windows defines the CMSG macros in WinSock2.h sometimes. This allows the
definitions there to be used when present and avoids compiler errors
about double definitions.

  This is an iCelero project.

11 years agoBug 3849: Duplicate certificate sent when using https_port
Christos Tsantilas [Wed, 11 Sep 2013 01:05:03 +0000 (19:05 -0600)] 
Bug 3849: Duplicate certificate sent when using https_port

The certificate file given with the "cert=" option it may contain a list
of
certificates to be chained to the SSL client, for example intermediate
certificates.

The bug caused because in the certificates  chain we are storing also
the
certificate of the port. This is works well for SSL-bump because squid
generates a certificate which uses the port certificate as CA
certificate.
But in the case of https_port without bumping the port certificate is
sent
twice, one as SSL server certificate and one as chained certificate.

This patch try to chain port certificate only when the sslbump is used.

This is a Measurement Factory project

11 years agoFix myportname ACL on ICAP/eCAP transactions
Amos Jeffries [Wed, 11 Sep 2013 01:03:45 +0000 (19:03 -0600)] 
Fix myportname ACL on ICAP/eCAP transactions

The port name from http_port/https_port was not being propigated to
adapted reqeusts after ICAP/eCAP. Which makes the myportname ACL and
logging of portname not work on adapted requests.

 This is an iCelero Project

11 years agoWindows: document the purpose and use of Squid namespace wrappers
Amos Jeffries [Wed, 11 Sep 2013 01:02:54 +0000 (19:02 -0600)] 
Windows: document the purpose and use of Squid namespace wrappers

Also, add some missing #define's

  This is an iCelero project

11 years agoWindows: fix IPv6 split-stack support
Amos Jeffries [Wed, 11 Sep 2013 01:01:32 +0000 (19:01 -0600)] 
Windows: fix IPv6 split-stack support

Some builds of MinGW do not define IPV6_V6ONLY socket option.

  This is an iCelero project

11 years agoWindows: fix collision between POSIX wrappers and DiskIO class methods
Amos Jeffries [Wed, 11 Sep 2013 01:00:02 +0000 (19:00 -0600)] 
Windows: fix collision between POSIX wrappers and DiskIO class methods

The POSIX function shutdown() is #define'd on Windows. This causes
compiler issues with the DiskIO method of same name. Rename the method
to gracefulShutdown() instead.

Also, Bug 3189 was incomplete and missed a change to DiskThreads
Windows initialization method.

  This is an iCelero project.

11 years agoWindows: fix getopt.c build error with MinGW
Amos Jeffries [Wed, 11 Sep 2013 00:58:53 +0000 (18:58 -0600)] 
Windows: fix getopt.c build error with MinGW

Resolve warning 'initialization discards const qualifieer from pointer'.

  This is an iCelero project.

11 years agoImproved compatibility with clang and icc
Francesco Chemolli [Wed, 11 Sep 2013 00:58:09 +0000 (18:58 -0600)] 
Improved compatibility with clang and icc

11 years agoBug 3895: fix acl_uses_indirect_client and cache_peer_access
David Isaacs [Tue, 10 Sep 2013 11:33:49 +0000 (05:33 -0600)] 
Bug 3895: fix acl_uses_indirect_client and cache_peer_access

11 years agoWindows: Fix ConnOpener::sleep() collision with global macro
Amos Jeffries [Tue, 10 Sep 2013 11:30:13 +0000 (05:30 -0600)] 
Windows: Fix ConnOpener::sleep() collision with global macro

Squid compat library defines sleep() as a wrapper macro which
collides with the member definition in Comm::ConnOpener.

 This is an iCelero project

11 years agoShow number of available filedescriptors when reserved FD changes
Amos Jeffries [Tue, 10 Sep 2013 11:28:59 +0000 (05:28 -0600)] 
Show number of available filedescriptors when reserved FD changes

11 years agoRegression Bug 3077: off-by-one error in Digest header decoding
Jan Sievers [Tue, 10 Sep 2013 11:28:13 +0000 (05:28 -0600)] 
Regression Bug 3077: off-by-one error in Digest header decoding

This is a regression in the 3.2 and later version of the original bug
fix patch.

The effect is that all attributes are treated as quoted-string values
with unescaping performed. This ends with credentials wrongly being
rejected as invalid.

11 years agoRegister Http2-Settings header
Amos Jeffries [Tue, 10 Sep 2013 07:36:28 +0000 (01:36 -0600)] 
Register Http2-Settings header

This header ia a hop-by-hop request-only header and requires stripping
by intermediaries which do not support HTTP/2.0 in Upgrade feature.

We register it now to ensure the stripping occurs even if broken clients
omit it from the Connection header list.

11 years agoFix configure parsing IP/domain directives
Amos Jeffries [Tue, 10 Sep 2013 07:34:29 +0000 (01:34 -0600)] 
Fix configure parsing IP/domain directives

Squid would semi-silently accept invalid IP address or hostname in some
directives which required them (eg wccp_router) and use the magic
IP_ANYADDR value. This change makes configure halt with a FATAL error
instead.

 Detected by Coverity Scan. Issue 1057286.

11 years agoSync with newest OpenSSL error codes
Christos Tsantilas [Tue, 10 Sep 2013 07:31:09 +0000 (01:31 -0600)] 
Sync with newest OpenSSL error codes

This patch updates Squid list of errors to handle the ones available in
newer
OpenSSL versions.

  This is a Measurement Factory project

11 years agoHandle infinite certificate validation loops caused by OpenSSL bug #3090.
Christos Tsantilas [Tue, 10 Sep 2013 07:22:44 +0000 (01:22 -0600)] 
Handle infinite certificate validation loops caused by OpenSSL bug #3090.

If OpenSSL is stuck in a validation loop, Squid breaks the loop and
triggers a
new custom SQUID_X509_V_ERR_INFINITE_VALIDATION SSL validation error.
That
error cannot be bypassed using sslproxy_cert_error because to break the
loop
Squid has to tell OpenSSL that the certificate is invalid, which
terminates
the SSL connection.

Validation loops exceeding SQUID_CERT_VALIDATION_ITERATION_MAX
iterations
are deemed infinite. That macro is defined to be 16384, but that default
can
be overwritten using CPPFLAGS.

  This is a Measurement Factory project

11 years agoWindows: updated test for ws2tcpip.h and windows.h
Amos Jeffries [Mon, 9 Sep 2013 09:29:28 +0000 (03:29 -0600)] 
Windows: updated test for ws2tcpip.h and windows.h

11 years agoWindows: cleanup Squid OS detection macros
Amos Jeffries [Mon, 9 Sep 2013 07:17:19 +0000 (01:17 -0600)] 
Windows: cleanup Squid OS detection macros

* _SQUID_WINDOWS_  for any Windows build specific code
* _SQUID_CYGWIN_   for CygWin Windows build specific code
* _SQUID_MINGW_    for MinGW Windows build specific code

11 years agoWindows: build Windows specific libraries only on Windows.
Amos Jeffries [Mon, 9 Sep 2013 06:30:54 +0000 (00:30 -0600)] 
Windows: build Windows specific libraries only on Windows.

Some libraries are only available on Windows and others are unable to be
built.

11 years agoWindows: fix error: variable 'h_error' set but not used
Amos Jeffries [Mon, 9 Sep 2013 06:09:27 +0000 (00:09 -0600)] 
Windows: fix error: variable 'h_error' set but not used

11 years agoWindows: provide mkdir() wrapper
Amos Jeffries [Mon, 9 Sep 2013 06:06:59 +0000 (00:06 -0600)] 
Windows: provide mkdir() wrapper

11 years agoWindows: fix detection of GNU atomic operations
Amos Jeffries [Sun, 8 Sep 2013 22:05:21 +0000 (16:05 -0600)] 
Windows: fix detection of GNU atomic operations

On MinGW the GNU atomic operations symbols are defined but do not work.
We require a run-time test to detect problems. Not just a compiler check.

12 years agoMake GCC 4.8 happy with libip code
Amos Jeffries [Fri, 26 Jul 2013 12:43:39 +0000 (06:43 -0600)] 
Make GCC 4.8 happy with libip code

Invalid casting seems to confuse the ABI generator and results in
illegal instruction faults when the unit tests is run.
The class API is already const-correct so there is no need for the cast
to occur, and it should not be done on a non-pointer type anyway.

Also, fixes a missing "struct" type identifier found along the way.

12 years agoFix assert with side effects in ServerStateData::handleAdaptedHeader
Nathan Hoad [Fri, 26 Jul 2013 12:39:59 +0000 (06:39 -0600)] 
Fix assert with side effects in ServerStateData::handleAdaptedHeader

setConsumerIfNotLate conditionally schedules some async calls, so the
call definitely shouldn't be removed by the precompiler.

12 years agoFix mgr:info report 'Largest file desc currently in use' with SMP
Amos Jeffries [Fri, 26 Jul 2013 12:38:40 +0000 (06:38 -0600)] 
Fix mgr:info report 'Largest file desc currently in use' with SMP

The biggest FD in use should not be the sum of biggest FD in each worker,
but the maximum across all workers.

12 years agoBug 3879: assertion failed ConnStateData::validatePinnedConnection
Martin Stolle [Fri, 26 Jul 2013 12:34:37 +0000 (06:34 -0600)] 
Bug 3879: assertion failed ConnStateData::validatePinnedConnection

12 years agoBug 2287: Better fix for unsupported HTTP version handling
Amos Jeffries [Fri, 26 Jul 2013 12:32:07 +0000 (06:32 -0600)] 
Bug 2287: Better fix for unsupported HTTP version handling

RFC 2616 section 10.5.6 is more specifically about MAJOR versions.
Remove the criterion limiting 1.x minor version numbers.

12 years agoBug 2112: Reload into If-None-Match
Christos Tsantilas [Fri, 26 Jul 2013 12:21:20 +0000 (06:21 -0600)] 
Bug 2112: Reload into If-None-Match

This patch sends an If-None-Match  request, when we need to re-validate
if a cached object which has a strong ETag is still valid.

This is also done in the cases an HTTP client request contains HTTP
headers prohibiting a from-cache response (i.e., a "reload" request).
The use of If-None-Match request in this context violates RFC 2616 and
requires using reload-into-ims option within refresh_pattern squid.conf
directive.

The exact definition of a "reload request" and the adjustment/removal of
"reload" headers is the same as currently used for reload-into-ims
option support. This patch is not modifying that code/logic, just adding
an If-None-Match header in addition to the IMS header that Squid already
adds.

This is a Measurement Factory Project

12 years agoFix external ACL user:pass detail logging after adaptation
Nathan Hoad [Fri, 26 Jul 2013 11:47:48 +0000 (05:47 -0600)] 
Fix external ACL user:pass detail logging after adaptation

When a request is successfully adapted, the external ACL username and
password are now inherited with this patch. This means the
LFT_USER_NAME log token can display the username from an external ACL
if available, for adapted requests.

The HttpRequest will inherit the password for good measure as well -
while none too useful, it seems strange to inherit the username but
not the password.

12 years agoFix assert() with side effects
Amos Jeffries [Fri, 26 Jul 2013 11:40:37 +0000 (05:40 -0600)] 
Fix assert() with side effects

assert() may be completely removed by precompiler when optimizing. Such
that the code conditional never gets run.

12 years agoBug 3863: myportname acl causes segmentation fault
Amos Jeffries [Mon, 22 Jul 2013 05:09:11 +0000 (23:09 -0600)] 
Bug 3863: myportname acl causes segmentation fault

12 years ago3.3.8 SQUID_3_3_8
Amos Jeffries [Sat, 13 Jul 2013 13:24:45 +0000 (07:24 -0600)] 
3.3.8

12 years agoPrep for 3.3.8 and 3.2.13
Amos Jeffries [Sat, 13 Jul 2013 13:20:39 +0000 (07:20 -0600)] 
Prep for 3.3.8 and 3.2.13

12 years agoBetter handling of strange port values in Host:
Amos Jeffries [Sat, 13 Jul 2013 12:40:22 +0000 (06:40 -0600)] 
Better handling of strange port values in Host:

We can do better than just producing errors about invalid port details
and treating it as port-0.
We can instead undo the port separation and pass it through as part of
the host name to be verified with the default port number properly
assumed.

12 years agoBug 3869: assertion failed: MemBuf.cc:272: size < capacity
Amos Jeffries [Sat, 13 Jul 2013 12:37:35 +0000 (06:37 -0600)] 
Bug 3869: assertion failed: MemBuf.cc:272: size < capacity

12 years ago3.3.7 SQUID_3_3_7
Amos Jeffries [Thu, 11 Jul 2013 06:07:36 +0000 (00:07 -0600)] 
3.3.7

12 years agoPrep for 3.2.12 and 3.3.7
Amos Jeffries [Thu, 11 Jul 2013 04:41:32 +0000 (22:41 -0600)] 
Prep for 3.2.12 and 3.3.7

12 years agoProtect against buffer overrun in DNS query generation
Nathan Hoad [Wed, 10 Jul 2013 12:44:19 +0000 (06:44 -0600)] 
Protect against buffer overrun in DNS query generation

see SQUID-2013:2.

This bug has been present as long as the internal DNS component however
most code reaching this point is passing through URL validation first.
With Squid-3.2 Host header verification using DNS directly we may have
problems.

12 years agoSourceFormat Enforcement
Automatic source maintenance [Fri, 5 Jul 2013 03:06:00 +0000 (21:06 -0600)] 
SourceFormat Enforcement

12 years agoBug 3297: Fix openSSL related build failures
Christos Tsantilas [Thu, 4 Jul 2013 04:42:07 +0000 (22:42 -0600)] 
Bug 3297: Fix openSSL related build failures

- The SSL_CTX_new in newer openSSL releases requires a const
'SSL_METHOD *' argument and in older releases requires non const
'SSL_METHD *' argument. Currently we are trying to identify openSSL
version using the OPENSSL_VERSION_NUMBER macro define but we are failing
to correctly identify all cases.

- sk_OPENSSL_PSTRING_value is buggy in early openSSL-1.0.0? releases
causing compile errors to squid.

This is a Measurement Factory project

12 years agoFix build on FreeBSD 9.x platform with clang
Christos Tsantilas [Thu, 4 Jul 2013 04:40:34 +0000 (22:40 -0600)] 
Fix build on FreeBSD 9.x platform with clang

Add the "/usr/local/*" directories to include files and libraries search
paths, for clang compiler too.

12 years ago3.3.6 SQUID_3_3_6
Amos Jeffries [Mon, 1 Jul 2013 04:00:25 +0000 (22:00 -0600)] 
3.3.6

12 years agoBug 3762: remove bogus WARNING in cache.log
Amos Jeffries [Sun, 30 Jun 2013 08:45:09 +0000 (02:45 -0600)] 
Bug 3762: remove bogus WARNING in cache.log

The warning is bogus for several reasons:
* it appears with memory-only cache configurations
* it only checks the size of first SwapDir (as seen in bug 3762)
* very large memory spaces are now possible which may make disk appear
  small by comparison.

Its usefulness in detecting memory and disk misconfigurations has long
been almosy nil. Removing this entirey to resolve the bogus noise in
the above mentioned legitimate configurations.

12 years agoFix Ip::Address::operator =(sockaddr_storage)
Alexis Robert [Sat, 29 Jun 2013 08:23:49 +0000 (02:23 -0600)] 
Fix Ip::Address::operator =(sockaddr_storage)

The memcpy() for AF_INET6 is using a length of sizeof(sockaddr_in) instead
of sizeof(sockaddr_in6), so squid was trying to connect to truncatured IPv6
addresses with strange ports.

12 years agoMake sure %<tt includes all [failed] connection attempts.
Alex Rousskov [Sat, 29 Jun 2013 08:20:01 +0000 (02:20 -0600)] 
Make sure %<tt includes all [failed] connection attempts.

The old code was using zero n_tries to detect the first connection
attempt,
but n_tries is not incremented when we are opening a new connection
rather
than reusing an old one. Perhaps n_tries should be updated differently
as
well, but this change simply makes %<tt (hier.total_response_time)
management
independent from that [complex] counter.

12 years agoBug 3854: pt1: compile errors on AIX
Amos Jeffries [Sat, 29 Jun 2013 08:16:04 +0000 (02:16 -0600)] 
Bug 3854: pt1: compile errors on AIX

12 years agoFix request headers logging for icap_log
Christos Tsantilas [Tue, 11 Jun 2013 14:55:34 +0000 (08:55 -0600)] 
Fix request headers logging for icap_log

The %http::>h does not print the original request headers but the adapted
request headers. Also the %http::>ha does not print adapted headers.

12 years agoSupport HTTP reply ACLs in icap_log and log_icap
Christos Tsantilas [Tue, 11 Jun 2013 14:52:01 +0000 (08:52 -0600)] 
Support HTTP reply ACLs in icap_log and log_icap

The HTTP reply related acls does not check for icap_log

12 years agoFix wrong check inside Format::Format::assemble
Christos Tsantilas [Tue, 11 Jun 2013 14:09:58 +0000 (08:09 -0600)] 
Fix wrong check inside Format::Format::assemble

We are checking for al->request but we are using al->adapted_request.
This is may cause crashes if the al->adapted_request is NULL.

12 years agoFix configure with --disable-internal-dns compile error
Zhanpeng Chen [Tue, 11 Jun 2013 14:05:04 +0000 (08:05 -0600)] 
Fix configure with --disable-internal-dns compile error

dns.cc: In function variable_list* snmp_netDnsFn(variable_list*,s=nint*):
dns.cc:150:5: error: snmpDebugOid was not declared in this scope

12 years agoPolished icap_service and ecap_service documentation.
Alex Rousskov [Tue, 11 Jun 2013 13:47:06 +0000 (07:47 -0600)] 
Polished icap_service and ecap_service documentation.

12 years agoSourceFormat Enforcement
Automatic source maintenance [Thu, 6 Jun 2013 02:42:12 +0000 (20:42 -0600)] 
SourceFormat Enforcement

12 years agoBug 3717: assertion failed with dstdom_regex with IP based URL
Alex Rousskov [Wed, 5 Jun 2013 13:00:09 +0000 (07:00 -0600)] 
Bug 3717: assertion failed with dstdom_regex with IP based URL

A combination of ACL negation and async lookup leads to
Checklist.cc:287:"!needsAsync && !matchFinished" assertions.

The lower-level ACL code says "not a match because I need an async lookup" but
the negation-handling code in ACL::matches() ignores the "need an async
lookup" part and converts "not a match" into a "match". This patch prevents
that conversion, while allowing Checklist code to decide what to do with
an async lookup (depending on whether the directive being checked supports
slow ACLs).

Note that this change prevents admins from negating async lookups in
directives that do not support them: both "!foo" and "foo" will probably not
match in those directives if ACL foo needs an async lookup.

12 years agoFix incorrect external_acl_type codes
Amos Jeffries [Tue, 4 Jun 2013 06:58:07 +0000 (00:58 -0600)] 
Fix incorrect external_acl_type codes

Documentation describes %USER_CA_CERT_* codes for outputing the CA cert
attributes. However the directive parser and internals were all
referencing it as %CA_CERT_*.

This updates the internals to match documentation, and adds an upgrade
notice for any installations using the old token name.

Also, Prepare external_acl_type format codes for libformat upgrade.
Add upgrade warnings for the %> and %< header codes which will change
radically in a future version when libformat is integrated.

Also, while we are at it support the other logformat codes which map 1:1
but silently for now and only on parse.

12 years agoAvoid segfaults on seriously malformed requests when ICAP logging is enabled.
Alex Rousskov [Tue, 4 Jun 2013 06:20:44 +0000 (00:20 -0600)] 
Avoid segfaults on seriously malformed requests when ICAP logging is enabled.

12 years agoAsk for SSL key password when started with -N but without sslpassword_program.
Alex Rousskov [Sun, 2 Jun 2013 16:01:18 +0000 (10:01 -0600)] 
Ask for SSL key password when started with -N but without sslpassword_program.

Do not give SSL a password-asking callback if sslpassword_program is not
configured. Without a callback, OpenSSL itself asks for the password (which
works if Squid runs in foreground because of -N).

The fix applies to Ssl::readCertChainAndPrivateKeyFromFiles() context only.
This is not the only place where we read private keys. Some other places are
working correctly, but others may need more work. Also,
Ssl::readCertChainAndPrivateKeyFromFiles() may not really work if
sslpassword_program _is_ configured because "user data" pointer will be nil.

12 years agobasic_ncsa_auth: fix unused variable warnings (typo in rev.12762)
Amos Jeffries [Sun, 2 Jun 2013 15:50:00 +0000 (09:50 -0600)] 
basic_ncsa_auth: fix unused variable warnings (typo in rev.12762)

When libcrypto is absent the passwordLength variable becomes unused.
Detected by Windows build farm node.

12 years agoFix buffer null termination
Amos Jeffries [Fri, 24 May 2013 04:38:33 +0000 (22:38 -0600)] 
Fix buffer null termination

strncpy() does not ensure a buffer is nul-terminated if the source is the
same length or longer than the destination buffer.

Detected by Coverity Scan. Issue 1025738.

12 years agoBug 1991: kqueue causes SSL to hang
Ming Fu [Thu, 23 May 2013 02:26:18 +0000 (20:26 -0600)] 
Bug 1991: kqueue causes SSL to hang

Compare the code in normal select and epoll v.s. kqueue. The select use a 0
wait time to get out of select wait in order to handle a list of read_pendings.
However, epoll add the read_pending to read and write event monitor. At a first
look, this seems strange as why read pending has anything to do with write. It
became obvious when the write ready event is triggered. During a write ready
event, if read_pending is on, the read callback is called before the write
callback. As the write buffer is unlikely to be full for an extended period, a
write callback is guaranteed in the immediate future for the read_pending
socket by waiting on write.

The patch follows that same logic as epoll and applies it on kqueue.

12 years ago3.3.5 SQUID_3_3_5
Amos Jeffries [Mon, 20 May 2013 11:48:25 +0000 (05:48 -0600)] 
3.3.5

12 years agoAllocate ClientInfo::hash.key using malloc() instead of new char[]
Alex Rousskov [Sun, 19 May 2013 03:27:30 +0000 (21:27 -0600)] 
Allocate ClientInfo::hash.key using malloc() instead of new char[]

... because it is destroyed using safe_free() instead of delete[].

Added ClientInfo construction/destruction debugging to find leaking objects.

12 years agoBug 3851: Delay Pool class 5 tag:levels displayed incorrectly in cache manager
Amos Jeffries [Sun, 19 May 2013 03:21:00 +0000 (21:21 -0600)] 
Bug 3851: Delay Pool class 5 tag:levels displayed incorrectly in cache manager

12 years agoUse case-insensitive comparison for HTTP header names in *_header_access
Alex Rousskov [Sun, 19 May 2013 03:19:50 +0000 (21:19 -0600)] 
Use case-insensitive comparison for HTTP header names in *_header_access

12 years agoBug 3744: squid terminated: FATAL: Bungled (null) line 3: sslproxy_cert_sign signTrus...
Christos Tsantilas [Sun, 19 May 2013 03:17:59 +0000 (21:17 -0600)] 
Bug 3744: squid terminated: FATAL: Bungled (null) line 3: sslproxy_cert_sign signTrusted all

This bug is a Makefile dependencies  problem.

 - The cf_gen includes the  cf_gen_defines.cci so this file should included in
   cf_gen dependencies.
 - Currently the cf_gen_defines.cci exist in cf_gen.$(OBJEXT) dependencies but
   does not have any effect because the obj file never build and used.
 - Also the  cf_gen_defines.cci file depends on autoconf.h so this file should
   added to to cf_gen_defines.cc dependencies.
   All of the sources has the autoconf.h file in their dependencies.
   But the cf_gen_defines.cci is auto-generated and does not exist when the
   dependencies computed.

This is a Measurement Factory project

12 years agoBug 3759: OpenSSL compilation error on stock Fedora17, RHEL, CentOS 6 systems
Christos Tsantilas [Sun, 19 May 2013 03:12:36 +0000 (21:12 -0600)] 
Bug 3759: OpenSSL compilation error on stock Fedora17, RHEL, CentOS 6 systems

OpenSSL-1.0.x has changes in TXT_DB interface over the earlier openSSL releases.
Also looks that the IMPLEMENT_LHASH_* macros are not correctly implemented and
causes compile failures.
Some of the linux distributions to overcome the above problems trying to patch
openSSL SDK. For squid this is means that the current checks based on openSSL
version can not work.

This patch try to detect at configure time:
 - if the TXT_DB uses the new implementation investigated in openSSL-1.0.x
   releases
 - If the IMPLEMENT_LHASH_* openSSL  macros are correctly implemented.

Then uses the autoconf defines to implement the correct workarounds for used
openSSL SDK.

This is a Measurement Factory project

12 years agoBug 3816: SSL_get_certificate call inside Ssl::verifySslCertificate crashes squid...
Christos Tsantilas [Sun, 19 May 2013 03:11:29 +0000 (21:11 -0600)] 
Bug 3816: SSL_get_certificate call inside Ssl::verifySslCertificate crashes squid, part2

This patch try to avoid using the SSL_get_certificate function. While configures
squid run tests:
  - to examine if the workaround code can be used
  - to detect buggy SSL_get_certificate

Inside Ssl::verifySslCertificate try to use workarround code and if this is not
possible uses the SSL_get_certificate if it is not buggy, else hit an assertion

This is a Measurement Factory project

12 years agoPort from 2.6: external acl %ACL and %DATA tags
Henrik Nordstrom [Sun, 19 May 2013 02:46:58 +0000 (20:46 -0600)] 
Port from 2.6: external acl %ACL and %DATA tags

12 years agoLog an ERROR instead of halting on unknown cache_dir types
Amos Jeffries [Sun, 19 May 2013 02:43:38 +0000 (20:43 -0600)] 
Log an ERROR instead of halting on unknown cache_dir types

Squid-3 can run fine without any configured cache_dir. This assists with
upgrade from older Squid-2 where COSS or NULL cache types may be present.
It also assists with backward compatibility for any future cache types
which may be added in future.

12 years agoBug 2648: Add missing piece omitted from rev.9677
Silamael [Sun, 19 May 2013 02:38:40 +0000 (20:38 -0600)] 
Bug 2648: Add missing piece omitted from rev.9677

rev.9677 created forward_max_tries directive but omitted one of the
checks. This adds that check and allows forward_max_tries to be set
to values greater than 10.

12 years agoRemove origin_tries limiter on forwarding
Amos Jeffries [Sun, 19 May 2013 02:35:36 +0000 (20:35 -0600)] 
Remove origin_tries limiter on forwarding

This limit seems to have been set to prevent large amount of looping when
DIRECT attempts fail under the old model of constant DNS lookups and
retries.

However it is hard-coded and has no configuration knob visible. Under
the curent model of all destinations being enumerated once and tried
sequentially this protection would seem to be no longer necessary and
somewhat harmful as it will be preventing retries reaching destinations
with more than 2 unreachable IPs (think 3 IPv6 and an IPv4 on IPv4-only
network).

12 years agoFixed leaking configurable SSL error details.
Alex Rousskov [Sun, 19 May 2013 02:34:11 +0000 (20:34 -0600)] 
Fixed leaking configurable SSL error details.

Trunk r11496 "Configurable SSL error details messages" correctly disabled
collection of HTTP statistics for non-HTTP header fields, such as configurable
SSL error details. However, it also incorrectly disabled deletion of those
non-HTTP header fields.

Configurable SSL error details are only created during [re]configuration time,
so the leak went unnoticed since 2011-06-17, but the same bug caused a major
runtime annotation leak later (r12413) until the new annotation code was
redesigned to avoid using HttpHeader (r12779).

12 years agoFix memory error with Kerberos authentication
Markus Moeller [Sun, 19 May 2013 02:32:47 +0000 (20:32 -0600)] 
Fix memory error with Kerberos authentication

Uninitialized variable 'dp' shows up as
"glibc detected (ext_kerberos_ldap_group_acl): double free or corruption"

see mailing list thread for full details:
http://www.squid-cache.org/mail-archive/squid-users/201305/0031.html

12 years agoAvoid !closing assertions when helpers call comm_read [during reconfigure].
Alex Rousskov [Sun, 19 May 2013 02:32:10 +0000 (20:32 -0600)] 
Avoid !closing assertions when helpers call comm_read [during reconfigure].

While helper reading code does check for COMM_ERR_CLOSING, it is not sufficient
because helperReturnBuffer() called by the reading code may notice the helper
shutdown flag (set earlier by reconfigure) and start closing the connection
underneath the reading code feet.

12 years agoAvoid Comm::Connection leaks when helpers are reconfigured or otherwise closed.
Alex Rousskov [Sun, 19 May 2013 02:31:15 +0000 (20:31 -0600)] 
Avoid Comm::Connection leaks when helpers are reconfigured or otherwise closed.

CBDATA_CLASS2 classes must be deleted using C++ delete, not cbdataFree().
cbdataFree() does not call the class destructor.

12 years agofind-alive.pl: Replaced HttpReq entry (already covered by the guessing code) with...
Alex Rousskov [Sun, 12 May 2013 05:10:35 +0000 (23:10 -0600)] 
find-alive.pl: Replaced HttpReq entry (already covered by the guessing code) with HttpHeaderEntry entry

12 years agoDocs: Polish [http::]>h and [http::]>ha descriptions to emphasize their pre-cache...
Alex Rousskov [Sun, 12 May 2013 05:08:39 +0000 (23:08 -0600)] 
Docs: Polish [http::]>h and [http::]>ha descriptions to emphasize their pre-cache scope

12 years agoPolish: show file path on Bungled lines
Amos Jeffries [Tue, 7 May 2013 09:17:00 +0000 (03:17 -0600)] 
Polish: show file path on Bungled lines

Since include directive was added it is entirely possible that two files
are loaded from the same filename on different paths.

This also enables automated tools to make use of the displayed filename
to manipulate the relevant file.

12 years agoBug 3780: cachemgr.cgi: output problem in HTTP Header Statistics
Amos Jeffries [Tue, 7 May 2013 09:16:37 +0000 (03:16 -0600)] 
Bug 3780: cachemgr.cgi: output problem in HTTP Header Statistics