mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-06 13:41:31 +00:00
util: add comment explaining hostname_is_valid()
This commit is contained in:
@@ -4248,6 +4248,11 @@ bool hostname_is_valid(const char *s) {
|
||||
if (isempty(s))
|
||||
return false;
|
||||
|
||||
/* Doesn't accept empty hostnames, hostnames with trailing or
|
||||
* leading dots, and hostnames with multiple dots in a
|
||||
* sequence. Also ensures that the length stays below
|
||||
* HOST_NAME_MAX. */
|
||||
|
||||
for (p = s, dot = true; *p; p++) {
|
||||
if (*p == '.') {
|
||||
if (dot)
|
||||
|
||||
Reference in New Issue
Block a user