Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 203809 Details for
Bug 259634
net-misc/networkmanager-0.7.0 alters /etc/hosts and changes hostname
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
patch that reads hostname from /etc/conf.d/hostname if no connection is avaible instead of using localhost.localdomain.
hostname-from-confd-hostname.patch (text/plain), 1.44 KB, created by
Paul
on 2009-09-11 18:00:34 UTC
(
hide
)
Description:
patch that reads hostname from /etc/conf.d/hostname if no connection is avaible instead of using localhost.localdomain.
Filename:
MIME Type:
Creator:
Paul
Created:
2009-09-11 18:00:34 UTC
Size:
1.44 KB
patch
obsolete
>--- src/NetworkManagerPolicy.c 2009-04-13 00:29:59.000000000 +0200 >+++ src/NetworkManagerPolicyNew.c 2009-09-11 21:40:15.000000000 +0200 >@@ -344,6 +344,34 @@ set_system_hostname (const char *new_hos > int ret = 0; > const char *name = new_hostname ? new_hostname : FALLBACK_HOSTNAME; > >+#ifdef TARGET_GENTOO >+ if (!new_hostname) { >+ static char* sysconf_hostname = NULL; >+ char *hostname_end = NULL; >+ char *contents = NULL; >+ gsize contents_len; >+ GError *error = NULL; >+ if (!sysconf_hostname && !g_file_get_contents (SYSCONFDIR "/conf.d/hostname", &contents, &contents_len, &error)) { >+ nm_warning ("%s: couldn't read " SYSCONFDIR "/conf.d/hostname: (%d) %s", >+ __func__, error ? error->code : 0, >+ (error && error->message) ? error->message : "(unknown)"); >+ } else if (!sysconf_hostname) { >+ contents = strstr(contents, "hostname=\""); >+ contents = strchr(contents, '"') + 1; >+ hostname_end = strchr(contents, '"'); >+ *hostname_end = '\0'; >+ >+ sysconf_hostname = contents; >+ } >+ >+ if(sysconf_hostname) >+ name = sysconf_hostname; >+ } >+#endif >+ >+ >+ >+ > old_hostname[HOST_NAME_MAX] = '\0'; > errno = 0; > ret = gethostname (old_hostname, HOST_NAME_MAX);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 259634
:
193285
| 203809