summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-02-28 10:00:33 +0100
committerChristian Poessinger <christian@poessinger.com>2021-02-28 10:01:59 +0100
commit350180a60b9d80b189db51d8e643c9798192a812 (patch)
tree9c08943aaf33e2cdae082a6aaf8e03ea04bbe191 /src
parent3e4ac30427fe2af7a304f7e73eb9ecdb27b1ae99 (diff)
downloadvyos-1x-350180a60b9d80b189db51d8e643c9798192a812.tar.gz
vyos-1x-350180a60b9d80b189db51d8e643c9798192a812.zip
validators: fqdn: T3370: support "private" or "local" domain names
(cherry picked from commit 04724ed189553ce43f8504f68fef8024ef5796de)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/validators/fqdn7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/validators/fqdn b/src/validators/fqdn
index 347ffda42..a4027e4ca 100755
--- a/src/validators/fqdn
+++ b/src/validators/fqdn
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2020 VyOS maintainers and contributors
+# Copyright (C) 2020-2021 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -17,10 +17,7 @@
import re
import sys
-
-# pattern copied from: https://www.regextester.com/103452
-pattern = "(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{0,62}[a-zA-Z0-9]\.)+[a-zA-Z]{2,63}$)"
-
+pattern = '[A-Za-z0-9][-.A-Za-z0-9]*'
if __name__ == '__main__':
if len(sys.argv) != 2: