]> Cypherpunks repositories - dsc.git/commitdiff
Stricter length checks
authorSergey Matveev <stargrave@stargrave.org>
Fri, 15 Aug 2025 08:38:10 +0000 (11:38 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Fri, 15 Aug 2025 08:38:10 +0000 (11:38 +0300)
schema/net/*/check
schema/srv/*/check
schema/sys/hostname/check
schema/ui/password/check

index 0d492a119b52cd8066787f4bd06ea6210661f10a32428475a19022a6c3891a4d..d03dd7980705749fd508cf72374e583e1b59cbff57d451e7f968ebc2522fcfbc 100755 (executable)
@@ -1,8 +1,8 @@
 #!/usr/bin/env tclsh8.6
 
 set n [read -nonewline stdin]
-if {! [regexp {^[a-z0-9]+$} $n]} {
-    puts {does not match ^[a-z0-9]+$}
+if {! [regexp {^[a-z0-9]{1,16}$} $n]} {
+    puts {does not match ^[a-z0-9]{1,16}$}
     exit 1
 }
 puts $n
index 0f8cef8b874c1c15a492b4720ad40a4453359a777fc2b7114425ae0bf3f9da82..18ad9a9873e40ae13ab4eefa684faea0f6c289ed715d4aebd5ec8d627e3bb4de 100755 (executable)
@@ -1,8 +1,8 @@
 #!/usr/bin/env tclsh8.6
 
 set n [read -nonewline stdin]
-if {! [regexp {^[.A-Za-z0-9_-]+$} $n]} {
-    puts {does not match ^[.A-Za-z0-9_-]+$}
+if {! [regexp {^[.A-Za-z0-9_-]{1,32}$} $n]} {
+    puts {does not match ^[.A-Za-z0-9_-]{1,32}$}
     exit 1
 }
 puts $n
index a90bf84105948837b89d5867ce6e42c2ca3a673bfe518b8241f807d682622917..4df8a41f743cdfe681878811d168a80f822762c01585b83b84a70badfdf24298 100755 (executable)
@@ -4,8 +4,8 @@ set n [read -nonewline stdin]
 if {$n == ""} {
     set n unknown
 }
-if {! [regexp {^[a-z0-9]+$} $n]} {
-    puts {does not match ^[a-z0-9]+$}
+if {! [regexp {^[a-z0-9]{1,32}$} $n]} {
+    puts {does not match ^[a-z0-9]{1,32}$}
     exit 1
 }
 puts $n
index f3960972bf7213cc94be429d93ea2e0ad53c6a919d13395c516fd38891ca1802..33bfac0eb2d24168e8cb656e0065d38cdbca779fcda281ec4abda4b9edc19f6f 100755 (executable)
@@ -4,8 +4,8 @@ set passwd [read -nonewline stdin]
 if {$passwd == ""} {
     set passwd admin
 }
-if {! [regexp {^[0-9a-z-]+$} $passwd]} {
-    puts {does not match ^[0-9a-z-]+$}
+if {! [regexp {^[0-9a-z-]{1,64}$} $passwd]} {
+    puts {does not match ^[0-9a-z-]{1,64}$}
     exit 1
 }
 puts $passwd