| Summary: |
hostnamectl doesn't allow apostrophes in pretty hostname |
| Product: |
systemd
|
Reporter: |
Philip Puryear <philippuryear> |
| Component: |
general | Assignee: |
nchen <nathaniel.chen> |
| Status: |
RESOLVED
FIXED
|
QA Contact: |
systemd-bugs |
| Severity: |
normal
|
|
|
| Priority: |
medium
|
CC: |
garyvdm, nathaniel.chen
|
| Version: |
unspecified | |
|
| Hardware: |
Other | |
|
| OS: |
All | |
|
| Whiteboard: |
|
|
i915 platform:
|
|
i915 features:
|
|
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.
Overview: hostnamectl set-hostname rejects pretty hostnames which contain apostrophes, despite the example in hostnamectl's manpage ("Lennart's Laptop") containing an apostrophe. Steps to Reproduce: # hostnamectl set-hostname --pretty "Phil's Laptop" Actual Results: The error "Failed to issue method call: Invalid argument" is printed. Expected Results: No error; /etc/machine-info should contain the supplied pretty name. Build Date & Platform: systemd-196, Arch Linux Additional Information: I believe this occurs because systemd-hostnamed calls string_is_safe() on the new pretty hostname (hostnamed.c:554), which rejects apostrophes (along with backslashes and double quotes) (util.c:5562).