1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 01:27:11 +03:00
systemd/src/test
Lennart Poettering f35cb39ed6 hostname-util: rework read_hostname_config() a bit
First of all, let's rename it to read_etc_hostname(), to make clearer
what kind of configuration it actually reads: the file format defined in
/etc/hostname and nothing else.

Secondly: let's port this to use read_line(), i.e. the new way to read
lines from a file in a safe, bounded way.

Thirdly: let's strip leading/trailing whitespace from what we are
reading. Given that we are already pretty lenient what we read (comments
and empty lines), let's be permissive regarding whitespace too.

Fourthly: let's actually validate the hostname when reading it. So far
we tried to make it valid, but that's not always possible (for example,
we can't make an empty hostname valid, ever).
2017-11-20 16:43:15 +01:00
..
generate-sym-test.py Mark python scripts executable 2017-05-07 20:16:47 -04:00
meson.build Add license headers and SPDX identifiers to meson.build files 2017-11-19 19:08:15 +01:00
test-acl-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-af-list.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-alloc-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-architecture.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-arphrd-list.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-ask-password-api.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-async.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-barrier.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-bitmap.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-boot-timestamps.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-bpf.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-btrfs.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-calendarspec.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-cap-list.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-capability.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-cgroup-mask.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-cgroup-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-cgroup.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-clock.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-condition.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-conf-files.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-conf-parser.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-copy.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-cpu-set-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-daemon.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-date.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-device-nodes.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-dissect-image.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-dlopen.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-dns-domain.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-ellipsize.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-engine.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-env-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-escape.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-exec-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-execute.c Merge pull request #7198 from poettering/stdin-stdout 2017-11-19 19:49:11 +01:00
test-extract-word.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-fd-util.c Merge pull request #7198 from poettering/stdin-stdout 2017-11-19 19:49:11 +01:00
test-fdset.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-fileio.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-firewall-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-fs-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-fstab-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-glob-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-hash.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-hashmap-ordered.awk meson: also indent scripts with 8 spaces 2017-04-25 08:49:16 -04:00
test-hashmap-plain.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-hashmap.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-helper.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-helper.h Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-hexdecoct.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-hostname-util.c hostname-util: rework read_hostname_config() a bit 2017-11-20 16:43:15 +01:00
test-hostname.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-id128.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-in-addr-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-install-root.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-install.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-io-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-ipcrm.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-job-type.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-journal-importer.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-libudev.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-list.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-locale-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-log.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-loopback.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-mount-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-namespace.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-netlink-manual.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-ns.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-nss.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-parse-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-path-lookup.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-path-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-path.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-prioq.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-proc-cmdline.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-process-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-random-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-ratelimit.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-replace-var.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-rlimit-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-sched-prio.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-seccomp.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-selinux.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-set.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-sigbus.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-signal-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-siphash24.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-sizeof.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-sleep.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-socket-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-stat-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-strbuf.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-string-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-strip-tab-ansi.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-strv.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-strxcpyx.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-tables.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-terminal-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-time-util.c util: add new helper in_utc_timezone() 2017-11-20 10:53:26 +01:00
test-tmpfiles.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-udev.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-uid-range.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-unaligned.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-unit-file.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-unit-name.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-user-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-utf8.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-verbs.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-watchdog.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-web-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-xattr-util.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00
test-xml.c Add SPDX license identifiers to source files under the LGPL 2017-11-19 19:08:15 +01:00