]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
12 years agonote ACL
Christos Tsantilas [Sat, 25 May 2013 07:13:09 +0000 (10:13 +0300)] 
note ACL

This patch investigates the new note ACL type, to match transaction annotation.
Syntax:
   acl aclname note name [value ...]

Without values, matches any annotation with a given name. With value(s), matches
any annotation with a given name that also has one of the given values.
Annotation sources include note and adaptation_meta directives as well as helper
and eCAP responses.

This is a Measurement Factory project

12 years agoAvoid segfaults on seriously malformed requests when ICAP logging is enabled.
Alex Rousskov [Fri, 24 May 2013 23:40:50 +0000 (17:40 -0600)] 
Avoid segfaults on seriously malformed requests when ICAP logging is enabled.

12 years agoAsk for SSL key password when started with -N but without sslpassword_program.
Alex Rousskov [Fri, 24 May 2013 15:14:50 +0000 (09:14 -0600)] 
Ask for SSL key password when started with -N but without sslpassword_program.

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

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

12 years agoSourceFormat Enforcement
Automatic source maintenance [Fri, 24 May 2013 00:13:23 +0000 (18:13 -0600)] 
SourceFormat Enforcement

12 years agobasic_ncsa_auth: fix unused variable warnings (typo in rev.12762)
Amos Jeffries [Thu, 23 May 2013 15:40:07 +0000 (03:40 +1200)] 
basic_ncsa_auth: fix unused variable warnings (typo in rev.12762)

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

12 years agoCleanup: Merge AccessLogEntry 'helperNotes' and 'configNotes' members to 'notes'...
Christos Tsantilas [Thu, 23 May 2013 08:18:09 +0000 (11:18 +0300)] 
Cleanup: Merge AccessLogEntry 'helperNotes' and 'configNotes' members to 'notes' member

There is not any need to store notes added using Note cfg option and notes added
from helper to separated member. This patch merge them to the same
AccessLogEntry::note member.

This is a Measurement Factory project

12 years agoAdd pt-bz (Belize Portuguee) dialect to translations
Amos Jeffries [Wed, 22 May 2013 06:33:05 +0000 (00:33 -0600)] 
Add pt-bz (Belize Portuguee) dialect to translations

In absence of information on whether Belize Portuguese dialect can be
presented with Brazillian or European Portuguese texts or whether they
require a third translation use a symlink entry for pt-bz to pt-br based
on the geographical distance for dialect locale alternatives.

12 years agoHonor zero-padded logformat codes again.
Alex Rousskov [Wed, 22 May 2013 01:04:34 +0000 (19:04 -0600)] 
Honor zero-padded logformat codes again.

Trunk r12628 "Turn flags to bool" set Token::zero to false instead of true,
resulting in extra spaces occasionally logged in front of such popular and
default fields as %03tu, screwing up log parsers.

12 years agoSourceFormat Enforcement
Automatic source maintenance [Wed, 22 May 2013 00:13:36 +0000 (18:13 -0600)] 
SourceFormat Enforcement

12 years agoDetect and use -march=natuve when possible
Amos Jeffries [Tue, 21 May 2013 05:39:18 +0000 (23:39 -0600)] 
Detect and use -march=natuve when possible

Clang++ 3.2 fails to detect some CPUs correctly and requires the
additional checks enabled by this option to build working executables.

This option supported by GCC 4.3 and later enables additional CPU
detection and enables CPU-specific optimizations. In the interests of
better performance this patch enables it whenever is it available and
possible to use (cross-compilers cannot use it).

12 years agoBug 1991: kqueue causes SSL to hang
Ming Fu [Tue, 21 May 2013 05:17:23 +0000 (23:17 -0600)] 
Bug 1991: kqueue causes SSL to hang

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

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

12 years agoPolish: src/auth/AclProxyAuth.cc whitespace
Amos Jeffries [Tue, 21 May 2013 04:47:37 +0000 (22:47 -0600)] 
Polish: src/auth/AclProxyAuth.cc whitespace

12 years agoFix --enable-log-daemon-helpers auto-detect helpers
Amos Jeffries [Sun, 19 May 2013 12:56:18 +0000 (06:56 -0600)] 
Fix --enable-log-daemon-helpers auto-detect helpers

The code initializing default values and determining helper detection
was significantly different from other helpers detection logics. Combined
with rev.12786 logic changes resulted in the detection always failing.

Update the --enable-log-deemon-heleprs option to work identically to the
--enable-external-acl-helpers option.

12 years agoPolish debugging output in ASN acls
Francesco Chemolli [Sun, 19 May 2013 07:11:51 +0000 (01:11 -0600)] 
Polish debugging output in ASN acls

12 years agoPrep for 3.3.5
Amos Jeffries [Sun, 19 May 2013 06:06:07 +0000 (00:06 -0600)] 
Prep for 3.3.5

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

12 years agoFix typos in rev.12786
Amos Jeffries [Sat, 18 May 2013 12:20:54 +0000 (06:20 -0600)] 
Fix typos in rev.12786

Also, update some EGREP tests to COMPILE_IFELSE

12 years agoautoconf.h exist in buildir, not srcdir.
Amos Jeffries [Sat, 18 May 2013 11:18:37 +0000 (05:18 -0600)] 
autoconf.h exist in buildir, not srcdir.

rev.12827 only works for in-tree builds.

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

12 years agoAvoid annotation leaks by properly destroying NotePairs entries.
Alex Rousskov [Fri, 17 May 2013 23:05:23 +0000 (17:05 -0600)] 
Avoid annotation leaks by properly destroying NotePairs entries.

The leak was added with the "note" directive (r12414).

Also removed empty default constructor as unneeded.

12 years agoPolish: convert ACLFilledChecklist to CBDATA_CLASS2
Amos Jeffries [Fri, 17 May 2013 11:07:15 +0000 (05:07 -0600)] 
Polish: convert ACLFilledChecklist to CBDATA_CLASS2

12 years agoAdd missing piece omitted from rev.9677.
Silamael [Fri, 17 May 2013 08:36:45 +0000 (02:36 -0600)] 
Add missing piece omitted from rev.9677.

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

12 years agoSourceFormat Enforcement
Automatic source maintenance [Fri, 17 May 2013 00:13:27 +0000 (18:13 -0600)] 
SourceFormat Enforcement

12 years agoUse case-insensitive comparison for HTTP header names in *_header_access
Alex Rousskov [Thu, 16 May 2013 21:00:29 +0000 (15:00 -0600)] 
Use case-insensitive comparison for HTTP header names in *_header_access
and *_header_replace directives.

12 years agoBug 3744: squid terminated: FATAL: Bungled (null) line 3: sslproxy_cert_sign signTrus...
Christos Tsantilas [Thu, 16 May 2013 14:41:02 +0000 (17:41 +0300)] 
Bug 3744: squid terminated: FATAL: Bungled (null) line 3: sslproxy_cert_sign signTrusted all

This bug is a Makefile dependencies  problem.

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

This is a Measurement Factory project

12 years ago"LruMap bug fix and other polishing touches" patch: fix compile error
Christos Tsantilas [Thu, 16 May 2013 07:06:50 +0000 (10:06 +0300)] 
"LruMap bug fix and other polishing touches" patch: fix compile error

12 years agoRelease Notes: rebuild HTML notes for 3.4
Amos Jeffries [Thu, 16 May 2013 03:19:46 +0000 (21:19 -0600)] 
Release Notes: rebuild HTML notes for 3.4

12 years agoLruMap bug fix and other polishing touches
Christos Tsantilas [Wed, 15 May 2013 16:43:04 +0000 (19:43 +0300)] 
LruMap bug fix and other polishing touches

The  LruMap::findEntry may return destroyed entries to the caller.

12 years agoBug 3816: SSL_get_certificate call inside Ssl::verifySslCertificate crashes squid...
Christos Tsantilas [Wed, 15 May 2013 15:56:40 +0000 (18:56 +0300)] 
Bug 3816: SSL_get_certificate call inside Ssl::verifySslCertificate crashes squid, part3

Change the libraries order in LIBS variable inside SQUID_CHECK_OPENSSL_GETCERTIFICATE_WORKS check.
Looks that play a role in some cases (when openssl provided only as static
library in my tests).

12 years agoBug 3759: OpenSSL compilation error on stock Fedora17, RHEL, CentOS 6 systems
Christos Tsantilas [Wed, 15 May 2013 15:41:43 +0000 (18:41 +0300)] 
Bug 3759: OpenSSL compilation error on stock Fedora17, RHEL, CentOS 6 systems

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

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

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

This is a Measurement Factory project

12 years agoDrop terminal comments and garbage options from cache_peer lines
Amos Jeffries [Tue, 14 May 2013 18:36:45 +0000 (12:36 -0600)] 
Drop terminal comments and garbage options from cache_peer lines

12 years agoRelease Notes: update status of Squid-2 options
Amos Jeffries [Tue, 14 May 2013 17:54:30 +0000 (11:54 -0600)] 
Release Notes: update status of Squid-2 options

12 years agoPort from 2.6: external acl %ACL and %DATA tags
Henrik Nordstrom [Tue, 14 May 2013 17:53:18 +0000 (11:53 -0600)] 
Port from 2.6: external acl %ACL and %DATA tags

12 years agoBug 3816: SSL_get_certificate call inside Ssl::verifySslCertificate crashes squid...
Christos Tsantilas [Tue, 14 May 2013 17:15:02 +0000 (20:15 +0300)] 
Bug 3816: SSL_get_certificate call inside Ssl::verifySslCertificate crashes squid, part2

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

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

This is a Measurement Factory project

12 years agoLog an ERROR instead of halting on unknown cache_dir types
Amos Jeffries [Tue, 14 May 2013 15:31:15 +0000 (09:31 -0600)] 
Log an ERROR instead of halting on unknown cache_dir types

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

12 years agoRelease notes: Document spoof_client_ip
Amos Jeffries [Tue, 14 May 2013 02:03:07 +0000 (20:03 -0600)] 
Release notes: Document spoof_client_ip

12 years agoWindwos: MinGW supports stdc++11. Remove exclusion.
Amos Jeffries [Tue, 14 May 2013 01:58:51 +0000 (19:58 -0600)] 
Windwos: MinGW supports stdc++11. Remove exclusion.

12 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 14 May 2013 00:13:40 +0000 (18:13 -0600)] 
SourceFormat Enforcement

12 years agoWindows: MinGW supplies statfs
Amos Jeffries [Mon, 13 May 2013 16:36:33 +0000 (10:36 -0600)] 
Windows: MinGW supplies statfs

This fixes compile errors with shadowed definitions:

 error: 'int statfs(const char*, statfs*)'
 hides constructor for 'struct statfs' [-Werror=shadow]

12 years agoRemove origin_tries limiter on forwarding
Amos Jeffries [Mon, 13 May 2013 16:21:23 +0000 (10:21 -0600)] 
Remove origin_tries limiter on forwarding

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

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

12 years agoFix pointless comparison of unsigned integer with zero in rev.12805
Amos Jeffries [Mon, 13 May 2013 14:44:59 +0000 (08:44 -0600)] 
Fix pointless comparison of unsigned integer with zero in rev.12805

CommIoCbParams::size and local variable writtenSize are both size_t
which is unsigned and cannot be less than 0.

This produces compiler warnings/errors in ICC.

12 years agoFixed leaking configurable SSL error details.
Alex Rousskov [Mon, 13 May 2013 14:07:55 +0000 (08:07 -0600)] 
Fixed leaking configurable SSL error details.

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

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

12 years agoAdd spoof_client_ip access control
Steve Hill [Mon, 13 May 2013 03:57:03 +0000 (21:57 -0600)] 
Add spoof_client_ip access control

... to control whether TPROXY requests have their source IP address
spoofed by Squid.  The ACL defaults to allow (i.e. the current
behaviour), but using an ACL that results in a deny result will
disable spoofing for that request.

Example config to disable spoofing for all requests:
    spoof_client_ip deny all

Also, polish the TPROXY related flags:

1. The flags.spoofClientIp flag was a general "this is a TPROXY
   request" flag, which was a bit confusing given the name of the
   flag.  So the flags.spoofClientIp flag now only indicates
   whether we want to spoof the source IP or not.

2. The flags.interceptTproxy is added to flag whether the request
   was received on a "tproxy" port or not.

12 years agoFix memory error with Kerberos authentication
Markus Moeller [Sun, 12 May 2013 11:06:22 +0000 (05:06 -0600)] 
Fix memory error with Kerberos authentication

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

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

12 years agoRevert r12797
Amos Jeffries [Sun, 12 May 2013 05:04:14 +0000 (23:04 -0600)] 
Revert r12797

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

12 years agoBug 3389: Auto-reconnect for tcp access_log.
Nathan Hoad [Sat, 11 May 2013 20:59:44 +0000 (14:59 -0600)] 
Bug 3389: Auto-reconnect for tcp access_log.

Major changes:

1. Squid reconnects to TCP logger as needed. Squid keeps trying to connect
forever, using a hard-coded 0.5 second delay between attempts.

2. Squid buffers log records while there is no connectivity. The buffering
limit is configurable.

3. On buffer overflows, Squid worker either dies or starts dropping log
records. The choice is configurable.

4. The tcp logging module honors buffered_logs setting. Old code was flushing
each record.

5. Squid reports changes in logging state to cache.log. Except for every 100th
consecutive connection failures, routine connection retries are not reported
at level 1, to reduce noise level.

6. A new access_log configuration format/style has been added. It allows us to
easily add named options such as buffer-size or on-error. The same format can
be used to add module-specific options in the future, but doing so would
require changes to the high-level logging code. All old configuration
formats/styles are still supported.

7. squid.conf buffered_log option documentation now reflects reality. It used
to talk about cache.log but I do not think Squid uses that option for
cache.log maintenance.

Known minor side-effects of these changes:

i) All access_log logs can now be configured to bypass errors because the old
"fatal" flag is now configurable via log-specific on-error option in
squid.conf. The default is still "die". I have not checked whether modules
other than TCP logger honor that flag.

ii) All access_log logs now use 8*MAX_URL (64KB) instead of a 4*MAX_URL (32KB)
or smaller buffer size by default. The ICAP logger was using 2*MAX_URL buffer
size. The TCP logger was using 64KB buffer size before so no change for TCP. I
decided that it is better to raise the default buffering level for some logs
rather than decrease it for other logs, but it is not clear what the best
default is. The buffer size is now configurable via buffer-size so admins can
control it on individual log basis.

iii) Some access_log configuration styles overlap. To resolve ambiguities,
Squid may need to assume that the first logging ACL name (if any) does not
contain '=' and is not equal to an existing logformat name. It is possible to
use 'all' as the first ACL name if these heuristics cause problems.

TODO: We have attempted to solve more TCP logging problems, but it turns out
that correct solutions would require fixing higher-level logging code, not
specific to TCP logger or Bug 3389 scope. Those unsolved problems include:

A. During reconfiguration, all logs are closed and reopened, even if there
have been no changes to their configuration that necessitate such a drastic
action (or no changes at all!). For TCP logger, this means that the old
connection is used to flush remaining buffered records (if any), and the new
connection is used to log new records, possibly at the same time. Nathan wrote
clever code that keeps logging going using the same job/connection. However,
we had to yank that code out because it clashed with higher-level logging
state in subtle ways.

B. During shutdown, all connections are put in the closing state before logs
are told to flush remaining records. For TCP logger, this means that the
remaining buffered records (if any) are lost. The correct fix may require
rearranging shutdown sequence AND letting EventLoop run during shutdown (among
other things).

C. When logger connectivity is lost, Squid does not notice the problem until
the second TCP socket write (or later). This results in lost records. This is
due to TCP-level buffering. I suspect the only cure for this is adding
logger-to-Squid "I got your records" feedback, which requires changes in the
logging protocol (currently there is no logger-to-Squid communication at all).

12 years agoAvoid !closing assertions when helpers call comm_read [during reconfigure].
Alex Rousskov [Sat, 11 May 2013 15:23:59 +0000 (09:23 -0600)] 
Avoid !closing assertions when helpers call comm_read [during reconfigure].

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

12 years agoAvoid Comm::Connection leaks when helpers are reconfigured or otherwise closed.
Alex Rousskov [Sat, 11 May 2013 14:45:03 +0000 (08:45 -0600)] 
Avoid Comm::Connection leaks when helpers are reconfigured or otherwise closed.

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

12 years agoAllocate ClientInfo::hash.key using malloc() instead of new char[]
Alex Rousskov [Sat, 11 May 2013 00:16:48 +0000 (18:16 -0600)] 
Allocate ClientInfo::hash.key using malloc() instead of new char[]
because it is destroyed using free() instead of delete[].

Added ClientInfo construction/destruction debugging to find leaking objects.

12 years agoReplaced HttpReq entry (already covered by the guessing code) with HttpHeaderEntry...
Alex Rousskov [Fri, 10 May 2013 22:08:04 +0000 (16:08 -0600)] 
Replaced HttpReq entry (already covered by the guessing code) with HttpHeaderEntry entry.

12 years agoPolished [http::]>h and [http::]>ha descriptions to emphasize their pre-cache scope.
Alex Rousskov [Thu, 9 May 2013 15:25:02 +0000 (09:25 -0600)] 
Polished [http::]>h and [http::]>ha descriptions to emphasize their pre-cache scope.

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

12 years agoPolish client-side: make TcpAcceptor fill out EUI details
Amos Jeffries [Wed, 8 May 2013 03:02:01 +0000 (21:02 -0600)] 
Polish client-side: make TcpAcceptor fill out EUI details

The scope of TcpAcceptor is to receive new TCP connections and to fill
out the state data about the new connectino as much as possible.
EUI details about the client come under that state management.

This change makes EUI details available about https_port and FTP data
connections.

12 years agoBug 2179: debug_options ALL,1 3,9 83,9 has no effect
Gonzalo Arana [Wed, 8 May 2013 02:55:07 +0000 (20:55 -0600)] 
Bug 2179: debug_options ALL,1 3,9 83,9 has no effect

12 years agoPolish: show file path on Bungled lines
Amos Jeffries [Tue, 7 May 2013 08:35:57 +0000 (02:35 -0600)] 
Polish: show file path on Bungled lines

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

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

12 years agoBug 3780: cachemgr.cgi: output problem in HTTP Header Statistics
Amos Jeffries [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