Amos Jeffries [Tue, 10 Mar 2009 14:29:30 +0000 (03:29 +1300)]
Bug 2559: Problem parsing /0 and /0.0.0.0
netmask strikes again.
Squid was parsing /0 on an IPv4 as mask /0.0.0.0 before v4-mapping the
mask to /96 IPv6. Which is invalid CIDR size for IPv4 and maps back as
0.0.0.0/32 there during ACL matching.
This affects any input of /0 and equivalents but in a fail-closed way.
Force /0 to the magic noaddr mask regardless of the protocol.
Also adds a lot of level-9 debugs for tracing other issues in IP ACL parse
Amos Jeffries [Tue, 10 Mar 2009 12:36:54 +0000 (01:36 +1300)]
Bug 2404: WCCP in mask mode is broken
Also autodoc and cleanup some WCCPv2 structures.
This patch:
- adds a reference to each struct mentioning the exact draft
RFC section where that struct is defined.
- fixes sent mask structure fields to match draft. (bug 2404)
- removes two duplicate useless structs
Alex Rousskov [Sun, 8 Mar 2009 21:57:12 +0000 (15:57 -0600)]
Synced #includes after moving files around.
Use newly added ACLFilledChecklist for fast ACL checks. Its constructor locks
request and accessList, simplifying the caller code.
Use newly added ACLFilledChecklist for state-specific ACL code. Also, the
ACLChecklist::authenticated() method is now an AuthenticateAcl global
function. See ACLFilledChecklist addition log for rationale.
Alex Rousskov [Sun, 8 Mar 2009 21:53:27 +0000 (15:53 -0600)]
Synced #includes after moving files around.
Use newly added ACLFilledChecklist for fast ACL checks. Its constructor locks
request and accessList, simplifying the caller code.
Use newly added ACLFilledChecklist for state-specific ACL code. Also, the
ACLChecklist::authenticated() method is now an AuthenticateAcl global
function. See ACLFilledChecklist addition log for rationale.
Alex Rousskov [Sun, 8 Mar 2009 21:37:32 +0000 (15:37 -0600)]
Removed some 140 SOURCEs of ufsdump, adding a few stubs. The program seems to
work on simple ufs cache files.
urlCanonical is currently an always-asserting stub. I am not sure what pulls
in urlCanonical. I know storeKeyPublicByRequest* require it, but I am not sure
which source requires storeKeyPublicByRequest. If the stub assertion fails on
some cache files, we will need to pull more sources or re-implement
urlCanonical.
The more sources are moved into libraries, the more difficult it may be to
write isolated, compact test cases or tools because test case stubs and
customizations may start to conflict with names defined in the libraries and
because pulling in a whole library might require defining more stubs. It is
not clear yet how real this concern is in general, but a lot of acl/
SourceLayout time was spent on making ufsdump build...
Alex Rousskov [Sun, 8 Mar 2009 21:29:22 +0000 (15:29 -0600)]
Split auth/libauth into two libraries:
- auth/libauth containing core authentication code (used, in part,
by the acl/libstate library) and not using acl/ libraries; and
- auth/libacls containing authentication-related ACL code (used to build
executables) and using acl/libstate.
The split was necessary to prevent circular dependencies among acl/ and auth/
libraries.
Added conditionally built libraries to libauth, eliminating the need for
AUTH_LIBS_TO_ADD. Use libtool to build those libraries.
Alex Rousskov [Sun, 8 Mar 2009 21:19:10 +0000 (15:19 -0600)]
Moved src/ACL* and a few related files into src/acl/.
Renamed ACL source files from ACLFoo.{cc,cci,h} to Foo.{cc,cci,h}.
Many targets in src/Makefile.am depended on selected ACL ACL*cc and related
sources. These targets depend on acl/* libraries now. As a part of this
cleanup and reorganization, the number of ufsdump sources went from about 160
to about 20.
Alex Rousskov [Sun, 8 Mar 2009 19:45:44 +0000 (13:45 -0600)]
Split ACL.{cc,h} and src/acl_noncore.cc into acl/Acl and acl/Gadgets, moving
high-level global functions into Gadgets and leaving basic API types in Acl.
Moved horrific acl_access::containsPURGE into aclPurgeMethodInUse to avoid
exposing basic ACL API to "strategy" templates and HTTP-specific PURGE method.
The aclPurgeMethodInUse global lives in acl/libacls, which is a top-level
library that already contains a lot of data-specific code.
Alex Rousskov [Sun, 8 Mar 2009 19:41:27 +0000 (13:41 -0600)]
Extracted transaction state storage and related checks from ACLChecklist into
ACLFilledChecklist. Context: SourceLayout: acl/, take 1
ACLChecklist contained many data members representing the state of the current
transaction (in a broad sense). These members and related methods depended
on complex types such as HttpRequest and ConnStateData. Any Squid code using
ACLChecklist (and there is a lot of that code) was, hence, dependent on these
types. These dependencies caused, among other things, huge SOURCES lists in
src/Makefile.am, often for trivial targets such as ufsdump and test cases.
ACLChecklist is an abstract class now (to make sure we do not accidentally
create it). ACLChecklist has only one kid: ACLFilledChecklist. The Filled()
global function can be used to cast ACLChecklist* to ACLFilledChecklist*.
Since all ACLChecklist objects have to be ACLFilledChecklist objects, the cast
is fast and safe. The cast allows us to avoid bloating ACLChecklist with
virtual methods that only make sense in ACLFilledChecklist context.
ACLFilledChecklist now contains state-specific members while ACLChecklist
contains basic check list logic. The code that organizes or passes through
ACL checks does not need to be exposed to ACLFilledChecklist and the data
types it depends on.
Furthermore, ACLFilledChecklist should not contain complicated checks either.
It should focus on maintaining the state. The checks should go into specific
ACLs. Otherwise, complex checks cause dependency cycles with higher-level
libraries that provide code for those checks and yet depend on having access
to ACLFilledChecklist to implement specific ACLs. Currently, only the
authenticated() method got moved to auth/Acl.{cc,h} to break the circular
dependency between acl/libs and auth/libs. More work in that direction will
probably be required as we move more src/* code into libraries.
ACLFilledChecklist constructor replaces aclChecklistCreate global. This
simplifies the initiating code of all fast ACL checks: the checks no longer
need to do manual state locking, duplicating aclChecklistCreate code.
Alex Rousskov [Sun, 8 Mar 2009 19:38:12 +0000 (13:38 -0600)]
Removed AUTH_LIBS_TO_ADD as unused. auth/libauth.la now includes conditionally
built auth libraries and src/Makefile.am no longer needs to know about them.
Alex Rousskov [Sun, 8 Mar 2009 19:34:36 +0000 (13:34 -0600)]
Moved src/ACL* and a few related files into src/acl/.
Renamed ACL source files from ACLFoo.{cc,cci,h} to Foo.{cc,cci,h}.
Many targets in src/Makefile.am depended on selected ACL ACL*cc and related
sources. These targets depend on acl/* libraries now. As a part of this
cleanup and reorganization, the number of ufsdump sources went from about 160
to about 20.
Alex Rousskov [Sun, 8 Mar 2009 18:41:06 +0000 (12:41 -0600)]
Fixed subdir handling when USE_LOADABLE_MODULES is false. DIST_SUBDIRS was
defined incorrectly. Moreover, we do not need to define DIST_SUBDIRS because
the default works:
"If `SUBDIRS' is defined conditionally using Automake conditionals,
Automake will define `DIST_SUBDIRS' automatically from the possibles
values of `SUBDIRS' in all conditions."
The bug was exposed by ./test-builds.sh layer-01-minimal with "make distcheck"
test added.
Amos Jeffries [Sun, 8 Mar 2009 10:57:37 +0000 (23:57 +1300)]
Bug 2613: test-builds.sh does not test what it claims to test
* Add report from worker level of testbed to show test being run
* Alter test config path on case where ../ is added to tester location
* rename dist variable to correct config (its the config file path)
* remove some no longer relevant bashism
Amos Jeffries [Fri, 6 Mar 2009 07:36:36 +0000 (20:36 +1300)]
Author: Francesco Chemolli <kinkie@squid-cache.org>
Bug 2608: Build broken by Linux basename() implementation.
This patch implements a replacement for the call to basename() in
debugs().
It involves a hard-coded relative test location for debugs.cc used as an
anchor within the __FILE__ path. This relative path MUST be updated
whenever debugs.cc is moved.
debugs() is no longer valid to be used within auto-generated files which
may retain a completely different relative base path.
Amos Jeffries [Tue, 3 Mar 2009 13:02:21 +0000 (02:02 +1300)]
Experimental Solaris 10 pthreads Support
Why is it going in since its experimental?
- we need a snapshot to test the configure code with.
- side testing indicates this new option is best and does work under
some conditions with only Solaris native compiler to build with.
Amos Jeffries [Sat, 28 Feb 2009 13:38:11 +0000 (02:38 +1300)]
TestBed: Alter translation to work in more make targets
This makes translation work in distcheck, uninstallcheck, and installcheck
out-of-tree testing. Not just dist, all, and check.
Also adds some clean failure for out-of-tree 'make all' translations.
Automake seems to not have enough correct path info to perform translation
when its run inside distcheck target.
Re-add distcheck to Testbed requirements.
TODO: verify through build slaves that its portable.
Alex Rousskov [Fri, 27 Feb 2009 15:45:17 +0000 (08:45 -0700)]
SourceLayout: src/auth, take 0: Moved src/AuthFoo* to src/auth/Foo*, polished.
SourceLayout: src/fs, take 0: Polished Makefiles.
These fixes should have no runtime effects and were triggered by an attempt to
make "make distclean" work. TODO: add Auth and Fs namespaces, rename classes.
Alex Rousskov [Fri, 27 Feb 2009 04:58:29 +0000 (21:58 -0700)]
Add a dummy file called testHeaders to CLEANFILES.
It is created by testheaders.sh and distclean does not know about it.
The change can be reversed when testheaders.sh and its users are fixed.
Amos Jeffries [Thu, 26 Feb 2009 03:58:09 +0000 (16:58 +1300)]
TestBed: correct log handling.
Removal of the log MUST happen after the log has been checked for a
successful run. Removal of run data MAY hapen before this.
Probably data SHOULD be removed early to prevent excess data between runs.
Alex Rousskov [Wed, 25 Feb 2009 20:35:16 +0000 (13:35 -0700)]
SourceLayout: src/fs, take 0
Simplified and documented STORE_* autotools variables.
All fs code is built as fs/lib*.a libraries now, no exception for
diskd and aufs "fake" legacy modules.
fs/* sources are no longer added to executables directly.
TODO: Add Makefiles to specific fs modules.
TODO: Add Fs namespace and rename fs classes accordingly.
testHeaders in fs/Makefile.am requires absolute source directories for
out-of-tree checks to work.
Removed src/ip/stubQosConfig.cc from STORE_TEST_SOURCES. It does not seem to
be needed in my tests. If it is needed, the stub file should be moved into
src/tests to avoid dependency on a source in a directory with a Makefile. If
the stub is not needed at all, it should be removed from the tree. Note that
src/ip/stubQosConfig.cc is non-empty only when --enable-zph-qos.
These changes were triggered by an attempt to make "make distclean" work.
Amos Jeffries [Mon, 23 Feb 2009 11:05:52 +0000 (00:05 +1300)]
Author: frencesco chemolli <kinkie@squid-cache.org>
testBed: add parallel make capability to build testing
This small patch to the test-suite system allows for parallel-make in
the test-suite (only on Linux). This will allow for shorter build-test
times on multicpu/multicore systems.
Amos Jeffries [Mon, 23 Feb 2009 09:41:36 +0000 (22:41 +1300)]
Author: Mark Nottingham <mnot@pobox.com>
Bug 2599: Idempotent start
As discussed on squid-dev, Squid shouldn't return a shell error when:
- starting squid, if it's already running
- stopping squid, if it isn't running
This is to make writing scripts that control squid easier.
Note that it should still notify the user, and should not affect other
operations (e.g., kill, rotate, parse).
Alex Rousskov [Fri, 20 Feb 2009 18:48:56 +0000 (11:48 -0700)]
Added CBDATA_NAMESPACED_CLASS_INIT to define static members of classes that
live in a namespace.
The alternative was to change CBDATA_CLASS_* macros so that the static member
name does not depend on the type. That may have been better, but perhaps there
are some, unknown to me, low-level reasons why unique member names are
required for class cbdata code to work.