Skip to content

Commit

Permalink
Add a valid_user type
Browse files Browse the repository at this point in the history
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 as default for this type
is the one suggested by the useradd man page.
  • Loading branch information
XaF committed Sep 25, 2018
1 parent 2ff00f7 commit da6152f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions quattor/functions/validation.pan
Original file line number Diff line number Diff line change
Expand Up @@ -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_-]|\$)?$");

0 comments on commit da6152f

Please sign in to comment.