]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
13 years agoDo not allow broken IpcIo-based cache_dir to be selected for swap out.
Alex Rousskov [Sun, 20 Jan 2013 17:31:50 +0000 (10:31 -0700)] 
Do not allow broken IpcIo-based cache_dir to be selected for swap out.

I/O code refuses to read or write when file error is set, but canRead()
and canWrite() ignored that fact, allowing broken files to be selected for
writing (at least). SwapDir::createStoreIO() would then return nil, leading
to missed swapout opportunities (if other cache_dirs could write) and wasted
CPU cycles.

13 years agoPolish: zero-initialize WCCPv2 security object
Amos Jeffries [Sun, 20 Jan 2013 04:37:30 +0000 (21:37 -0700)] 
Polish: zero-initialize WCCPv2 security object

Most of the objects fields are initialized later individually and the
rest SHOULD not matter. But it is better to be safe than sorry in this
area.

 Detected by Coverity Scan. Issue 740505.

13 years agoMem-cache entries exceeding one shared memory page in size, using
Alex Rousskov [Sun, 20 Jan 2013 02:07:24 +0000 (19:07 -0700)] 
Mem-cache entries exceeding one shared memory page in size, using
Ipc::StoreMap that now supports multi-slice entries. For the memory cache,
each slice corresponds to a shared memory page. Added a shared memory stack of
free slices. Many aspects of the implementation are similar to Rock Store.

Do not mem-cache entries that are already mem-cached at the time of keep()
call. This change is unrelated to multi-slice caching, but may provide a
noticeable performance boost.

13 years agosquidpurge: polish debug -d option handling
Amos Jeffries [Sun, 20 Jan 2013 02:01:16 +0000 (19:01 -0700)] 
squidpurge: polish debug -d option handling

Parsing of the -d option parameter was severaly broken with an inverted
NULL check resulting in segfaul whenever a level was supplied.

Also, add validation that out-of-range values cannot be supplied and
document in the help that this is a mask value, not just a number.

 Detected by Coverity Scan. Issue 740378.

13 years agoInitialize freeSlots before the map in case we decide to free something
Alex Rousskov [Sun, 20 Jan 2013 01:58:16 +0000 (18:58 -0700)] 
Initialize freeSlots before the map in case we decide to free something
during initialization (e.g., after reading something from the db file
in sync mode).

Removed allSlots as unused.

13 years agoPolished entry freeing.
Alex Rousskov [Sun, 20 Jan 2013 01:53:24 +0000 (18:53 -0700)] 
Polished entry freeing.

Clean Writeable entries in addition to Readables ones. Otherwise, there is no
way for the caller to completely get rid of a [large] entry the caller has
been writing! We hold the lock so this should be safe as long as slice.next
(and slice extras) are valid even in a half-baked Writeable entry.

Reset slice.next [before giving it to the caller]. As a consequence, we must
free individual slices even if cleaner is not set.

13 years agoUse signed type for StoreMapSliceId because we use -1 as an "unset" value.
Alex Rousskov [Sun, 20 Jan 2013 01:50:52 +0000 (18:50 -0700)] 
Use signed type for StoreMapSliceId because we use -1 as an "unset" value.

Initialize slice.next to be "unset". This should not be necessary in most
cases, but reduces the probability that a half-made writeable entry cannot be
freed properly because it contains an invalid slice.next value.

Losing the bit to store ID sign is not a big deal: Since slices always contain
non-trivial number of bytes for metadata, it is unlikely that all 32 (but less
than 33) bits would be required to store slice IDs in the future.

13 years agoBug 3567: Memory leak handling malformed requests
Amos Jeffries [Fri, 18 Jan 2013 05:57:22 +0000 (22:57 -0700)] 
Bug 3567: Memory leak handling malformed requests

13 years agoMade "make check" happier. Needs more work.
Alex Rousskov [Thu, 17 Jan 2013 04:27:30 +0000 (21:27 -0700)] 
Made "make check" happier. Needs more work.

13 years agoMoved StoreMapSlice declaration and ctor definition into StoreMap.h
Alex Rousskov [Thu, 17 Jan 2013 04:25:35 +0000 (21:25 -0700)] 
Moved StoreMapSlice declaration and ctor definition into StoreMap.h
as too small/trivial to warrant dedicated source files.

13 years agosquidpurge: Polish details of what filename is generated from
Amos Jeffries [Wed, 16 Jan 2013 11:49:51 +0000 (00:49 +1300)] 
squidpurge: Polish details of what filename is generated from

* change strlen(url) to strlen(ptrt) since the string under ptr is being
  added to filename, not the whole URL.

* also add a few extra magic bytes to make it clear that there is space
  for delimiters and termination bytes. These were previously hidden as
  extra bytes in the URL prefix length.

Should resolve Coverity Scan false positive issue 740414

13 years agosquidpurge: display friendly errors on missing command line options
Amos Jeffries [Wed, 16 Jan 2013 11:22:25 +0000 (00:22 +1300)] 
squidpurge: display friendly errors on missing command line options

Currently the tool will crash with a segmentation fault if any one of
several command switches which are expected to have a mandatory argument
are in fact followed by nothing.
 Detect these cases and display a message about what is missing.

 Detected by Coverity Scan. Issue 740378

13 years agoFix missing include in rev.12588
Amos Jeffries [Wed, 16 Jan 2013 10:35:54 +0000 (23:35 +1300)] 
Fix missing include in rev.12588

13 years agoFix ConnOpener IPv6 awareness
Amos Jeffries [Wed, 16 Jan 2013 07:30:47 +0000 (20:30 +1300)] 
Fix ConnOpener IPv6 awareness

When updating IPv6 support for split-stack one USE_IPV6 wrapper was
omitted conversion to the EnabledIpv6 stack auto-detect mechanism.
This resulted in IPv6 addresses being mis-converted on split-stack
systems or with IPv6 disabled in the kernel and --enable-ipv6 built.

The visible symptom is "assert(FALSE)" in Ip::Address::GetAddrInfo().

13 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 15 Jan 2013 01:13:22 +0000 (18:13 -0700)] 
SourceFormat Enforcement

13 years agoInitialize mem_node fully
Amos Jeffries [Tue, 15 Jan 2013 01:01:30 +0000 (18:01 -0700)] 
Initialize mem_node fully

Experience in squid-2.7 shows that with MemPools use of malloc instead
of calloc mem_node requires full initialization in order to get accurate
memory accounting.

Also closes Coverity Scan defect issue 740573.

13 years agoFix constructor order in rev.12582
Amos Jeffries [Mon, 14 Jan 2013 11:44:31 +0000 (04:44 -0700)] 
Fix constructor order in rev.12582

13 years agoPolish NULL detection in SNMP
Amos Jeffries [Mon, 14 Jan 2013 10:00:45 +0000 (03:00 -0700)] 
Polish NULL detection in SNMP

* Several places were ignoring the possibility that pointers may be NULL

  Detected by Coverity Scan. Issues 434107, 740455

13 years agoFix typo in rev.12582
Amos Jeffries [Mon, 14 Jan 2013 09:35:11 +0000 (02:35 -0700)] 
Fix typo in rev.12582

13 years agoPolish constructor initialization for StoreEntry
Amos Jeffries [Mon, 14 Jan 2013 06:55:34 +0000 (23:55 -0700)] 
Polish constructor initialization for StoreEntry

  Detected by Coverity Scan. Issues 740577, 740578

13 years agoMemPools: remove zero on allocate (calloc) from some pool types
Amos Jeffries [Mon, 14 Jan 2013 05:01:04 +0000 (22:01 -0700)] 
MemPools: remove zero on allocate (calloc) from some pool types

As we are closing defects identified by Coverity and improving
constructors everywhere we are creating a minor anti-pattern in
MemPool'ed objects with calloc() in the pool initializing the memory
then constructors re-initializing it in a better way for that object.

MemPools contains a doZeroOnPush flag to optimize performance by removing
use of memset() as chunks are added back into the pool. However, on
closer inspection it is clear that the following pop() process to re-use
those chunks is never performing memset() anyway. As such I believe that
there is no special need to use calloc() on these particular object types
in the first place.

Update MemPools to use malloc() instead of calloc() on all types with
doZeroOnPush set. This should increase performance a little, and allows
us to remove the anti-pattern by setting doZeroOnPush for more objects
as we can verify they are correctly initialized by their constructors.

13 years agoFix signed/unsigned error in rev.12573
Amos Jeffries [Sun, 13 Jan 2013 06:59:55 +0000 (19:59 +1300)] 
Fix signed/unsigned error in rev.12573

13 years agoSourceFormat Enforcement
Automatic source maintenance [Sun, 13 Jan 2013 01:13:10 +0000 (18:13 -0700)] 
SourceFormat Enforcement

13 years agoFix "address.GetPort() != 0" assertion for helpers on FreeBSD (at least).
Alex Rousskov [Sat, 12 Jan 2013 18:34:10 +0000 (11:34 -0700)] 
Fix "address.GetPort() != 0" assertion for helpers on FreeBSD (at least).

The order (or set of?) #include files used by src/ssl/helper.cc (and
probably by other helper source files) has changed recently, exposing a
defines.h dependency on sys/socket.h where that system header is
required to define AF_UNIX. With AF_UNIX incorrectly undefined,
IPC_STREAM was set to IPC_TCP_SOCKET instead of IPC_UNIX_STREAM, and
helpers that do not have a notion of a listening port, were trying to
create communication sockets using TCP streams, triggering a "must have
a port" assertion in comm_connect_addr() called from ipcCreate().

TODO: Moving IPC_* defines into an IPC-specific header file may be a
better solution then exposing all defines.h users to sys/socket.h.

13 years agoFix typo in rev.12573
Amos Jeffries [Sat, 12 Jan 2013 10:06:24 +0000 (03:06 -0700)] 
Fix typo in rev.12573

13 years agoBug 3736: Floating point exception due to divide by zero
Tianyin Xu [Sat, 12 Jan 2013 09:53:15 +0000 (02:53 -0700)] 
Bug 3736: Floating point exception due to divide by zero

13 years agoPolish debug messages on Path MTU discovery on client connections
Amos Jeffries [Fri, 11 Jan 2013 10:02:21 +0000 (03:02 -0700)] 
Polish debug messages on Path MTU discovery on client connections

* Display errors when PMTUd disable operation fails

* Correct debug message about PMTUd support being absent

 Detected by Coverity Scan. Issue 740319

13 years agoext_unix_group_acl: remove useless check for NULL
Amos Jeffries [Fri, 11 Jan 2013 06:31:01 +0000 (23:31 -0700)] 
ext_unix_group_acl: remove useless check for NULL

* the string in p is checked for NULL prior to being assigned to user
  there is no need to check it twice and doing so confuses Coverity.

 Detected by Coverity Scan. Issue 740451.

13 years agoWCCP: Fix memory leak in mask assignment, improve debuggsing.
Amos Jeffries [Fri, 11 Jan 2013 05:05:52 +0000 (22:05 -0700)] 
WCCP: Fix memory leak in mask assignment, improve debuggsing.

* Release temporary weight array allocated on each HERE_I_AM packet sent
  by Squid. For mask assignment these were not released properly and may
  build up to a significant size of memory over time.

* Add debug traces to send() events to report failures sending packets

* Also, on HERE_I_AM event send() failure, reduce the timeout to 2sec
  for the retry in a crude attempt to prevent router state flapping.

* Silence compiler warnings on use of connect() to disconnect a socket.
  Inconsistent OS behaviour makes the result useless in this case.

 Detected by Coverity Scan. Issues 740329, 740330, 740331, 740332,
    740333, 740441.

13 years agoPolish quick_abort feature decision code
Amos Jeffries [Fri, 11 Jan 2013 04:03:33 +0000 (21:03 -0700)] 
Polish quick_abort feature decision code

Also, fixes a defect identified by Coverity Scan issues 740376, 740456

13 years agoFix clang compile error in acl/Gadgets.h
Amos Jeffries [Thu, 10 Jan 2013 01:00:54 +0000 (14:00 +1300)] 
Fix clang compile error in acl/Gadgets.h

Since rev.12562 dlink_list is a class not a struct.

Detected by Squi dbuild farm FreeBSD 9.x node.

13 years agoFix memory leak in IP address unit test
Amos Jeffries [Wed, 9 Jan 2013 00:42:25 +0000 (17:42 -0700)] 
Fix memory leak in IP address unit test

Another failure to call FreeAddrInfo() after calling GetAddrInfo().

 Detected by Coverity Scan. Issue 740438.

13 years agoPrep for 3.1.23, 3.2.6, 3.3.0.3
Amos Jeffries [Wed, 9 Jan 2013 00:22:17 +0000 (17:22 -0700)] 
Prep for 3.1.23, 3.2.6, 3.3.0.3

13 years agoBug 3731: use 'int' on all systems settign TOS value.
Amos Jeffries [Tue, 8 Jan 2013 23:51:02 +0000 (16:51 -0700)] 
Bug 3731: use 'int' on all systems settign TOS value.

FreeBSD is confirmed erroring out on 8-bit variable size. Other BSD are
documented in a way that implies they do as well, although not at this
stage confirmed to be failing.
 Linux seems to be the only confirmed system workign with 8-bit size sent
to setsockopt(). So we revert this to 'int' (32-bit or 64-bit) as was
working in Squid 3.1.

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

13 years agoSynced with Ipc::StoreMap API changes. No functionality changes expected.
Alex Rousskov [Mon, 7 Jan 2013 19:44:59 +0000 (12:44 -0700)] 
Synced with Ipc::StoreMap API changes. No functionality changes expected.

13 years agoWorking Large Rock implementation, including concurrent store "rebuild"
Alex Rousskov [Mon, 7 Jan 2013 19:41:41 +0000 (12:41 -0700)] 
Working Large Rock implementation, including concurrent store "rebuild"
and a simple "scan" replacement policy.

Needs polishing and possibly a swap.state equivalent for faster rebuild.

13 years agoUse size_t instead of int32_t for blob sizes
Alex Rousskov [Mon, 7 Jan 2013 19:08:33 +0000 (12:08 -0700)] 
Use size_t instead of int32_t for blob sizes
because MemBlob only stores in-memory things and does not use negative sizes.

13 years agoAdded patterns for finding Ipc::StoreMap entries.
Alex Rousskov [Mon, 7 Jan 2013 19:06:53 +0000 (12:06 -0700)] 
Added patterns for finding Ipc::StoreMap entries.

13 years agoFixed job entering/leaving search patterns in job tracing scripts.
Alex Rousskov [Mon, 7 Jan 2013 19:06:25 +0000 (12:06 -0700)] 
Fixed job entering/leaving search patterns in job tracing scripts.

Same as trunk r12530.

13 years agoFixed job entering/leaving search patterns in job tracing scripts.
Alex Rousskov [Mon, 7 Jan 2013 19:04:30 +0000 (12:04 -0700)] 
Fixed job entering/leaving search patterns in job tracing scripts.

Same as trunk r12530.

13 years agoDo not reject size-less entries in storeRebuildParseEntry(). Deal with
Alex Rousskov [Mon, 7 Jan 2013 18:01:37 +0000 (11:01 -0700)] 
Do not reject size-less entries in storeRebuildParseEntry(). Deal with
entry size in the caller.

Some callers can handle entries that had unknown (at swapout start time) sizes.

Added rebuild debugging.

13 years agoAdjusted StoreIOState::write() API to allow callers detect write errors.
Alex Rousskov [Mon, 7 Jan 2013 17:54:27 +0000 (10:54 -0700)] 
Adjusted StoreIOState::write() API to allow callers detect write errors.

The errors are reported without these changes, but only via callbacks, some of
which may be asynchronous. Callers such as doPages() would keep calling
write() after the failure. It is probably best to quit early instead of
ignoring "post-error" state in StoreIOState::write().

Added StoreIOState::write() API description.

13 years agoSplit lock() into "just lock" and "update entry reference time" interfaces.
Alex Rousskov [Mon, 7 Jan 2013 17:18:10 +0000 (10:18 -0700)] 
Split lock() into "just lock" and "update entry reference time" interfaces.
Improved entry lock/unlock debugging.

Several modern store entry users need to lock the entry for storage rather
then to update entry's reference time. There is an old XXX describing the
corresponding API bug that merges the two distinct operations. This change
does not modify existing code, but allows new code to use new/fixed API
instead of changing an essentially private entry lock counter.

13 years agoDebug push and pop operations.
Alex Rousskov [Mon, 7 Jan 2013 17:16:17 +0000 (10:16 -0700)] 
Debug push and pop operations.

13 years agoProvide a safer version of a "is set" operator and
Alex Rousskov [Mon, 7 Jan 2013 17:14:28 +0000 (10:14 -0700)] 
Provide a safer version of a "is set" operator and
its explicitly named equivalent.

13 years agosquidpurge: ensure PURGE repsonse buffer is terminated
Amos Jeffries [Sat, 5 Jan 2013 08:14:46 +0000 (01:14 -0700)] 
squidpurge: ensure PURGE repsonse buffer is terminated

 Detected by Coverity Scan. Issue 965807.

Also, additional validation check for issue 740488

13 years agoBug 3676: Fix various shadowed variables
Amos Jeffries [Wed, 2 Jan 2013 23:40:49 +0000 (12:40 +1300)] 
Bug 3676: Fix various shadowed variables

Also, fixes logformat dumper to output 'logformat' instead of 'format'.
'format' directive is the planned future name but is not yet parsed.

 Detected by GCC 4.7 with -Wshadow

13 years agoFixed SMP cache manager request handling.
Alex Rousskov [Wed, 2 Jan 2013 18:57:34 +0000 (11:57 -0700)] 
Fixed SMP cache manager request handling.

Same as trunk r12564.

13 years agoFixed SMP cache mgr request handling.
Alex Rousskov [Wed, 2 Jan 2013 18:50:24 +0000 (11:50 -0700)] 
Fixed SMP cache mgr request handling.

Coordinator could not successfully parse any SMP cache manager request since
r12410 "Polish: Http::MethodType upgrade" because the parsing code assumed the
presence of the request method ID field that was no longer added by the
request packing code.

13 years agoBug 3676: fix shadowed variable in negotiate_wrapper
Amos Jeffries [Wed, 2 Jan 2013 11:09:45 +0000 (00:09 +1300)] 
Bug 3676: fix shadowed variable in negotiate_wrapper

Detected by GCC 4.7 with -Wshadow

13 years agoFix initialization of helper and doubly-linked list objects
Amos Jeffries [Wed, 2 Jan 2013 03:16:45 +0000 (20:16 -0700)] 
Fix initialization of helper and doubly-linked list objects

  Detected by Coverity Scan. Issue 740565.

13 years agolibacl: Fix various issues in ASN and random ACL types
Amos Jeffries [Wed, 2 Jan 2013 00:42:43 +0000 (17:42 -0700)] 
libacl: Fix various issues in ASN and random ACL types

* replace malloc+memset pattern with calloc in ASN ACL.
  Highlighted by Coverity Scan, issue 434128.

* Log the even where ACL random is configured with no parameters.

* Improve detecton of negative values in random ACL.
  Detected by Coverity Scan, issue 740486.

NOTE: coverity issues which brought these to view require additional
fixes.

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

13 years agoBug 3731: FreeBSD requires 32-bit TOS options
Amos Jeffries [Tue, 1 Jan 2013 03:55:32 +0000 (20:55 -0700)] 
Bug 3731: FreeBSD requires 32-bit TOS options

13 years agoFix memory leaks in ICMP
Amos Jeffries [Tue, 1 Jan 2013 03:20:47 +0000 (20:20 -0700)] 
Fix memory leaks in ICMP

InitAddrInfo() and GetAddrInfo() both allocate addrinfo structs which
must be freed by FreeAddrInfo(). Several places in ICMP were not doing
that free step.

 Detected by Coverity Scan. Issues 740434, 740435, 740436, 740437.

13 years agocbdataUnlock may deallocate cbdata as well.
Alex Rousskov [Mon, 31 Dec 2012 19:48:11 +0000 (12:48 -0700)] 
cbdataUnlock may deallocate cbdata as well.

13 years agoCompleted initializer for constructors of Adaptation::Config and AsyncJob
Francesco Chemolli [Mon, 31 Dec 2012 10:52:17 +0000 (11:52 +0100)] 
Completed initializer for constructors of Adaptation::Config and AsyncJob

13 years agosquidpurge: fix META TLV parsing issues
Amos Jeffries [Mon, 31 Dec 2012 07:42:32 +0000 (20:42 +1300)] 
squidpurge: fix META TLV parsing issues

* current Squid may stoe objects with up to 64KB URLs and 64KB headers
  in the disk cache. Increas the tool buffer to 128KB to prevent
  truncating the loaded meta data.

* check for and report when meta data overruns the end of loaded buffer
  content. Ignore the truncated TLV entry and produce a WARNING.

* validate the TLV size field loaded from disk to prevent buffer overrun
  errors from corrupted files on disk.

 Detected by Coverity Scan. Issues 740381, 740488.

13 years agoSourceFormat Enforcement
Automatic source maintenance [Mon, 31 Dec 2012 01:13:06 +0000 (18:13 -0700)] 
SourceFormat Enforcement

13 years agoCompletd and fixed some class constructors, removed redundant htcpReplyData class.
Francesco Chemolli [Sun, 30 Dec 2012 12:53:01 +0000 (13:53 +0100)] 
Completd and fixed some class constructors, removed redundant htcpReplyData class.

Address several Coverity issues dealing with noninitialized data members.

13 years agoBug 3729: 32-bit overflow in parsing 64-bit configuration values
Tianyin Xu [Sat, 29 Dec 2012 02:52:50 +0000 (19:52 -0700)] 
Bug 3729: 32-bit overflow in parsing 64-bit configuration values

13 years agoTypo in rev.12550
Amos Jeffries [Sat, 29 Dec 2012 02:49:04 +0000 (19:49 -0700)] 
Typo in rev.12550

13 years agoFix various Disk I/O issues in all modules
Tomas Hozza [Sat, 29 Dec 2012 02:40:12 +0000 (19:40 -0700)] 
Fix various Disk I/O issues in all modules

* Uninitialized class members.

* Handle NULL potential after several dynamic_cast.

* Better error result handling from several system functions
  lseek(), fcntl() can report errors which need handling.

* diskd explicit NULL dereference on broken input.
  Extremely unlikely, but worth protecting against.

 Detected by Coverity Scan. Issues 740510, 740358, 740359,
  740511, 740317, 740360, 740513, 740318, 740514

13 years agoFix some issues revealed by Coverty Scan, improve documentation of parseHttpRequest
Francesco Chemolli [Fri, 28 Dec 2012 15:23:21 +0000 (16:23 +0100)] 
Fix some issues revealed by Coverty Scan, improve documentation of parseHttpRequest

Address issues for the defect classes:
- Array compared against 0
- Copy into fixed size buffer
- Dereference after null check
- Dereference before null check

13 years agoSourceFormat Enforcement
Automatic source maintenance [Fri, 28 Dec 2012 01:13:14 +0000 (18:13 -0700)] 
SourceFormat Enforcement

13 years agoFix error in configuration parser which would misassigne the sslcrlfile directive.
Francesco Chemolli [Thu, 27 Dec 2012 18:15:38 +0000 (19:15 +0100)] 
Fix error in configuration parser which would misassigne the sslcrlfile directive.
Fix potentially crashing flaw in CPU affinity map display code.

Detected by Coverity Scan, defects 740336 and 740337.

13 years agoRemoved useless checks for guaranteed-defined pointers.
Francesco Chemolli [Thu, 27 Dec 2012 17:58:29 +0000 (18:58 +0100)] 
Removed useless checks for guaranteed-defined pointers.

Detected by Coverity Scan. Defects 740936 and 740937.

13 years agoPlugged memory leaks in digest authentication module.
Francesco Chemolli [Thu, 27 Dec 2012 17:23:08 +0000 (18:23 +0100)] 
Plugged memory leaks in digest authentication module.

Detected by Coverity Scan. Issue 740431.

13 years agoFix various issues in unit tests
Amos Jeffries [Thu, 27 Dec 2012 10:17:04 +0000 (03:17 -0700)] 
Fix various issues in unit tests

* Define MemObject stub constructor to initialize teh stub object properly
  apparently store unit tests needs one defined. Best to make it work and
  set base values than leave garbage in the object fields.

* Buffer overrun on config parser if test is ever given a too-long
  string input.

* Memory leak in HttpRequest testing. One instance of a short array.

* Range: header testing may thor exceptions which were not caught by the
  test binary. Could lead to difficulty debugging exception errors.

 Detected by Coverity Scan. Issues 740523, 740482, 740440, 740498

13 years agoFix build error on FreeBSD in kqueue
Amos Jeffries [Thu, 27 Dec 2012 06:21:06 +0000 (19:21 +1300)] 
Fix build error on FreeBSD in kqueue

13 years agoBug 3728: Improve debug for cache_dir
Tianyin Xu [Thu, 27 Dec 2012 02:26:28 +0000 (19:26 -0700)] 
Bug 3728: Improve debug for cache_dir

13 years agokqueue: update status from experimental to fully available net I/O method
Amos Jeffries [Thu, 27 Dec 2012 01:42:48 +0000 (14:42 +1300)] 
kqueue: update status from experimental to fully available net I/O method

kqueue has been in use on FreeBSD and maybe others for some time now and
has less bugs than epoll. So the issues on record should not be held
against it.

The attached patch adds auto-detection for the kqueue dependencies and
enables it by default when it can build. Unfortunately due to the
dependencies we cannot add it to maximus layer for force-enable, but the
default layer will test it on FreeBSD at least. It is still less
preferred than epoll(), but more than select() and poll().

13 years agoImport fixes for defects in client_side_reply, client_side_request, esi
Thomas Hozza [Wed, 26 Dec 2012 14:03:11 +0000 (15:03 +0100)] 
Import fixes for defects in client_side_reply, client_side_request, esi
and ufsswapdir from Red Hat's patchset.

13 years agoImport fixes for some defects found by Coverity Scan from Red Hat's patchset.
Thomas Hozza [Tue, 25 Dec 2012 19:43:38 +0000 (20:43 +0100)] 
Import fixes for some defects found by Coverity Scan from Red Hat's patchset.

13 years agoRemoved useless check in store_swapout.cc
Francesco Chemolli [Mon, 24 Dec 2012 13:39:37 +0000 (14:39 +0100)] 
Removed useless check in store_swapout.cc

Detected by Coverity Scan; fix by  Tomas Hozza.

13 years agoMake sure copied strings are properly terminated in snmplib and wccp2.
Francesco Chemolli [Sun, 23 Dec 2012 18:43:09 +0000 (19:43 +0100)] 
Make sure copied strings are properly terminated in snmplib and wccp2.

Detected by Coverity Scan; fix by  Tomas Hozza.

13 years agoRemoved useless variable assignment in acl/Asn.cc
Francesco Chemolli [Sat, 22 Dec 2012 17:58:56 +0000 (18:58 +0100)] 
Removed useless variable assignment in acl/Asn.cc

Detected by Coverity Scan. Issue 740592.

13 years agoRmoved useless variable in auth_digest.cc.
Francesco Chemolli [Sat, 22 Dec 2012 13:58:20 +0000 (14:58 +0100)] 
Rmoved useless variable in auth_digest.cc.

  Detected by Coverity Scan, issue 740594.

13 years agoRmoved useless variable in peer_digest.cc.
Francesco Chemolli [Sat, 22 Dec 2012 13:25:50 +0000 (14:25 +0100)] 
Rmoved useless variable in peer_digest.cc.

Detected by Coverity Scan, issue 740596

13 years agoFix end-of-reply handling in helperHandleRead.
Francesco Chemolli [Fri, 21 Dec 2012 09:27:17 +0000 (10:27 +0100)] 
Fix end-of-reply handling in helperHandleRead.

Detected by Coverity Scan. Issue 747703.

13 years agoFix wrong string length in testHttpReply.
Francesco Chemolli [Fri, 21 Dec 2012 09:24:24 +0000 (10:24 +0100)] 
Fix wrong string length in testHttpReply.

Detected by Coverity Scan. Issue 740413

13 years agoBug 3727: kerberos_ldap_group: explicitly assigning a variable to itself
Tianyin Xu [Fri, 21 Dec 2012 06:53:55 +0000 (19:53 +1300)] 
Bug 3727: kerberos_ldap_group: explicitly assigning a variable to itself

 Detected by LLVM compiler.

13 years agoPrevent Rock Store map entries being locked for reading forever.
Alex Rousskov [Thu, 20 Dec 2012 04:48:13 +0000 (21:48 -0700)] 
Prevent Rock Store map entries being locked for reading forever.

The map entries were locked to serve a hit but the client side carelessly
discarded the attached StoreEntry object when the hit had to be ignored.
Discarded StoreEntry object was left idle because it was never [un]locked.

13 years agoFixed job entering/leaving search patterns in job tracing scripts
Alex Rousskov [Thu, 20 Dec 2012 04:33:39 +0000 (21:33 -0700)] 
Fixed job entering/leaving search patterns in job tracing scripts
broken by r12436 "Modify debugs() to automatically include HERE"

13 years agoFix typos in AccessLogEntry
Amos Jeffries [Mon, 17 Dec 2012 02:19:47 +0000 (15:19 +1300)] 
Fix typos in AccessLogEntry

Some of these were added by rev.12527 patch.

Clash between USE_ICAP_CLIENT and USE_ADAPTATION uncovered while testing
the fix for the those issues. Breaks build for eCAP without ICAP.

13 years agoSourceFormat Enforcement
Automatic source maintenance [Mon, 17 Dec 2012 01:13:14 +0000 (18:13 -0700)] 
SourceFormat Enforcement

13 years agoFix uninitialized fields in IcapLogEntry
Tomas Hozza [Sun, 16 Dec 2012 06:30:55 +0000 (19:30 +1300)] 
Fix uninitialized fields in IcapLogEntry

 Detected by Coverity Scan. Issue 740507

13 years agoFix various issues in snmplib
Tomas Hozza [Sat, 15 Dec 2012 12:18:50 +0000 (01:18 +1300)] 
Fix various issues in snmplib

* Memory leaks in OID management

* NULL pointer dereference on OID tree creation

* Ensure buffer terminations on OID data copy

* Better file handle management

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

13 years agoFix various issues in smblib
Tomas Hozza [Sat, 15 Dec 2012 04:30:03 +0000 (17:30 +1300)] 
Fix various issues in smblib

* Crash on NTLM handshakes without domain.

* Memory leak on several internal DC connection failures

* Potential buffer overruns on specially crafted tokens

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

13 years agoSourceFormat Enforcement
Automatic source maintenance [Sat, 15 Dec 2012 01:13:21 +0000 (18:13 -0700)] 
SourceFormat Enforcement

13 years agoPolished helper messages debugging slightly.
Alex Rousskov [Fri, 14 Dec 2012 16:10:05 +0000 (09:10 -0700)] 
Polished helper messages debugging slightly.

Made stateful and stateless debugging a little bit more similar/symmetric.
Debug helperStatefulSubmit message contents length.
Debug accumulated helperStatefulHandleRead buffer.
Polished helperHandleRead buffer debugging.

13 years agoAdded Raw, an std::ostream manipulator to print possibly non-terminated buffers
Alex Rousskov [Fri, 14 Dec 2012 16:07:18 +0000 (09:07 -0700)] 
Added Raw, an std::ostream manipulator to print possibly non-terminated buffers
and their labels/sizes.

The Raw manipulator tries to be smart about printing buffers at various
debugging levels: Large buffers are only printed at DBG_DATA by default.
This allows the caller to mix higher-level debug messages with dumping
of potentially large volumes of data. This smartness can be overruled
using an explicit minLevel() method call.

13 years agocert validation cache: fix to build on amd64-CentOS-5.3
Christos Tsantilas [Fri, 14 Dec 2012 13:34:13 +0000 (15:34 +0200)] 
cert validation cache: fix to build on amd64-CentOS-5.3

13 years agocert validation cache: Fixes to LruMap template class to build on amd64-CentOS-5.3
Christos Tsantilas [Fri, 14 Dec 2012 11:11:16 +0000 (13:11 +0200)] 
cert validation cache: Fixes to LruMap template class to build on amd64-CentOS-5.3

13 years agocert validation cache: Fixes to LruMap template class to build on amd64-CentOS-5.3
Christos Tsantilas [Fri, 14 Dec 2012 09:46:42 +0000 (11:46 +0200)] 
cert validation cache: Fixes to LruMap template class to build on amd64-CentOS-5.3

13 years agocert validation cache: Add missing include file to avoid building errors on amd64...
Christos Tsantilas [Fri, 14 Dec 2012 08:25:59 +0000 (10:25 +0200)] 
cert validation cache: Add missing include file to avoid building errors on amd64-CentOs-icc and amd64-ubuntu-precise platforms

13 years agoext_kerberos_ldap_group_acl: Fix various bugs in rev.12512
Amos Jeffries [Fri, 14 Dec 2012 05:52:56 +0000 (22:52 -0700)] 
ext_kerberos_ldap_group_acl: Fix various bugs in rev.12512

Two issues added by patch hunk mis-alignment in rev.12512.
and correct patch for issue 740423.

 Detected by Coverity Scan. Issues 751097, 740423, 751096

13 years agoSourceFormat Enforcement
Automatic source maintenance [Fri, 14 Dec 2012 01:13:32 +0000 (18:13 -0700)] 
SourceFormat Enforcement

13 years agocert validation cache
Christos Tsantilas [Thu, 13 Dec 2012 22:31:55 +0000 (00:31 +0200)] 
cert validation cache

This patch add cache to cert validation helper. The following new options
added to "sslcrtvalidator_program" configuration parameter to control cache
behaviour:
   ttl=n         TTL in seconds for cached results.The default is 60 secs
   cache=n       limit the result cache size. The default value is 2048

To implement the cert validation cache a new template class investigated,
the LruMap which implements a simple lru cache.

The LruMap templete class also used to replace the old Ssl::LocalContextStorage
class which implements a SSL contexts cache.

This is a Measurement Factory project