]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
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

12 years agoBug 3840: assertion failed 'sde' in UFS cache loading
Alex Rousskov [Tue, 7 May 2013 09:00:37 +0000 (03:00 -0600)] 
Bug 3840: assertion failed 'sde' in UFS cache loading

12 years agoBug 3836: make check failures with automake-1.13
Eray Aslan [Tue, 7 May 2013 08:52:26 +0000 (02:52 -0600)] 
Bug 3836: make check failures with automake-1.13

12 years agoBug 3845: http_port tcpkeepalive= option fails parsing
Amos Jeffries [Tue, 7 May 2013 08:51:08 +0000 (02:51 -0600)] 
Bug 3845: http_port tcpkeepalive= option fails parsing

The stricter xato*() parsing bounds checks are halting on the ','
delimiters. Fix this by adding an optional end-of-value parameter to the
relevant parse functions and sending the delimiter in.

This fix makes xatoui() and xatoll() more friendly to parsing
unterminated strings.

previous to this fix the latter two values of tcpkeepalive= were
undocumented optional. This makes Squid enforce the documented format
where all three values are required if any is set.

12 years agoBug 3827: Remove AccessLogEntry::cache.authuser
Amos Jeffries [Tue, 7 May 2013 08:48:36 +0000 (02:48 -0600)] 
Bug 3827: Remove AccessLogEntry::cache.authuser

12 years agolog_db_daemon: add missing pod2man controls
Amos Jeffries [Fri, 3 May 2013 11:17:08 +0000 (05:17 -0600)] 
log_db_daemon: add missing pod2man controls

12 years agoPrep for 3.2.11
Amos Jeffries [Tue, 30 Apr 2013 04:20:43 +0000 (22:20 -0600)] 
Prep for 3.2.11

12 years agoUpdated copyright for icons/SN.png
Amos Jeffries [Sun, 28 Apr 2013 11:03:54 +0000 (05:03 -0600)] 
Updated copyright for icons/SN.png

The NC (Non-Commercial) clause conflicts with FOSS software distribution
policies and requirements of some of our downstream distributors.

By resolution of The Squid Software Foundation board of directors in
meeting #6 on 28-04-2013 this icon now has the NC clause removed.

12 years ago3.3.4 SQUID_3_3_4
Amos Jeffries [Sat, 27 Apr 2013 03:34:25 +0000 (21:34 -0600)] 
3.3.4

12 years agoPrep for 3.2.10 and 3.3.4
Amos Jeffries [Sat, 27 Apr 2013 02:56:15 +0000 (20:56 -0600)] 
Prep for 3.2.10 and 3.3.4

12 years agoDocs: Polish configuration file documentation
Amos Jeffries [Sat, 27 Apr 2013 02:23:20 +0000 (20:23 -0600)] 
Docs: Polish configuration file documentation

* Mostly adding DEFAULT_DOC directive to hide strange default values.
  This wll help us move to different internal values for no-limit etc
  at some point in the future.

* Migrates some access controls to "DEFAULT: none" instead of "deny all".
 This reduces run-time CPU cycles running useless ACL tests.
 NP: some access controls have been left unchanged due to complexity in
     the code testing them (ie icap_access).

* added documentation for several directives which were missing text

* corrected buffered_logs documentation (text by Alex Rousskov)

* updated cf_gen tool to produce more descriptive error messages

* corrected icp_access default to match documented 'deny all' permission

12 years agoCacheMgr: fix missing column separator in helper stats
Amos Jeffries [Sat, 27 Apr 2013 02:17:46 +0000 (20:17 -0600)] 
CacheMgr: fix missing column separator in helper stats

12 years agoPrevent external_acl.cc "inBackground" assertion on queue overloads.
Alex Rousskov [Thu, 25 Apr 2013 15:47:40 +0000 (09:47 -0600)] 
Prevent external_acl.cc "inBackground" assertion on queue overloads.

The enqueue check for external ACL lookups was inconsistent with the final
queue length check in ExternalACLLookup::Start(). The former allowed adding to
the already full (but not yet overflowing) queue while the latter
rightfully(?) asserted that the queue should not overflow.

12 years agoBug 3816: SSL_get_certificate call inside Ssl::verifySslCertificate crashes
Christos Tsantilas [Wed, 24 Apr 2013 15:46:24 +0000 (09:46 -0600)] 
Bug 3816: SSL_get_certificate call inside Ssl::verifySslCertificate crashes

The SSL_get_certificate implementation in OpenSSL 1.0.1d and 1.0.1e releases,
will crash if called before the certificate sent to the client.
This patch add a hack when one of the problematic OpenSSL versions used to
retrieve the certificate directly from SSL_CTX object, instead of creating
a temporary SSL object, and call SSL_get_certificate.

12 years agoHurd: define MAP_NORESERVE as no-op when missing
Amos Jeffries [Wed, 24 Apr 2013 15:43:26 +0000 (09:43 -0600)] 
Hurd: define MAP_NORESERVE as no-op when missing

Some systems like GNU Hurd provide the mmap() API but lack MAP_NORESERVE
support. This option is an optimization, so we can define the macro
ourselves to nil and apparently not suffer (many) bad side effects.

12 years agoBug 3833: Option '-k' is not present in squidclient man page
Amos Jeffries [Wed, 24 Apr 2013 15:42:44 +0000 (09:42 -0600)] 
Bug 3833: Option '-k' is not present in squidclient man page

12 years agoBug 3831: basic_ncsa_auth Blowfish and SHA support
Amos Jeffries [Wed, 24 Apr 2013 15:39:49 +0000 (09:39 -0600)] 
Bug 3831: basic_ncsa_auth Blowfish and SHA support

12 years agoBug 3817: Memory leak in SSL cert validate for alt_name peer certs
Christos Tsantilas [Thu, 18 Apr 2013 05:33:28 +0000 (23:33 -0600)] 
Bug 3817: Memory leak in SSL cert validate for alt_name peer certs

Inside function Ssl::matchX509CommonNames which checks a domain name against
certificate common name and alternate names, if the domain matches any of the
alternate names the function return without releasing allocated data.

12 years agoBug 3822: Locate LDAP and SASL headers in /usr/local/include for BSD support
Stuart Henderson [Thu, 18 Apr 2013 05:32:17 +0000 (23:32 -0600)] 
Bug 3822: Locate LDAP and SASL headers in /usr/local/include for BSD support

12 years agoBug 3825: basic_ncsa_auth segfaulting with glibc-2.17
Michal Luscon [Thu, 18 Apr 2013 05:30:47 +0000 (23:30 -0600)] 
Bug 3825: basic_ncsa_auth segfaulting with glibc-2.17

It appears the crypt() function may return NULL strings. Check for those
before all strcmp() operations.

NOTE: The MD5 output checks are probably not needed but since SquidMD5 is
an object build-time switched between several encryption library API
definitions it is better to be safe here as well.

12 years agoOpenBSD: libpthreads requires OpenBSD 5.2 or later
Stuart Henderson [Thu, 18 Apr 2013 05:29:31 +0000 (23:29 -0600)] 
OpenBSD: libpthreads requires OpenBSD 5.2 or later

This patch imported from the OpenBSD ports packaging implements a TODO in
DiskThreads component regarding wider system support for libpthreads.

12 years agoBug 3674: Improve compiler detection, better support warnings-as-errors on clang
Francesco Chemolli [Thu, 18 Apr 2013 05:28:16 +0000 (23:28 -0600)] 
Bug 3674: Improve compiler detection, better support warnings-as-errors on clang

12 years agoFix enter_suid/leave_suid build errors in ip/Intercept.cc
Amos Jeffries [Tue, 2 Apr 2013 12:42:12 +0000 (06:42 -0600)] 
Fix enter_suid/leave_suid build errors in ip/Intercept.cc

 Intercept.cc:210: error: 'enter_suid' was not declared in this scope
 Intercept.cc:217: error: 'leave_suid' was not declared in this scope

We should just be including tools.h, but on some GCC the src/tools.h and
src/ip/tools.h include locations clash when building inside src/ip/.
For now we must reference the src/tools.h by its long path.

12 years agoAdd TPROXY support for OpenBSD, FreeBSD, NetBSD
Marios Makassikis [Tue, 2 Apr 2013 04:07:35 +0000 (22:07 -0600)] 
Add TPROXY support for OpenBSD, FreeBSD, NetBSD

This adds support for the PF 'divert-to' target which presents the
client and remote IPs directly to Squid in accept() parameters the
way Linux TPROXY target does.

It also adds support for the SO_BINDANY option on outgoing traffic for
client IP address spoofing which completes the TPROXY behaviour.

To enable these features Squid built with --enable-pf-transparent can
be configured with:
  http_port 1234 tproxy

12 years agoPolish default http_access lines ordering
Amos Jeffries [Tue, 2 Apr 2013 04:04:31 +0000 (22:04 -0600)] 
Polish default http_access lines ordering

There is no reason why manager access should be excluded from CONNECT and
Safe_ports security checks. Also, under the new design manager ACL is a
REGEX pattern test, which may be quite slow.

Overall there should be better performnce under certain DoS condtions
having the manager tests after the port tests, with no change under the
other more common traffic.

12 years agoFix memory leaks in ConnStateData pinning
Amos Jeffries [Fri, 29 Mar 2013 05:59:17 +0000 (23:59 -0600)] 
Fix memory leaks in ConnStateData pinning

ConnStateData does not cleanup any of the pinning child structure fields.
This results in a leak of pinned host and peer details.

Run the full un-pin cleanup operation from ConnStateData::swanSong in
order to clean up all the pinning state instead of just the release the
Comm::Connection.

12 years agoBug 3774: -k reconfigure drops rock
Alexandre Chappaz [Fri, 29 Mar 2013 05:57:55 +0000 (23:57 -0600)] 
Bug 3774: -k reconfigure drops rock

This fix keeps Rock cache_dirs visible to Cache Manager after reconfigure.
We still lack proper support for complex reconfiguration changes involving
cache_dirs.

12 years agoBug 3565: Resuming postponed accept kills Squid
Amos Jeffries [Fri, 29 Mar 2013 05:56:46 +0000 (23:56 -0600)] 
Bug 3565: Resuming postponed accept kills Squid

This implements part 1 of Alex proposed fixes outlined in bug 3565.
Crashes with deferred accept() pointer dereference.

It replaces the raw-pointers stored in AcceptLimiter with a new
TcpAcceptor::Pointer.

It also adds a bit of TODO documentation about future optimizations which
we might want to consider later.

12 years agoHTTP/1.1: partial support for no-cache and private= controls with parameters
Amos Jeffries [Fri, 29 Mar 2013 05:55:45 +0000 (23:55 -0600)] 
HTTP/1.1: partial support for no-cache and private= controls with parameters

Since we now support HTTP/1.1 storage and revalidation of
Cache-Control:no-cache it is important that we at least detect the cases
where no-cache= and private= contain parameters.

These are likely still rare occurances due to the historic lack of
support. So for now Squid just detects and exempts these responses from
the caching performed. The basic framework for adding handling of the
header lists is made available but not at this time used.

12 years agossl_crtd: helpers dying during startup on ARM
folkert [Fri, 29 Mar 2013 05:55:09 +0000 (23:55 -0600)] 
ssl_crtd: helpers dying during startup on ARM

12 years agoFix SSL Bump bypass for intercepted traffic
Amos Jeffries [Thu, 14 Mar 2013 11:32:19 +0000 (05:32 -0600)] 
Fix SSL Bump bypass for intercepted traffic

The SSL-bump bypass code on intercepted HTTPS traffic generates a fake
CONNECT request from the original destination IP:port in an attempt to
trigger a TCP tunnel being opened for the un-bumped data to be
transferred over.

The current implementation breaks in two situations:

1) when IPv6 traffic is intercepted

The URL field generated does not account for the additional []
requirements involved when IPv6+port are combined.

The resulting fake requests look like:

 CONNECT ::1:443 HTTP/1.1
 Host: ::1

... which are both invalid, and will fail to parse. Breaking IPv6 HTTPS
interception bypass.

Resolve this by using Ip::Address::ToURL() function which was created
for the purpose of generating URL hostnames from raw-IP + port with
the bracketing inserted when required.

2) when a non-443 port is being intercepted

The Host: header generated is missing the port and Squid Host: header
validity will reject the outbound

 CONNECT 127.0.0.1:8443 HTTP/1.1
 Host: 127.0.0.1

... this is an invalid request. Squid is currently ignoring the Host
header. However Squid tunnel.cc does make use of peering and may relay
the fake request Host: to upstream peers where we cannot be so sure what
will happen.

Resolve this issue by re-using the generated IP:port string for both URL
and Host: fields, which preserves teh port in Host: regardless of value.
This also means there is an unnecessary :443 tagged on for most HTTPS
traffic, however the omission of port from the Host: header is only a MAY
and this should not cause any issues.

12 years ago3.3.3 SQUID_3_3_3
Amos Jeffries [Tue, 12 Mar 2013 10:16:57 +0000 (04:16 -0600)] 
3.3.3

12 years agoPrep for 3.3.3 and 3.2.9
Amos Jeffries [Tue, 12 Mar 2013 10:06:56 +0000 (04:06 -0600)] 
Prep for 3.3.3 and 3.2.9

12 years agoRegression fix: Accept-Language header parse
Amos Jeffries [Fri, 8 Mar 2013 02:05:39 +0000 (19:05 -0700)] 
Regression fix: Accept-Language header parse

When handling error page negotiation the header parse to detect language
code can enter into an infinite loop. Recover the 3.1 series behaviour
and fix an additional pre-existing off-by-1 error.

The errors were introduced in trunk rev.11496 in 3.2.0.9.

12 years agoBug 3673: Silence 'Failed to select source' messages
Amos Jeffries [Mon, 4 Mar 2013 20:16:37 +0000 (13:16 -0700)] 
Bug 3673: Silence 'Failed to select source' messages

12 years agoSolaris, OpenIndiana: Add missing limits.h includes
Anonymous [Mon, 4 Mar 2013 20:10:29 +0000 (13:10 -0700)] 
Solaris, OpenIndiana: Add missing limits.h includes

12 years agoBug 3720: Add missing include in /dev/poll I/O module
Anonymous [Mon, 4 Mar 2013 20:09:52 +0000 (13:09 -0700)] 
Bug 3720: Add missing include in /dev/poll I/O module

12 years agoFix authentication headers sent on peer digest requests
Amos Jeffries [Mon, 4 Mar 2013 20:08:47 +0000 (13:08 -0700)] 
Fix authentication headers sent on peer digest requests

Cache digest fetches have been sending the cache_peer login= option
value without sanitizing it for special-case values used internally
by Squid. This causes authentication failure on peers which are checking
user credentials.

12 years ago3.3.2 SQUID_3_3_2
Amos Jeffries [Sat, 2 Mar 2013 02:36:49 +0000 (19:36 -0700)] 
3.3.2

12 years agoTypo in rev.12507
Amos Jeffries [Sat, 2 Mar 2013 01:57:02 +0000 (18:57 -0700)] 
Typo in rev.12507

12 years agoPrep for 3.3.2 and 3.2.8
Amos Jeffries [Sat, 2 Mar 2013 01:28:22 +0000 (18:28 -0700)] 
Prep for 3.3.2 and 3.2.8

12 years agoDocs: document ConnOpener::swanSong() better
Amos Jeffries [Fri, 1 Mar 2013 10:04:57 +0000 (03:04 -0700)] 
Docs: document ConnOpener::swanSong() better

12 years agoBug 3329: Quieten orphan Comm::Connection messages
Amos Jeffries [Fri, 1 Mar 2013 10:04:12 +0000 (03:04 -0700)] 
Bug 3329: Quieten orphan Comm::Connection messages

The cases which were earlier causing a lot of RAM 'leaks' have been
resolved already and the remaining causes appear to all be in components
with short packet handling pathways where the orphan is not wasting much
in the way of RAM bytes or FD time.

The trace is left at level-4 for future debugging if necessary.

12 years agoSync TESTDIR names used by testCoss and testUfs with testRock changes.
Alex Rousskov [Fri, 1 Mar 2013 10:03:06 +0000 (03:03 -0700)] 
Sync TESTDIR names used by testCoss and testUfs with testRock changes.

12 years agoMacOS: reduce the testRock unit test UDS path
Amos Jeffries [Fri, 1 Mar 2013 10:01:57 +0000 (03:01 -0700)] 
MacOS: reduce the testRock unit test UDS path

On MacOS shm_open() requires the name entry to be less than 31 bytes
long. The garbage name used by testRock was 35 bytes and not really
describing what it was used for in the test anyway.

TODO: find out and fix why MacOS still responds EINVAL once the path
      is set to a usable length.

12 years agoBug 3720: SourceLayout: shuffle fd_table definition into fde.h
Amos Jeffries [Tue, 26 Feb 2013 22:21:22 +0000 (15:21 -0700)] 
Bug 3720: SourceLayout: shuffle fd_table definition into fde.h

Shift the definition out of globals.h into fde.h where the type class
is defined, and the instance into fde.cc. Fixing bug 3720; build errors
on OpenIndiana and Solaris.

Also, move it into the fde class scope as a static Table member.
Provides wrapper definition of fd_table to reduce patch impact.

12 years agoBug 3794: MacOS: workaround compiler errors and case-insensitivity
Amos Jeffries [Mon, 25 Feb 2013 03:47:25 +0000 (20:47 -0700)] 
Bug 3794: MacOS: workaround compiler errors and case-insensitivity

MacOS GCC version implicitly searches the local directory for .h
includes despite the absence of -I. in the provided options.
Furthermore it searches with case-insensitive filenames due to the
underlying case-insensitive filesystem.

The combined result is that libacl .cc files include their local copy of
acl/Url.h instead of the base directories src/URL.h which was needed.

The long term fix will be to shuffle URL.h and its related code into
a convenience library. For now we can avoid issues by prefixing the full
src/ path to the includes.

12 years agoPolish debugs in cacheability test
Amos Jeffries [Mon, 25 Feb 2013 03:44:09 +0000 (20:44 -0700)] 
Polish debugs in cacheability test

12 years agoBug 3753: Removes the domain from the cache_peer server pconn key
Amos Jeffries [Mon, 25 Feb 2013 03:42:35 +0000 (20:42 -0700)] 
Bug 3753: Removes the domain from the cache_peer server pconn key

Under the squid-3.2 pconn model the IP:port specifying the destination
are part of the key and can be used to strictly filter selection when
locating pconn.  This means the domain is no longer a necessary part
of the key.

Squid using cache_peer can see a large number of wasted idle connections
to their peers due to the key domain value if the peer hostname is not
substituted properly. There is also a similar affect when contacting
servers with virtual hosted domains.

Also bug 3753 was located with peer host and name= values being used
inconsistently as the domain marker. Resulting in failed pop()
operations and extra FD usage.

This has been tested for several months now with only socket usage
benefits seen in several production networks.

NOTE: previous experience some years back with pconn has demonstrated
several broken web servers which assume all requests on a persistent
connection are for the same virtual host. For now this change avoids
altering the behaviour on DIRECT traffic for this reason.

This was sponsored by Treehouse Networks Ltd.

12 years agoBug 3781: Proxy Authentication not sent to cache_peer
Amos Jeffries [Sun, 17 Feb 2013 10:00:12 +0000 (03:00 -0700)] 
Bug 3781: Proxy Authentication not sent to cache_peer

12 years agoBug 3763: diskd Error: no filename in shm buffer
Amos Jeffries [Thu, 14 Feb 2013 09:14:37 +0000 (02:14 -0700)] 
Bug 3763: diskd Error: no filename in shm buffer

12 years agoSolaris: Fix xstrto*() function linkages
Amos Jeffries [Thu, 14 Feb 2013 09:13:47 +0000 (02:13 -0700)] 
Solaris: Fix xstrto*() function linkages

These functions are only used by C++ code now and can be hidden from
the .c files.

12 years agoMentioned creation of diskers in cache_dir rock documentation.
Alex Rousskov [Thu, 14 Feb 2013 09:13:10 +0000 (02:13 -0700)] 
Mentioned creation of diskers in cache_dir rock documentation.

12 years agoFix coverity scan issue 740457: unsecure temporary file creation
Francesco Chemolli [Thu, 14 Feb 2013 09:12:21 +0000 (02:12 -0700)] 
Fix coverity scan issue 740457: unsecure temporary file creation

12 years agoBug 3686: cache_dir max-size default fails
Amos Jeffries [Thu, 14 Feb 2013 07:34:42 +0000 (00:34 -0700)] 
Bug 3686: cache_dir max-size default fails

If some cache_dir are configured with max-size and some not the default
maximum_object_size limit fails.

This refactors the max-size management code such that each SwapDir always
has a value maxObjectSize(). This value is calculated from the SwapDir
local setting or global limit as appropriate.

The global maximum_object_size directive is migrated to simply be a default
for cache_dir max-size= option.

The global store_maxobjsize variable is altered to be the overall global
limit on how big an object may be cache by this proxy. It now takes into
account the max-size for all cache_dir and cache_mem limitation.

NP: The slow accumulation of these and earlier changes means Squid no
longer immediately caches unknown-length objects. The unit-tests are
therefore changed to test using explicit 0-length objects to ensure the
test is on a cached object not bypassing the apparently ested logic.
They are also provided with a large global store_maxobjsize limit in order
to do a weak test of the SwapDir types max-size in the presence of other
larger cache_dir or maximum_object_size settings.

12 years agoBug 3752: objects that cannot be cached in memory are not cached on disk if cache_dir...
Alex Rousskov [Sat, 9 Feb 2013 12:48:22 +0000 (05:48 -0700)] 
Bug 3752: objects that cannot be cached in memory are not cached on disk if cache_dir max-size is used.

This fix contains four related changes:

1) When fixing "trimMemory for unswappable objects" (trunk r11969), we
replaced swapoutPossible() with swappingOut()||mayStartSwapOut() but missed
the fact that swapoutPossible() had "possible now" semantics while
mayStartSwapOut() has "may start now or in the future" semantics. When all
cache_dirs had max-size set, mayStartSwapOut() returned false for objects of
unknown size and even for smaller-than-maximum but not-yet-received objects,
despite the fact that those objects could be swapped out later.

That false mayStartSwapOut() result allowed maybeTrimMemory() to trim those
objects memory and mark the objects for release, preventing their subsequent
disk caching.

2) To fix (1) above, mayStartSwapOut() had to return true for not-yet-received
objects of unknown size. However, returning true is correct only if no
subsequent check can return false. Thus, we had to move all lower/later checks
that could return false up, placing them before the maximum-of-all-max-sizes
check.

3) Once (2) was done, the end of mayStartSwapOut() had (a) a loop that could
return true while setting decision to MemObject::SwapOut::swPossible and (b)
an unconditional code that did ... the same thing. Thus, the loop could no
longer change the method outcome. The loop also had a lot of doubts and XXXs
attached to it. We removed it. If that loop is needed, it is needed and must
be resurrected elsewhere.

4) Since mayStartSwapOut() returns true if swapout is possible in the future
(but not necessarily now), we cannot rely on its return value to initiate
swapout code. We need to test whether swapout.decision is swPossible instead.

12 years ago3.3.1 SQUID_3_3_1
Amos Jeffries [Sat, 9 Feb 2013 07:29:34 +0000 (00:29 -0700)] 
3.3.1

12 years agoRelease Notes: update and spelling corrections
Amos Jeffries [Sat, 9 Feb 2013 07:14:42 +0000 (00:14 -0700)] 
Release Notes: update and spelling corrections

* Move the formal deprecation of upgrade_headers to 3.2.
* spell-check 3.2, 3.3 release notes
* spell-check squid.conf.documented

12 years agoBug 3767: tcp_outgoing_tos/mark ACLs do not obey acl_uses_indirect_client
Nick Rogers [Sat, 9 Feb 2013 07:01:43 +0000 (00:01 -0700)] 
Bug 3767: tcp_outgoing_tos/mark ACLs do not obey acl_uses_indirect_client

12 years agoDocs: handle unknown squid-2.7 directives cleaner
Amos Jeffries [Sat, 9 Feb 2013 06:59:45 +0000 (23:59 -0700)] 
Docs: handle unknown squid-2.7 directives cleaner

This uses the squid-3 'obsolete' directive logics to cleanly accept and
warn about squid-2.7 directives which are not yet ported to squid-3.

12 years agoPolish debugs on more obsolete options
Amos Jeffries [Sat, 9 Feb 2013 06:56:06 +0000 (23:56 -0700)] 
Polish debugs on more obsolete options

12 years agoMake squid -z for cache_dir rock work like UFS instead of like COSS.
Alex Rousskov [Fri, 8 Feb 2013 11:25:14 +0000 (04:25 -0700)] 
Make squid -z for cache_dir rock work like UFS instead of like COSS.

Also, Polish -z documentation and cache.log reporting.

When a startup script runs squid -z by mistake against a cache_dir that is
already initialized and full of cached entries, some admins prefer that
nothing happens. Rock store now skips reinitialization if both the cache_dir
directory and the db file in that directory exist. If one or both are missing,
the missing pieces are created.

UFS does something similar because it creates missing L1 and L2 directories
but does not erase any entries already present in the cache_dir path. COSS,
OTOH, re-initializes the existing db. Rock behavior will now be closer to UFS.

To clean a corrupted cache_dir, the admin must remove its top-level directory
before running squid -z.

Squid now logs "Creating missing swap directories" instead of "Creating Swap
Directories", and our documentation now reflects the "if missing" part of the
-z algorithm.

Also documented that recent Squid versions run -z in daemon mode (so that SMP
configuration macros continue to work).

12 years agoFix memory leaks and segmentation faults in librfcnb parser
Francesco Chemolli [Fri, 8 Feb 2013 10:13:05 +0000 (03:13 -0700)] 
Fix memory leaks and segmentation faults in librfcnb parser

 Detected by Coverity Scan. Issues 740426, 740427, 740499.

12 years agoFix segmentation fault on missing squid.conf values
Amos Jeffries [Sun, 3 Feb 2013 14:08:46 +0000 (07:08 -0700)] 
Fix segmentation fault on missing squid.conf values

Directves expecting percentage values may segfault when no value token
is supplied.

 Detected by Coverity Scan. Issue 970941

12 years agoFix parsing of max-stale values in Surrogate-Control header
Amos Jeffries [Sun, 3 Feb 2013 14:07:54 +0000 (07:07 -0700)] 
Fix parsing of max-stale values in Surrogate-Control header

Skip parsing of the max-stale field when the initial max-age value
is not a valid integer value.

 Detected by Coverity Scan. Issue 740361