]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/machine/machined-dbus.c
hostname-util: flagsify hostname_is_valid(), drop machine_name_is_valid()
authorLennart Poettering <lennart@poettering.net>
Fri, 11 Dec 2020 15:40:45 +0000 (16:40 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 15 Dec 2020 16:59:48 +0000 (17:59 +0100)
commit52ef5dd7989d886945e18ab50de31bf5a21ba158
treeed64c0d2c22b0ea1a1375c24ca692fdad3e4e07e
parent9e815cf2c2d8463e58c6609edb6a33f9bb62e7b5
hostname-util: flagsify hostname_is_valid(), drop machine_name_is_valid()

Let's clean up hostname_is_valid() a bit: let's turn the second boolean
argument into a more explanatory flags field, and add a flag that
accepts the special name ".host" as valid. This is useful for the
container logic, where the special hostname ".host" refers to the "root
container", i.e. the host system itself, and can be specified at various
places.

let's also get rid of machine_name_is_valid(). It was just an alias,
which is confusing and even more so now that we have the flags param.
30 files changed:
src/basic/hostname-util.c
src/basic/hostname-util.h
src/basic/util.c
src/core/hostname-setup.c
src/firstboot/firstboot.c
src/hostname/hostnamectl.c
src/hostname/hostnamed.c
src/import/export.c
src/import/import-fs.c
src/import/import-raw.c
src/import/import-tar.c
src/import/import.c
src/import/importd.c
src/import/pull-raw.c
src/import/pull-tar.c
src/import/pull.c
src/journal/sd-journal.c
src/libsystemd-network/sd-dhcp-client.c
src/libsystemd-network/sd-dhcp6-client.c
src/libsystemd/sd-bus/sd-bus.c
src/libsystemd/sd-login/sd-login.c
src/machine/machinectl.c
src/machine/machined-dbus.c
src/machine/machined.c
src/network/generator/network-generator.c
src/network/networkd-network.c
src/nspawn/nspawn-oci.c
src/nspawn/nspawn-settings.c
src/nspawn/nspawn.c
src/test/test-hostname-util.c