use strict;
use vars qw( @ISA $nossh_hack $conf $dir_prefix @shells $usernamemin
- $usernamemax $passwordmin
+ $usernamemax $passwordmin $username_letter $username_letterfirst
$shellmachine $useradd $usermod $userdel
@saltset @pw_set);
use Carp;
'rm -rf $old_dir'.
')';
}
+ $username_letter = $conf->exists('username-letter');
+ $username_letterfirst = $conf->exists('username-letterfirst');
};
@saltset = ( 'a'..'z' , 'A'..'Z' , '0'..'9' , '.' , '/' );
$recref->{username} =~ /^([a-z0-9_\-\.]{$usernamemin,$ulen})$/
or return "Illegal username";
$recref->{username} = $1;
- $recref->{username} =~ /[a-z]/ or return "Illegal username";
+ if ( $username_letterfirst ) {
+ $recref->{username} =~ /^[a-z]/ or return "Illegal username";
+ } elsif ( $username_letter ) {
+ $recref->{username} =~ /[a-z]/ or return "Illegal username";
+ }
$recref->{popnum} =~ /^(\d*)$/ or return "Illegal popnum: ".$recref->{popnum};
$recref->{popnum} = $1;
=head1 VERSION
-$Id: svc_acct.pm,v 1.16 2001-06-03 11:37:08 ivan Exp $
+$Id: svc_acct.pm,v 1.17 2001-06-03 12:36:10 ivan Exp $
=head1 BUGS
<li><a name="textradiusprepend">textradiusprepend</a> - The contents of this file will be prepended to the first line of a user's RADIUS entry in text exports. If necessary, usually `Auth-Type = Local, '.
<li><a name="usernamemin">usernamemin</a> - Minimum username length (default 2);
<li><a name="usernamemax">usernamemax</a> - Maximum username length (default is the size of the SQL column, probably specified when fs-setup was run)
+ <li><a name="usernamemax">username-letter</a> - The existance of this file will turn on the requirement that usernames contain at least one letter.
+ <li><a name="usernamemax">username-letterfirst</a> - The existance of this file will turn on the requirement that usernames start with a letter.
</ul>
</body>