diff --git a/quattor/functions/validation.pan b/quattor/functions/validation.pan index 58675383e..2782fd613 100644 --- a/quattor/functions/validation.pan +++ b/quattor/functions/validation.pan @@ -139,3 +139,11 @@ function valid_absolute_file_paths = { }; true; }; + +@documentation{ + desc = This types is meant to be used to check if strings provided are \ + valid user names. This is however designed to be overriden by \ + site-specific policies. The regex used here as default is the \ + one suggested by the useradd man page. +} +type valid_user = string with match(SELF, "^[a-zA-Z_][a-zA-Z0-9_-]{0,30}([a-zA-Z0-9_-]|\$)?$");