Merge ~danilogondolfo/ubuntu/+source/netplan.io:mantic_generator_postinst into ubuntu/+source/netplan.io:ubuntu/mantic-devel

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

Unmerged commits

c0c7191... by Danilo Egea Gondolfo

Changelog

5d5ba73... by Danilo Egea Gondolfo

debian/netplan-generator.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 d0785e2..1c12f58 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+netplan.io (0.107-5ubuntu0.4) mantic; urgency=medium
7+
8+ * debian/netplan-generator.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:40:14 +0100
13+
14 netplan.io (0.107-5ubuntu0.3) mantic-security; urgency=medium
15
16 * SECURITY UPDATE: weak permissions on secret files, command injection
17diff --git a/debian/netplan-generator.postinst b/debian/netplan-generator.postinst
18index 1758dff..f805c24 100644
19--- a/debian/netplan-generator.postinst
20+++ b/debian/netplan-generator.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/libexec/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/libexec/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