<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - hostnamectl doesn't allow apostrophes in pretty hostname"
href="https://bugs.freedesktop.org/show_bug.cgi?id=59311">59311</a>
</td>
</tr>
<tr>
<th>Assignee</th>
<td>systemd-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Summary</th>
<td>hostnamectl doesn't allow apostrophes in pretty hostname
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>systemd-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Reporter</th>
<td>philippuryear@gmail.com
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Component</th>
<td>general
</td>
</tr>
<tr>
<th>Product</th>
<td>systemd
</td>
</tr></table>
<p>
<div>
<pre>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).</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>