systemd/hostname-setup-shortname.patch
Stephan Kulow f2f0016f98 Accepting request 176682 from Base:System
- 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). (forwarded request 176648 from fcrozat)

OBS-URL: https://build.opensuse.org/request/show/176682
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=141
2013-05-28 05:43:35 +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;
}