]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
12 years agoBug 3728: Improve debug for cache_dir
Tianyin Xu [Mon, 28 Jan 2013 04:33:00 +0000 (21:33 -0700)] 
Bug 3728: Improve debug for cache_dir

12 years agoMake sure copied strings are properly terminated in snmplib and wccp2
Tomas Hozza [Mon, 28 Jan 2013 04:30:26 +0000 (21:30 -0700)] 
Make sure copied strings are properly terminated in snmplib and wccp2

12 years agoFix various issues in snmplib
Tomas Hozza [Mon, 28 Jan 2013 04:28:17 +0000 (21:28 -0700)] 
Fix various issues in snmplib

* Memory leaks in OID management

* NULL pointer dereference on OID tree creation

* Ensure buffer terminations on OID data copy

* Better file handle management

  Detected by Coverity Scan. Issues 740480, 740357, 740429,
    443111, 740479, 740500

12 years agoFix various issues in smblib
Tomas Hozza [Mon, 28 Jan 2013 04:27:32 +0000 (21:27 -0700)] 
Fix various issues in smblib

* Crash on NTLM handshakes without domain.

* Memory leak on several internal DC connection failures

* Potential buffer overruns on specially crafted tokens

  Detected by Coverity Scan. Issues 740356, 740406, 740428,
   740476, 740477, 740478

12 years agoBug 3678: external acl grace period causes acl lookup failures
Timo Teras [Fri, 25 Jan 2013 09:59:54 +0000 (02:59 -0700)] 
Bug 3678: external acl grace period causes acl lookup failures

12 years ago3.2.6 SQUID_3_2_6
Amos Jeffries [Wed, 9 Jan 2013 01:41:35 +0000 (18:41 -0700)] 
3.2.6

12 years agoBug 3731: TOS setsockopt() requires int value
Amos Jeffries [Wed, 9 Jan 2013 00:14:43 +0000 (17:14 -0700)] 
Bug 3731: TOS setsockopt() requires int value

FreeBSD is confirmed errors on 8-bit variable size. Other BSD are
documented in a way that implies they do as well, although not at this
stage confirmed to be failing.

Linux seems to be the only confirmed system working with 8-bit size sent
to setsockopt(). So we revert this to 'int' (32-bit or 64-bit) as was
working in Squid 3.1.

12 years agoAnother piece of SQUID-2012:1
Eygene Ryabinkin [Tue, 8 Jan 2013 22:40:18 +0000 (15:40 -0700)] 
Another piece of SQUID-2012:1

12 years agoAdditional pieces of SQUID-2012:1
Amos Jeffries [Tue, 1 Jan 2013 05:29:14 +0000 (22:29 -0700)] 
Additional pieces of SQUID-2012:1

12 years agoBug 3727: kerberos_ldap_group: explicitly assigning a variable to itself
Tianyin Xu [Sun, 30 Dec 2012 07:47:17 +0000 (00:47 -0700)] 
Bug 3727: kerberos_ldap_group: explicitly assigning a variable to itself

 Detected by LLVM compiler.

12 years agoBug 3650: Negotiate auth missing challenge token
Steve Hill [Thu, 27 Dec 2012 03:01:45 +0000 (20:01 -0700)] 
Bug 3650: Negotiate auth missing challenge token

12 years agoBug 3712: Rotating logs overwrites the previous log
Markus Rietzler [Thu, 27 Dec 2012 02:58:57 +0000 (19:58 -0700)] 
Bug 3712: Rotating logs overwrites the previous log

12 years ago3.2.5 SQUID_3_2_5
Amos Jeffries [Mon, 10 Dec 2012 09:52:41 +0000 (02:52 -0700)] 
3.2.5

12 years agoBug 3698: Add missing include to xstrerror.h
Amos Jeffries [Sun, 2 Dec 2012 21:25:28 +0000 (14:25 -0700)] 
Bug 3698: Add missing include to xstrerror.h

later versions were fixed as poart of trunk rev.12290 which added a lot
of errno.h includes. However all that is needed is this one to pull it
in through libcompat headers which cover all .cc.

xstrerror.h is the right place to add the include because it is the place
presenting a macro inlining the dependency.

12 years ago3.2.4 SQUID_3_2_4
Amos Jeffries [Sun, 2 Dec 2012 09:22:41 +0000 (02:22 -0700)] 
3.2.4

12 years agoBug 3688: Lots of Orphan Comm:Connections to ICAP server
Alexander Komyagin [Sun, 2 Dec 2012 08:17:17 +0000 (01:17 -0700)] 
Bug 3688: Lots of Orphan Comm:Connections to ICAP server

12 years agoRemove unnecessary xmemset()
Amos Jeffries [Sun, 2 Dec 2012 08:09:13 +0000 (01:09 -0700)] 
Remove unnecessary xmemset()

Was a simple wrapper around memset() to add debugs() traces. However
other profiling tools can trace memset far better.

12 years agoext_file_userip_acl: Remove duplicate variable definition
Amos Jeffries [Fri, 30 Nov 2012 23:58:20 +0000 (16:58 -0700)] 
ext_file_userip_acl: Remove duplicate variable definition

12 years agoFix accept_filter on Linux
Amos Jeffries [Fri, 30 Nov 2012 13:40:25 +0000 (06:40 -0700)] 
Fix accept_filter on Linux

accept_filter directive on Linux requires TCP_DEFER_ACCEPT which
in turn requires netinet/tcp.h. This was removed when splitting comm
into libcomm.la.

12 years agoTreat no-cache as must-revalidate in Authentication
Amos Jeffries [Fri, 30 Nov 2012 13:38:38 +0000 (06:38 -0700)] 
Treat no-cache as must-revalidate in Authentication

Wrapped as a violation because this operation is off-spec.

CC:no-cache was omitted from the HTTP spec apparently on grounds that
changing its caching effects on authentication would come as a surprise.
The actual operation is safe enough to use when parameterless no-cache
is treated strictly as an alias for must-revalidate (as done by Squid now).

Ref: http://lists.w3.org/Archives/Public/ietf-http-wg/2012OctDec/0387.html

12 years agoBug 3685: Squid hangs in ClassCBucket::update
Amos Jeffries [Fri, 30 Nov 2012 13:35:44 +0000 (06:35 -0700)] 
Bug 3685: Squid hangs in ClassCBucket::update

12 years agoFix several buffer termination bugs
Amos Jeffries [Fri, 30 Nov 2012 13:34:49 +0000 (06:34 -0700)] 
Fix several buffer termination bugs

* strcpy() replaced in several places with strncpy() to ensure destination
  buffers are not overflowed.

* strncpy() does not nul-terminate the destination when the string being
  copied in exactly fills the buffer. Ensure we have terminated strings
  where it may matter.

 Detected by Coverity Scan. Issues 740309, 740310, 740311, 740481, 740483

12 years agolibeui: Warn and fail nicely on socket errors looking up ARP record
Amos Jeffries [Fri, 30 Nov 2012 13:34:06 +0000 (06:34 -0700)] 
libeui: Warn and fail nicely on socket errors looking up ARP record

If something nasty happened (out of FD or similar) socket() may fail.
Report these events and continue with unknown EUI value.

 Detected by Coverity Scan. Issue 740393

12 years agolibrfcnb: memory leaks in session setup
Amos Jeffries [Fri, 30 Nov 2012 13:32:27 +0000 (06:32 -0700)] 
librfcnb: memory leaks in session setup

 Detected by Coverity Scan. Issue 740425.

12 years agoRemove MemPoolChunked::memPID
Amos Jeffries [Fri, 30 Nov 2012 13:31:52 +0000 (06:31 -0700)] 
Remove MemPoolChunked::memPID

This member variable appears to have been missed when MemPool was split
into generic framework and specific Chunked implementation.
 (rev:10513.1.1 aka trunk rev:10517)

The memPID and its maintenance code was moved into MemImplementingAllocator
but this definition left here un-initialized and shadowing the framework
member.

 Detected by Coverity Scan. Issue 740506.

12 years agonegotiate_kerberos_auth: better bounds checking
Amos Jeffries [Fri, 30 Nov 2012 13:31:18 +0000 (06:31 -0700)] 
negotiate_kerberos_auth: better bounds checking

* sysconf() may return -N values on some platforms or values larger than
  the hard-coded 1024 buffer size for hostname. Use sizeof() instead
  since the buffer is hardcoded anyway.

* also, use return instead of exit() on the test binary to reduce
  warnings from static analysis compilers.

 Detected by Coverity Scan. Issues 740392, 740484

12 years agontlm_smb_lm_auth: better bounds checking
Amos Jeffries [Fri, 30 Nov 2012 13:30:40 +0000 (06:30 -0700)] 
ntlm_smb_lm_auth: better bounds checking

Protect against overflow of domain and domain controlleler FQDN buffers
leading to missing nul-termination string errors.

 Detected by Coverity Scan. Issue 740475.

12 years agodigest_fiel_auth: add missing include errno.h
Amos Jeffries [Fri, 30 Nov 2012 13:25:33 +0000 (06:25 -0700)] 
digest_fiel_auth: add missing include errno.h

rev. squid-3.2-11710 adds use of xstrerror() which requires errno.h

12 years agoFix OpenSUSE glibc 2.17 compile issues
Andreas Jaeger [Fri, 30 Nov 2012 13:21:22 +0000 (06:21 -0700)] 
Fix OpenSUSE glibc 2.17 compile issues

12 years agoFixed incomplete MemBlobStats constructor
Francesco Chemolli [Fri, 30 Nov 2012 13:20:10 +0000 (06:20 -0700)] 
Fixed incomplete MemBlobStats constructor

12 years agosquidclient: Better error checking
Amos Jeffries [Fri, 30 Nov 2012 13:19:14 +0000 (06:19 -0700)] 
squidclient: Better error checking

* detect and report fstat() errors which could lead to invalid
  Content-Length being sent.

* remove some useless checks which were causing false positives by Coverity.

 Detected by Coverity Scan. Issues 740334, 740379

12 years agontlm_fake_auth: Fix nesting error
Amos Jeffries [Fri, 30 Nov 2012 13:18:30 +0000 (06:18 -0700)] 
ntlm_fake_auth: Fix nesting error

Broken macro wrapping leads to the fake authenticator sending bad
responses to Squid. This can ead to users being rejected by the fake
helper whose purpose is to accept everything.

 Detected by Coverity Scan. Issue 740394

12 years agobasic_smb_auth: Buffer overrun.
Amos Jeffries [Fri, 30 Nov 2012 11:04:55 +0000 (04:04 -0700)] 
basic_smb_auth: Buffer overrun.

A reply string expanding to >8KB after shell escaping can cause the helper
memory corruption or crash as output buffer is overrun.

 Detected by Coverity Scan. Issue 740411

12 years agolog_file_daemon: better error reporting
Amos Jeffries [Thu, 29 Nov 2012 11:20:58 +0000 (04:20 -0700)] 
log_file_daemon: better error reporting

Report rotation errors and log file removal errors instead of silently
ignoring them.

 Detected by Coverity Scan. Issue 740316

12 years agoVarious memory leaks in configuration parsing
Amos Jeffries [Thu, 29 Nov 2012 11:20:18 +0000 (04:20 -0700)] 
Various memory leaks in configuration parsing

This lot are all small issues derived from allocating new memory and
assigning to a pointer already pointing at previous allocation, or
passing xstrdup() output to a caller which does not directly hold the
passed memory.
 Both cases will disappear once we clean up the string handling in Squid
but for now these still need fixing to avoid leaking memory.

 Detected by Coverity Scan. Issues 740430, 740432, 740439.

12 years agoFix various assertion with side effects
Amos Jeffries [Thu, 29 Nov 2012 11:17:11 +0000 (04:17 -0700)] 
Fix various assertion with side effects

When compiled with high optimization and assert disabled these operations
would have disappeared. The side effects being:
* Disk I/O failure protection disabled. Allowing loops in diskd write.
* squidpurge error handling on command line parse gone. Causing segfault.
* squidpurge 'I am Alive' ticker feature cease working.

 Detected by Coverity Scan. Issues 740299, 740300, 740301, 740302, 740303

12 years agodigest_ldap_auth: Fix crash on empty password
Amos Jeffries [Thu, 29 Nov 2012 11:16:29 +0000 (04:16 -0700)] 
digest_ldap_auth: Fix crash on empty password

 Detected by Coverity Scan. Issue 740399

12 years agocachemgr.cgi: Memory Leaks and DoS Vulnerability
Amos Jeffries [Thu, 29 Nov 2012 11:15:32 +0000 (04:15 -0700)] 
cachemgr.cgi: Memory Leaks and DoS Vulnerability

* Ignore invalid Content-Length headers.

* Limit received POST requests to 4KB and discard the rest.

* Authentication credentials parser also leaks badly.

 Detected by Coverity Scan.
 Issues 740380, 740443, 740444, 740442, 740487, 740446, 740445

12 years agoFix TextException: gracefully handle exceptions with null text messages.
Francesco Chemolli [Mon, 26 Nov 2012 10:24:10 +0000 (03:24 -0700)] 
Fix TextException: gracefully handle exceptions with null text messages.

12 years agoext_file_userip_acl: Polish and missing file handling
Amos Jeffries [Mon, 26 Nov 2012 10:23:30 +0000 (03:23 -0700)] 
ext_file_userip_acl: Polish and missing file handling

* Display error when dictionary file is unaccessible instead of crashing.

* Polish several useless assignments out of the code.

 Detected by Coverity Scan. Issues 740402, 740403, 740589, 740590.

12 years agounlinkd: Compiler warning cleanups
Amos Jeffries [Mon, 26 Nov 2012 10:21:01 +0000 (03:21 -0700)] 
unlinkd: Compiler warning cleanups

Check the return value for open(/dev/null). Nothing we can do about it
since the daemon has already disconnected from cache.log but note that.

 Detected by Coverity Scan. Issue 740328

12 years agodigest_file_auth: Improved error handling
Amos Jeffries [Mon, 26 Nov 2012 08:35:49 +0000 (01:35 -0700)] 
digest_file_auth: Improved error handling

Adds missing error handling when pasword file fails to open for any
reason.

Skips records with missing username in password file.Displays an error
message instead of crashing.

 Detected by Coverity Scan. Issues 740400, 740401

12 years agodigest_edirectory_auth: improved error handling
Amos Jeffries [Mon, 26 Nov 2012 08:35:13 +0000 (01:35 -0700)] 
digest_edirectory_auth: improved error handling

Malicious response from LDAP server can cause squid helper to crash.

Missing realm value returned from LDAP without error/missing value being
indicated in the response can lead to strcmp() using a NULL pointer.
 Extremely unlikely to happen in practice, but worth fixing.

 Detected by Coverity Scan. Issue 740399

12 years agobasic_radius_auth: Fix several issues
Amos Jeffries [Mon, 26 Nov 2012 08:34:05 +0000 (01:34 -0700)] 
basic_radius_auth: Fix several issues

* abort on failed fcntl() non-blocking socket setup

* retry send() on failure. Up to retry attempt count.
  Display send() errors to cache.log.

* prevent buffer overflow on long command line arguments.

* make compiler buffer overflow checks happier with RADIUS packet
  creation code.

 Detected by Coverity Scan. Issues 740314, 740315, 740410, 740474, 743276

12 years agobasic_pam_auth: Fix NULL-dereference issues
Amos Jeffries [Mon, 26 Nov 2012 08:33:25 +0000 (01:33 -0700)] 
basic_pam_auth: Fix NULL-dereference issues

PAM session handles being used after setup failure left them NULL.

Also removes several useless checks of retval after it being explicitly
set to the value tested againt.

 Detected by Coverity Scan. Issue 740354

12 years agobasic_ncsa_auth: Fix NULL-dereference crash
Amos Jeffries [Mon, 26 Nov 2012 08:32:53 +0000 (01:32 -0700)] 
basic_ncsa_auth: Fix NULL-dereference crash

When reading corrupt or broken user passwd files with missing username
data this helper can crash.

 Detected by Coverity Scan. Issue 740398

12 years agobasic_msnt_auth: memory leaks
Amos Jeffries [Mon, 26 Nov 2012 08:32:02 +0000 (01:32 -0700)] 
basic_msnt_auth: memory leaks

 Detected by Coverity scan (free). Issues: 740415, 740416

12 years agoBug 3279: Polish: reference bugzilla record to prevent duplicate reports
Amos Jeffries [Mon, 26 Nov 2012 08:31:24 +0000 (01:31 -0700)] 
Bug 3279: Polish: reference bugzilla record to prevent duplicate reports

12 years agoBug 3329: Polish: reference bugzilla record in cache.log to prevent duplicates
Amos Jeffries [Mon, 26 Nov 2012 08:30:30 +0000 (01:30 -0700)] 
Bug 3329: Polish: reference bugzilla record in cache.log to prevent duplicates

12 years agoModify debugs() to automatically include file, line and function name for high-detail...
Francesco Chemolli [Mon, 26 Nov 2012 08:28:09 +0000 (01:28 -0700)] 
Modify debugs() to automatically include file, line and function name for high-detail cache log lines.

12 years agoBug 3405: ssl_crtd crashes failing to remove certificate
Christos Tsantilas [Mon, 26 Nov 2012 08:26:04 +0000 (01:26 -0700)] 
Bug 3405: ssl_crtd crashes failing to remove certificate

- Try to update the index file in all cases the database modified
  rows. Currently we are using the new operator.

- The find operator in database should not modify the database. Currently
  if an entry is expired, ssl_crtd removes the cert file but does not
  update the index file.

- Fix a small memory leak when remove entries from database: A row object
  removed from TXT_DB indexes but never released.

This patch:
* Use OPENSSL_malloc and OPENSSL_free to allocate/release memory for
  TXT_DB rows. OpenSSL SDK assumes that always allocated using these
  functions.

* Add code in Ssl::CertificateDb::Row destructor to correctly release
  a TXT_DB row.

* Add the sq_TXT_DB_delete and sq_TXT_DB_delete_row functions which
  removes a row from TXT_DB indexes.

This is a Measurement Factory project

12 years agoBug 3659: read_timeout problem with HTTPS
Jean-Philippe Menil [Sat, 10 Nov 2012 04:39:36 +0000 (21:39 -0700)] 
Bug 3659: read_timeout problem with HTTPS

12 years agoPolish: replace several assert(isOpen(fd))
Amos Jeffries [Sat, 10 Nov 2012 04:38:32 +0000 (21:38 -0700)] 
Polish: replace several assert(isOpen(fd))

Reduces by over half the number of asserts which can be confused as
cache.log bug reports just says "assertion isOpen(fd)" in comm.cc

12 years agoBug 3189: AIO thread race on pipe() initialization
Amos Jeffries [Sat, 10 Nov 2012 04:37:29 +0000 (21:37 -0700)] 
Bug 3189: AIO thread race on pipe() initialization

12 years agoPorted: urllogin ACL from squid 2.7
Amos Jeffries [Sat, 10 Nov 2012 04:33:25 +0000 (21:33 -0700)] 
Ported: urllogin ACL from squid 2.7

12 years agoBug 3677: Port un-pinning logic changes from 3.3
Amos Jeffries [Tue, 6 Nov 2012 12:45:17 +0000 (05:45 -0700)] 
Bug 3677: Port un-pinning logic changes from 3.3

Several design changes have been made to pinning in 3.3. One of them
added a safety check to proect close handler removal in the event that
the server connection was already closed.

This ports that protection from 3.3 and fixes at least one code path
leading to bug 3677 assertions.

12 years agoRefactored tools/purge conffile reading to c++-streams
Francesco Chemolli [Sun, 28 Oct 2012 09:58:15 +0000 (03:58 -0600)] 
Refactored tools/purge conffile reading to c++-streams

12 years agoext_lm_group_acl: Add missing rfc1738.h include
Amos Jeffries [Sun, 28 Oct 2012 09:57:13 +0000 (03:57 -0600)] 
ext_lm_group_acl: Add missing rfc1738.h include

12 years agoRemove 'Bungled' warning on missing component directives
Amos Jeffries [Sun, 28 Oct 2012 09:54:40 +0000 (03:54 -0600)] 
Remove 'Bungled' warning on missing component directives

* Make Squid display a ERROR notice and ignore squid.conf directives
  which belong to components disabled at build time instead of throwing
  up 'FATAL: Bungled' message and aborting.

* Polish the 'requires X' message text for better display of cases like
  'requires MS Windows' and 'requires Linux'

* Add 'requires X' message for --enable-auth, --enable-eui, and
  --enable-ssl-crtd which were missing.

* Add debug 'filename' for if-none and postscriptum logging

12 years agoFix missing predefines in PeerDigest.h
Amos Jeffries [Sun, 28 Oct 2012 09:47:38 +0000 (03:47 -0600)] 
Fix missing predefines in PeerDigest.h

12 years ago3.2.3 SQUID_3_2_3
Amos Jeffries [Sat, 20 Oct 2012 12:35:20 +0000 (06:35 -0600)] 
3.2.3

12 years agoRemove the refresh_pattern ignore-no-cache option
Amos Jeffries [Sat, 20 Oct 2012 12:32:21 +0000 (06:32 -0600)] 
Remove the refresh_pattern ignore-no-cache option

With the HTTP/1.1 Cache-Control:no-cache compliance upgrade this option became
obsolete. Its main use-case was to force caching of responses which contained this
control. Revalidation is now happening and no-cache objects are cached by default.

The one remaining effect of ignoring no-cache is to prevent no-cache from allowing
authenticated responses being cached. Which is the opposite of its usually expected
result and allowing that change of behaviour would be counter productive.

12 years agoHTTP/1.1: Cache-Control compliance upgrade
Amos Jeffries [Sat, 20 Oct 2012 10:07:11 +0000 (04:07 -0600)] 
HTTP/1.1: Cache-Control compliance upgrade

trunk rev 11361 converted Cache-Control header from using a single mask
bitmap (shared by request and response) to separate CC header objects in
the request response. This conversion contained several regressions like
the one bug 3670 reports.

This patch:
 * documents HttpStateData::cacheableReply() clarifying the overall
   method action and what each individual check it doing.
 * resolves several visible regressions, including bug 3670.
 * extends the caching to handle the "no-cache" controls as per HTTP/1.1
   (MAY store, but MUST revalidate before use).
 * extends the caching for several lesser known cases of "MAY store"
   exemptions handling authenticated transactions.
 * removes an old hack handling Pragme:no-cache (undefined in HTTP/1.1)

One side effect of now caching transactions utilizing "no-cache" is that
hacks around Pragma:no-cache are reduced to only having any effect when
Cache-Control is absent. Reducing their performance cost. And now require
--enable-http-violations is built in since HTTP/1.1 states that
response Pragma are not defined and thus SHOULD be ignored.

12 years agoBug 3655: pinning failure breaks NTLM and Negotiate authentication
Wolfgang Breyha [Thu, 18 Oct 2012 04:23:10 +0000 (22:23 -0600)] 
Bug 3655: pinning failure breaks NTLM and Negotiate authentication

Some additional bits for squid-3.2 ensuring that already pinned connections
are cleaned up properly before re-pinning. Also that the pointer is not
NULL before closing when un-pinning.

12 years agoSourceFormat Enforcement
Automatic source maintenance [Wed, 17 Oct 2012 06:47:41 +0000 (00:47 -0600)] 
SourceFormat Enforcement

12 years agoAllow a ufs cache_dir entry to coexist with a shared memory cache entry
Alex Rousskov [Wed, 17 Oct 2012 01:02:52 +0000 (19:02 -0600)] 
Allow a ufs cache_dir entry to coexist with a shared memory cache entry

... instead of being released when it becomes idle.

The original boolean version of the StoreController::dereference() code
(r11730) was written to make sure that idle unlocked local store_table entries
are released if nobody needs them (to avoid creating inconsistencies with
shared caches that could be modified in a different process).

Then, in r11786, we realized that the original code was destroying non-shared
memory cache entries if there were no cache_dirs to vote for keeping them in
store_table. I fixed that by changing the StoreController::dereference() logic
from "remove if nobody needs it" to "remove if somebody objects to keeping
it". That solved the problem at hand, but prohibited an entry to exist in
a non-shared cache_dir and in a shared memory cache at the same time.

We now go back to the original "remove if nobody needs it" design but also
give non-shared memory cache a vote so that it can protect idle but suitable
for memory cache entries from being released if there are no cache_dirs to
vote for them.

This is a second revision of the fix. The first one (r12231) was reverted
because it did not pass tests/testRock unit tests on some platforms. The unit
tests assume that the entry slot is not locked after the entry is stored, but
the first revision of the fix allowed idle entries to remain in store_table
and, hence, their slots were locked and could not be replaced, causing
assertions.  This revision allows the idle entry to be destroyed (and its slot
unlocked) if [non-shared] memory caching is disabled.

It is not clear why only some of the platforms were affected by this. Should
not memory caching be disabled everywhere during testRock (because testRock
does not set memory cache capacity and memory cache entry size limits)?

12 years agoHTTP/1.1: honour Cache-Control before Pragma:no-cache
Amos Jeffries [Wed, 17 Oct 2012 00:43:57 +0000 (18:43 -0600)] 
HTTP/1.1: honour Cache-Control before Pragma:no-cache

HTTPbis WG clarifications on the interaction between Cache-Control and
Pragma specify that Cache-Control may be explicitly crafted to allow
conditional caching by HTTP/1.1 caches and Pragma:no-cache supplied to
prevent caching by older HTTP/1.0 caches unable to understand the
Cache-Control properly.

Squid does obey Cache-Control. So we can deprecate Pragma to the side
cases when Cache-Control is absent entirely.

12 years agoStatic Code Analysis: varargs cleanup, improvements to readability
Francesco Chemolli [Wed, 17 Oct 2012 00:39:25 +0000 (18:39 -0600)] 
Static Code Analysis: varargs cleanup, improvements to readability

12 years agoBug 3655: pinning failure breaks NTLM and Negotiate authentication
Wolfgang Breyha [Wed, 17 Oct 2012 00:32:47 +0000 (18:32 -0600)] 
Bug 3655: pinning failure breaks NTLM and Negotiate authentication

12 years agoCorrect --enable-build-info on out-of-tree builds
Henrik Nordstrom [Wed, 17 Oct 2012 00:20:30 +0000 (18:20 -0600)] 
Correct --enable-build-info on out-of-tree builds

bzr expects to be run from the source tree, not the build directory

12 years agoFix using assignment as a condition without parentheses
Amos Jeffries [Wed, 17 Oct 2012 00:18:33 +0000 (18:18 -0600)] 
Fix using assignment as a condition without parentheses

12 years agoFix ipv6 enabled squidclient.
Henrik Nordstrom [Wed, 17 Oct 2012 00:12:40 +0000 (18:12 -0600)] 
Fix ipv6 enabled squidclient.

Was failing with assertion failure due to ipv6 support not being probed
automatically.

12 years agoFreeBSD: net/if_dl.h seems to require param.h
Amos Jeffries [Wed, 17 Oct 2012 00:12:04 +0000 (18:12 -0600)] 
FreeBSD: net/if_dl.h seems to require param.h

12 years agoReverted trunk r12255 changes. Provided a portable flexible arrays replacement.
Alex Rousskov [Wed, 17 Oct 2012 00:02:26 +0000 (18:02 -0600)] 
Reverted trunk r12255 changes. Provided a portable flexible arrays replacement.

Trunk r12255 made Clang compiler happy by removing flexible nonPod[] arrays.
Unfortunately, it also moved shared memory items into local memory (in some
cases uninitialized).

This change provides a Clang-friendly flexible array replacement while keeping
items in the shared memory (and using placement-new initialization). The code
may have become even less readable, but hopefully more portable.

N.B. Flexible arrays were introdiced in C99 standard, after C++ was
standardized in 1998. They are not yet in any revised C++ standard, but most
C++ compilers support them, at least for PODs.

12 years agoDo not check 'reply content_length is too big' condition twice.
Alex Rousskov [Sun, 14 Oct 2012 00:13:18 +0000 (18:13 -0600)] 
Do not check 'reply content_length is too big' condition twice.

Saves a few CPU cycles. No visible runtime effects are expected.

The semi-duplicate check was introduced in trunk r4410 while trying to
prevent huge objects from being swapped out. It is not clear to me why
that change helped at the time (but it could have something to do with
negative content_length values and their effect on then-current size
types).

12 years ago3.2.2 SQUID_3_2_2
Amos Jeffries [Sat, 6 Oct 2012 03:07:59 +0000 (21:07 -0600)] 
3.2.2

12 years agoBug 3661: Segmentation fault when using more than 1 worker
Amos Jeffries [Sat, 6 Oct 2012 02:27:30 +0000 (20:27 -0600)] 
Bug 3661: Segmentation fault when using more than 1 worker

Previous change to Ipc::Mem::PageStack making variable arrays into
dynamically-allocated arrays added an allocate after use bug.

12 years agoFix website config display of default settings
Amos Jeffries [Sat, 6 Oct 2012 02:26:32 +0000 (20:26 -0600)] 
Fix website config display of default settings

The website page cfgman builder script was omitted when adding the
DEFAULT_DOC parameter and making DEFAULT / DEFAULT_IF_NONE support
multi-line values.

12 years agoPolish the ACLFilledChecklist::fd related documentation
Christos Tsantilas [Sat, 6 Oct 2012 02:20:11 +0000 (20:20 -0600)] 
Polish the ACLFilledChecklist::fd related documentation

12 years agoSmall memory leak in src ACL parse
Amos Jeffries [Sat, 6 Oct 2012 02:18:46 +0000 (20:18 -0600)] 
Small memory leak in src ACL parse

Fixes one minor memory leak when IPv6 is disabled and parsing an IPv6
address. For example the default localhost ACL ::1 value.

Caught by Valgrind:

==26647== 384 bytes in 4 blocks are definitely lost in loss record 1,132 of 1,726
==26647==    at 0x4C25A28: calloc (vg_replace_malloc.c:467)
==26647==    by 0x65B441: xcalloc (xalloc.cc:75)
==26647==    by 0x657B99: MemPoolMalloc::allocate() (MemPoolMalloc.cc:62)
==26647==    by 0x5A95B1: acl_ip_data::FactoryParse(char const*) (Ip.h:66)
==26647==    by 0x5AA8BD: ACLIP::parse() (Ip.cc:523)
==26647==    by 0x5E0A80: ACL::ParseAclLine(ConfigParser&, ACL**) (Acl.cc:174)
==26647==    by 0x4B0C0F: parse_line(char*) (cache_cf.cc:1252)
==26647==    by 0x4B2076: parseOneConfigFile(char const*, unsigned int) (cache_cf.cc:518)
==26647==    by 0x4B29D0: parseConfigFile(char const*) (cache_cf.cc:558)
==26647==    by 0x546B81: SquidMain(int, char**) (main.cc:1372)
==26647==    by 0x547445: main (main.cc:1215)

12 years agoPortability: squid provides strtoll()
Amos Jeffries [Sat, 6 Oct 2012 02:12:35 +0000 (20:12 -0600)] 
Portability: squid provides strtoll()

12 years agoBug 3658: ERR_ZERO_SIZE errors propagates out even after successful retry
Christos Tsantilas [Thu, 4 Oct 2012 11:53:31 +0000 (05:53 -0600)] 
Bug 3658: ERR_ZERO_SIZE errors propagates out even after successful retry

12 years agoBug 3660: ACLFilledChecklist::fd set with wrong fd for sslproxy_cert_error
Christos Tsantilas [Wed, 3 Oct 2012 01:08:20 +0000 (19:08 -0600)] 
Bug 3660: ACLFilledChecklist::fd set with wrong fd for sslproxy_cert_error

The Config.ssl_client.cert_error uses the server-side connection fd instead of
the client-side connection fd.

12 years agoMake IPC base path absolute in testRock
Francesco Chemolli [Mon, 24 Sep 2012 11:10:23 +0000 (05:10 -0600)] 
Make IPC base path absolute in testRock

12 years agoRegression fix: Handle dstdomain duplicates and overlapping names better
Amos Jeffries [Mon, 24 Sep 2012 11:08:52 +0000 (05:08 -0600)] 
Regression fix: Handle dstdomain duplicates and overlapping names better

Since 3.2 changes to dstdomain overlap detection teh case of duplicate
wildcards has become a fatal error needlessly.

This silently ignores all exact duplicates, even if they are wildcards.

Also, adjust the message display to always display the longer of the
domains first. Since we are dealing with sub-domains it is the most
reliable indicator of which should be removed to safely fix the detected
issue.

12 years agoPrep for 3.1.21 and 3.2 release notes
Amos Jeffries [Sun, 23 Sep 2012 09:20:43 +0000 (03:20 -0600)] 
Prep for 3.1.21 and 3.2 release notes

12 years agoBug 3648: Polish String class files
Reinhard Posmyk [Sun, 23 Sep 2012 08:40:08 +0000 (02:40 -0600)] 
Bug 3648: Polish String class files

Fix to correct function parameter const correctness.

Also polishes whitespace to match Squid coding guidelines.

12 years agoBug 3647: parsing hier_code acl fails
Alex Rousskov [Sat, 22 Sep 2012 03:14:27 +0000 (21:14 -0600)] 
Bug 3647: parsing hier_code acl fails

12 years agoDo not reuse persistent connections for PUTs to avoid ERR_ZERO_SIZE_OBJECT.
Alex Rousskov [Sat, 22 Sep 2012 03:12:33 +0000 (21:12 -0600)] 
Do not reuse persistent connections for PUTs to avoid ERR_ZERO_SIZE_OBJECT.

A compliant proxy may retry PUTs, but Squid lacks the [rather complicated]
code required to protect the PUT request body from being nibbled during the
first try or [also tricky] code to send 100-continue expectation requiredto
delay body sending. Thus, Squid cannot safely retry some PUTs today, and
FwdState::checkRetriable() must return false for all PUTs, to avoid
bogus ERR_ZERO_SIZE_OBJECT errors (especially for clients that did not
reuse a pconn and, hence, may not be ready to handle/retry an error response).

In theory, requests with safe or idempotent methods other than PUT might have
bodies so we apply the same logic to them as well.

This reopens Squid bug #3398, undoing trunk r11859 commit which attempted
to close that bug.

12 years agoDo not chunk responses carrying a Content-Range header.
Alex Rousskov [Sat, 22 Sep 2012 03:11:24 +0000 (21:11 -0600)] 
Do not chunk responses carrying a Content-Range header.

When Squid forwards a response with a Content-Range header,
ClientSocketContext::socketState() detects the end of the response range(s)
and returns STREAM_*COMPLETE to ClientSocketContext::writeComplete().
The latter thinks that the writing of the response to the client must be
over and calls keepaliveNextRequest() instead of writing the last-chunk
(if any). If the to-client response was chunked, the client gets stuck
waiting for that missing last-chunk.

The multipart Range request case was already excluded from chunking (or it
would probably suffer from the same problem). With this change, no
Content-Range responses will be chunked.

N.B. Some servers send Content-Range responses to basic GET requests
without a Range header, so the problem affects more than just Range requests.

TODO: A proper fix would be to rewrite ClientSocketContext::writeComplete()
and other code so that it does not mix internal ClientStream completion with
[possibly chunk-encoded] writing completion. This should probably be done
along with fixing ClientSocketContext::socketState() and other state-checking
code to ignore to-client persistence (flags.proxy_keepalive), which is not
related to the internal ClientStream state.

12 years agoBug 3615: configure check for default max number of FDs is broken
Amos Jeffries [Sun, 9 Sep 2012 10:06:53 +0000 (04:06 -0600)] 
Bug 3615: configure check for default max number of FDs is broken

12 years agoFix maximum_single_addr_tries upgrade
Amos Jeffries [Sun, 9 Sep 2012 10:05:51 +0000 (04:05 -0600)] 
Fix maximum_single_addr_tries upgrade

12 years agoBug 3622: peerClearRRStart scheduling multiple events
Amos Jeffries [Sun, 9 Sep 2012 10:05:22 +0000 (04:05 -0600)] 
Bug 3622: peerClearRRStart scheduling multiple events

12 years agoBug 3626: Forwarding loops on intercepted traffic
Amos Jeffries [Sun, 9 Sep 2012 10:04:39 +0000 (04:04 -0600)] 
Bug 3626: Forwarding loops on intercepted traffic

Changes to interception handling in 3.2 series (namely the preference
for using ORIGINAL_DST) have increased the chances that misconfigured
network systems involving Squid will hit forwarding loops.

Two instances are currently known:
 * passing forward-proxy traffic to a interception port.
 * NAT performed on a separate box.

This enacts an old TODO by removing the loop detection bypass for
intercepted traffic and accelerated traffic. Now we always check for
loops regardless of how the request was received.

NOTE: accel mode was only included due to the TODO.
      If problems are found there it can be re-instated.

12 years agoMake CpuAffinitySet::applied() method non-const.
Dmitry Kurochkin [Sun, 9 Sep 2012 10:03:38 +0000 (04:03 -0600)] 
Make CpuAffinitySet::applied() method non-const.

According to CPU_SET(3) and, apparently, on some systems (e.g.,
OpenSuSE 10.3) CPU_COUNT macro expects a non-const argument.  The
patch fixes build error on these systems.

12 years agoBug 3609: several RADIUS helper improvements
Alan Mizrahi [Sun, 9 Sep 2012 09:54:47 +0000 (03:54 -0600)] 
Bug 3609: several RADIUS helper improvements

12 years agoSourceFormat Enforcement
Automatic source maintenance [Sun, 9 Sep 2012 02:19:55 +0000 (20:19 -0600)] 
SourceFormat Enforcement

12 years agoBug 3616: Retrieve client connection for ACL checks from the related HttpRequest...
Christos Tsantilas [Sat, 8 Sep 2012 05:27:54 +0000 (23:27 -0600)] 
Bug 3616: Retrieve client connection for ACL checks from the related HttpRequest object

This patch enable SSL client certificate ACL checks (user_cert and ca_cert)
in all cases the client connection information can retrieved from the related
HttpRequest object, eg when making peering decisions (peer_cache_access ACL).

Also fixes assertion failure caused by acl dst on transparent proxy.

Discussed under the "Supply client connection and IDENT information to
peer_cache_access ACL check" thread on squid-dev.

This is a Measurement Factory project

12 years agoFix 'error: continue statement not within a loop'
Amos Jeffries [Wed, 29 Aug 2012 14:38:29 +0000 (08:38 -0600)] 
Fix 'error: continue statement not within a loop'

12 years agoRegression: login=PASS send no credentials when none available.
Amos Jeffries [Wed, 29 Aug 2012 03:36:29 +0000 (21:36 -0600)] 
Regression: login=PASS send no credentials when none available.

login=PASS should act like PASSTHRU, sending no credentials header, when
no client supplied OR external ACL credentials are available.
3.2 has been found wrongly adding the username "PASS" in this case.