Merge ~danilogondolfo/ubuntu/+source/netplan.io:focal_generator_postinst into ubuntu/+source/netplan.io:ubuntu/focal-devel

Proposed by Danilo Egea Gondolfo
Status: Work in progress
Proposed branch: ~danilogondolfo/ubuntu/+source/netplan.io:focal_generator_postinst
Merge into: ubuntu/+source/netplan.io:ubuntu/focal-devel
Diff against target: 34 lines (+13/-1)
2 files modified
debian/changelog (+8/-0)
debian/netplan.io.postinst (+5/-1)
Reviewer Review Type Date Requested Status
git-ubuntu import Pending
Review via email: mp+468428@code.launchpad.net
To post a comment you must log in.

Unmerged commits

2c06c83... by Danilo Egea Gondolfo

Changelog

d2fe286... by Danilo Egea Gondolfo

debian/netplan.io.postinst

Don't call the generator if no netplan configuration file exists.
(LP: #2071333)

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 fea6a3b..b894b45 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+netplan.io (0.104-0ubuntu2~20.04.6) focal; urgency=medium
7+
8+ * debian/netplan.io.postinst:
9+ Don't call the generator if no networkd configuration file exists.
10+ (LP: #2071333)
11+
12+ -- Danilo Egea Gondolfo <danilo.egea.gondolfo@canonical.com> Fri, 28 Jun 2024 10:43:21 +0100
13+
14 netplan.io (0.104-0ubuntu2~20.04.5) focal-security; urgency=medium
15
16 * SECURITY UPDATE: weak permissions on secret files, command injection
17diff --git a/debian/netplan.io.postinst b/debian/netplan.io.postinst
18index d76598a..b3554f5 100644
19--- a/debian/netplan.io.postinst
20+++ b/debian/netplan.io.postinst
21@@ -3,8 +3,12 @@
22 set -e
23
24 # Calling the generator after installation to mitigate CVE-2022-4968
25+# We avoid calling the generator if the system doesn't have networkd files to be fixed (LP: #2071333)
26 if [ "$1" = configure ]; then
27- /usr/lib/netplan/generate 2>/dev/null || echo "WARNING: Netplan could not re-generate network configuration. Please run 'netplan generate' to see details."
28+ FILES=$(find /run/systemd/network/ -type f -regex ".*-netplan.*\.\(network\|netdev\)" 2>/dev/null || true)
29+ if [ -n "${FILES}" ]; then
30+ /usr/lib/netplan/generate 2>/dev/null || echo "WARNING: Netplan could not re-generate network configuration. Please run 'netplan generate' to see details."
31+ fi
32 fi
33
34 #DEBHELPER#

Subscribers

People subscribed via source and target branches