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
1diff --git a/debian/changelog b/debian/changelog
2index 7ec4ae4..e957d13 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,68 @@
6+squid (4.1-1ubuntu1) cosmic; urgency=medium
7+
8+ * Merged with Debian unstable (LP: #1780944, LP: #1097032, LP: #16669).
9+ Remaining changes:
10+ - Use snakeoil certificates.
11+ [Updated to use the correct config setting names]
12+ - Add an example refresh pattern for debs.
13+ [Improved the refresh patterns based on the configuration from
14+ squid-deb-proxy package]
15+ - Add disabled by default AppArmor profile.
16+ [Updated to include the ssl_certs abstraction and suggestions on how to
17+ deal with the snakeoil private key and other keys in /etc/ssl.]
18+ * Dropped changes:
19+ - Add additional dep8 tests.
20+ [Adopted in 4.0.21-1~exp5, albeit a stripped down version]
21+ - Correct attribution and add explanatory note in d/NEWS.debian.
22+ [That particular upgrade path has happened long ago.]
23+ - Drop wrong short-circuiting of various invocations; we always want to
24+ call the debhelper block.
25+ [This was for the transitional squid3 package, and that transition has
26+ already happened.]
27+ - Revert "Set pidfile for systemd's sysv-generator" from Debian.
28+ [Not needed anymore since we have a native systemd service file
29+ and no longer rely on the generator.]
30+ - Enable autoreconf. This is no longer required for the security updates,
31+ but is needed for the seddery of test-suite/Makefile.am in
32+ d/t/upstream-test-suite.
33+ [Replaced by patch 0003-installed-binary-for-debian-ci.patch]
34+ - Adjust seddery for upstream test squid binary location.
35+ [sed no longer necessary since patch,
36+ 0003-installed-binary-for-debian-ci.patch, will be dropped
37+ entirely.]
38+ - Drop Conflicts/Replaces of squid against squid3. In Ubuntu, the migration
39+ happened in Xenial, so no upgrade path still requires this code. This
40+ reduces upgrade ordering difficulty.
41+ [Again we have a migration, but this time from squid3 to squid, so we
42+ need this].
43+ - GCC7 FTBFS fixes (LP: #1712668):
44+ + d/rules: don't error when hitting the "deprecated" and
45+ "format-truncation" gcc7 warnings. Upstream 3.5.27 has fixes for these,
46+ but one in Format.cc that affects 32bit builds was deemed too intrusive
47+ for the 3.5 stable series and is only in squid 4.x
48+ [No longer needed with squid 4.x]
49+ - Do not force gcc-6
50+ [It was a temporary workaround in Debian that got dropped]
51+ * Added changes:
52+ - d/rules: enable cdbs parallel build
53+ - d/t/test-squid.py: fix apparmor profile filename
54+ - d/t/test-squid.py: fix the process name. The PID points at the parent.
55+ - d/t/upstream-test-suite: also make libmem.la, needed by the tests.
56+ - d/t/0003-installed-binary-for-debian-ci.patch: use the squid
57+ binary from the system, instead of the one from the source tree.
58+ - d/p/fix-uninitialized-var.patch: Workaround gcc's maybe-unitialized
59+ error in parse_time_t, triggered on ppc64el due to the build using -O3
60+ in that architecture.
61+ - d/rules: Add -Wno-format-truncation to CXXFLAGS as a workaround if
62+ building for ppc64el. On that arch, dpkg-buildflags sets -O3 instead of
63+ -O2 and that triggers a format-truncation error on pcon.cc. See
64+ See https://bugs.squid-cache.org/show_bug.cgi?id=4875
65+ - d/t/upstream-test-suite: drop the sed line, since patch
66+ 0003-installed-binary-for-debian-ci.patch is doing this work now.
67+ (https://salsa.debian.org/squid-team/squid/commit/ad4372b444ba8b1587839)
68+
69+ -- Andreas Hasenack <andreas@canonical.com> Thu, 16 Aug 2018 12:33:17 -0300
70+
71 squid (4.1-1) unstable; urgency=high
72
73 * New Upstream Release (Closes: #896120)
74diff --git a/debian/control b/debian/control
75index c59d487..bdd9c4f 100644
76--- a/debian/control
77+++ b/debian/control
78@@ -1,7 +1,8 @@
79 Source: squid
80 Section: web
81 Priority: optional
82-Maintainer: Luigi Gangitano <luigi@debian.org>
83+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
84+XSBC-Original-Maintainer: Luigi Gangitano <luigi@debian.org>
85 Uploaders: Santiago Garcia Mantinan <manty@debian.org>
86 Homepage: http://www.squid-cache.org
87 Standards-Version: 4.1.4
88@@ -24,6 +25,7 @@ Build-Depends: ed, libltdl-dev, pkg-config
89 , libsasl2-dev
90 , libxml2-dev
91 , nettle-dev
92+ , dh-apparmor
93
94 Package: squid3
95 Architecture: all
96@@ -40,8 +42,8 @@ Description: Transitional package
97 Package: squid
98 Architecture: any
99 Pre-Depends: adduser
100-Depends: ${shlibs:Depends}, ${misc:Depends}, netbase, logrotate (>= 3.5.4-1), squid-common (>= ${source:Version}), lsb-base, libdbi-perl
101-Suggests: squidclient, squid-cgi, squid-purge, resolvconf (>= 0.40), smbclient, ufw, winbindd
102+Depends: ${shlibs:Depends}, ${misc:Depends}, netbase, logrotate (>= 3.5.4-1), squid-common (>= ${source:Version}), lsb-base, libdbi-perl, ssl-cert
103+Suggests: squidclient, squid-cgi, squid-purge, resolvconf (>= 0.40), smbclient, ufw, winbindd, apparmor
104 Recommends: libcap2-bin [linux-any], ca-certificates
105 Conflicts: squid3 (<< ${binary:Version})
106 Replaces: squid3
107diff --git a/debian/patches/0003-installed-binary-for-debian-ci.patch b/debian/patches/0003-installed-binary-for-debian-ci.patch
108new file mode 100644
109index 0000000..abbe089
110--- /dev/null
111+++ b/debian/patches/0003-installed-binary-for-debian-ci.patch
112@@ -0,0 +1,37 @@
113+Description: Use installed squid binary for Debian CI testing
114+ Upstream config tests are designed for use during builds. Debian CI uses a
115+ pre-built binary installation.
116+ .
117+ Ubuntu specific note:
118+ This patch replaces two bits of Ubuntu delta:
119+ - Adjust seddery for upstream test squid binary location.
120+ - Enable autoreconf
121+Author: Amos Jeffries <amosjeffries@squid-cache.org>
122+Origin: vendor, https://salsa.debian.org/squid-team/squid/commit/fe6be5764611e9d7294b6bd97d97d1b23ffa4ce9
123+Last-Update: 2018-08-15
124+diff --git a/test-suite/Makefile.am b/test-suite/Makefile.am
125+index c8ff455d..bb7aef46 100644
126+--- a/test-suite/Makefile.am
127++++ b/test-suite/Makefile.am
128+@@ -150,7 +150,7 @@ VirtualDeleteOperator_SOURCES = VirtualDeleteOperator.cc stub_libmem.cc $(DEBUG_
129+ squid-conf-tests: $(top_builddir)/src/squid.conf.default $(srcdir)/squidconf/*
130+ @failed=0; cfglist="$?"; rm -f $@ || $(TRUE); \
131+ for cfg in $$cfglist ; do \
132+- $(top_builddir)/src/squid -k parse -f $$cfg || \
133++ /usr/sbin/squid -k parse -f $$cfg || \
134+ { echo "FAIL: squid.conf test: $$cfg" | \
135+ sed s%$(top_builddir)/src/%% | \
136+ sed s%$(srcdir)/squidconf/%% ; \
137+diff --git a/test-suite/Makefile.in b/test-suite/Makefile.in
138+index 5e7cd5fa..15f78635 100644
139+--- a/test-suite/Makefile.in
140++++ b/test-suite/Makefile.in
141+@@ -1477,7 +1477,7 @@ STUB.h: $(top_srcdir)/src/tests/STUB.h
142+ squid-conf-tests: $(top_builddir)/src/squid.conf.default $(srcdir)/squidconf/*
143+ @failed=0; cfglist="$?"; rm -f $@ || $(TRUE); \
144+ for cfg in $$cfglist ; do \
145+- $(top_builddir)/src/squid -k parse -f $$cfg || \
146++ /usr/sbin/squid -k parse -f $$cfg || \
147+ { echo "FAIL: squid.conf test: $$cfg" | \
148+ sed s%$(top_builddir)/src/%% | \
149+ sed s%$(srcdir)/squidconf/%% ; \
150diff --git a/debian/patches/90-cf.data.ubuntu.patch b/debian/patches/90-cf.data.ubuntu.patch
151new file mode 100644
152index 0000000..9dfa5b4
153--- /dev/null
154+++ b/debian/patches/90-cf.data.ubuntu.patch
155@@ -0,0 +1,16 @@
156+--- a/src/cf.data.pre
157++++ b/src/cf.data.pre
158+@@ -5859,6 +5862,12 @@ NOCOMMENT_START
159+ refresh_pattern ^ftp: 1440 20% 10080
160+ refresh_pattern ^gopher: 1440 0% 1440
161+ refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
162++refresh_pattern \/(Packages|Sources)(|\.bz2|\.gz|\.xz)$ 0 0% 0 refresh-ims
163++refresh_pattern \/Release(|\.gpg)$ 0 0% 0 refresh-ims
164++refresh_pattern \/InRelease$ 0 0% 0 refresh-ims
165++refresh_pattern \/(Translation-.*)(|\.bz2|\.gz|\.xz)$ 0 0% 0 refresh-ims
166++# example pattern for deb packages
167++#refresh_pattern (\.deb|\.udeb)$ 129600 100% 129600
168+ refresh_pattern . 0 20% 4320
169+ NOCOMMENT_END
170+ DOC_END
171+
172diff --git a/debian/patches/99-ubuntu-ssl-cert-snakeoil.patch b/debian/patches/99-ubuntu-ssl-cert-snakeoil.patch
173new file mode 100644
174index 0000000..40b5306
175--- /dev/null
176+++ b/debian/patches/99-ubuntu-ssl-cert-snakeoil.patch
177@@ -0,0 +1,22 @@
178+--- a/src/cf.data.pre
179++++ b/src/cf.data.pre
180+@@ -3516,6 +3516,19 @@
181+ reference a PEM file containing both the certificate
182+ and private key.
183+
184++ Notes:
185++
186++ On Debian/Ubuntu systems a default snakeoil certificate is
187++ available in /etc/ssl and users can set:
188++
189++ sslcert=/etc/ssl/certs/ssl-cert-snakeoil.pem
190++
191++ and
192++
193++ sslkey=/etc/ssl/private/ssl-cert-snakeoil.key
194++
195++ for testing.
196++
197+ sslcipher=... The list of valid SSL ciphers to use when connecting
198+ to this peer.
199+
200diff --git a/debian/patches/fix-uninitialized-var.patch b/debian/patches/fix-uninitialized-var.patch
201new file mode 100644
202index 0000000..a682703
203--- /dev/null
204+++ b/debian/patches/fix-uninitialized-var.patch
205@@ -0,0 +1,25 @@
206+Description: Workaround gcc's maybe-uninitialized error in parse_time_t
207+ Function parse_time_t() passes an unitialized variable to parseTimeLine(),
208+ which will fill it in as the return value. gcc's -Wmaybe-unitialized setting
209+ trips over this when the build is done with -O3, as is the case in ppc64el.
210+ This fix is suggested in https://github.com/squid-cache/squid/pull/270, but
211+ not accepted yet. It was remarked that a better fix can be done, instead of
212+ just working around the gcc misfire.
213+Origin: other, https://github.com/squid-cache/squid/pull/270
214+Bug: https://bugs.squid-cache.org/show_bug.cgi?id=4875
215+Last-Update: 2018-08-14
216+---
217+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
218+diff --git a/src/cache_cf.cc b/src/cache_cf.cc
219+index 006a42d..96fe36f 100644
220+--- a/src/cache_cf.cc
221++++ b/src/cache_cf.cc
222+@@ -2925,7 +2925,7 @@ dump_time_t(StoreEntry * entry, const char *name, time_t var)
223+ void
224+ parse_time_t(time_t * var)
225+ {
226+- time_msec_t tval;
227++ time_msec_t tval = 0;
228+ parseTimeLine(&tval, T_SECOND_STR, false);
229+ *var = static_cast<time_t>(tval/1000);
230+ }
231diff --git a/debian/patches/series b/debian/patches/series
232index 9c85ddd..12952d3 100644
233--- a/debian/patches/series
234+++ b/debian/patches/series
235@@ -1,3 +1,7 @@
236 0001-Default-configuration-file-for-debian.patch
237 0002-Change-default-file-locations-for-debian.patch
238 0011-upstream-pr172.patch
239+90-cf.data.ubuntu.patch
240+99-ubuntu-ssl-cert-snakeoil.patch
241+0003-installed-binary-for-debian-ci.patch
242+fix-uninitialized-var.patch
243diff --git a/debian/rules b/debian/rules
244index 48211db..9b7b98c 100755
245--- a/debian/rules
246+++ b/debian/rules
247@@ -3,6 +3,13 @@
248 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
249 export DEB_CFLAGS_MAINT_APPEND = -Wall
250 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
251+# On ppc64el, dpkg-buildflags sets -O3 instead of the usual
252+# -O2. This makes gcc emit a format-truncation error on
253+# pconn.cc. See https://bugs.squid-cache.org/show_bug.cgi?id=4875
254+ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH),ppc64el)
255+ export DEB_CXXFLAGS_MAINT_APPEND = -Wno-format-truncation
256+endif
257+export DEB_BUILD_PARALLEL = yes
258 include /usr/share/dpkg/buildflags.mk
259
260 include /usr/share/cdbs/1/rules/debhelper.mk
261@@ -88,3 +95,7 @@ install/squid::
262 install -m 755 -g root -d $(INSTALLDIR)/usr/share/man/man1
263 mv $(INSTALLDIR)/usr/bin/purge $(INSTALLDIR)/usr/bin/squid-purge
264 mv $(INSTALLDIR)/usr/share/man/man1/purge.1 $(INSTALLDIR)/usr/share/man/man1/squid-purge.1
265+ install -m 755 -g root -d $(INSTALLDIR)/etc/apparmor.d/force-complain
266+ install -m 755 -g root -d $(INSTALLDIR)/etc/apparmor.d/disable
267+ install -m 644 -g root debian/usr.sbin.squid $(INSTALLDIR)/etc/apparmor.d
268+ dh_apparmor --profile-name=usr.sbin.squid -psquid
269diff --git a/debian/squid.install b/debian/squid.install
270index 95ebe1a..d13050d 100644
271--- a/debian/squid.install
272+++ b/debian/squid.install
273@@ -28,3 +28,6 @@ usr/share/man/man8/negotiate_kerberos_auth.8
274 usr/share/man/man8/security_fake_certverify.8
275 usr/share/man/man8/storeid_file_rewrite.8
276 usr/share/man/man8/squid.8
277+etc/apparmor.d/disable
278+etc/apparmor.d/force-complain
279+etc/apparmor.d/usr.sbin.squid
280diff --git a/debian/squid.preinst b/debian/squid.preinst
281index 6b490e0..593ffa9 100644
282--- a/debian/squid.preinst
283+++ b/debian/squid.preinst
284@@ -63,6 +63,21 @@ then
285 chsh -s /bin/sh proxy
286 fi
287
288+disable_profile() {
289+ APP_CONFFILE="/etc/apparmor.d/usr.sbin.squid"
290+ APP_DISABLE="/etc/apparmor.d/disable/usr.sbin.squid"
291+ # Create a symlink to the yet-to-be-unpacked profile
292+ if [ ! -e "$APP_CONFFILE" ]; then
293+ mkdir -p `dirname $APP_DISABLE` 2>/dev/null || true
294+ ln -sf $APP_CONFFILE $APP_DISABLE
295+ fi
296+}
297+
298+if [ "$1" = "install" ]; then
299+ # Disable AppArmor profile on install
300+ disable_profile
301+fi
302+
303 # dh_installdeb will replace this with shell code automatically
304 # generated by other debhelper scripts.
305
306diff --git a/debian/tests/test-squid.py b/debian/tests/test-squid.py
307index 11c630a..bc5c172 100644
308--- a/debian/tests/test-squid.py
309+++ b/debian/tests/test-squid.py
310@@ -106,7 +106,7 @@ class BasicTest(HttpdCommon):
311
312 self.gophermap = "/var/gopher/gophermap"
313
314- self.aa_profile = "usr.sbin.squid3"
315+ self.aa_profile = "usr.sbin.squid"
316 self.aa_abs_profile = "/etc/apparmor.d/%s" % self.aa_profile
317
318 def tearDown(self):
319@@ -118,7 +118,7 @@ class BasicTest(HttpdCommon):
320 '''Test daemon'''
321
322 pidfile = "/run/squid.pid"
323- exe = "(squid-1)"
324+ exe = "squid"
325
326 self.assertTrue(check_pidfile(exe, pidfile))
327
328diff --git a/debian/tests/upstream-test-suite b/debian/tests/upstream-test-suite
329index 4f6b332..bdb0e06 100644
330--- a/debian/tests/upstream-test-suite
331+++ b/debian/tests/upstream-test-suite
332@@ -2,10 +2,10 @@
333 set -e
334
335 dpkg-source --before-build `pwd`
336-sed -i -e 's/\$(top_builddir)\/src\/squid/\/usr\/sbin\/squid/' test-suite/Makefile.am
337 dpkg-buildpackage -rfakeroot --target=pre-build
338 dpkg-buildpackage -rfakeroot --target=common-configure-arch 2>/dev/null
339 make -C src/base libbase.la
340+make -C src/mem libmem.la
341 make -C src globals.o
342 make -C lib all
343 make -C compat
344diff --git a/debian/usr.sbin.squid b/debian/usr.sbin.squid
345new file mode 100644
346index 0000000..d80c8ea
347--- /dev/null
348+++ b/debian/usr.sbin.squid
349@@ -0,0 +1,85 @@
350+# Author: Simon Deziel
351+# Jamie Strandboge
352+# vim:syntax=apparmor
353+#include <tunables/global>
354+
355+/usr/sbin/squid {
356+ #include <abstractions/base>
357+ #include <abstractions/kerberosclient>
358+ #include <abstractions/nameservice>
359+ #include <abstractions/ssl_certs>
360+
361+ # If you are using squid with the default snakeoil certificates, you will
362+ # probably have to uncomment the line below so that squid can read the
363+ # private key:
364+ #/etc/ssl/private/ssl-cert-snakeoil.key r,
365+
366+ # For a more generous permission, but also less secure, you could
367+ # alternatively include the <abstractions/ssl_keys> abstraction, which
368+ # gives read access to the entire contents of /etc/ssl
369+
370+ capability net_raw,
371+ capability setuid,
372+ capability setgid,
373+ capability sys_chroot,
374+
375+ # allow child processes to run execvp(argv[0], [kidname, ...])
376+ /usr/sbin/squid ix,
377+
378+ # pinger
379+ network inet raw,
380+ network inet6 raw,
381+
382+ /etc/mtab r,
383+ @{PROC}/[0-9]*/mounts r,
384+ @{PROC}/mounts r,
385+
386+ # squid3 configuration
387+ /etc/squid/** r,
388+ /{,var/}run/squid.pid rwk,
389+ /var/spool/squid/ r,
390+ /var/spool/squid/** rwk,
391+ /usr/lib/squid{,3}/* rmix,
392+ /usr/share/squid/** r,
393+ /var/log/squid/* rw,
394+
395+ # squid-langpack
396+ /usr/share/squid-langpack/** r,
397+
398+ # maas-proxy
399+ /var/lib/maas/maas-proxy.conf r,
400+ /var/log/maas/proxy/** rw,
401+ /var/spool/maas-proxy/ r,
402+ /var/spool/maas-proxy/** rwk,
403+
404+ # squid-deb-proxy
405+ /etc/squid-deb-proxy/** r,
406+ /{,var/}run/squid-deb-proxy.pid rwk,
407+ /var/cache/squid-deb-proxy/ r,
408+ /var/cache/squid-deb-proxy/** rwk,
409+ /var/log/squid-deb-proxy/* rw,
410+ owner /dev/shm/** rmw,
411+
412+ # squidguard
413+ /usr/bin/squidGuard Cx -> squidguard,
414+ profile squidguard {
415+ #include <abstractions/base>
416+
417+ /etc/squid/squidGuard.conf r,
418+ /var/log/squid{,3}/squidGuard.log w,
419+ /var/lib/squidguard/** rw,
420+
421+ # squidguard by default uses /var/log/squid as its logdir, however, we
422+ # don't want it to access squid's logs, only its own. Explicitly deny
423+ # access to squid's files but allow all others since the user may specify
424+ # anything for the squidGurad 'log' directive.
425+ /var/log/squid{,3}/* rw,
426+ audit deny /var/log/squid{,3}/{access,cache,store}.log* rw,
427+
428+ # Site-specific additions and overrides. See local/README for details.
429+ #include <local/usr.sbin.squid>
430+ }
431+
432+ # Site-specific additions and overrides. See local/README for details.
433+ #include <local/usr.sbin.squid>
434+}

Subscribers

People subscribed via source and target branches