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

11 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

11 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.

11 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

11 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.

11 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.

11 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.

11 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

11 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.

11 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.

11 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

11 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

11 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.

11 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.

11 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)

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

11 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

11 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.

11 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

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

11 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.

11 years agoMany typos fixed
Benjamin Kerensa [Mon, 11 Mar 2013 00:30:26 +0000 (17:30 -0700)] 
Many typos fixed

11 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.

11 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

11 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

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

11 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

11 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.

11 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

11 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

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

11 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

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

11 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.

11 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.

11 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.

11 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.

11 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.

11 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.

11 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

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

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

11 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.

11 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().

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

11 years agoRelease Notes: some grammer fixes in 3.2 notes
Amos Jeffries [Sun, 17 Feb 2013 21:38:22 +0000 (14:38 -0700)] 
Release Notes: some grammer fixes in 3.2 notes

11 years agoAdd missing stub_fde entry
Amos Jeffries [Sun, 17 Feb 2013 10:10:00 +0000 (03:10 -0700)] 
Add missing stub_fde entry

11 years agoFix typo in rev.12692
Amos Jeffries [Sun, 17 Feb 2013 09:31:18 +0000 (02:31 -0700)] 
Fix typo in rev.12692

11 years agoFix uninitializd members in LeakFinder
Amos Jeffries [Sun, 17 Feb 2013 02:30:31 +0000 (15:30 +1300)] 
Fix uninitializd members in LeakFinder

 Detected by Coverity Scan. Issue 740521

11 years agoFix uninitialized member fields in Http* objects
Amos Jeffries [Sun, 17 Feb 2013 02:24:54 +0000 (15:24 +1300)] 
Fix uninitialized member fields in Http* objects

 Detected by Coverity Scan. Issues 740516, 740519, 740520, 740620

11 years agoInitialize EventLoop members
Amos Jeffries [Sun, 17 Feb 2013 02:09:16 +0000 (15:09 +1300)] 
Initialize EventLoop members

These members are setup when starting the event loop, but it helps
to have them set to sane values on construction just in case.

 Detected by Coverity Scan. Issue 740515

11 years agoSourceLayout: shuffle fd_table definition into fde.h
Amos Jeffries [Sun, 17 Feb 2013 01:55:00 +0000 (14:55 +1300)] 
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.

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

11 years agoFix segfault inside Adaptation::AccessCheck::checkCandidates method
Christos Tsantilas [Sat, 16 Feb 2013 17:05:36 +0000 (19:05 +0200)] 
Fix segfault inside Adaptation::AccessCheck::checkCandidates method

The realted HttpReply object maybe is NULL, for example for icap reqmod
requests. We should always check  before using it with HTTPMSGLOCK macro

11 years agoBug 3781: Proxy Authentication not sent to cache_peer
Amos Jeffries [Sat, 16 Feb 2013 11:42:53 +0000 (00:42 +1300)] 
Bug 3781: Proxy Authentication not sent to cache_peer

11 years agoTypo in rev.12686
Amos Jeffries [Thu, 14 Feb 2013 06:31:38 +0000 (23:31 -0700)] 
Typo in rev.12686

11 years agoFix Negotiate auth NA response handling
Amos Jeffries [Thu, 14 Feb 2013 05:42:57 +0000 (22:42 -0700)] 
Fix Negotiate auth NA response handling

Handle the blurb presented on NA responses as an error message.

Negotiate auth was also treating token as a mandatory field, although it is
optional along with an optional message.

11 years agoPolish: remove dead code added by rev.12670
Amos Jeffries [Thu, 14 Feb 2013 03:42:26 +0000 (20:42 -0700)] 
Polish: remove dead code added by rev.12670

Remove the do_free_filename hack which on most modern systems causes the
extra if() code and local variable to be optimized out.

Detected by Coverity Scan. Issue 980999.

11 years agoSourceFormat Enforcement
Automatic source maintenance [Thu, 14 Feb 2013 01:13:24 +0000 (18:13 -0700)] 
SourceFormat Enforcement

11 years agomime.cc post-merge cleanup
Francesco Chemolli [Wed, 13 Feb 2013 22:27:19 +0000 (23:27 +0100)] 
mime.cc post-merge cleanup

11 years agoMerge mime.cc refactoring work
Francesco Chemolli [Wed, 13 Feb 2013 10:54:46 +0000 (11:54 +0100)] 
Merge mime.cc refactoring work

11 years agoBug 3763: diskd Error: no filename in shm buffer
Amos Jeffries [Wed, 13 Feb 2013 09:19:18 +0000 (02:19 -0700)] 
Bug 3763: diskd Error: no filename in shm buffer

11 years agoSolaris: Fix xstrto*() function linkages
Amos Jeffries [Wed, 13 Feb 2013 05:37:51 +0000 (18:37 +1300)] 
Solaris: Fix xstrto*() function linkages

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

11 years agoDocument the -n acl option (no-lookup DNS ACLs)
Christos Tsantilas [Tue, 12 Feb 2013 21:49:03 +0000 (23:49 +0200)] 
Document the -n acl option (no-lookup DNS ACLs)

11 years agoRelease Notes: 3.2 and 3.3 are stable already.
Amos Jeffries [Tue, 12 Feb 2013 12:04:58 +0000 (01:04 +1300)] 
Release Notes: 3.2 and 3.3 are stable already.

Several lines of text were still mentioning being in testing or not
ready for production use. That was incorrect

11 years agoPolish: Drop redundant HttpMsgPointerT template
Amos Jeffries [Tue, 12 Feb 2013 11:34:35 +0000 (00:34 +1300)] 
Polish: Drop redundant HttpMsgPointerT template

Despite the object and API changes being rather extensive
there are no logic changes in this patch.

The HttpMsgPointerT template was used to ref-count HttpMsg
objects and its children. It provided an API identical to
the RefCount API plus a few extensions for handling
polymorphism cast operations in the background.

This patch:

* update HttpMsg class hierarchy to use Lock API directly
 removing the _lock() and _unlock() virtual functions.

* update HttpControlMsg to use a HttpReply::Pointer directly
 since this type is available to that class a re-definition
 using HttpMsg* casting was not needed.

* update HTTPMSGLOCK() macro not to return a HttpMsg*
 The API polymorphism extensions provided by
 HttpMsgPointerT<> were only necessary to handle the
 HttpMsg* object casting this macro made a requirement.
 Once that assignment casting is removed the entire
 API extensions are no longer used.

11 years agoRelease Notes: fix bugzilla URL
Amos Jeffries [Tue, 12 Feb 2013 09:24:47 +0000 (22:24 +1300)] 
Release Notes: fix bugzilla URL

11 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 12 Feb 2013 01:35:25 +0000 (18:35 -0700)] 
SourceFormat Enforcement

11 years agoRelease Notes: localip/localport are in 3.3 not 3.2
Amos Jeffries [Mon, 11 Feb 2013 23:34:27 +0000 (16:34 -0700)] 
Release Notes: localip/localport are in 3.3 not 3.2

11 years agoFix rev.12655 helper type is a class not struct.
Amos Jeffries [Mon, 11 Feb 2013 23:18:17 +0000 (16:18 -0700)] 
Fix rev.12655 helper type is a class not struct.

11 years agoSourceLayout: Shuffle and collate the log result codes symbols
Amos Jeffries [Mon, 11 Feb 2013 23:11:12 +0000 (16:11 -0700)] 
SourceLayout: Shuffle and collate the log result codes symbols

This collates all the small definitions spread around Squid for defining
and handling the TCP_* and UDP_* result code tags logged by Squid.

* log_type enumeration shuffled from enums.h
* log_type increment operator shuffled from client_db
* log_type strings shuffled from Format:: and built automatically
* is-HIT lookup test shuffled from ICP

Due to LogTags.cc being automatically built from the enum list we define
the shuffled functions as inline. This is not a problem due to their small
size. When the LogTags type is converted to a class thay can be de-inlined.

11 years agoMentioned creation of diskers in cache_dir rock documentation.
Alex Rousskov [Mon, 11 Feb 2013 21:31:11 +0000 (14:31 -0700)] 
Mentioned creation of diskers in cache_dir rock documentation.

11 years agoFix coverity scan issue 740457: unsecure temporary file creation
Francesco Chemolli [Mon, 11 Feb 2013 16:39:09 +0000 (17:39 +0100)] 
Fix coverity scan issue 740457: unsecure temporary file creation

11 years agoAdded missing include in mime.cc
Francesco Chemolli [Mon, 11 Feb 2013 15:33:15 +0000 (16:33 +0100)] 
Added missing include in mime.cc

11 years agoIntegrated Mime auxiliary classes with mempools, formatting fixes.
Francesco Chemolli [Mon, 11 Feb 2013 11:01:21 +0000 (12:01 +0100)] 
Integrated Mime auxiliary classes with mempools, formatting fixes.

11 years agoMerged from trunk
Francesco Chemolli [Sun, 10 Feb 2013 16:57:19 +0000 (17:57 +0100)] 
Merged from trunk

11 years agoTurned remaining PortCfg flags to bool type
Francesco Chemolli [Sun, 10 Feb 2013 16:31:40 +0000 (17:31 +0100)] 
Turned remaining PortCfg flags to bool type

11 years agoMerged from trunk
Francesco Chemolli [Sun, 10 Feb 2013 15:17:19 +0000 (16:17 +0100)] 
Merged from trunk

11 years agoTypo in rev.12661
Amos Jeffries [Sat, 9 Feb 2013 12:36:13 +0000 (01:36 +1300)] 
Typo in rev.12661

11 years agoAttempt alternative method of snapshot cleanup.
Amos Jeffries [Sat, 9 Feb 2013 10:45:25 +0000 (03:45 -0700)] 
Attempt alternative method of snapshot cleanup.

Something in the sed regex patterns is not matching the snapshots detected
by the ls pattern. We can skip the sed and use the full file path ls
found to remove the snapshot.

11 years agoPrep for 3.3.1
Amos Jeffries [Sat, 9 Feb 2013 07:23:12 +0000 (00:23 -0700)] 
Prep for 3.3.1

11 years agoFix signed/unsigned comparison warnings on GCC 4.7
Amos Jeffries [Sat, 9 Feb 2013 06:20:27 +0000 (23:20 -0700)] 
Fix signed/unsigned comparison warnings on GCC 4.7

11 years agoPolish: call maxObjectSze virtual in SwapDir.
Amos Jeffries [Sat, 9 Feb 2013 05:16:04 +0000 (22:16 -0700)] 
Polish: call maxObjectSze virtual in SwapDir.

Say "virtual" explicitly in this
case to remind us that maxObjectSize() is a part of the [semi-broken]
Store API and not some SwapDir "own" method. This will help us when we
polish the API to remove the common Store root.

11 years agoSourceFormat Enforcement
Automatic source maintenance [Sat, 9 Feb 2013 01:23:39 +0000 (18:23 -0700)] 
SourceFormat Enforcement

11 years agoBug 3686: cache_dir max-size default fails
Amos Jeffries [Sat, 9 Feb 2013 00:44:07 +0000 (17:44 -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.

11 years agoproper fix for stub HttpRequest
Amos Jeffries [Fri, 8 Feb 2013 14:00:26 +0000 (03:00 +1300)] 
proper fix for stub HttpRequest

11 years agoBug 3767: tcp_outgoing_* ACLs do not obey acl_uses_indirect_client
Nick Rogers [Fri, 8 Feb 2013 12:24:38 +0000 (05:24 -0700)] 
Bug 3767: tcp_outgoing_* ACLs do not obey acl_uses_indirect_client

11 years agoDocs: handle unknown squid-2.7 directives cleaner
Amos Jeffries [Fri, 8 Feb 2013 11:58:57 +0000 (00:58 +1300)] 
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.

11 years agoFix missing HttpRequest stub for storeId()
Amos Jeffries [Fri, 8 Feb 2013 11:38:05 +0000 (00:38 +1300)] 
Fix missing HttpRequest stub for storeId()

11 years agoPolish debugs on more obsolete options
Amos Jeffries [Fri, 8 Feb 2013 11:30:24 +0000 (00:30 +1300)] 
Polish debugs on more obsolete options

11 years agoRemove useless conditional in announce_period
Tianyin Xu [Fri, 8 Feb 2013 09:50:17 +0000 (22:50 +1300)] 
Remove useless conditional in announce_period

11 years agoAdd custom Store ID code support
Eliezer Croitoru [Fri, 8 Feb 2013 09:25:04 +0000 (02:25 -0700)] 
Add custom Store ID code support

This is a port of the StoreURL feature from Squid-2.7 rewritten to avoid
the unfortunate link that 2.7 feature had with URL-rewriting.

The feature uses a helper to retrieve custom ID values for use in the
cache storage ID key. The default ID used is the requested URL.

Differences since 2.7:
* storeurl_* directive names are now called store_id_*

* The helper response now expects 'OK store-id="..."\n'
  However the squid-2.7 response syntax is still accepted.

* the ID value presented need not be a URL. Although URL syntax
  is recommended to simplify store log interpretation and
  refresh pattern matching.

* refresh_pattern applies to the store ID, not the request URL.

TODO: support store ID lookups on ICP and HTCP queries.

11 years agoMake squid -z for cache_dir rock work like UFS instead of like COSS.
Alex Rousskov [Fri, 8 Feb 2013 04:14:50 +0000 (21:14 -0700)] 
Make squid -z for cache_dir rock work like UFS instead of like COSS.
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).

11 years agoMigrate HttpMsg to Lock refcounting
Amos Jeffries [Tue, 5 Feb 2013 07:47:28 +0000 (20:47 +1300)] 
Migrate HttpMsg to Lock refcounting

First stage of the conversion to RefCount<>. This replaces the custom
attempt at ref-count locking in HttpMsg with the locking mechanism
presented by class Lock.

11 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 5 Feb 2013 01:13:29 +0000 (18:13 -0700)] 
SourceFormat Enforcement

11 years agoBug 3752: objects that cannot be cached in memory are not cached on disk
Alex Rousskov [Mon, 4 Feb 2013 17:39:23 +0000 (10:39 -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.

11 years agoFix RefCount documentation
Francesco Chemolli [Mon, 4 Feb 2013 15:40:58 +0000 (16:40 +0100)] 
Fix RefCount documentation

11 years agoShuffle the traffic mode flags into their own structure
Amos Jeffries [Mon, 4 Feb 2013 11:12:03 +0000 (00:12 +1300)] 
Shuffle the traffic mode flags into their own structure

* ssl-bump i sincluded for now since it effectively initiates a mode of
  traffic handling on decrypted CONNECT requests or intercepted HTTPS

11 years agoImplemented TrafficMode::isIntercepted()
Francesco Chemolli [Mon, 4 Feb 2013 09:47:50 +0000 (10:47 +0100)] 
Implemented TrafficMode::isIntercepted()

11 years agoMerged from trunk
Francesco Chemolli [Mon, 4 Feb 2013 08:59:59 +0000 (09:59 +0100)] 
Merged from trunk

11 years agoFormatting
Francesco Chemolli [Mon, 4 Feb 2013 07:26:53 +0000 (08:26 +0100)] 
Formatting