mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-12 19:20:32 +01:00
core: ensure failed /etc/hosts update writes out well-formatted file (lp#471498)
This commit is contained in:
parent
c0b951d83b
commit
de2205a24e
1 changed files with 3 additions and 3 deletions
|
|
@ -315,9 +315,9 @@ update_etc_hosts (const char *hostname)
|
|||
|
||||
/* Hmm, /etc/hosts was empty for some reason */
|
||||
if (!added) {
|
||||
g_string_append (new_contents, "# Do not remove the following line, or various programs");
|
||||
g_string_append (new_contents, "# that require network functionality will fail.");
|
||||
g_string_append (new_contents, "127.0.0.1\t" FALLBACK_HOSTNAME "\tlocalhost");
|
||||
g_string_append (new_contents, "# Do not remove the following line, or various programs\n");
|
||||
g_string_append (new_contents, "# that require network functionality will fail.\n");
|
||||
g_string_append (new_contents, "127.0.0.1\t" FALLBACK_HOSTNAME "\tlocalhost\n");
|
||||
}
|
||||
|
||||
error = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue