systemd/0003-strip-the-domain-part-from-etc-hostname-when-setting.patch
Franck Bui 70ae75e56a Accepting request 832016 from home:fbui:systemd:openSUSE-Factory
- Upgrade to v246.4 (commit f1344d5b7f31e98aedb01e606f41d74d3caaf446)
  See https://github.com/openSUSE/systemd/blob/SUSE/v246/NEWS for
  details. 
  Now that the number of SUSE specific patches has been shrinked and
  is pretty low (12 at the time of this writing), they are no more
  tracked by the git repo and are now handled at the package
  level. Hence It is easier to maintain and identify them. This
  effectively means that SUSE/v246 will contain upstream commits only.

OBS-URL: https://build.opensuse.org/request/show/832016
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1113
2020-09-04 06:47:46 +00:00

44 lines
1.6 KiB
Diff

From f299a8180f1db0680b454c0e37696891361e3067 Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat@suse.com>
Date: Tue, 28 May 2013 15:17:35 +0200
Subject: [PATCH 03/12] 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/core/hostname-setup.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/core/hostname-setup.c b/src/core/hostname-setup.c
index 6d047db838..1acc0c998b 100644
--- a/src/core/hostname-setup.c
+++ b/src/core/hostname-setup.c
@@ -39,8 +39,16 @@ int hostname_setup(void) {
enoent = true;
else
log_warning_errno(r, "Failed to read configured hostname: %m");
- } else
+ } else {
+ char *domain;
+
+ /* SUSE: strip the domain name */
+ domain = strchr(b, '.');
+ if (domain)
+ *domain = '\0';
+
hn = b;
+ }
}
if (isempty(hn)) {
--
2.26.2