systemd/hostname-setup-shortname.patch
Ludwig Nussel 40b6ae1d77 - Do no ship defaults for sysctl, they should be part of aaa_base
(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
2013-05-27 09:58:29 +00:00

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;
}