Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into coverity-cid-1461163
Browse files Browse the repository at this point in the history
  • Loading branch information
kinkie committed Aug 8, 2024
2 parents 8d0a12d + a18aabb commit 60223cd
Show file tree
Hide file tree
Showing 55 changed files with 780 additions and 487 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,21 @@ jobs:
export CPPFLAGS="-I$HOMEBREW_PREFIX/include${CPPFLAGS:+ $CPPFLAGS}"
export LDFLAGS="-L$HOMEBREW_PREFIX/lib${LDFLAGS:+ $LDFLAGS}"
export CFLAGS="-Wno-compound-token-split-by-macro${CFLAGS:+ $CFLAGS}" # needed fir ltdl with Xcode
# libtool package referenced below fails to copy its configure*
# files, possibly due to a packaging/brewing bug. The following sed
# command restores installed libtoolize code to its earlier (and
# working) variation.
echo "brew libtool package details:"
brew info libtool --json | grep -E 'rebuild|tap_git_head'
# This hack was tested on libtoolize package with the following output:
# "rebuild": 2,
# "tap_git_head": "5cede8ea3b7b12c7f68215f75a951430b38d945f",
#
editable=$HOMEBREW_CELLAR/libtool/2.4.7/bin/glibtoolize
sed -i.bak 's@ltdl_ac_aux_dir=""@ltdl_ac_aux_dir="../build-aux"@' $editable || true
diff -u $editable.bak $editable || true
./test-builds.sh ${{ matrix.layer.name }}
- name: Publish build logs
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ Thank you!
Hasso Tepper <[email protected]>
Heinrich Schuchardt <[email protected]>
helix84 <[email protected]>
Helmut Grohne <[email protected]>
Henrik Nordstrom <[email protected]>
Henrik Nordstrom <[email protected]>
Hide Nagaoka <[email protected]>
Expand Down
8 changes: 4 additions & 4 deletions acinclude/krb5.m4
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ AC_DEFUN([SQUID_CHECK_KRB5_HEIMDAL_BROKEN_KRB5_H], [
AC_CACHE_CHECK([for broken Heimdal krb5.h],squid_cv_broken_heimdal_krb5_h, [
SQUID_STATE_SAVE(squid_krb5_heimdal_test)
CPPFLAGS="-I${srcdir:-.} $CPPFLAGS"
AC_RUN_IFELSE([AC_LANG_SOURCE([[
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include <krb5.h>
int
main(void)
Expand All @@ -88,7 +88,7 @@ main(void)
return 0;
}
]])], [ squid_cv_broken_heimdal_krb5_h=no ], [
AC_RUN_IFELSE([AC_LANG_SOURCE([[
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#define HAVE_BROKEN_HEIMDAL_KRB5_H 1
#include "compat/krb5.h"
int
Expand Down Expand Up @@ -172,7 +172,7 @@ int main(int argc, char *argv[])
dnl checks that gssapi is ok, and sets squid_cv_working_gssapi accordingly
AC_DEFUN([SQUID_CHECK_WORKING_GSSAPI], [
AC_CACHE_CHECK([for working gssapi], squid_cv_working_gssapi, [
AC_RUN_IFELSE([AC_LANG_SOURCE([[
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#if HAVE_GSS_H
#include <gss.h>
#endif
Expand Down Expand Up @@ -255,7 +255,7 @@ AC_DEFUN([SQUID_CHECK_WORKING_KRB5],[
AC_CACHE_CHECK([for working krb5], squid_cv_working_krb5, [
SQUID_STATE_SAVE(squid_krb5_test)
CPPFLAGS="-I${srcdir:-.} $CPPFLAGS"
AC_RUN_IFELSE([AC_LANG_SOURCE([[
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include "compat/krb5.h"
int
main(void)
Expand Down
71 changes: 40 additions & 31 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,38 +116,47 @@ echo "autoconf ($acversion) : autoconf$acver"
echo "libtool ($ltversion) : ${LIBTOOL_BIN}${ltver}"
echo "libtool path : $ltpath"

for dir in \
""
do
if [ -z "$dir" ] || [ -d $dir ]; then
if (
echo "Bootstrapping $dir"
cd ./$dir
if [ -n "$dir" ] && [ -f bootstrap.sh ]; then
./bootstrap.sh
elif [ ! -f $dir/configure ]; then
# Make sure cfgaux exists
mkdir -p cfgaux

if test -n "$ltpath"; then
acincludeflag="-I $ltpath/../share/aclocal"
else
acincludeflag=""
fi

# Bootstrap the autotool subsystems
bootstrap aclocal$amver $acincludeflag
bootstrap autoheader$acver
bootstrap_libtoolize ${LIBTOOL_BIN}ize${ltver}
bootstrap automake$amver --foreign --add-missing --copy -f
bootstrap autoconf$acver --force
fi ); then
: # OK
else
exit 1
fi
if test -n "$ltpath"; then
acincludeflag="-I $ltpath/../share/aclocal"
else
acincludeflag=""
fi

# bootstrap primary or subproject sources
bootstrap_dir() {
dir="$1"
cd $dir || exit $?

bootstrap aclocal$amver $acincludeflag
bootstrap autoheader$acver

# Do not libtoolize ltdl
if grep -q '^LTDL_INIT' configure.ac
then
bootstrap_libtoolize ${LIBTOOL_BIN}ize${ltver}
fi
done

bootstrap automake$amver --foreign --add-missing --copy --force
bootstrap autoconf$acver --force

cd - > /dev/null
}

echo "Bootstrapping primary Squid sources"
mkdir -p cfgaux || exit $?
bootstrap_dir .

# The above bootstrap_libtoolize step creates or updates libltdl. It copies
# (with minor adjustments) configure.ac and configure, Makefile.am and
# Makefile.in from libtool installation, but does not regenerate copied
# configure from copied configure.ac and copied Makefile.in from Makefile.am.
# We get libltdl/configure and libltdl/Makefile.in as they were bootstrapped
# by libtool authors or package maintainers. Low-level idiosyncrasies in those
# libtool files result in mismatches between copied code expectations and
# Squid sub-project environment, leading to occasional build failures that
# this bootstrapping addresses.
echo "Bootstrapping libltdl sub-project"
bootstrap_dir libltdl

# Make a copy of SPONSORS we can package
if test -f SPONSORS.list; then
Expand Down
20 changes: 20 additions & 0 deletions doc/release-notes/release-7.sgml.in
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,17 @@ This section gives an account of those changes in three categories:
<p>Removed the <em>non_peers</em> action. See the Cache Manager
<ref id="mgr" name="section"> for details.

<tag>dns_packet_max</tag>
<p>Honor positive <em>dns_packet_max</em> values when sending DNS A queries
and PTR queries containing IPv4 addresses. Prior to this change, Squid did
not add EDNS extension (RFC 6891) to those DNS queries because 2010 tests
revealed compatibility problems with some DNS resolvers. We hope that those
problems are now sufficiently rare to enable this useful optimization for
all DNS queries, as originally intended. Squid still sends EDNS extension
with DNS AAAA queries and PTR queries containing IPv6 addresses (when
dns_packet_max is set to a positive value). Rare deployments that must use
buggy DNS resolvers should not set <em>dns_packet_max</em>.

<tag>access_log</tag>
<p>Built-in <em>common</em> and <em>combined</em> logformats now always
receive a dash character ("-") in the position of what used to be a
Expand Down Expand Up @@ -275,6 +286,15 @@ This section gives an account of those changes in three categories:

</descrip>

<sect1>Other changes<label id="otherchanges">
<p>
<descrip>
<tag>Adjusted configuration and format of ext_time_quota_acl helper debugging</tag>
<p>The <em>-l</em> option that enables <em>ext_time_quota_acl</em> to log debug messages
to a custom logfile has been removed, and their format has been
changed to be in line with Squid's cache.log format.
</descrip>

<sect>Copyright
<p>
Copyright (C) 1996-2023 The Squid Software Foundation and contributors
Expand Down
1 change: 0 additions & 1 deletion lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ libmisccontainers_la_SOURCES = \
hash.cc

libmiscutil_la_SOURCES = \
$(SNPRINTFSOURCE) \
Splay.cc \
heap.c \
radix.c \
Expand Down
4 changes: 1 addition & 3 deletions src/CachePeer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ CachePeer::~CachePeer()
aclDestroyAccessList(&access);

#if USE_CACHE_DIGESTS
void *digestTmp = nullptr;
if (cbdataReferenceValidDone(digest, &digestTmp))
peerDigestNotePeerGone(static_cast<PeerDigest *>(digestTmp));
delete digest;
xfree(digest_url);
#endif

Expand Down
1 change: 0 additions & 1 deletion src/ClientRequestContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ class ClientRequestContext : public RefCountable
#endif

ClientHttpRequest *http;
ACLChecklist *acl_checklist = nullptr; ///< need ptr back so we can unregister if needed
int redirect_state = REDIRECT_NONE;
int store_id_state = REDIRECT_NONE;

Expand Down
4 changes: 2 additions & 2 deletions src/ConfigParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -594,13 +594,13 @@ ConfigParser::skipOptional(const char *keyword)
return false; // no more tokens (i.e. we are at the end of the line)
}

Acl::Tree *
ACLList *
ConfigParser::optionalAclList()
{
if (!skipOptional("if"))
return nullptr; // OK: the directive has no ACLs

Acl::Tree *acls = nullptr;
ACLList *acls = nullptr;
const auto aclCount = aclParseAclList(*this, &acls, cfg_directive);
assert(acls);
if (aclCount <= 0)
Expand Down
2 changes: 1 addition & 1 deletion src/ConfigParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class ConfigParser
bool skipOptional(const char *keyword);

/// parses an [if [!]<acl>...] construct
Acl::Tree *optionalAclList();
ACLList *optionalAclList();

/// extracts and returns a regex (including any optional flags)
std::unique_ptr<RegexPattern> regex(const char *expectedRegexDescription);
Expand Down
2 changes: 1 addition & 1 deletion src/Notes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Note::printAsNoteDirective(StoreEntry * const entry, const char * const directiv
os << directiveName << ' ' << key() << ' ' << ConfigParser::QuoteString(SBufToString(v->value()));
if (v->aclList) {
// TODO: Use Acl::dump() after fixing the XXX in dump_acl_list().
for (const auto &item: v->aclList->treeDump("", &Acl::AllowOrDeny)) {
for (const auto &item: ToTree(v->aclList).treeDump("", &Acl::AllowOrDeny)) {
if (item.isEmpty()) // treeDump("") adds this prefix
continue;
if (item.cmp("\n") == 0) // treeDump() adds this suffix
Expand Down
6 changes: 5 additions & 1 deletion src/PeerDigest.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class DigestFetchState
DigestFetchState(PeerDigest *,HttpRequest *);
~DigestFetchState();

PeerDigest *pd;
CbcPointer<PeerDigest> pd;
StoreEntry *entry;
StoreEntry *old_entry;
store_client *sc;
Expand Down Expand Up @@ -79,6 +79,10 @@ class PeerDigest
PeerDigest(CachePeer *);
~PeerDigest();

/// reacts to digest transfer completion
/// \prec DigestFetchState stats were finalized (by calling peerDigestFetchSetStats())
void noteFetchFinished(const DigestFetchState &, const char *outcomeDescription, bool sawError);

CbcPointer<CachePeer> peer; ///< pointer back to peer structure, argh
CacheDigest *cd = nullptr; /**< actual digest structure */
const SBuf host; ///< copy of peer->host
Expand Down
1 change: 0 additions & 1 deletion src/PeerSelectState.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ class PeerSelector: public Dns::IpReceiver
*/
CachePeer *hit;
peer_t hit_type;
ACLChecklist *acl_checklist;

typedef CbcPointer<PeerSelectionInitiator> Initiator;
Initiator initiator_; ///< recipient of the destinations we select; use interestedInitiator() to access
Expand Down
1 change: 0 additions & 1 deletion src/SnmpRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class SnmpRequest
Ip::Address from;

struct snmp_pdu *PDU;
ACLChecklist *acl_checklist;
u_char *community;

struct snmp_session session;
Expand Down
2 changes: 1 addition & 1 deletion src/SquidConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ class SquidConfig

std::chrono::nanoseconds paranoid_hit_validation;

class Acl::Node *aclList;
Acl::NamedAcls *namedAcls; ///< acl aclname acltype ...

struct {
acl_access *http;
Expand Down
Loading

0 comments on commit 60223cd

Please sign in to comment.