- Drop 0003-strip-the-domain-part-from-etc-hostname-when-setting.patch

/etc/hostname is supposed to contain the static host name of the system. This
  patch was used to work around cases where users incorrectly save the FQDN
  instead. However this is incorrect and not consistent with what
  systemd-hostnamed does and what other distributions do. Also assuming that
  /etc/hostname will contain the system host name only removes any ambiguities
  since the host name can contain a period.
  /etc/hosts is usually where one sets the domain name by aliasing the host name
  to the FQDN.
  Note that the installer used to save the FQDN in /etc/hostname but this has
  been fixed since several years now (bsc#972463).

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1416
This commit is contained in:
Franck Bui 2023-07-28 14:57:10 +00:00 committed by Git OBS Bridge
parent 5ae79415a2
commit 367e962d5f
3 changed files with 22 additions and 44 deletions

View File

@ -1,39 +0,0 @@
From c6ed74889adade0287ee609150611544d8d5c6d2 Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat@suse.com>
Date: Tue, 28 May 2013 15:17:35 +0200
Subject: [PATCH 04/11] strip the domain part from /etc/hostname when setting
system host name
[fbui: fixes bnc#820213]
[fbui: forwardported from bfd2462b8ddec591d953841ab22bb30bdc6f9085]
[fbui: adjust context and make sure that strip of the domain name is
only done when setting the system host name. Therefore it's
still possible to pass an FQDN to hostnamectl]
[fbui: I'm still not sure that it was the right thing to do. Other
possibility was to fix the installer to create a correct
/etc/hostname file. Need to investigate...]
---
src/shared/hostname-setup.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/shared/hostname-setup.c b/src/shared/hostname-setup.c
index 511aa7d031..351d0e761d 100644
--- a/src/shared/hostname-setup.c
+++ b/src/shared/hostname-setup.c
@@ -189,6 +189,13 @@ int hostname_setup(bool really) {
else
log_warning_errno(r, "Failed to read configured hostname: %m");
} else {
+ char *domain;
+
+ /* SUSE: strip the domain name */
+ domain = strchr(b, '.');
+ if (domain)
+ *domain = '\0';
+
hn = b;
source = HOSTNAME_STATIC;
}
--
2.26.2

View File

@ -1,3 +1,21 @@
-------------------------------------------------------------------
Fri Jul 28 14:40:48 UTC 2023 - Franck Bui <fbui@suse.com>
- Drop 0003-strip-the-domain-part-from-etc-hostname-when-setting.patch
/etc/hostname is supposed to contain the static host name of the system. This
patch was used to work around cases where users incorrectly save the FQDN
instead. However this is incorrect and not consistent with what
systemd-hostnamed does and what other distributions do. Also assuming that
/etc/hostname will contain the system host name only removes any ambiguities
since the host name can contain a period.
/etc/hosts is usually where one sets the domain name by aliasing the host name
to the FQDN.
Note that the installer used to save the FQDN in /etc/hostname but this has
been fixed since several years now (bsc#972463).
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Jul 25 06:30:55 UTC 2023 - Franck Bui <fbui@suse.com> Tue Jul 25 06:30:55 UTC 2023 - Franck Bui <fbui@suse.com>

View File

@ -202,13 +202,12 @@ Source209: files.homed
# get rid of one of them ! # get rid of one of them !
# #
Patch1: 0001-restore-var-run-and-var-lock-bind-mount-if-they-aren.patch Patch1: 0001-restore-var-run-and-var-lock-bind-mount-if-they-aren.patch
Patch2: 0002-rc-local-fix-ordering-startup-for-etc-init.d-boot.lo.patch Patch2: 0001-conf-parser-introduce-early-drop-ins.patch
Patch3: 0003-strip-the-domain-part-from-etc-hostname-when-setting.patch Patch3: 0009-pid1-handle-console-specificities-weirdness-for-s390.patch
%if %{with sysvcompat} %if %{with sysvcompat}
Patch8: 0008-sysv-generator-translate-Required-Start-into-a-Wants.patch Patch4: 0002-rc-local-fix-ordering-startup-for-etc-init.d-boot.lo.patch
Patch5: 0008-sysv-generator-translate-Required-Start-into-a-Wants.patch
%endif %endif
Patch10: 0001-conf-parser-introduce-early-drop-ins.patch
Patch12: 0009-pid1-handle-console-specificities-weirdness-for-s390.patch
# Patches listed below are put in quarantine. Normally all changes must go to # Patches listed below are put in quarantine. Normally all changes must go to
# upstream first and then are cherry-picked in the SUSE git repository. But for # upstream first and then are cherry-picked in the SUSE git repository. But for