1
0
mirror of https://github.com/squid-cache/squid.git synced 2025-04-18 22:04:07 +03:00

20027 Commits

Author SHA1 Message Date
Francesco Chemolli
fefaea1e39 Bug 5489: Fix "make check" linking on Solaris (#2049)
Change link order of libcomm and libip to fix missing symbols at link
time on Solaris:

    libtool: link: /usr/gcc/14/bin/g++ ... -o tests/testCacheManager
    _ZN2Ip11InterceptorE ... libcomm.a
    _ZN2Ip9Intercept9LookupNatERKN4Comm10ConnectionE ... libcomm.a
    ld: fatal: symbol referencing errors
2025-04-14 08:18:18 +00:00
Francesco Chemolli
be644428ba CI: update FreeBSD version (#2051)
The FreeBSD project has promoted version 14.2 to stable.
Some packages we use are not compatible with version 14.1.
Upgrade the reference version we use, the action supports it
2025-04-13 21:35:46 +00:00
Francesco Chemolli
84bb09abbd MinGW: Fix aiops_win32.cc (#2030)
Fixed missing includes, type mismatches in some
local variables, applied some AAA;
extracted WIN32_maperror
into own header and implementation files using NoMoreGlobals,
and used modern c++ data types for it.

This change also mirrors changes introduced in aiops.cc by commit
91d1cfb. These changes require further refinement (in both files).

Examples of errors fixed:
```
aiops_win32.cc: In function
    'void* squidaio_xmalloc(int)':
aiops_win32.cc:161:17: error:
    invalid use of incomplete type 'class Mem::Allocator'

aiops_win32.cc: In function 'void squidaio_init()':
aiops_win32.cc:278:19: error:
    comparison of integer expressions of different signedness:
    'int' and 'size_t' {aka 'long long unsigned int'}

aiops_win32.cc: In function
    'void squidaio_do_read(squidaio_request_t*)':
aiops_win32.cc:782:9: error:
    'WIN32_maperror' was not declared in this scope
```
2025-03-30 08:53:34 +00:00
Amos Jeffries
c807ccfd49 Remove unused scHeaderStats global (#2039) 2025-03-28 17:49:26 +00:00
Amos Jeffries
dbd76bc89e Remove unused ccHeaderStats global (#2038) 2025-03-28 16:24:20 +00:00
Francesco Chemolli
13dbfb1322 Remove NEWSOS detection and code (#2035)
Sony Network Engineering Workstation was discontinued in 1998.
2025-03-26 02:40:14 +00:00
Francesco Chemolli
25a99dc6ea MingGW: implement compat/pipe.h (#2029)
The pipe(2) function is not available on Windows and mingw,
in favour of a broader _pipe() call.

Fixes the following build error:

    DiskThreads/CommIO.cc:
        In static member function 'static void CommIO::Initialize()':
    DiskThreads/CommIO.cc:26:9: error:
        'pipe' was not declared in this scope; did you mean '_pipe'?
2025-03-25 15:23:36 +00:00
Eduard Bagdasaryan
4d8e3b83ca Remove ConnStateData::pinning.peer (#2034)
Use ConnStateData::pinning.serverConnection.getPeer() instead of
copying: pinning.peer does not need to outlive pinning.serverConnection.
2025-03-23 14:00:15 +00:00
Francesco Chemolli
25a59ca1b6 ntlm_sspi_auth: Fix missing base64 symbol linkage (#2031)
Solve build error:

```
ld: ntlm_sspi_auth.o: in function `token_decode':
    undefined reference to `nettle_base64_decode_init'
    undefined reference to `nettle_base64_decode_update'
    undefined reference to `nettle_base64_decode_final'
```
2025-03-22 22:36:48 +00:00
Eduard Bagdasaryan
16b17ba916 Remove HttpRequest::peer_host (#2032)
HttpRequest::peer_host was added in 2009 commit 9ca29d23 so that
httpFixupAuthentication() could pass copied raw CachePeer::host pointer
value to peer_proxy_negotiate_auth(). Unfortunately, raw peer_host
pointer (to CachePeer::host memory) becomes dangling when CachePeer is
reconfigured away. Instead of maintaining this problematic field, we can
safely obtain the same CachePeer::host value from HttpStateData::_peer.
2025-03-22 19:46:06 +00:00
Eduard Bagdasaryan
a6b9c45235 Do not reuse an idle connection to a removed cache_peer (#2028)
Sending new requests to a removed cache_peer contradicts current Squid
configuration and even exposes Squid code that forgets to check
CachePeer validity to dangling pointers. We will address the latter
concern separately.
2025-03-20 15:00:37 +00:00
Francesco Chemolli
4090fe8b4c MingGW: do not build ext_edirectory_userip_acl (#2017)
ext_edirectory_userip_acl uses API that are too
different from what is provided by windlap.h, do not build it
2025-03-16 23:25:49 +00:00
Eduard Bagdasaryan
8a13e36b98 CI: Enable eCAP and Valgrind in layer build tests if possible (#1996)
Now these optional features are enabled during applicable layer tests if
their packages appear to be available on the build system. This should
help prevent regressions like the one fixed in recent commit 53ed1a9.
2025-03-16 22:03:26 +00:00
Francesco Chemolli
65ad598418 negotiate_sspi_auth: Fix command debugging (-v) (#2025)
Terminate helper_command buffer before using it as a c-string. Supported
helper commands have two characters.

This change also reduces MinGW build errors.
2025-03-16 20:42:25 +00:00
Francesco Chemolli
917ab84d6f MinGW: do not build negotiate_wrapper (#2026)
MinGW is missing fork(2). Deeper changes will be
needed to build this helper
2025-03-16 12:52:47 +00:00
Francesco Chemolli
716671aca1 Portability: add include guards to ldap_backend.cc (#2021)
In the non-Windows case, we unconditinoally
include some system headers. Add conditions
for improved portability

Fixes error:
```
src/auth/digest/LDAP/ldap_backend.cc:49:10:
   fatal error: lber.h: No such file or directory
```
2025-03-15 05:00:52 +00:00
Francesco Chemolli
403e7a6129 MinGW: fix store/Controller.cc build (#2019)
error: 'WNOHANG' was not declared in this scope
2025-03-15 03:39:30 +00:00
Francesco Chemolli
23d4635a5e MinGW: add mkdir adapter (#2018)
On Windows, mkdir only takes one argument.
compat/mswindows.h has an adapter, add it to
compat/mingw.h as well.

Solves error:

```
UFSSwapDir.cc:617:26: error: too many arguments
    to function 'int mkdir(const char*)'
mingw/include/io.h:282:15: note: declared here
    int __cdecl mkdir (const char *);
```
2025-03-14 23:49:08 +00:00
Francesco Chemolli
4efe42f9f9 Fix Mem::Segment::open() stub to fix build without shm_open() (#2016)
When the environment does not HAVE_SHM, Ipc::Mem::Segment::open() method
definition does not match its declaration. Make it match.

    src/ipc/mem/Segment.cc:346:1: error: no declaration matches
    void Ipc::Mem::Segment::open()
    src/ipc/mem/Segment.h:37:10: note: candidate is:
    void Ipc::Mem::Segment::open(bool)
2025-03-14 15:59:53 +00:00
Francesco Chemolli
a871412b14 MinGW: Fix ext_ad_group_acl build errors (#2005)
- In C++, win32 APIs want references, not pointers
- Fix const mismatch
- Other minor polishing touches
2025-03-14 13:29:47 +00:00
Francesco Chemolli
4b232652ba MinGW: add libnettle to negotiate_sspi_auth (#2024)
libnettle is needed to build negotiate_sspi_auth.

This change fixes many errors similar to:

    negotiate_sspi_auth.cc:126: undefined reference to
        nettle_base64_decode_init
2025-03-14 00:44:21 +00:00
Francesco Chemolli
7390e47db1 Maintenance: remove compat/psignal (#2022)
psignal(3) is not used anywhere in squid.
Remove the also-unused bundled implementation
2025-03-13 23:09:55 +00:00
Francesco Chemolli
9cfb06c741 MinGW: fix aio compatibility layer (#2020)
The AIO Windows compatibilty layer is also
necessary on mingw

Problems fixed:

```
DiskIO/AIO/async_io.h:58:18:
    error: field 'aq_e_aiocb' has incomplete type 'aiocb'
DiskIO/AIO/async_io.h:58:12:
     note: forward declaration of 'struct aiocb'

DiskIO/AIO/AIODiskFile.cc:
    In member function
    'virtual void AIODiskFile::read(ReadRequest*)':
src/DiskIO/AIO/AIODiskFile.cc:134:9:
    error: 'aio_read' was not declared in this scope;
    did you mean 'file_read' ?
```
2025-03-13 21:25:10 +00:00
Andreas Weigel
86d85bd4bd Fix tls-dh support for DHE parameters with OpenSSL v3+ (#1949)
# When applying tls-dh=prime256v1:dhparams.pem configuration:
    WARNING: Failed to decode EC parameters 'dhparams.pem'

    # When forcing the use of FFDHE with something like
    # openssl s_client -tls1_2 -cipher DHE-RSA-AES256-SHA256 -connect...
    ERROR: failure while accepting a TLS connection on:
        SQUID_TLS_ERR_ACCEPT+TLS_LIB_ERR=A0000C1+TLS_IO_ERR=1

Squid `https_port ... tls-dh=curve:dhparams.pem` configuration is
supposed to support _both_ ECDHE and FFDHE key exchange mechanisms (and
their cipher suites), depending on client-supported cipher suites. ECDHE
mechanism should use the named curve (e.g., `prime256v1`), and FFDHE
mechanism should use key exchange parameters loaded from the named PEM
file (e.g., `ffdhe4096` named group specified in RFC 7919).

When 2022 commit 742236c added support for OpenSSL v3 APIs, new
loadDhParams() code misinterpreted curve name presence in `tls-dh` value
as an indication that the named parameters file contains ECDHE
parameters, setting OSSL_DECODER_CTX_new_for_pkey() type parameter to
"EC", and (when parameter file specified FFDHE details) triggering the
WARNING message quoted above.

Squid should not expect additional ECDHE parameters when the elliptic
curve group is already fully specified by naming it at the start of
`tls-dh` value. Squid now reverts to earlier (v4) behavior, where
the two mechanisms can coexist and can be configured separately as
described above:

    $ openssl s_client -tls1_2 -cipher DHE-RSA-AES256-SHA256 -connect...
    Server Temp Key: DH, 4096 bits

    $ openssl s_client -connect...
    Server Temp Key: ECDH, prime256v1, 256 bits

Furthermore, updateContextEecdh() code in commit 742236c continued  to
load parsed parameters using old SSL_CTX_set_tmp_dh() call but should
have used SSL_CTX_set0_tmp_dh_pkey() API because the type of parsed
parameters (i.e. DhePointer) have changed from DH to EVP_PKEY pointer.
This second bug affected configurations with and without an explicit
curve name in `tls-dh` value.

Also report a failure to load parsed parameters into TLS context.
2025-03-13 19:50:01 +00:00
Francesco Chemolli
8f2566c72c Remove basic_smb_lm_auth helper (#2014)
This helper implementation is based on an old snapshot and adaptation of
Samba code. Samba project offers a more secure and better maintained
tool.
2025-03-12 00:18:38 +00:00
Francesco Chemolli
fd63bf56cd Remove ntlm_smb_lm_auth helper (#2015)
This helper implementation is based on an old snapshot and adaptation of
Samba code. Samba project offers a more secure and better maintained
tool.
2025-03-11 10:02:12 +00:00
Francesco Chemolli
256e08b6a8 Revert "Remove basic_smb_lm_auth helper" (#2013)
Commit f53a024a40 contained spurious changes. Revert the change
2025-03-10 03:15:47 +00:00
Francesco Chemolli
f53a024a40 Remove basic_smb_lm_auth helper (#2009)
This helper implementation is based on an old snapshot and adaptation of
Samba code. Samba project offers a more secure and better maintained
tool.
2025-03-06 13:41:32 +00:00
Francesco Chemolli
4b7b6df85c Remove ext_lm_group_acl helper (#2011)
Lan Manager (LM) is an obsolete variant of the SMB protocol.
No product on the market has supported it for several years now,
in favour of NTLMv1 , NTLMv2 and Kerberos.
2025-03-04 19:30:55 +00:00
Francesco Chemolli
17645a33f5 MinGW: use nameless unions in ext_ad_group_acl (#2004)
ext_ad_group_acl was written in 2008 in C, and
it used the C variant of the Win32 API.
It was then ported to C++, but the API callers were
not updated to the C++ version of the API.
With more modern compilers, and
Squid enforcing more strict types and error handling,
it is no longer compiling.

This is part 1 of 2 of the fixes to make the helper build
again, the scope is to update Win32 API callers so they
use the C++ version of the API


Examples of fixed errors:

    error: 'IADs' {aka 'struct IADs'} has no member named 'lpVtbl'
    error: 'VARIANT' {aka 'struct tagVARIANT'} has no member named 'n1'
2025-03-04 15:16:52 +00:00
Francesco Chemolli
74e0d1cb1d MinGW: Fix winldap.h detection (#2010)
<winldap.h> requires <windows.h> to be previously
included in order to compile.

    configure:38466: checking for winldap.h
    wincrypt.h:5051:254: error: 'PSYSTEMTIME' has not been declared
2025-03-04 13:07:58 +00:00
Eduard Bagdasaryan
9e779e40ef NoNewGlobals for OpenSSL-related structures (#2006)
These changes were anticipated in Bug 5390 fix (recent commit c565067):
https://bugs.squid-cache.org/show_bug.cgi?id=5390#c16

They eliminate all known OpenSSL-related globals:

* Security::ProxyOutgoingConfig
* Ssl::SquidUntrustedCerts
* Ssl::TheGeneratorRequests
* Ssl::TheGlobalContextStorage

Also applied AAA and range-based `for` loop upgrades to modified lines.
2025-03-02 15:49:15 +00:00
Francesco Chemolli
0c90595b9d CI: Do not classify "no failures" stats as test-build errors (#2001)
CppUnit tests emit a lot of "FAIL: 0" and "XFAIL: 0" lines, which are
incorrectly classified as errors by the test-builds.sh. Filter these
messages out as they are not indicative of problems.
2025-02-26 08:10:47 +00:00
Francesco Chemolli
4ae7430eff CI: Revert recent "show build commands on terminal" change (#2000)
GitHub Actions UI does not handle large amounts of console output with
collapsable `::group::` sections well.
For example, UI may truncate console output if a collapsable `::group::`
section gets too many log lines. In some cases, GitHub does not report
truncation at all, resulting in misleading console output. In other, UI
warns: "This step has been truncated due to its large size. Download the
full logs from the menu once the workflow run has completed."

This change reverts recent commit e5a66fc26d.
2025-02-24 14:27:13 +00:00
Julien
91d1cfb180 Fix GCC v13 LTO build [-Walloc-size-larger-than=] (#1929)
store/Disks.cc:690: error: argument 1 value 18446744073709551615
        exceeds maximum object size 9223372036854775807
        [-Werror=alloc-size-larger-than=]
    const auto tmp = new SwapDir::Pointer[swap->n_allocated];

    pconn.cc:43:53: error: argument 1 value 18446744073709551615 ...
    theList_ = new Comm::ConnectionPointer[capacity_];

Tested on Ubuntu 24.04 and GCC v13.2.0.
2025-02-23 23:16:09 +00:00
Eduard Bagdasaryan
28a2ea0ded NoNewGlobals for iocb_table (#1998)
During shutdown, iocb_table global was deleted, but the corresponding
cleanup code ignored some IoCallback members, triggering misleading
Ipc::UdsSender memory leak reports from Valgrind.

This change uses NoNewGlobals design to address the above problem, but
this code needs a lot more refactoring to address other old problems
associated with Comm initialization.
2025-02-21 18:59:21 +00:00
Francesco Chemolli
e5a66fc26d CI: show build commands on terminal (#1965)
test-builds.sh records build output in per-layer logs, and we are
already collecting those logs. Send build output to standard output as
well, to expose it in GitHub Actions user interface. This new detailed
output is enclosed in a "layer ... output" group to keep emphasizing
problematic output lines extracted by test-builds.sh.

Also enclose MacOS build setup output in a group, for similar reasons.
2025-02-17 16:33:19 +00:00
Eduard Bagdasaryan
bbcef1c5cc NoNewGlobals for cbdata_htable (#1991)
This fix also reduces memory leak false positives
reported by Valgrind.
2025-02-05 13:52:00 +00:00
Francesco Chemolli
3352fa2240 Add v8 release notes 2025-02-06 01:43:26 +13:00
Francesco Chemolli
fb16a53c5d Master is now v8 2025-02-06 01:43:26 +13:00
Francesco Chemolli
69a67c3451 Prep for v7.0.1 (#1988)
Add v7.0.1 ChangeLog section.
Incorporate changes from v6.8 to v6.13 (inclusive).
2025-02-02 17:42:07 +00:00
Eduard Bagdasaryan
53ed1a918f Fix eCAP build broken by Adaptation::Config::metaHeaders change (#1987)
2024 master/v7 commit 984577ac replaced Adaptation::Config::metaHeaders
data member with a function but did not update metaHeaders users in eCAP
code.
2025-01-22 03:04:56 +00:00
huaraz
d2437a2f9a Fix GCC v14 [-Wanalyzer-null-dereference] warnings in Kerberos (#1983)
src/acl/external/kerberos_ldap_group/support_sasl.cc:190:17: error:
    dereference of NULL 'defs' [CWE-476] [-Wanalyzer-null-dereference]

    src/auth/negotiate/kerberos/negotiate_kerberos_pac.cc:235:19: error:
    dereference of NULL 'Rids' [CWE-476] [-Wanalyzer-null-dereference]
2025-01-19 11:41:18 +00:00
Francesco Chemolli
83c501d1ba Bug 5091: document that changes to workers require restart (#1980) 2025-01-15 07:49:19 +00:00
Alex Rousskov
8c77c4b24b Bug 5481: Fix GCC v14 build [-Wmaybe-uninitialized] (#1982)
Successful xstrtoui(start,end) calls do initialize `end`, but we can
polish this code and avoid triggering that GCC warning at the same time.
2025-01-15 05:56:13 +00:00
Eduard Bagdasaryan
a14169990e Improve Tunnel Server RESPONSE dumps (#1975)
Level-2 "Tunnel Server RESPONSE:..." debugs() incorrectly assumed that
its readBuf parameter contained hdr_sz header bytes. In reality, by the
time code reached that debugs(), readBuf no longer had any header bytes
(and often had no bytes at all). Besides broken header dumps, this bug
could lead to problems that Valgrind reports as "Conditional jump or
move depends on uninitialised value" in DebugChannel::writeToStream().

This fix mimics HttpStateData::processReplyHeader() reporting code,
including its known problems. Future changes should address those
problems and reduce code duplication across at least ten functions
containing similar "decorated" level-2 message dumps.
2025-01-13 20:16:23 +00:00
Francesco Chemolli
5fa48bb562 Bug 5311: clarify configuration byte units (#1979) 2025-01-10 21:47:13 +00:00
Francesco Chemolli
fb51e46128 Bug 5093: List http_port params that https_port/ftp_port lack (#1977)
To avoid documentation duplication, current https_port and ftp_port
directive descriptions reference http_port directive instead of
detailing their own supported parameters. For https_port, this solution
creates a false impression that the directive supports all http_port
options. Our ftp_port documentation is better but still leaves the
reader guessing which options are actually supported.

This change starts enumerating http_port configuration parameters that
ftp_port and https_port directives do _not_ support. Eventually, Squid
should reject configurations with unsupported listening port options.
2025-01-08 23:31:27 +00:00
Francesco Chemolli
b56774dd09 CI: Add workflow_dispatch to workflows that still lack it (#1976)
Manually triggering a workflow rerun is handy when troubleshooting. Our
coverity-scan.yaml workflow already has a workflow_dispatch trigger.
2025-01-02 09:26:24 +00:00
Alex Rousskov
32218e04a5 Work around some mgr:forward accounting/reporting bugs (#1969)
In modern code, FwdReplyCodes[0][i] is usually zero because n_tries is
usually at least one at logReplyStatus() call time. This leads to
mgr:forward report showing nothing but table heading (i.e. no stats)

Also improve `try#N` heading:data match by skipping FwdReplyCodes[0]
reporting (there is still no `try#0` heading) and adding a previously
missing `try#9` heading
2024-12-31 21:59:10 +00:00