From 1a2cad26263190460ed211329d040cb1da8d7ac2 Mon Sep 17 00:00:00 2001
From: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
Date: Thu, 13 Oct 2022 09:49:12 +0200
Subject: rdma-ndd: disable systemd ProtectHostName feature

[ Upstream commit 57637df8dd6b92b4bcd3e04cea476012901526d0 ]

ProtectHostName prevents dynamic name changes to be noticed by the service.
This means that on a system with no static hostname, rdma-ndd is started with
a hostname 'localhost' and is not aware of new hostname retreived
through a DHCP lease.

Fixes: 384b75b5f624 ("rdma-ndd: systemd hardening")
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
---
 rdma-ndd/rdma-ndd.service.in | 1 -
 1 file changed, 1 deletion(-)

diff --git a/rdma-ndd/rdma-ndd.service.in b/rdma-ndd/rdma-ndd.service.in
index e3f8d11..368deec 100644
--- a/rdma-ndd/rdma-ndd.service.in
+++ b/rdma-ndd/rdma-ndd.service.in
@@ -22,7 +22,6 @@ Restart=always
 ExecStart=@CMAKE_INSTALL_FULL_SBINDIR@/rdma-ndd --systemd
 ProtectSystem=full
 ProtectHome=true
-ProtectHostname=true
 ProtectKernelLogs=true
 
 # rdma-ndd is automatically wanted by udev when an RDMA device with a node description is present
-- 
2.34.1

