diff options
author | kremlin <ian@kremlin.cc> | 2014-08-21 12:10:14 +0800 |
---|---|---|
committer | kremlin <ian@kremlin.cc> | 2014-08-21 12:10:14 +0800 |
commit | 45e096043edca0d3f050cd510ef93e43fdd6c1cf (patch) | |
tree | 42fec8d9882149fdb85ff50f10df45041e199dca | |
parent | 057ab9c2481d5ade30273e1069357b7c839e184c (diff) | |
download | systembsd-45e096043edca0d3f050cd510ef93e43fdd6c1cf.tar systembsd-45e096043edca0d3f050cd510ef93e43fdd6c1cf.tar.gz systembsd-45e096043edca0d3f050cd510ef93e43fdd6c1cf.tar.bz2 systembsd-45e096043edca0d3f050cd510ef93e43fdd6c1cf.tar.lz systembsd-45e096043edca0d3f050cd510ef93e43fdd6c1cf.tar.xz systembsd-45e096043edca0d3f050cd510ef93e43fdd6c1cf.tar.zst systembsd-45e096043edca0d3f050cd510ef93e43fdd6c1cf.zip |
pretty hostname and static hostname no longer sync across each other
-rw-r--r-- | src/interfaces/hostnamed/hostnamed.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/interfaces/hostnamed/hostnamed.c b/src/interfaces/hostnamed/hostnamed.c index ec7156f..0f4af9a 100644 --- a/src/interfaces/hostnamed/hostnamed.c +++ b/src/interfaces/hostnamed/hostnamed.c @@ -343,7 +343,7 @@ on_handle_set_pretty_hostname(Hostname1 *hn1_passed_interf, g_key_file_set_string(config, "hostnamed", "PRETTY_HOSTNAME", valid_pretty_hostname_buf); - if((computed_static_hostname = g_hostname_to_ascii(PRETTY_HOSTNAME))) { + /* if((computed_static_hostname = g_hostname_to_ascii(PRETTY_HOSTNAME))) { g_strdelimit(computed_static_hostname, " ", '-'); hostname1_set_static_hostname(hn1_passed_interf, computed_static_hostname); @@ -351,10 +351,8 @@ on_handle_set_pretty_hostname(Hostname1 *hn1_passed_interf, g_ptr_array_add(hostnamed_freeable, computed_static_hostname); g_key_file_set_string(config, "hostnamed", "StaticHostname", computed_static_hostname); - } else - g_free(computed_static_hostname); + } */ } - } } @@ -814,18 +812,18 @@ gboolean set_names() { else PRETTY_HOSTNAME = ""; - if(config) - g_key_file_unref(config); + + /* (4) set STATIC_HOSTNAME */ + if((static_hostname_buf = g_key_file_get_value(config, "hostnamed", "STATIC_HOSTNAME", NULL))) + STATIC_HOSTNAME = static_hostname_buf; - /* (4) set STATIC_HOSTNAME */ - if(!g_strcmp0(PRETTY_HOSTNAME, "")) - STATIC_HOSTNAME = HOSTNAME; + else + STATIC_HOSTNAME = ""; - else if((static_hostname_buf = g_hostname_to_ascii(PRETTY_HOSTNAME))) - STATIC_HOSTNAME = static_hostname_buf; + if(config) + g_key_file_unref(config); return (HOSTNAME && STATIC_HOSTNAME && PRETTY_HOSTNAME) ? TRUE : FALSE; - } gboolean set_uname_properties() { |