Fix: relayd: hostname check is too restrictive
The check performed by the relay daemon on hostnames is too
restrictive. Since existing session daemons directly use the hostname
returned by gethostname(), the relay daemon must correctly handle FQDN
hostnames, which may contain dots.
This has been observed on the LTTng CI's RHEL8 nodes which report an
FQDN hostname.
The new function 'is_name_path_safe' is used for both session and host
names. It does not check for every problematic path names (reserved
names on Windows, per-platform illegal characters, etc.) Those
restrictions are assumed to be handled when open() and similar
syscalls fail.
However, the objective of this check is to prevent malicious (or at
least unexpected), but legal, names from being used, namely:
- names that contain a path separator,
- empty names,
- hidden names (starting with a dot).
Ideally, illegal names would be automatically escaped in the future.
This is, however, beyond the scope of this fix.
Fixes #1212
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ieeb8b60d22c27b390b51ef7fb52cea0d0ac0f188
This page took 0.025376 seconds and 4 git commands to generate.