summaryrefslogtreecommitdiffstats
path: root/src/nspawn/nspawn-settings.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-03-10 06:40:18 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-03-10 06:47:19 +0100
commitfa787a13e219c9c342abb9bb2353a1f2cc16961a (patch)
treebb5ce517c1ca04fcb8b1522652804bfc03bf4eee /src/nspawn/nspawn-settings.c
parentnetwork: refuse string which contains non-safe or non-ascii characters for Fi... (diff)
downloadsystemd-fa787a13e219c9c342abb9bb2353a1f2cc16961a.tar.xz
systemd-fa787a13e219c9c342abb9bb2353a1f2cc16961a.zip
conf-parser: introduce config_parse_dns_name() and config_parse_hostname()
This makes nspawn refuse hostnames which are invalid DNS domain names.
Diffstat (limited to 'src/nspawn/nspawn-settings.c')
-rw-r--r--src/nspawn/nspawn-settings.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/src/nspawn/nspawn-settings.c b/src/nspawn/nspawn-settings.c
index 1f58bf3ed4..3a5d72549a 100644
--- a/src/nspawn/nspawn-settings.c
+++ b/src/nspawn/nspawn-settings.c
@@ -710,31 +710,6 @@ int config_parse_syscall_filter(
}
}
-int config_parse_hostname(
- const char *unit,
- const char *filename,
- unsigned line,
- const char *section,
- unsigned section_line,
- const char *lvalue,
- int ltype,
- const char *rvalue,
- void *data,
- void *userdata) {
-
- char **s = data;
-
- assert(rvalue);
- assert(s);
-
- if (!hostname_is_valid(rvalue, 0)) {
- log_syntax(unit, LOG_WARNING, filename, line, 0, "Invalid hostname, ignoring: %s", rvalue);
- return 0;
- }
-
- return free_and_strdup_warn(s, empty_to_null(rvalue));
-}
-
int config_parse_oom_score_adjust(
const char *unit,
const char *filename,