projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5df2b16
)
shorten hostname before checking for trailing dot
author
Thomas Blume
<Thomas.Blume@suse.com>
Mon, 29 Feb 2016 09:19:01 +0000
(10:19 +0100)
committer
Thomas Blume
<Thomas.Blume@suse.com>
Mon, 29 Feb 2016 09:19:01 +0000
(10:19 +0100)
Shortening can lead to a hostname that has a trailing dot.
Therefore it should be done before checking from trailing dots.
src/basic/hostname-util.c
patch
|
blob
|
history
diff --git
a/src/basic/hostname-util.c
b/src/basic/hostname-util.c
index 3cd2f2c8721699d0165dda91f329376364c790fa..5a7ee87a20cb42f9669513a4cdb55fcbb20c52d9 100644
(file)
--- a/
src/basic/hostname-util.c
+++ b/
src/basic/hostname-util.c
@@
-150,6
+150,8
@@
char* hostname_cleanup(char *s) {
assert(s);
+ strshorten(s, HOST_NAME_MAX);
+
for (p = s, d = s, dot = true; *p; p++) {
if (*p == '.') {
if (dot)
@@
-169,8
+171,6
@@
char* hostname_cleanup(char *s) {
else
*d = 0;
- strshorten(s, HOST_NAME_MAX);
-
return s;
}