diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-01-27 23:36:01 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-01-27 23:36:01 -0500 |
commit | 8146c32b9264a6915d467a5cab1a24311fbede7e (patch) | |
tree | 5d6d7b19e963a5ba6598e21fd49ffcb33ea3779f /src/hostname | |
parent | e0afad4b64863227031c73704deabe9b64acf23a (diff) |
build-sys,hostnamed: allow distributions to override the "localhost" fallback
A configure param is added to make this easy to change if distributions want
to differentiate on that. The default remains unchanged.
https://bugzilla.redhat.com/show_bug.cgi?id=1392925#c10
Diffstat (limited to 'src/hostname')
-rw-r--r-- | src/hostname/hostnamed.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index 74256e4444..4657cf8c77 100644 --- a/src/hostname/hostnamed.c +++ b/src/hostname/hostnamed.c @@ -283,7 +283,7 @@ static int context_update_kernel_hostname(Context *c) { /* ... and the ultimate fallback */ else - hn = "localhost"; + hn = FALLBACK_HOSTNAME; if (sethostname_idempotent(hn) < 0) return -errno; @@ -419,7 +419,7 @@ static int method_set_hostname(sd_bus_message *m, void *userdata, sd_bus_error * name = c->data[PROP_STATIC_HOSTNAME]; if (isempty(name)) - name = "localhost"; + name = FALLBACK_HOSTNAME; if (!hostname_is_valid(name, false)) return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid hostname '%s'", name); |