]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
12 years agoBug 3780: cachemgr.cgi: output problem in HTTP Header Statistics
Amos Jeffries [Mon, 6 May 2013 12:35:23 +0000 (06:35 -0600)] 
Bug 3780: cachemgr.cgi: output problem in HTTP Header Statistics

12 years agoBug 3840: assertion failed 'sde' in UFS cache loading
Alex Rousskov [Mon, 6 May 2013 12:19:39 +0000 (06:19 -0600)] 
Bug 3840: assertion failed 'sde' in UFS cache loading

12 years agoBug 3836: make check failures with automake-1.13
Eray Aslan [Mon, 6 May 2013 04:18:38 +0000 (22:18 -0600)] 
Bug 3836: make check failures with automake-1.13

12 years agoFix parsing error in rev.12620
Amos Jeffries [Sun, 5 May 2013 08:38:06 +0000 (02:38 -0600)] 
Fix parsing error in rev.12620

The ConfigParser::strtokFile() methods added by rev.12620 use
an undo mechanism to pull the next token if anything has been
undone.

The new parseFlags() method also added in that revision uses
the undo mechanism for any token which is not a flag token
it also returns the token in its nextToken parameter.

In ACLIP the data parser uses parseFlags() and the nextToken
received then goes on to use strtokFile() and the undo copy
of that same token. The result being that all dst/src ACLs
had a double-entry for the first IP address tokens.
Since IP address tokens are de-duplicated with loud WARNING
on -k parse this was resulting in confusing noise from the
built-in ACL definitions.

Since parseFlags() is so new and ACLIP was the only user of the
nextToken parameter we can drop it entirely and rely on only
ConfigParser undo mechanism from now on.

12 years agoPolish: better libcomm initialization and error detection
Amos Jeffries [Sun, 5 May 2013 01:19:46 +0000 (19:19 -0600)] 
Polish: better libcomm initialization and error detection

Initialize nfmark value on Comm::Connections to zero. Memory is init by
MemPools functionality earlier, but not necessarily now.

Check for and produce error when getsockname() call fails to identify
a local IP address on inbound connections.

 Detected by Coverity Scan. Issues 740543, 740320

12 years agoPolish: fix if-def in splay template definitions
Amos Jeffries [Sat, 4 May 2013 14:23:49 +0000 (08:23 -0600)] 
Polish: fix if-def in splay template definitions

12 years agoBug 3845: http_port tcpkeepalive= option fails parsing
Amos Jeffries [Sat, 4 May 2013 13:14:23 +0000 (07:14 -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 [Sat, 4 May 2013 11:57:43 +0000 (05:57 -0600)] 
Bug 3827: Remove AccessLogEntry::cache.authuser

12 years agoSourceLayout: rename Array.h to base/Vector.h
Amos Jeffries [Sat, 4 May 2013 11:50:26 +0000 (05:50 -0600)] 
SourceLayout: rename Array.h to base/Vector.h

Also moves the unit-test for Vector<> to src/tests.

12 years agoautoconf: upgrade all helper config.test to M4 scriptlets
Amos Jeffries [Sat, 4 May 2013 06:34:24 +0000 (00:34 -0600)] 
autoconf: upgrade all helper config.test to M4 scriptlets

This carries on from the success of basic auth heleprs upgrade to perform
the update on all helpers bundled with Squid.

It also polishes some of the basic auth M4 macro tests a little.

TODO:
* Convert the duplicate code in the modules.m4 files into a macro
  for simpler management.

* Update the tests. This patch replaces all config.test tests with an
  equivalent autoconf macro. There are some helpers which could be
  extended with better tests now.

12 years agoautoconf: wrap AC_MASG_WARN and AC_CHECK_HEADERS parameters
Amos Jeffries [Sat, 4 May 2013 03:38:49 +0000 (21:38 -0600)] 
autoconf: wrap AC_MASG_WARN and AC_CHECK_HEADERS parameters

It should have no effect, however we are wrapping these headers in the
main configure and it adds an extra safety measure in case of problems.

12 years agoTypo in rev.12783 and remove MinGW specific hacks
Amos Jeffries [Thu, 2 May 2013 05:33:16 +0000 (23:33 -0600)] 
Typo in rev.12783 and remove MinGW specific hacks

12 years agoFix missing parts of rev.12782
Amos Jeffries [Wed, 1 May 2013 10:13:22 +0000 (04:13 -0600)] 
Fix missing parts of rev.12782

12 years agoautoconf upgrade: basic_auth helpers (and Bug 3793)
Amos Jeffries [Wed, 1 May 2013 06:59:12 +0000 (00:59 -0600)] 
autoconf upgrade: basic_auth helpers (and Bug 3793)

Convert the basic_auth bundled helpers from using bash to m4 scripts
when testgn which helpers are able to be built.

This conversion allows us to leverage existing information found by
./configure in the helper test scritps, and to de-duplicate and simplify
many of the testing checks.

This required shuffling the SASL checks into a custom macro, which is
altered from a halting ERROR when SASL is absent to a softer WARNING,
but prevents the SASL helpers building - which the old checks did not
guarantee. Resolving Bug 3793.

The nature of m4 macros adds two small long term issues. Both
well-known issues with m4_include() expansion:
 * the macro is expanded in-place without scoping separation.
 So any brokenness in the child scripts will be a little harder to
 identify and may result in breakage of modues other than the one whose
 child script was the cause.

 * the macro takes literal arguments without variable expansion.
 So a "full" path relative to the main configure.ac script is required
 in every include. Meaning the modules.m4 file cannot simply
 sub-include using the $helper script variable, but must be a full
 expansion of the modules set.

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

12 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 30 Apr 2013 00:13:26 +0000 (18:13 -0600)] 
SourceFormat Enforcement

12 years agoHttpRequest::helperNotes to NotePairs
Christos Tsantilas [Mon, 29 Apr 2013 13:31:05 +0000 (16:31 +0300)] 
HttpRequest::helperNotes to NotePairs

This patch try to fix current current Notes interface and usage.
The changes done having in mind that we need:

  1) to add multiple notes with the same key
  2) to support 3 different note types: adaptation meta headers, helper notes
    and custom notes added by the system administrator
  3) to log notes using the %note formating code
  4) to use the %note formating code everywhere the formating API is used. For
    example use the %note with the request_header_add configuration parameter.
  5) to use notes with ACLs.

Details:
 - The NotePairs class is not a kid of HttpHeader class anymore. It is
   implemented from scratch to cover Helper/adaptation and custom notes needs.
     * The new class stores key:value pairs in list. It allow multiple entries
       with the same key.
     * Includes a find method which return a coma separated list of values
       for a given key
 - The HttpRequest::helperNotes is now a Refcount of a HttpPairs object
 - The HelperReply::notes is now a HttpPairs object
 - The AccessLogEntry::notes now is a RefCount of a HttpPairs object, and
   stores only the custom notes add by the "note" configuration parameter
 - Add the AccessLogEntry::helperNotes which is a RefCount of a HttpPairs object
   to store notes added by helpers.
   Now the notes added by adaptation or helpers are accessible to format/* code
   imediatelly after added. Before this patch are accessible only for logging.

Future work:
 - Posible merge AccessLogEntry::notes and AccessLogEntry::helperNotes
 - Performance fixes

This is a Measurement Factory project

12 years agoUpdated copyright for icons/SN.png
Amos Jeffries [Sun, 28 Apr 2013 10:58:35 +0000 (04:58 -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 agolog_db_daemon: add missing pod2man controls
Amos Jeffries [Sat, 27 Apr 2013 08:59:40 +0000 (20:59 +1200)] 
log_db_daemon: add missing pod2man controls

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

12 years agoPrevent external_acl.cc "inBackground" assertion on queue overloads.
Alex Rousskov [Wed, 24 Apr 2013 21:22:39 +0000 (15:22 -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 agoFix undefined symbols in rev.12766
Amos Jeffries [Wed, 24 Apr 2013 15:14:26 +0000 (09:14 -0600)] 
Fix undefined symbols in rev.12766

The code changes to prevent several useless allocations on missing
sslproxy_cert_error directive left a few lines out of place.
Shuffle cert.sslErrors setup back to the original code sequence and
define allowDomainMismatch early as false for the default handling.

12 years agoHurd: define MAP_NORESERVE as no-op when missing
Amos Jeffries [Wed, 24 Apr 2013 07:47:19 +0000 (01:47 -0600)] 
Hurd: define MAP_NORESERVE as no-op when missing

Some systems like GNU Hurd provide teh 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 3816: SSL_get_certificate call inside Ssl::verifySslCertificate crashes squi
Christos Tsantilas [Tue, 23 Apr 2013 15:03:31 +0000 (18:03 +0300)] 
Bug 3816: SSL_get_certificate call inside Ssl::verifySslCertificate crashes squi
d

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 agoDocs: remove Squid prefix from ntlm_auth example paths
Amos Jeffries [Tue, 23 Apr 2013 14:22:51 +0000 (08:22 -0600)] 
Docs: remove Squid prefix from ntlm_auth example paths

There is no longer a helper called ntlm_auth shipped with Squid and the
example configs are supposed to be referring to the Samba helper now
as demonstrated by the command line options.

/usr/bin/ is probably not the only location where Samba installs its
helper, but is easily recognised and better than prefixing with a custom
Squid-specific path from --prefix.

12 years agoFix symbol errors in cf_gen after rev.12766
Amos Jeffries [Tue, 23 Apr 2013 12:35:44 +0000 (06:35 -0600)] 
Fix symbol errors in cf_gen after rev.12766

12 years agoBug 3833: Option '-k' is not present in squidclient man page
Amos Jeffries [Tue, 23 Apr 2013 12:25:33 +0000 (06:25 -0600)] 
Bug 3833: Option '-k' is not present in squidclient man page

12 years agoCacheMgr: fix missing column separator in helper stats
Amos Jeffries [Tue, 23 Apr 2013 06:28:58 +0000 (00:28 -0600)] 
CacheMgr: fix missing column separator in helper stats

12 years agoDocs: updated NCSA auth helper binary name in examples
Amos Jeffries [Tue, 23 Apr 2013 06:22:09 +0000 (00:22 -0600)] 
Docs: updated NCSA auth helper binary name in examples

12 years agoDocs: Polish configuration file documentation
Amos Jeffries [Mon, 22 Apr 2013 06:22:27 +0000 (00:22 -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 it

* corrected buffered_logs documentation (text by Alex Rousskov)

* Updated cf_gen tool to produce more descriptive error messages.

12 years agoPolish: allow debugs printing a StringArea
Amos Jeffries [Fri, 19 Apr 2013 01:33:23 +0000 (19:33 -0600)] 
Polish: allow debugs printing a StringArea

This operation is very useful for printing sub-sections of string buffers
of any kind.

12 years agoDocs: polish uri_whitespace texts
Amos Jeffries [Thu, 18 Apr 2013 05:13:50 +0000 (23:13 -0600)] 
Docs: polish uri_whitespace texts

12 years agoSourceFormat Enforcement
Automatic source maintenance [Thu, 18 Apr 2013 00:13:56 +0000 (18:13 -0600)] 
SourceFormat Enforcement

12 years agoBug 3831: basic_ncsa_auth Blowfish and SHA support
Amos Jeffries [Wed, 17 Apr 2013 11:58:23 +0000 (05:58 -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 [Wed, 17 Apr 2013 08:14:56 +0000 (11:14 +0300)] 
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 agoMake ConfigParser::QuoteString parameter const
Christos Tsantilas [Tue, 16 Apr 2013 15:08:46 +0000 (18:08 +0300)] 
Make ConfigParser::QuoteString parameter const

12 years agoResolve unused variable warnings from rev.12757
Amos Jeffries [Tue, 16 Apr 2013 13:09:27 +0000 (07:09 -0600)] 
Resolve unused variable warnings from rev.12757

12 years agoBug 3822: Locate LDAP and SASL headers in /usr/local/include for BSD support
Stuart Henderson [Tue, 16 Apr 2013 13:06:01 +0000 (07:06 -0600)] 
Bug 3822: Locate LDAP and SASL headers in /usr/local/include for BSD support

12 years agoPolish TPROXY support for OpenBSD and FreeBSD
Amos Jeffries [Tue, 16 Apr 2013 02:21:47 +0000 (20:21 -0600)] 
Polish TPROXY support for OpenBSD and FreeBSD

Current OpenBSD implementation of PF divert-to works similarly to TPROXY
and only requires a getsockname() lookup to locate the TCP packet
original destination.

We can use the same PF configuration to preform "intercept" option but
the old PF transparent code does lookups on /dev/pf which fails badly
on the new PF versions. getsockname() is what is really required and
already performed by TcpAcceptor on all incoming connections, so there
is no need for a special PF lookup code now.

Add a new ./configure option --with-nat-devpf to enable the old /dev/pf
NAT lookup code in a backward-compatible way for older OS versions and
OpenBSD based distros which have not yet ported the new PF code. The
option is disabled by default since the systems requiring it are fairly
old now.

Also remove the getsockname() lookup in the IPFW lookup implementation
which is redundant behind TcpAcceptor.

12 years agoBug 3825: ncsa_auth segfaulting with glibc-2.17
Michal Luscon [Tue, 16 Apr 2013 00:26:10 +0000 (18:26 -0600)] 
Bug 3825: 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 agoPolish: upgrade TunnelStateData to CBDATA_CLASS2()
Amos Jeffries [Sun, 7 Apr 2013 12:47:59 +0000 (06:47 -0600)] 
Polish: upgrade TunnelStateData to CBDATA_CLASS2()

CBDATA_CLASS2() removes the need to define new/delete operators and
removes soem uses of cbdataFree()/cbdataAlloc()

Also replaces several abuses of the cbdataInternal*() locking API with
CbcPointer<> auto-pointers. The existence of some of these locks needing
to be done is questionable since AsyncCalls scheduling protects better
against the 'deleted under our feets' problem.
 For now the locks are retained since it is not yet easy to track down
which are safe and which are removable.

12 years agoPolish: TunnelStateData constructor/destructor
Amos Jeffries [Sun, 7 Apr 2013 12:32:06 +0000 (06:32 -0600)] 
Polish: TunnelStateData constructor/destructor

* convert the C-style tunnelStateFree() functio to a proper destructor.
* create a proper constructor for TunnelStateData
* include debugging for trace-job.pl to track tunnel jobs setup/teardown

12 years agoOpenBSD: libpthreads requires OpenBSD 5.2 or later
Stuart Henderson [Sun, 7 Apr 2013 02:47:50 +0000 (20:47 -0600)] 
OpenBSD: libpthreads requires OpenBSD 5.2 or later

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

12 years agoFix unit test link issue for missing ClientSocketContext::operator delete stub
Francesco Chemolli [Fri, 5 Apr 2013 10:04:29 +0000 (12:04 +0200)] 
Fix unit test link issue for missing ClientSocketContext::operator delete stub

12 years agoImprove compiler detection, better support warnings-as-errors on clang
Francesco Chemolli [Thu, 4 Apr 2013 09:24:23 +0000 (11:24 +0200)] 
Improve compiler detection, better support warnings-as-errors on clang

12 years agoBug 3643: NTLM helpers stuck in reserved state by Safari
Amos Jeffries [Thu, 4 Apr 2013 06:15:00 +0000 (00:15 -0600)] 
Bug 3643: NTLM helpers stuck in reserved state by Safari

NTLM failures are not always cleaning up connection-auth credentials
properly. In particular they are not releasing the NTLM helpers when
the connection is closed between challenge and handshake completion.
Resulting in permanently reserved helpers locking up all access
through the proxy.

This change redesigns the connection authentication state management
to move the auth link/unlink operations into the connection state
manager objects instead of being managed by NTLM auth components.
As a result we are able to manage credentials from any auth scheme
consistently and terminate the connection properly on several
error conditions which the auth components are not easily aware of.

 Fix sponsored by Netbox Blue Pty (http://netboxblue.com/)

12 years agoFix enter_suid/leave_suid build errors in ip/Intercept.cc
Amos Jeffries [Tue, 2 Apr 2013 12:25:55 +0000 (06:25 -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 agoRemove SUID and OpenBSD limits from SO_BINDANY support
Amos Jeffries [Mon, 1 Apr 2013 09:54:22 +0000 (03:54 -0600)] 
Remove SUID and OpenBSD limits from SO_BINDANY support

Apparently OpenBSD 5.x do not require enter_suid/leave_suid to test for
SO_BINDANY support.

Also, FreeBSD does support SO_BINDANY in a fashion. Remove the OpenBSD
build requirement and rely solely on the option being present.

12 years agoFix compile errors with ICC since rev.12728
Amos Jeffries [Sun, 31 Mar 2013 05:35:20 +0000 (23:35 -0600)] 
Fix compile errors with ICC since rev.12728

ICC is a bit more strict about const on pass-by-value return types.

12 years agoPolish default http_access lines ordering
Amos Jeffries [Sat, 30 Mar 2013 09:47:23 +0000 (03:47 -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 agoAdd TPROXY support for OpenBSD
Marios Makassikis [Fri, 29 Mar 2013 05:48:19 +0000 (23:48 -0600)] 
Add TPROXY support for OpenBSD

This adds support for the OpenBSD 'divert' target in PF 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 teh TPROXY behaviour.

To enable these features Squid is configured the same as Linux TPROXY:
  http_port 1234 tproxy

12 years agoFix memory leaks in ConnStateData pinning
Amos Jeffries [Thu, 28 Mar 2013 03:16:05 +0000 (21:16 -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 agoSourceFormat Enforcement
Automatic source maintenance [Wed, 27 Mar 2013 00:13:29 +0000 (18:13 -0600)] 
SourceFormat Enforcement

12 years agoBug 3774: -k reconfigure drops rock
Alexandre Chappaz [Tue, 26 Mar 2013 22:08:43 +0000 (16:08 -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 [Tue, 26 Mar 2013 10:38:20 +0000 (04:38 -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 [Tue, 26 Mar 2013 10:33:10 +0000 (04:33 -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 [Tue, 26 Mar 2013 00:58:56 +0000 (18:58 -0600)] 
ssl_crtd: helpers dying during startup on ARM

12 years agoFix Auth::QueueNode initialization
Amos Jeffries [Mon, 25 Mar 2013 05:41:24 +0000 (23:41 -0600)] 
Fix Auth::QueueNode initialization

 Detected by Coverity Scan. Issue 986564.

12 years agoPolish: safe_free is only needed to set NULL
Amos Jeffries [Sat, 23 Mar 2013 11:47:20 +0000 (05:47 -0600)] 
Polish: safe_free is only needed to set NULL

12 years agoSourceLayout: shuffle HttpStatusLine into http/libsquid-http.la
Christos Tsantilas [Fri, 22 Mar 2013 17:51:40 +0000 (19:51 +0200)] 
SourceLayout: shuffle HttpStatusLine into http/libsquid-http.la

Fix to allow ecap subsystem to compile, after later shuffle HttpStatusLine
changes.

12 years agoUpdate Key header resgistration
Amos Jeffries [Wed, 20 Mar 2013 22:53:18 +0000 (16:53 -0600)] 
Update Key header resgistration

* Key header is currently defined as a response-only header.

* Key header contains a list of values which MAY be split across multiple
  header lines.

12 years agoRegister new Key header
Amos Jeffries [Wed, 20 Mar 2013 22:39:26 +0000 (16:39 -0600)] 
Register new Key header

see http://tools.ietf.org/html/draft-fielding-http-key-02 for details
on the Vary extensions this header will be providing.

12 years agoDocs: tweak and typo fix in ext_session_acl man page syntax
Amos Jeffries [Wed, 20 Mar 2013 21:31:35 +0000 (15:31 -0600)] 
Docs: tweak and typo fix in ext_session_acl man page syntax

12 years agoFix bogus 'invalid response' message on URL rewriter interface
Amos Jeffries [Wed, 20 Mar 2013 04:48:17 +0000 (22:48 -0600)] 
Fix bogus 'invalid response' message on URL rewriter interface

The empty-line response from rewriter and redirector should be converted
to ERR reply code in the new API. It was being left as Unknown.

While this reply used to only be valid on URL helper interface, and it
woudl be more appropriate to map other helpers to BH the ERR response
seems to be safe for use on any of the helper interfaces for an empty
line response. At worst it will prevent the lookup being re-tried on
other possibly better working helper instance.

12 years agoPolish: clarify authenticate_ip_ttl code
Amos Jeffries [Mon, 18 Mar 2013 10:10:13 +0000 (04:10 -0600)] 
Polish: clarify authenticate_ip_ttl code

This patch alters the directive implementation to only perform TTL
addition when setting the expiry value. This improves speed a little when
comparing timestamps, and allows the config file to display 1 second TTL
instead of displaying 0 seconds and actually being 0-1 seconds.
 Which resolves some confusion about why max_user_ip ACL still works when
the TTL is set to 0 seconds.

Also, document the AuthUserIP class used to store the IP information.

12 years agoPolish: drop a bunch of dead code
Amos Jeffries [Mon, 18 Mar 2013 06:24:15 +0000 (00:24 -0600)] 
Polish: drop a bunch of dead code

12 years agoAdd missing NULL check in myportname ACL
Amos Jeffries [Mon, 18 Mar 2013 05:37:36 +0000 (23:37 -0600)] 
Add missing NULL check in myportname ACL

12 years agoSourceLayout: shuffle HttpStatusLine into http/libsquid-http.la
Amos Jeffries [Mon, 18 Mar 2013 04:55:51 +0000 (22:55 -0600)] 
SourceLayout: shuffle HttpStatusLine into http/libsquid-http.la

* moves HttpStatusLine.* to http/StatusLine.*

* renames HttpStatusLine to Http::StatusLine

* renames httpStatusLine*() functions as members of Http::StatusLine

* shuffles StatusCode string conversion function into http/StatusCode

* makes reason parameter of StatusLine::set() function optional.
  There is no logic change involved but callers now no longer need to
  set it to the status code string explicitly, nor need to set it to NULL
  explicitly unless intending to replace an existing status string.

* adds const-correctness and documentation to StatusLine symbols.

12 years agobasic_pam_auth: Add -r option to strip NTLM/Negotiate domain from username
Steve Hill [Sun, 17 Mar 2013 23:40:08 +0000 (17:40 -0600)] 
basic_pam_auth: Add -r option to strip NTLM/Negotiate domain from username

This option helps reduce end-user confusion accessing Squid using Basic
auth PAM helper as a backup to NTLM and/or Negotiate authentication.

The user can enter their NTLM/Negotiate user+domain details in the popup
which may occur without needing to know which auth scheme is in play.

12 years agoSourceLayout: Shuffle HttpVersion.h to http/ProtocolVersion.h
Amos Jeffries [Sun, 17 Mar 2013 12:19:16 +0000 (06:19 -0600)] 
SourceLayout: Shuffle HttpVersion.h to http/ProtocolVersion.h

* incluing Http namespace and rename HttpVersion to Http::ProtocolVersion

* use ProtocolVersion.h filename to avoid clashing with include/version.h
  on case-insensitive filesystems.

* add class and member documentation (also for Anyp::ProtocolVersion)

12 years agoSourceFormat Enforcement
Automatic source maintenance [Sun, 17 Mar 2013 00:13:22 +0000 (18:13 -0600)] 
SourceFormat Enforcement

12 years agoSourceLayout: shuffle StatusCode.h to http/StatusCode.h
Amos Jeffries [Sat, 16 Mar 2013 04:57:43 +0000 (22:57 -0600)] 
SourceLayout: shuffle StatusCode.h to http/StatusCode.h

* rename of http_status to Http::StatusCode

* rename all enum values to scReason in camelCase

12 years agoFix concurrency support in stateless helpers: Parse multiple replies correctly.
Alex Rousskov [Thu, 14 Mar 2013 23:04:37 +0000 (17:04 -0600)] 
Fix concurrency support in stateless helpers: Parse multiple replies correctly.

When multiple helper replies were read at the same time, the old code moved \0
(former EoM mark) in front of the buffer after handling the first reply, which
prevented remaining replies from being parsed.

The code also did not terminate the remaining replies correctly after moving
them to the beginning of the buffer. As far as I could test, such termination
is accidentally(?) not necessary, but I could not figure out why and added it
anyway.

12 years agoPrep for 3.3.3 and 3.2.9
Amos Jeffries [Tue, 12 Mar 2013 09:53:28 +0000 (03:53 -0600)] 
Prep for 3.3.3 and 3.2.9

12 years agoPolish: fix several spelling errors
Benjamin Kerensa [Mon, 11 Mar 2013 23:47:23 +0000 (17:47 -0600)] 
Polish: fix several spelling errors

12 years agoFix SSL Bump bypass for intercepted traffic
Amos Jeffries [Mon, 11 Mar 2013 23:28:51 +0000 (17:28 -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 agoMany typos fixed
Benjamin Kerensa [Mon, 11 Mar 2013 00:30:26 +0000 (17:30 -0700)] 
Many typos fixed

12 years agoRegression fix: Accept-Language header parse
Amos Jeffries [Thu, 7 Mar 2013 23:40:02 +0000 (12:40 +1300)] 
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 02:12:43 +0000 (19:12 -0700)] 
Bug 3673: Silence 'Failed to select source' messages

12 years agoOpenIndiana: Add missing limits.h includes
Anonymous [Mon, 4 Mar 2013 01:47:43 +0000 (14:47 +1300)] 
OpenIndiana: Add missing limits.h includes

12 years agoSourceFormat Enforcement
Automatic source maintenance [Mon, 4 Mar 2013 01:13:16 +0000 (18:13 -0700)] 
SourceFormat Enforcement

12 years agoBug 3720: Add missing include in /dev/poll I/O module
Anonymous [Sun, 3 Mar 2013 13:07:39 +0000 (02:07 +1300)] 
Bug 3720: Add missing include in /dev/poll I/O module

12 years agoFix authentication headers sent on peer digest requests
Amos Jeffries [Sun, 3 Mar 2013 12:44:30 +0000 (05:44 -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 agoMake all the parameter names and options case sensitive
Tianyin Xu [Sun, 3 Mar 2013 07:10:22 +0000 (00:10 -0700)] 
Make all the parameter names and options case sensitive

Changes "strcasecmp" to "strcmp".
This mainly deals with constant configuration options (e.g., enumerative
options and boolean options). For directive names, it's already
consistent (case sensitive), the parser functions are auto-generated.

The case sensitivity of the following parameter values is not changed:

- user and group names
- host names
- domain and realm names
- ACL names
- filesystem names
- options in request/response/digest messages

12 years agoBug 3795: fix several mistakes in the MIB file
Amos Jeffries [Sun, 3 Mar 2013 05:39:27 +0000 (18:39 +1300)] 
Bug 3795: fix several mistakes in the MIB file

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

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

12 years agoDocs: document ConnOpener::swanSong() better
Amos Jeffries [Thu, 28 Feb 2013 23:22:23 +0000 (16:22 -0700)] 
Docs: document ConnOpener::swanSong() better

12 years agoBug 3329: Quieten orphan Comm::Connection messages
Amos Jeffries [Thu, 28 Feb 2013 23:13:53 +0000 (16:13 -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 r12706 testRock changes.
Alex Rousskov [Tue, 26 Feb 2013 18:58:40 +0000 (11:58 -0700)] 
Sync TESTDIR names used by testCoss and testUfs with r12706 testRock changes.

12 years agoMacOS: reduce the testRock unit test UDS path
Amos Jeffries [Tue, 26 Feb 2013 00:34:52 +0000 (13:34 +1300)] 
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 agoMacOS: workaround compiler errors and case-insensitivity
Amos Jeffries [Sun, 24 Feb 2013 07:26:26 +0000 (00:26 -0700)] 
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 agoFix shadowed definition of socket in librfcnb headers
Amos Jeffries [Sun, 24 Feb 2013 06:27:46 +0000 (23:27 -0700)] 
Fix shadowed definition of socket in librfcnb headers

Detected by MacOS X build node.

12 years agoSourceLayout: shuffle BasicAuthQueueNode to Auth:: namespace
Amos Jeffries [Fri, 22 Feb 2013 13:26:12 +0000 (02:26 +1300)] 
SourceLayout: shuffle BasicAuthQueueNode to Auth:: namespace

... and document what it is used for by authentication.

There is only one logic change in this patch. The QueueNode destructor
is added to clear the queued CBDATA entries when the queue is deleted.
Previously the pointer was just erased in hopes that the queue was
notified prior to deletion.

12 years agoReverted r12655 debugging additions that printed raw unterminated digest strings
Alex Rousskov [Wed, 20 Feb 2013 05:59:41 +0000 (22:59 -0700)] 
Reverted r12655 debugging additions that printed raw unterminated digest strings

12 years agoRevert rev.12698
Amos Jeffries [Tue, 19 Feb 2013 00:26:59 +0000 (13:26 +1300)] 
Revert rev.12698

12 years agoPolish debugs in cacheability test
Amos Jeffries [Tue, 19 Feb 2013 00:06:48 +0000 (13:06 +1300)] 
Polish debugs in cacheability test

12 years agoRemoves the domain from the cache_peer server pconn key
Amos Jeffries [Mon, 18 Feb 2013 13:02:42 +0000 (02:02 +1300)] 
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 a bug 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 agoFix nested debugs() calls
Alexander Komyagin [Mon, 18 Feb 2013 11:37:32 +0000 (00:37 +1300)] 
Fix nested debugs() calls

Since debugs() is a macro, it should not change static Debugs::level
before putting the debug message to the internal stream. Otherwise we
encounter problems when debug message itself containg calls to debugs().

12 years agoFix missing fde linkages
Amos Jeffries [Mon, 18 Feb 2013 07:33:44 +0000 (20:33 +1300)] 
Fix missing fde linkages