Ludwig Nussel
40b6ae1d77
(currently in procps). - Add hostname-setup-shortname.patch: ensure shortname is set as hostname (bnc#820213). OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=385
26 lines
679 B
Diff
26 lines
679 B
Diff
Index: systemd-202/src/core/hostname-setup.c
|
|
===================================================================
|
|
--- systemd-202.orig/src/core/hostname-setup.c
|
|
+++ systemd-202/src/core/hostname-setup.c
|
|
@@ -32,7 +32,7 @@
|
|
#include "fileio.h"
|
|
|
|
static int read_and_strip_hostname(const char *path, char **hn) {
|
|
- char *s;
|
|
+ char *s, *domain;
|
|
int r;
|
|
|
|
assert(path);
|
|
@@ -49,6 +49,11 @@ static int read_and_strip_hostname(const
|
|
return -ENOENT;
|
|
}
|
|
|
|
+ /* strip any leftover of a domain name */
|
|
+ if (domain = strchr(s, '.')) {
|
|
+ *domain = NULL;
|
|
+ }
|
|
+
|
|
*hn = s;
|
|
return 0;
|
|
}
|