Merge ~ahasenack/ubuntu/+source/squid:squid-4-merge into ubuntu/+source/squid:debian/sid

Proposed by Andreas Hasenack
Status: Merged
Approved by: Christian Ehrhardt 
Approved revision: e4f96de5d26b16d2ea4d981288dd627eacc7eec7
Merge reported by: Christian Ehrhardt 
Merged at revision: e4f96de5d26b16d2ea4d981288dd627eacc7eec7
Proposed branch: ~ahasenack/ubuntu/+source/squid:squid-4-merge
Merge into: ubuntu/+source/squid:debian/sid
Diff against target: 434 lines (+291/-6)
13 files modified
debian/changelog (+65/-0)
debian/control (+5/-3)
debian/patches/0003-installed-binary-for-debian-ci.patch (+37/-0)
debian/patches/90-cf.data.ubuntu.patch (+16/-0)
debian/patches/99-ubuntu-ssl-cert-snakeoil.patch (+22/-0)
debian/patches/fix-uninitialized-var.patch (+25/-0)
debian/patches/series (+4/-0)
debian/rules (+11/-0)
debian/squid.install (+3/-0)
debian/squid.preinst (+15/-0)
debian/tests/test-squid.py (+2/-2)
debian/tests/upstream-test-suite (+1/-1)
debian/usr.sbin.squid (+85/-0)
Reviewer Review Type Date Requested Status
Christian Ehrhardt  (community) Approve
Canonical Server Pending
Review via email: mp+353097@code.launchpad.net

Description of the change

This is the merge of the new major upstream squid version from debian into ubuntu.

To work with this, I created logical/3.5.27-1ubuntu1 based on the pkg squid3 repository, and applied it on top of the pkg squid repository, which so far only contains debian uploads.

Therefore this will be the first ubuntu changelog entry in the squid repository. This looks a bit odd, as there are ancient squid-3.0.X changelogs in there from debian, and we had such releases in ubuntu, but the ubuntu ones are in the squid3 repository. I don't know how to recover that, or if that is even important since this is a new source package after all.

Noteworthy changes:
- dropped a good part of our delta, I hope the commit messages and d/changelog are enough.

Added changes:
 * These were all accepted by debian already via salsa MPs, so they can be dropped in the next update:
  - dep8 fixes: https://salsa.debian.org/squid-team/squid/merge_requests/4/
    - d/t/test-squid.py: fix apparmor profile filename
    - d/t/test-squid.py: fix the process name. The PID points at the parent.
    - d/t/upstream-test-suite: also make libmem.la, needed by the tests.
  - parallel build: https://salsa.debian.org/squid-team/squid/merge_requests/3
    - d/rules: enable cdbs parallel build
 * This is in debian salsa already and will be part of debian's 4.2 package update:
    - d/t/0003-installed-binary-for-debian-ci.patch: use the squid
      binary from the system, instead of the one from the source tree.
 * These two I had to add to workaround the PPC64EL build failures:
    - d/p/fix-uninitialized-var.patch: Workaround gcc's maybe-unitialized
      error in parse_time_t.
    - d/rules: Add -Wno-format-truncation to CXXFLAGS as a workaround if
      building for ppc64el. On that arch, dpkg-buildflags sets -O3 instead of
      -O2 and that triggers a format-truncation error on pcon.cc. See
      See https://bugs.squid-cache.org/show_bug.cgi?id=4875
The first one is part of an open PR at https://github.com/squid-cache/squid/pull/270. Upstream asked for a better fix, but is ok to take the workaround. The fix in the PR for the second issue was deemed unfit, so I worked around it by disabling the gcc check for just ppc64el builds for now. I preferred that to switching to -O2 because -O3 was a request from the ppc64el port partner.

DEP8 tests for all architectures passed: https://bileto.ubuntu.com/excuses/3351/cosmic.html

I think I can fix some of the "always failed" tests, one at least seems a silly path expansion error, but I won't block this upload on that.

PPA used by bileto: https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/3351/+packages

Other manual tests I did:
- release upgrade all the way from xenial to these packages in cosmic
- squid as an ssl reverse proxy (not possible with previous builds in ubuntu or debian)

Remaining delta bits we could perhaps drop, as they are about squid3 and that has been a transitional package for some time already:
  * only affects squid3.{post,pre}inst
        - Drop wrong short-circuiting of various invocations; we always want to call the debhelper block.

  * what was this one about? We are no longer using sysv anyway:
        - Revert "Set pidfile for systemd's sysv-generator" from Debian.

I could use some help with the above.

Finally, these two I can probably submit to debian, I just didn't want to block this upload on that, as they are easy to carry for now:
    - Add an example refresh pattern for debs.
    - Add disabled by default AppArmor profile.

To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Download full text (3.1 KiB)

## Drop/Remaining Changes ##

I went through the old and new Delta one by one and side by side, I'll only mention the ones worth to talk about (Thanks for the changelog entries explaining drops/adds).

#1 on the "refresh patterns" I wonder, this carried over as it was.
But it also adds a pattern for (Release|Packages(.gz)*) - probably worth to improve the changelog wording at least.
I'd have expected this to be commented out as well - do we want to change that?

#2 The "Correct attribution and add explanatory note in d/NEWS.debian" also is nor more relevant due to no related upgrade path being left. This can be Dropped IMHO.
Would you agree?

#3 "Set pidfile for systemd's sysv-generator" is no more needed. We have a native service which will be used (not the generator). This was from early Xenial and back then we had no service, so it made sense in the past, but no more.

#4 "short-circuiting"
It is important to note that this is in the maintscripts of the squid3 transitional package.
That transition already happened.
There is nothing generated after the removed short-circuit
The package is empty transitional now.
While in theory there could be something, there is in real life nothing in there.
The combination of "nothing is there" and "transition already happened" and "empty" makes me think we can drop this Delta - it isn't perfect in Debian, but also has no effect.
Turn it around, how would you explain Debian they need this Delta - see, there is no compelling reason I can think of.

Ack to all other Drops/Keep entries

## Added Changes ##
I checked debian/master - ack on the new changes themselve AND that are already in Debian and later to be dropped.

On the others:

#5 "d/t/0003-installed-binary-for-debian-ci.patch: use the squid binary from the system"
I see what you are doing, why are we doing that?
Bug or minimal in changelog reasoning would be nice

#6 "Workaround gcc's maybe-unitialized" I know since I remember our discussion, but maybe add "ppc64el build issue" to the changelog for this?

I was confused why Debian has taken "fix apparmor profile filename" if we are the only ones adding the disabled profile?! I found there is an upstream profile in tools/apparmor/usr.sbin.squid but it is not installed.
Maybe as you said, just submit the disabled profile to Debian as well and be good with it.
Maybe OTOH a merge of our profile with the one from upstream would be better (submit our things upstream).
And finally I think best would be
a) bring our apparmor Delta to upstream
b) change Debian packaging to install that profile
That way we can actually benefit from what upstream is maintaining there - we can always add pacthes that extend it if needed.
This won't stall the upload, but being curious, is there more background to it already?

Ack on the other new changes.

## Fin ##
From a testing POV I haven't found anything that breaks - so good to go from that as well.
I tested manual upgrades, start/stop and the qa-regression tests.
The qa tests showed one issue, but I'll debug first if it is an issue in the test due to the rename.

Already great work and if you follow my reasoning even more cleanup will happen.
Eager to hear your opini...

Read more...

review: Needs Fixing
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Yeah, the test Fail was an artifact of squid4 behaving slightly different - i'll submit an MP to the tests and set you to CC there.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
6f7ebb2... by Andreas Hasenack

    - Revert "Set pidfile for systemd's sysv-generator" from Debian.
      [Not needed anymore since we have a native systemd service file
       and no longer rely on the generator.]

c4a2ca9... by Andreas Hasenack

    - Drop wrong short-circuiting of various invocations; we always want to
      call the debhelper block.
      [This was for the transitional squid3 package, and that transition has
       already happened.]

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

1) I updated the refresh patterns, taking the more complete config from the squid-deb-proxy package. I left the caching of debs as a commented example, though, like it was before. I could be convinced otherwise. It would help to know why it was a comment in the first place, instead of enabled by default.

2) The attribution in d/NEWS.debian was added to a specific section in that file, namely under version "quid3 (3.5.6-1)". In that context, I think it's like a changelog entry, describing what happened at or around that version, so it makes sense to keep it. What do you think?

3) dropped

4) dropped

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

5) That patch is from the upcoming debian squid package (4.2) and is committed in salsa already. It's the reason we were able to drop two bits of delta: a) enable autoreconf; b) "Adjust seddery (...)". I added respective notes under each individual delta drop message that the drop was possible because of this patch. So essentially we are replacing two bits of delta we have with an upcoming debian patch, and this "new" delta will be dropped with the next debian release. I added a proper DEP3 header to this patch.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

6) updated d/changelog entry. Note that the DEP3 headers in that patch explain the situation in much more detail.

4f4f33e... by Andreas Hasenack

    - d/t/upstream-test-suite: drop the sed line, since patch
      0003-installed-binary-for-debian-ci.patch is doing this work now.
      (https://salsa.debian.org/squid-team/squid/commit/ad4372b444ba8b1587839)

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I added one more change, which can be dropped in the next merge since Debian adopted it:
    - d/t/upstream-test-suite: drop the sed line, since patch
      0003-installed-binary-for-debian-ci.patch is doing this work now.
      (https://salsa.debian.org/squid-team/squid/commit/ad4372b444ba8b1587839)

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I'm looking at apparmor now, this might be a bit of work.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I don't know of any history regarding the apparmor profile.

What I found out so far is that our profile has 4 additions that don't make sense for upstream, but might make sense for debian:
 - squid-langpack entries
 - maas-proxy entries
 - squid-deb-proxy entries
 - squidguard entries

The MAAS one probably wouldn't be taken, since there is no MAAS for debian. The others might make sense for debian.

In the meantime, I pushed another build to https://bileto.ubuntu.com/#/ticket/3351 with the changes done so far addressing review comments, just to be sure.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

We can postpone the apparmor unification in this project until after this merge.
Thanks for working on all the other concerns I had.

Assuming that we split the apparmor work in a delayed extra task I think we are good with all but #2 now.

On #2 - yes it is like a changelog, but with the bonus that if you are switching "through" this particular set of versions you will get it prompted on the update screen.
See: https://www.debian.org/doc/manuals/developers-reference/ch06.en.html#bpp-news-debian
These were important NEWS somewhen in the past, but lacking a upgrade path that hits it we can drop this.
The alternative would be to keep it forever without ever showing it to a user, that feels wrong and useless maintenance effort to me.

My call would be drop, if we need a more high level discussion and qorum on this lets discuss in the standup.

Again - thanks for all the other changes.
If tests are good and we have decided on #2 you'll have my +1 on this Merge.

37d441a... by Andreas Hasenack

    - Correct attribution and add explanatory note in d/NEWS.debian.
      [That particular upgrade path has happened long ago.]

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I added a card (https://trello.com/c/u07CzGb1) about pushing the apparmor delta to debian, thanks.

2) Dropped, thanks for the explanation.

Yesterday I also did some additional testing:
- enabled our (disabled by default) apparmor profile, confirming it still works
- with the apparmor profile enabled, I also confirmed squid-deb-proxy still works
- pinged the #maas team about this new upcoming release, since maas relies on squid as its proxy/cache. roaksoax said he would test it with the packages from the bileto ppa.

I still want to test these, should be done momentarily:
- squidguard
- apparmor profile with squid as an ssl accelerator (new feature in this squid package)

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

squidguard fails with apparmor enabled:
[ 477.494576] audit: type=1400 audit(1534426533.919:2436): apparmor="DENIED" operation="file_inherit" profile="/usr/sbin/squid" pid=8122 comm="squidGuard" family="unix" sock_type="stream" protocol=0 requested_mask="send receive" denied_mask="send receive" addr=none peer_addr=none peer="/usr/sbin/squid//squidguard"

This happens with both squid-3 that is currently in cosmic, and squid-4 from this MP, therefore an already existing bug.

I filed this to be fixed later: https://bugs.launchpad.net/ubuntu/+source/squid3/+bug/1787409

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thanks for breaking those out into other bugs.
And for integrating my suggestion with the NEWS file, I think we are good here.

Under the constraint that your and maas further testing does not reveal anything broken, from a packaging POV +1 on this.

review: Approve
e4f96de... by Andreas Hasenack

changelog

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I pushed a change to the apparmor profile to cope with the snakeoil certificates, as discussed in #ubuntu-hardened.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Testing with maas on cosmic, looks fine so far:

access log while a new machine is enlisting:

==> /var/log/maas/proxy/access.log <==
1534448951.246 232 192.168.100.190 TCP_MISS/200 89048 GET http://br.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease - HIER_DIRECT/200.236.31.4 -

packages:

root@maas-squid4:~# apt-cache policy maas squid
maas:
  Installed: 2.4.1-7032-g11e4fa330-0ubuntu1
  Candidate: 2.4.1-7032-g11e4fa330-0ubuntu1
  Version table:
 *** 2.4.1-7032-g11e4fa330-0ubuntu1 500
        500 http://br.archive.ubuntu.com/ubuntu cosmic/main amd64 Packages
        100 /var/lib/dpkg/status
squid:
  Installed: 4.1-1ubuntu1~ppa8
  Candidate: 4.1-1ubuntu1~ppa8
  Version table:
 *** 4.1-1ubuntu1~ppa8 500
        500 http://ppa.launchpad.net/ci-train-ppa-service/3351/ubuntu cosmic/main amd64 Packages
        100 /var/lib/dpkg/status
     3.5.27-1ubuntu1 500
        500 http://br.archive.ubuntu.com/ubuntu cosmic/main amd64 Packages

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

roaksoax will take a while to test this I think, I pinged him today and he hasn't gotten to it yet. Would you mind sponsoring it anyway, so maybe I can get an AA to look at it soon since it's a new package? If not that's fine too.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

To ssh://git.launchpad.net/~usd-import-team/ubuntu/+source/squid
 * [new tag] upload/4.1-1ubuntu1 -> upload/4.1-1ubuntu1

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading squid_4.1-1ubuntu1.dsc: done.
  Uploading squid_4.1.orig.tar.gz: done.
  Uploading squid_4.1-1ubuntu1.debian.tar.xz: done.
  Uploading squid_4.1-1ubuntu1_source.buildinfo: done.
  Uploading squid_4.1-1ubuntu1_source.changes: done.
Successfully uploaded packages.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index 7ec4ae4..e957d13 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,68 @@
1squid (4.1-1ubuntu1) cosmic; urgency=medium
2
3 * Merged with Debian unstable (LP: #1780944, LP: #1097032, LP: #16669).
4 Remaining changes:
5 - Use snakeoil certificates.
6 [Updated to use the correct config setting names]
7 - Add an example refresh pattern for debs.
8 [Improved the refresh patterns based on the configuration from
9 squid-deb-proxy package]
10 - Add disabled by default AppArmor profile.
11 [Updated to include the ssl_certs abstraction and suggestions on how to
12 deal with the snakeoil private key and other keys in /etc/ssl.]
13 * Dropped changes:
14 - Add additional dep8 tests.
15 [Adopted in 4.0.21-1~exp5, albeit a stripped down version]
16 - Correct attribution and add explanatory note in d/NEWS.debian.
17 [That particular upgrade path has happened long ago.]
18 - Drop wrong short-circuiting of various invocations; we always want to
19 call the debhelper block.
20 [This was for the transitional squid3 package, and that transition has
21 already happened.]
22 - Revert "Set pidfile for systemd's sysv-generator" from Debian.
23 [Not needed anymore since we have a native systemd service file
24 and no longer rely on the generator.]
25 - Enable autoreconf. This is no longer required for the security updates,
26 but is needed for the seddery of test-suite/Makefile.am in
27 d/t/upstream-test-suite.
28 [Replaced by patch 0003-installed-binary-for-debian-ci.patch]
29 - Adjust seddery for upstream test squid binary location.
30 [sed no longer necessary since patch,
31 0003-installed-binary-for-debian-ci.patch, will be dropped
32 entirely.]
33 - Drop Conflicts/Replaces of squid against squid3. In Ubuntu, the migration
34 happened in Xenial, so no upgrade path still requires this code. This
35 reduces upgrade ordering difficulty.
36 [Again we have a migration, but this time from squid3 to squid, so we
37 need this].
38 - GCC7 FTBFS fixes (LP: #1712668):
39 + d/rules: don't error when hitting the "deprecated" and
40 "format-truncation" gcc7 warnings. Upstream 3.5.27 has fixes for these,
41 but one in Format.cc that affects 32bit builds was deemed too intrusive
42 for the 3.5 stable series and is only in squid 4.x
43 [No longer needed with squid 4.x]
44 - Do not force gcc-6
45 [It was a temporary workaround in Debian that got dropped]
46 * Added changes:
47 - d/rules: enable cdbs parallel build
48 - d/t/test-squid.py: fix apparmor profile filename
49 - d/t/test-squid.py: fix the process name. The PID points at the parent.
50 - d/t/upstream-test-suite: also make libmem.la, needed by the tests.
51 - d/t/0003-installed-binary-for-debian-ci.patch: use the squid
52 binary from the system, instead of the one from the source tree.
53 - d/p/fix-uninitialized-var.patch: Workaround gcc's maybe-unitialized
54 error in parse_time_t, triggered on ppc64el due to the build using -O3
55 in that architecture.
56 - d/rules: Add -Wno-format-truncation to CXXFLAGS as a workaround if
57 building for ppc64el. On that arch, dpkg-buildflags sets -O3 instead of
58 -O2 and that triggers a format-truncation error on pcon.cc. See
59 See https://bugs.squid-cache.org/show_bug.cgi?id=4875
60 - d/t/upstream-test-suite: drop the sed line, since patch
61 0003-installed-binary-for-debian-ci.patch is doing this work now.
62 (https://salsa.debian.org/squid-team/squid/commit/ad4372b444ba8b1587839)
63
64 -- Andreas Hasenack <andreas@canonical.com> Thu, 16 Aug 2018 12:33:17 -0300
65
1squid (4.1-1) unstable; urgency=high66squid (4.1-1) unstable; urgency=high
267
3 * New Upstream Release (Closes: #896120)68 * New Upstream Release (Closes: #896120)
diff --git a/debian/control b/debian/control
index c59d487..bdd9c4f 100644
--- a/debian/control
+++ b/debian/control
@@ -1,7 +1,8 @@
1Source: squid1Source: squid
2Section: web2Section: web
3Priority: optional3Priority: optional
4Maintainer: Luigi Gangitano <luigi@debian.org>4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5XSBC-Original-Maintainer: Luigi Gangitano <luigi@debian.org>
5Uploaders: Santiago Garcia Mantinan <manty@debian.org>6Uploaders: Santiago Garcia Mantinan <manty@debian.org>
6Homepage: http://www.squid-cache.org7Homepage: http://www.squid-cache.org
7Standards-Version: 4.1.48Standards-Version: 4.1.4
@@ -24,6 +25,7 @@ Build-Depends: ed, libltdl-dev, pkg-config
24 , libsasl2-dev25 , libsasl2-dev
25 , libxml2-dev26 , libxml2-dev
26 , nettle-dev27 , nettle-dev
28 , dh-apparmor
2729
28Package: squid330Package: squid3
29Architecture: all31Architecture: all
@@ -40,8 +42,8 @@ Description: Transitional package
40Package: squid42Package: squid
41Architecture: any43Architecture: any
42Pre-Depends: adduser44Pre-Depends: adduser
43Depends: ${shlibs:Depends}, ${misc:Depends}, netbase, logrotate (>= 3.5.4-1), squid-common (>= ${source:Version}), lsb-base, libdbi-perl45Depends: ${shlibs:Depends}, ${misc:Depends}, netbase, logrotate (>= 3.5.4-1), squid-common (>= ${source:Version}), lsb-base, libdbi-perl, ssl-cert
44Suggests: squidclient, squid-cgi, squid-purge, resolvconf (>= 0.40), smbclient, ufw, winbindd46Suggests: squidclient, squid-cgi, squid-purge, resolvconf (>= 0.40), smbclient, ufw, winbindd, apparmor
45Recommends: libcap2-bin [linux-any], ca-certificates47Recommends: libcap2-bin [linux-any], ca-certificates
46Conflicts: squid3 (<< ${binary:Version})48Conflicts: squid3 (<< ${binary:Version})
47Replaces: squid349Replaces: squid3
diff --git a/debian/patches/0003-installed-binary-for-debian-ci.patch b/debian/patches/0003-installed-binary-for-debian-ci.patch
48new file mode 10064450new file mode 100644
index 0000000..abbe089
--- /dev/null
+++ b/debian/patches/0003-installed-binary-for-debian-ci.patch
@@ -0,0 +1,37 @@
1Description: Use installed squid binary for Debian CI testing
2 Upstream config tests are designed for use during builds. Debian CI uses a
3 pre-built binary installation.
4 .
5 Ubuntu specific note:
6 This patch replaces two bits of Ubuntu delta:
7 - Adjust seddery for upstream test squid binary location.
8 - Enable autoreconf
9Author: Amos Jeffries <amosjeffries@squid-cache.org>
10Origin: vendor, https://salsa.debian.org/squid-team/squid/commit/fe6be5764611e9d7294b6bd97d97d1b23ffa4ce9
11Last-Update: 2018-08-15
12diff --git a/test-suite/Makefile.am b/test-suite/Makefile.am
13index c8ff455d..bb7aef46 100644
14--- a/test-suite/Makefile.am
15+++ b/test-suite/Makefile.am
16@@ -150,7 +150,7 @@ VirtualDeleteOperator_SOURCES = VirtualDeleteOperator.cc stub_libmem.cc $(DEBUG_
17 squid-conf-tests: $(top_builddir)/src/squid.conf.default $(srcdir)/squidconf/*
18 @failed=0; cfglist="$?"; rm -f $@ || $(TRUE); \
19 for cfg in $$cfglist ; do \
20- $(top_builddir)/src/squid -k parse -f $$cfg || \
21+ /usr/sbin/squid -k parse -f $$cfg || \
22 { echo "FAIL: squid.conf test: $$cfg" | \
23 sed s%$(top_builddir)/src/%% | \
24 sed s%$(srcdir)/squidconf/%% ; \
25diff --git a/test-suite/Makefile.in b/test-suite/Makefile.in
26index 5e7cd5fa..15f78635 100644
27--- a/test-suite/Makefile.in
28+++ b/test-suite/Makefile.in
29@@ -1477,7 +1477,7 @@ STUB.h: $(top_srcdir)/src/tests/STUB.h
30 squid-conf-tests: $(top_builddir)/src/squid.conf.default $(srcdir)/squidconf/*
31 @failed=0; cfglist="$?"; rm -f $@ || $(TRUE); \
32 for cfg in $$cfglist ; do \
33- $(top_builddir)/src/squid -k parse -f $$cfg || \
34+ /usr/sbin/squid -k parse -f $$cfg || \
35 { echo "FAIL: squid.conf test: $$cfg" | \
36 sed s%$(top_builddir)/src/%% | \
37 sed s%$(srcdir)/squidconf/%% ; \
diff --git a/debian/patches/90-cf.data.ubuntu.patch b/debian/patches/90-cf.data.ubuntu.patch
0new file mode 10064438new file mode 100644
index 0000000..9dfa5b4
--- /dev/null
+++ b/debian/patches/90-cf.data.ubuntu.patch
@@ -0,0 +1,16 @@
1--- a/src/cf.data.pre
2+++ b/src/cf.data.pre
3@@ -5859,6 +5862,12 @@ NOCOMMENT_START
4 refresh_pattern ^ftp: 1440 20% 10080
5 refresh_pattern ^gopher: 1440 0% 1440
6 refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
7+refresh_pattern \/(Packages|Sources)(|\.bz2|\.gz|\.xz)$ 0 0% 0 refresh-ims
8+refresh_pattern \/Release(|\.gpg)$ 0 0% 0 refresh-ims
9+refresh_pattern \/InRelease$ 0 0% 0 refresh-ims
10+refresh_pattern \/(Translation-.*)(|\.bz2|\.gz|\.xz)$ 0 0% 0 refresh-ims
11+# example pattern for deb packages
12+#refresh_pattern (\.deb|\.udeb)$ 129600 100% 129600
13 refresh_pattern . 0 20% 4320
14 NOCOMMENT_END
15 DOC_END
16
diff --git a/debian/patches/99-ubuntu-ssl-cert-snakeoil.patch b/debian/patches/99-ubuntu-ssl-cert-snakeoil.patch
0new file mode 10064417new file mode 100644
index 0000000..40b5306
--- /dev/null
+++ b/debian/patches/99-ubuntu-ssl-cert-snakeoil.patch
@@ -0,0 +1,22 @@
1--- a/src/cf.data.pre
2+++ b/src/cf.data.pre
3@@ -3516,6 +3516,19 @@
4 reference a PEM file containing both the certificate
5 and private key.
6
7+ Notes:
8+
9+ On Debian/Ubuntu systems a default snakeoil certificate is
10+ available in /etc/ssl and users can set:
11+
12+ sslcert=/etc/ssl/certs/ssl-cert-snakeoil.pem
13+
14+ and
15+
16+ sslkey=/etc/ssl/private/ssl-cert-snakeoil.key
17+
18+ for testing.
19+
20 sslcipher=... The list of valid SSL ciphers to use when connecting
21 to this peer.
22
diff --git a/debian/patches/fix-uninitialized-var.patch b/debian/patches/fix-uninitialized-var.patch
0new file mode 10064423new file mode 100644
index 0000000..a682703
--- /dev/null
+++ b/debian/patches/fix-uninitialized-var.patch
@@ -0,0 +1,25 @@
1Description: Workaround gcc's maybe-uninitialized error in parse_time_t
2 Function parse_time_t() passes an unitialized variable to parseTimeLine(),
3 which will fill it in as the return value. gcc's -Wmaybe-unitialized setting
4 trips over this when the build is done with -O3, as is the case in ppc64el.
5 This fix is suggested in https://github.com/squid-cache/squid/pull/270, but
6 not accepted yet. It was remarked that a better fix can be done, instead of
7 just working around the gcc misfire.
8Origin: other, https://github.com/squid-cache/squid/pull/270
9Bug: https://bugs.squid-cache.org/show_bug.cgi?id=4875
10Last-Update: 2018-08-14
11---
12This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
13diff --git a/src/cache_cf.cc b/src/cache_cf.cc
14index 006a42d..96fe36f 100644
15--- a/src/cache_cf.cc
16+++ b/src/cache_cf.cc
17@@ -2925,7 +2925,7 @@ dump_time_t(StoreEntry * entry, const char *name, time_t var)
18 void
19 parse_time_t(time_t * var)
20 {
21- time_msec_t tval;
22+ time_msec_t tval = 0;
23 parseTimeLine(&tval, T_SECOND_STR, false);
24 *var = static_cast<time_t>(tval/1000);
25 }
diff --git a/debian/patches/series b/debian/patches/series
index 9c85ddd..12952d3 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,7 @@
10001-Default-configuration-file-for-debian.patch10001-Default-configuration-file-for-debian.patch
20002-Change-default-file-locations-for-debian.patch20002-Change-default-file-locations-for-debian.patch
30011-upstream-pr172.patch30011-upstream-pr172.patch
490-cf.data.ubuntu.patch
599-ubuntu-ssl-cert-snakeoil.patch
60003-installed-binary-for-debian-ci.patch
7fix-uninitialized-var.patch
diff --git a/debian/rules b/debian/rules
index 48211db..9b7b98c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,6 +3,13 @@
3export DEB_BUILD_MAINT_OPTIONS = hardening=+all3export DEB_BUILD_MAINT_OPTIONS = hardening=+all
4export DEB_CFLAGS_MAINT_APPEND = -Wall4export DEB_CFLAGS_MAINT_APPEND = -Wall
5export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed5export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
6# On ppc64el, dpkg-buildflags sets -O3 instead of the usual
7# -O2. This makes gcc emit a format-truncation error on
8# pconn.cc. See https://bugs.squid-cache.org/show_bug.cgi?id=4875
9ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH),ppc64el)
10 export DEB_CXXFLAGS_MAINT_APPEND = -Wno-format-truncation
11endif
12export DEB_BUILD_PARALLEL = yes
6include /usr/share/dpkg/buildflags.mk13include /usr/share/dpkg/buildflags.mk
714
8include /usr/share/cdbs/1/rules/debhelper.mk15include /usr/share/cdbs/1/rules/debhelper.mk
@@ -88,3 +95,7 @@ install/squid::
88 install -m 755 -g root -d $(INSTALLDIR)/usr/share/man/man195 install -m 755 -g root -d $(INSTALLDIR)/usr/share/man/man1
89 mv $(INSTALLDIR)/usr/bin/purge $(INSTALLDIR)/usr/bin/squid-purge96 mv $(INSTALLDIR)/usr/bin/purge $(INSTALLDIR)/usr/bin/squid-purge
90 mv $(INSTALLDIR)/usr/share/man/man1/purge.1 $(INSTALLDIR)/usr/share/man/man1/squid-purge.197 mv $(INSTALLDIR)/usr/share/man/man1/purge.1 $(INSTALLDIR)/usr/share/man/man1/squid-purge.1
98 install -m 755 -g root -d $(INSTALLDIR)/etc/apparmor.d/force-complain
99 install -m 755 -g root -d $(INSTALLDIR)/etc/apparmor.d/disable
100 install -m 644 -g root debian/usr.sbin.squid $(INSTALLDIR)/etc/apparmor.d
101 dh_apparmor --profile-name=usr.sbin.squid -psquid
diff --git a/debian/squid.install b/debian/squid.install
index 95ebe1a..d13050d 100644
--- a/debian/squid.install
+++ b/debian/squid.install
@@ -28,3 +28,6 @@ usr/share/man/man8/negotiate_kerberos_auth.8
28usr/share/man/man8/security_fake_certverify.828usr/share/man/man8/security_fake_certverify.8
29usr/share/man/man8/storeid_file_rewrite.829usr/share/man/man8/storeid_file_rewrite.8
30usr/share/man/man8/squid.830usr/share/man/man8/squid.8
31etc/apparmor.d/disable
32etc/apparmor.d/force-complain
33etc/apparmor.d/usr.sbin.squid
diff --git a/debian/squid.preinst b/debian/squid.preinst
index 6b490e0..593ffa9 100644
--- a/debian/squid.preinst
+++ b/debian/squid.preinst
@@ -63,6 +63,21 @@ then
63 chsh -s /bin/sh proxy63 chsh -s /bin/sh proxy
64fi64fi
6565
66disable_profile() {
67 APP_CONFFILE="/etc/apparmor.d/usr.sbin.squid"
68 APP_DISABLE="/etc/apparmor.d/disable/usr.sbin.squid"
69 # Create a symlink to the yet-to-be-unpacked profile
70 if [ ! -e "$APP_CONFFILE" ]; then
71 mkdir -p `dirname $APP_DISABLE` 2>/dev/null || true
72 ln -sf $APP_CONFFILE $APP_DISABLE
73 fi
74}
75
76if [ "$1" = "install" ]; then
77 # Disable AppArmor profile on install
78 disable_profile
79fi
80
66# dh_installdeb will replace this with shell code automatically81# dh_installdeb will replace this with shell code automatically
67# generated by other debhelper scripts.82# generated by other debhelper scripts.
6883
diff --git a/debian/tests/test-squid.py b/debian/tests/test-squid.py
index 11c630a..bc5c172 100644
--- a/debian/tests/test-squid.py
+++ b/debian/tests/test-squid.py
@@ -106,7 +106,7 @@ class BasicTest(HttpdCommon):
106106
107 self.gophermap = "/var/gopher/gophermap"107 self.gophermap = "/var/gopher/gophermap"
108108
109 self.aa_profile = "usr.sbin.squid3"109 self.aa_profile = "usr.sbin.squid"
110 self.aa_abs_profile = "/etc/apparmor.d/%s" % self.aa_profile110 self.aa_abs_profile = "/etc/apparmor.d/%s" % self.aa_profile
111111
112 def tearDown(self):112 def tearDown(self):
@@ -118,7 +118,7 @@ class BasicTest(HttpdCommon):
118 '''Test daemon'''118 '''Test daemon'''
119119
120 pidfile = "/run/squid.pid"120 pidfile = "/run/squid.pid"
121 exe = "(squid-1)"121 exe = "squid"
122122
123 self.assertTrue(check_pidfile(exe, pidfile))123 self.assertTrue(check_pidfile(exe, pidfile))
124124
diff --git a/debian/tests/upstream-test-suite b/debian/tests/upstream-test-suite
index 4f6b332..bdb0e06 100644
--- a/debian/tests/upstream-test-suite
+++ b/debian/tests/upstream-test-suite
@@ -2,10 +2,10 @@
2set -e2set -e
33
4dpkg-source --before-build `pwd`4dpkg-source --before-build `pwd`
5sed -i -e 's/\$(top_builddir)\/src\/squid/\/usr\/sbin\/squid/' test-suite/Makefile.am
6dpkg-buildpackage -rfakeroot --target=pre-build5dpkg-buildpackage -rfakeroot --target=pre-build
7dpkg-buildpackage -rfakeroot --target=common-configure-arch 2>/dev/null6dpkg-buildpackage -rfakeroot --target=common-configure-arch 2>/dev/null
8make -C src/base libbase.la7make -C src/base libbase.la
8make -C src/mem libmem.la
9make -C src globals.o9make -C src globals.o
10make -C lib all10make -C lib all
11make -C compat11make -C compat
diff --git a/debian/usr.sbin.squid b/debian/usr.sbin.squid
12new file mode 10064412new file mode 100644
index 0000000..d80c8ea
--- /dev/null
+++ b/debian/usr.sbin.squid
@@ -0,0 +1,85 @@
1# Author: Simon Deziel
2# Jamie Strandboge
3# vim:syntax=apparmor
4#include <tunables/global>
5
6/usr/sbin/squid {
7 #include <abstractions/base>
8 #include <abstractions/kerberosclient>
9 #include <abstractions/nameservice>
10 #include <abstractions/ssl_certs>
11
12 # If you are using squid with the default snakeoil certificates, you will
13 # probably have to uncomment the line below so that squid can read the
14 # private key:
15 #/etc/ssl/private/ssl-cert-snakeoil.key r,
16
17 # For a more generous permission, but also less secure, you could
18 # alternatively include the <abstractions/ssl_keys> abstraction, which
19 # gives read access to the entire contents of /etc/ssl
20
21 capability net_raw,
22 capability setuid,
23 capability setgid,
24 capability sys_chroot,
25
26 # allow child processes to run execvp(argv[0], [kidname, ...])
27 /usr/sbin/squid ix,
28
29 # pinger
30 network inet raw,
31 network inet6 raw,
32
33 /etc/mtab r,
34 @{PROC}/[0-9]*/mounts r,
35 @{PROC}/mounts r,
36
37 # squid3 configuration
38 /etc/squid/** r,
39 /{,var/}run/squid.pid rwk,
40 /var/spool/squid/ r,
41 /var/spool/squid/** rwk,
42 /usr/lib/squid{,3}/* rmix,
43 /usr/share/squid/** r,
44 /var/log/squid/* rw,
45
46 # squid-langpack
47 /usr/share/squid-langpack/** r,
48
49 # maas-proxy
50 /var/lib/maas/maas-proxy.conf r,
51 /var/log/maas/proxy/** rw,
52 /var/spool/maas-proxy/ r,
53 /var/spool/maas-proxy/** rwk,
54
55 # squid-deb-proxy
56 /etc/squid-deb-proxy/** r,
57 /{,var/}run/squid-deb-proxy.pid rwk,
58 /var/cache/squid-deb-proxy/ r,
59 /var/cache/squid-deb-proxy/** rwk,
60 /var/log/squid-deb-proxy/* rw,
61 owner /dev/shm/** rmw,
62
63 # squidguard
64 /usr/bin/squidGuard Cx -> squidguard,
65 profile squidguard {
66 #include <abstractions/base>
67
68 /etc/squid/squidGuard.conf r,
69 /var/log/squid{,3}/squidGuard.log w,
70 /var/lib/squidguard/** rw,
71
72 # squidguard by default uses /var/log/squid as its logdir, however, we
73 # don't want it to access squid's logs, only its own. Explicitly deny
74 # access to squid's files but allow all others since the user may specify
75 # anything for the squidGurad 'log' directive.
76 /var/log/squid{,3}/* rw,
77 audit deny /var/log/squid{,3}/{access,cache,store}.log* rw,
78
79 # Site-specific additions and overrides. See local/README for details.
80 #include <local/usr.sbin.squid>
81 }
82
83 # Site-specific additions and overrides. See local/README for details.
84 #include <local/usr.sbin.squid>
85}

Subscribers

People subscribed via source and target branches