Skip to content

Commit

Permalink
Merge pull request #184 from XaF/patch-1
Browse files Browse the repository at this point in the history
Add a valid_user type
  • Loading branch information
jrha authored Nov 22, 2018
2 parents dd42973 + 30a8727 commit a45c395
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions quattor/functions/validation.pan
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,13 @@ function valid_absolute_file_paths = {
};
true;
};

variable VALID_USER_PATTERN ?= '^[a-zA-Z_][a-zA-Z0-9_-]{0,30}([a-zA-Z0-9_-]|\$)?$';

@documentation{
This type 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, VALID_USER_PATTERN);

0 comments on commit a45c395

Please sign in to comment.