diff mbox series

[2/3] package/systemd: create system users

Message ID 20200113153516.486106-2-nolange79@gmail.com
State New
Headers show
Series [1/3] support/scripts/mkusers: allow option for system uid/gid | expand

Commit Message

Norbert Lange Jan. 13, 2020, 3:35 p.m. UTC
Signed-off-by: Norbert Lange <nolange79@gmail.com>
---
 package/systemd/allow-empty-hostname.patch | 58 ++++++++++++++++++++++
 package/systemd/systemd.mk                 | 18 +++----
 2 files changed, 67 insertions(+), 9 deletions(-)
 create mode 100644 package/systemd/allow-empty-hostname.patch

Comments

Thomas Petazzoni Jan. 13, 2020, 4:05 p.m. UTC | #1
On Mon, 13 Jan 2020 16:35:14 +0100
Norbert Lange <nolange79@gmail.com> wrote:

> Signed-off-by: Norbert Lange <nolange79@gmail.com>
> ---
>  package/systemd/allow-empty-hostname.patch | 58 ++++++++++++++++++++++

This patch doesn't seem to be related.

Thomas
diff mbox series

Patch

diff --git a/package/systemd/allow-empty-hostname.patch b/package/systemd/allow-empty-hostname.patch
new file mode 100644
index 0000000000..43dff94eae
--- /dev/null
+++ b/package/systemd/allow-empty-hostname.patch
@@ -0,0 +1,58 @@ 
+diff --git a/src/network/generator/network-generator.c b/src/network/generator/network-generator.c
+index 81afa953076..bed1e42697c 100644
+--- a/src/network/generator/network-generator.c
++++ b/src/network/generator/network-generator.c
+@@ -574,7 +574,7 @@ static int parse_netmask_or_prefixlen(int family, const char **value, unsigned c
+ 
+ static int parse_cmdline_ip_address(Context *context, int family, const char *value) {
+         union in_addr_union addr = {}, peer = {}, gateway = {};
+-        const char *hostname, *ifname, *dhcp_type, *dns, *p;
++        const char *hostname = NULL, *ifname, *dhcp_type, *dns, *p;
+         unsigned char prefixlen;
+         int r;
+ 
+@@ -599,9 +599,11 @@ static int parse_cmdline_ip_address(Context *context, int family, const char *va
+         if (!p)
+                 return -EINVAL;
+ 
+-        hostname = strndupa(value, p - value);
+-        if (!hostname_is_valid(hostname, false))
+-                return -EINVAL;
++        if (p != value) {
++                hostname = strndupa(value, p - value);
++                if (!hostname_is_valid(hostname, false))
++                        return -EINVAL;
++        }
+ 
+         value = p + 1;
+ 
+diff --git a/test/TEST-35-NETWORK-GENERATOR/test-03-issue-14319.expected/90-enp3s0.network b/test/TEST-35-NETWORK-GENERATOR/test-03-issue-14319.expected/90-enp3s0.network
+new file mode 100644
+index 00000000000..28ccfdd9b00
+--- /dev/null
++++ b/test/TEST-35-NETWORK-GENERATOR/test-03-issue-14319.expected/90-enp3s0.network
+@@ -0,0 +1,17 @@
++# Automatically generated by systemd-network-generator
++
++[Match]
++Name=enp3s0
++
++[Link]
++
++[Network]
++DHCP=no
++
++[DHCP]
++
++[Address]
++Address=10.99.37.44/16
++
++[Route]
++Gateway=10.99.10.1
+diff --git a/test/TEST-35-NETWORK-GENERATOR/test-03-issue-14319.input b/test/TEST-35-NETWORK-GENERATOR/test-03-issue-14319.input
+new file mode 100644
+index 00000000000..3be752067b8
+--- /dev/null
++++ b/test/TEST-35-NETWORK-GENERATOR/test-03-issue-14319.input
+@@ -0,0 +1 @@
++root=/dev/nfs nfsroot=10.99.37.240:/srv/netroot,v3,tcp ip=10.99.37.44::10.99.10.1:255.255.0.0::enp3s0:off
diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index a3073f10a9..bce87951d2 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -181,7 +181,7 @@  endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_JOURNAL_REMOTE),y)
 SYSTEMD_CONF_OPTS += -Dremote=true
-SYSTEMD_REMOTE_USER = systemd-journal-remote -1 systemd-journal-remote -1 * /run/systemd - - systemd Journal Remote
+SYSTEMD_REMOTE_USER = systemd-journal-remote -2 systemd-journal-remote -2 * /run/systemd - - systemd Journal Remote
 else
 SYSTEMD_CONF_OPTS += -Dremote=false
 endif
@@ -305,7 +305,7 @@  endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_COREDUMP),y)
 SYSTEMD_CONF_OPTS += -Dcoredump=true
-SYSTEMD_COREDUMP_USER = systemd-coredump -1 systemd-coredump -1 * /run/systemd - - systemd core dump processing
+SYSTEMD_COREDUMP_USER = systemd-coredump -2 systemd-coredump -2 * /run/systemd - - systemd core dump processing
 else
 SYSTEMD_CONF_OPTS += -Dcoredump=false
 endif
@@ -325,7 +325,7 @@  endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),y)
 SYSTEMD_CONF_OPTS += -Dnetworkd=true
-SYSTEMD_NETWORKD_USER = systemd-network -1 systemd-network -1 * /run/systemd - - systemd Network Management
+SYSTEMD_NETWORKD_USER = systemd-network -2 systemd-network -2 * /run/systemd - - systemd Network Management
 SYSTEMD_NETWORKD_DHCP_IFACE = $(call qstrip,$(BR2_SYSTEM_DHCP))
 ifneq ($(SYSTEMD_NETWORKD_DHCP_IFACE),)
 define SYSTEMD_INSTALL_NETWORK_CONFS
@@ -344,14 +344,14 @@  define SYSTEMD_INSTALL_RESOLVCONF_HOOK
 		$(TARGET_DIR)/etc/resolv.conf
 endef
 SYSTEMD_CONF_OPTS += -Dresolve=true
-SYSTEMD_RESOLVED_USER = systemd-resolve -1 systemd-resolve -1 * /run/systemd - - systemd Resolver
+SYSTEMD_RESOLVED_USER = systemd-resolve -2 systemd-resolve -2 * /run/systemd - - systemd Resolver
 else
 SYSTEMD_CONF_OPTS += -Dresolve=false
 endif
 
 ifeq ($(BR2_PACKAGE_SYSTEMD_TIMESYNCD),y)
 SYSTEMD_CONF_OPTS += -Dtimesyncd=true
-SYSTEMD_TIMESYNCD_USER = systemd-timesync -1 systemd-timesync -1 * /run/systemd - - systemd Time Synchronization
+SYSTEMD_TIMESYNCD_USER = systemd-timesync -2 systemd-timesync -2 * /run/systemd - - systemd Time Synchronization
 else
 SYSTEMD_CONF_OPTS += -Dtimesyncd=false
 endif
@@ -420,10 +420,10 @@  define SYSTEMD_INSTALL_IMAGES_CMDS
 endef
 
 define SYSTEMD_USERS
-	- - input -1 * - - - Input device group
-	- - systemd-journal -1 * - - - Journal
-	- - render -1 * - - - DRI rendering nodes
-	- - kvm -1 * - - - kvm nodes
+	- - input -2 * - - - Input device group
+	- - systemd-journal -2 * - - - Journal
+	- - render -2 * - - - DRI rendering nodes
+	- - kvm -2 * - - - kvm nodes
 	$(SYSTEMD_REMOTE_USER)
 	$(SYSTEMD_COREDUMP_USER)
 	$(SYSTEMD_NETWORKD_USER)