diff options
Diffstat (limited to 'src/basic')
-rw-r--r-- | src/basic/hostname-util.h | 2 | ||||
-rw-r--r-- | src/basic/util.c | 15 | ||||
-rw-r--r-- | src/basic/util.h | 2 |
3 files changed, 2 insertions, 17 deletions
diff --git a/src/basic/hostname-util.h b/src/basic/hostname-util.h index 7c50260d73..d4f5bfe45e 100644 --- a/src/basic/hostname-util.h +++ b/src/basic/hostname-util.h @@ -32,6 +32,8 @@ char* gethostname_malloc(void); bool hostname_is_valid(const char *s, bool allow_trailing_dot) _pure_; char* hostname_cleanup(char *s); +#define machine_name_is_valid(s) hostname_is_valid(s, false) + bool is_localhost(const char *hostname); bool is_gateway_hostname(const char *hostname); diff --git a/src/basic/util.c b/src/basic/util.c index 9571f0ab12..deff68073c 100644 --- a/src/basic/util.c +++ b/src/basic/util.c @@ -3006,21 +3006,6 @@ char* strshorten(char *s, size_t l) { return s; } -bool machine_name_is_valid(const char *s) { - - if (!hostname_is_valid(s, false)) - return false; - - /* Machine names should be useful hostnames, but also be - * useful in unit names, hence we enforce a stricter length - * limitation. */ - - if (strlen(s) > 64) - return false; - - return true; -} - int pipe_eof(int fd) { struct pollfd pollfd = { .fd = fd, diff --git a/src/basic/util.h b/src/basic/util.h index 8f21d56ed8..1ead7b5419 100644 --- a/src/basic/util.h +++ b/src/basic/util.h @@ -394,8 +394,6 @@ bool nulstr_contains(const char*nulstr, const char *needle); bool plymouth_running(void); -bool machine_name_is_valid(const char *s) _pure_; - char* strshorten(char *s, size_t l); int symlink_idempotent(const char *from, const char *to); |